@@ -58,6 +58,12 @@ def __init__(
5858 self ,
5959 network : Network ,
6060 ):
61+ warn (
62+ "AsyncClient from pyinjective.async_client is deprecated. "
63+ "Please use AsyncClient from pyinjective.async_client_v2 instead." ,
64+ DeprecationWarning ,
65+ stacklevel = 2 ,
66+ )
6167 self .addr = ""
6268 self .number = 0
6369 self .sequence = 0
@@ -1337,11 +1343,11 @@ async def listen_spot_markets_updates(
13371343 market_ids = market_ids ,
13381344 )
13391345
1340- async def fetch_spot_orderbook_v2 (self , market_id : str ) -> Dict [str , Any ]:
1341- return await self .indexer_client .fetch_spot_orderbook_v2 (market_id = market_id )
1346+ async def fetch_spot_orderbook_v2 (self , market_id : str , depth : Optional [ int ] = None ) -> Dict [str , Any ]:
1347+ return await self .indexer_client .fetch_spot_orderbook_v2 (market_id = market_id , depth = depth or 0 )
13421348
1343- async def fetch_spot_orderbooks_v2 (self , market_ids : List [str ]) -> Dict [str , Any ]:
1344- return await self .indexer_client .fetch_spot_orderbooks_v2 (market_ids = market_ids )
1349+ async def fetch_spot_orderbooks_v2 (self , market_ids : List [str ], depth : Optional [ int ] = None ) -> Dict [str , Any ]:
1350+ return await self .indexer_client .fetch_spot_orderbooks_v2 (market_ids = market_ids , depth = depth or 0 )
13451351
13461352 async def fetch_spot_orders (
13471353 self ,
@@ -1608,11 +1614,13 @@ async def listen_derivative_market_updates(
16081614 market_ids = market_ids ,
16091615 )
16101616
1611- async def fetch_derivative_orderbook_v2 (self , market_id : str ) -> Dict [str , Any ]:
1612- return await self .indexer_client .fetch_derivative_orderbook_v2 (market_id = market_id )
1617+ async def fetch_derivative_orderbook_v2 (self , market_id : str , depth : Optional [ int ] = None ) -> Dict [str , Any ]:
1618+ return await self .indexer_client .fetch_derivative_orderbook_v2 (market_id = market_id , depth = depth or 0 )
16131619
1614- async def fetch_derivative_orderbooks_v2 (self , market_ids : List [str ]) -> Dict [str , Any ]:
1615- return await self .indexer_client .fetch_derivative_orderbooks_v2 (market_ids = market_ids )
1620+ async def fetch_derivative_orderbooks_v2 (
1621+ self , market_ids : List [str ], depth : Optional [int ] = None
1622+ ) -> Dict [str , Any ]:
1623+ return await self .indexer_client .fetch_derivative_orderbooks_v2 (market_ids = market_ids , depth = depth or 0 )
16161624
16171625 async def fetch_derivative_orders (
16181626 self ,
0 commit comments