created exch_info in api class
parent
be8629929b
commit
b39affc96e
|
@ -344,6 +344,28 @@ class Client:
|
|||
'private/cancel', {'order_id': oid})
|
||||
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(
|
||||
self,
|
||||
instrument: Optional[str] = None,
|
||||
|
|
Loading…
Reference in New Issue