Skip to content

Commit d61a8f0

Browse files
Support multi subaccount ids for streamPositions and spot/deriv streamTrades API (#91)
* update proto, grpc files * added: subaccount ids param to sync, async clients * chore: regen
1 parent 2e59498 commit d61a8f0

File tree

5 files changed

+97
-70
lines changed

5 files changed

+97
-70
lines changed

pyinjective/async_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ async def stream_spot_trades(self, **kwargs):
407407
execution_side=kwargs.get("execution_side"),
408408
direction=kwargs.get("direction"),
409409
subaccount_id=kwargs.get("subaccount_id"),
410+
subaccount_ids=kwargs.get("subaccount_ids"),
410411
skip=kwargs.get("skip"),
411412
limit=kwargs.get("limit"),
412413
)
@@ -492,6 +493,7 @@ async def stream_derivative_trades(self, **kwargs):
492493
market_id=kwargs.get("market_id"),
493494
market_ids=kwargs.get("market_ids"),
494495
subaccount_id=kwargs.get("subaccount_id"),
496+
subaccount_ids=kwargs.get("subaccount_ids"),
495497
execution_side=kwargs.get("execution_side"),
496498
direction=kwargs.get("direction"),
497499
skip=kwargs.get("skip"),
@@ -509,7 +511,8 @@ async def stream_derivative_positions(self, **kwargs):
509511
req = derivative_exchange_rpc_pb.StreamPositionsRequest(
510512
market_id=kwargs.get("market_id"),
511513
market_ids=kwargs.get("market_ids"),
512-
subaccount_id=kwargs.get("subaccount_id")
514+
subaccount_id=kwargs.get("subaccount_id"),
515+
subaccount_ids=kwargs.get("subaccount_ids")
513516
)
514517
return self.stubDerivativeExchange.StreamPositions(req)
515518

pyinjective/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ def stream_spot_trades(self, **kwargs):
447447
execution_side=kwargs.get("execution_side"),
448448
direction=kwargs.get("direction"),
449449
subaccount_id=kwargs.get("subaccount_id"),
450+
subaccount_ids=kwargs.get("subaccount_ids"),
450451
skip=kwargs.get("skip"),
451452
limit=kwargs.get("limit"),
452453
)
@@ -547,6 +548,7 @@ def stream_derivative_trades(self, **kwargs):
547548
market_id=kwargs.get("market_id"),
548549
market_ids=kwargs.get("market_ids"),
549550
subaccount_id=kwargs.get("subaccount_id"),
551+
subaccount_ids=kwargs.get("subaccount_ids"),
550552
execution_side=kwargs.get("execution_side"),
551553
direction=kwargs.get("direction"),
552554
skip=kwargs.get("skip"),
@@ -567,7 +569,8 @@ def stream_derivative_positions(self, **kwargs):
567569
req = derivative_exchange_rpc_pb.StreamPositionsRequest(
568570
market_id=kwargs.get("market_id"),
569571
market_ids=kwargs.get("market_ids"),
570-
subaccount_id=kwargs.get("subaccount_id")
572+
subaccount_id=kwargs.get("subaccount_id"),
573+
subaccount_ids=kwargs.get("subaccount_ids")
571574
)
572575
metadata = self.get_cookie(type="exchange")
573576
res = self.stubDerivativeExchange.StreamPositions(req, metadata=metadata)

pyinjective/proto/exchange/injective_derivative_exchange_rpc_pb2.py

Lines changed: 51 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)