created exch_info in api class

jsonrpc_err_in_rent_task
Nelson Torres 2024-11-08 21:42:42 +00:00
parent be8629929b
commit b39affc96e
1 changed files with 22 additions and 0 deletions

View File

@ -344,6 +344,28 @@ class Client:
'private/cancel', {'order_id': oid}) 'private/cancel', {'order_id': oid})
return resp.result return resp.result
async def exch_info(
self,
sym: str | None = None,
venue: MarketType | None = None,
expiry: str | None = None,
) -> dict[str, Pair] | Pair:
pair_table: dict[str, Pair] = self._pairs
if (
sym
and (cached_pair := pair_table.get(sym))
):
return cached_pair
if sym:
return pair_table[sym.lower()]
else:
return self._pairs
async def symbol_info( async def symbol_info(
self, self,
instrument: Optional[str] = None, instrument: Optional[str] = None,