Skip to content

Commit 74140e9

Browse files
author
abel
committed
(fix) Fixed issues found by Black
1 parent afac173 commit 74140e9

File tree

1 file changed

+16
-31
lines changed

1 file changed

+16
-31
lines changed

examples/chain_client/49_ChainStream.py

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from google.protobuf import json_format
44

5-
from pyinjective.composer import Composer
65
from pyinjective.async_client import AsyncClient
6+
from pyinjective.composer import Composer
77
from pyinjective.core.network import Network
88

99

@@ -21,38 +21,23 @@ async def main() -> None:
2121
bank_balances_filter = composer.chain_stream_bank_balances_filter(
2222
accounts=["inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r"]
2323
)
24-
subaccount_deposits_filter = composer.chain_stream_subaccount_deposits_filter(
25-
subaccount_ids=[subaccount_id]
26-
)
27-
spot_trades_filter = composer.chain_stream_trades_filter(
28-
subaccount_ids=["*"],
29-
market_ids=[inj_usdt_market]
30-
)
24+
subaccount_deposits_filter = composer.chain_stream_subaccount_deposits_filter(subaccount_ids=[subaccount_id])
25+
spot_trades_filter = composer.chain_stream_trades_filter(subaccount_ids=["*"], market_ids=[inj_usdt_market])
3126
derivative_trades_filter = composer.chain_stream_trades_filter(
32-
subaccount_ids=["*"],
33-
market_ids=[inj_usdt_perp_market]
27+
subaccount_ids=["*"], market_ids=[inj_usdt_perp_market]
3428
)
3529
spot_orders_filter = composer.chain_stream_orders_filter(
36-
subaccount_ids=[subaccount_id],
37-
market_ids=[inj_usdt_market]
30+
subaccount_ids=[subaccount_id], market_ids=[inj_usdt_market]
3831
)
3932
derivative_orders_filter = composer.chain_stream_orders_filter(
40-
subaccount_ids=[subaccount_id],
41-
market_ids=[inj_usdt_perp_market]
42-
)
43-
spot_orderbooks_filter = composer.chain_stream_orderbooks_filter(
44-
market_ids=[inj_usdt_market]
45-
)
46-
derivative_orderbooks_filter = composer.chain_stream_orderbooks_filter(
47-
market_ids=[inj_usdt_perp_market]
33+
subaccount_ids=[subaccount_id], market_ids=[inj_usdt_perp_market]
4834
)
35+
spot_orderbooks_filter = composer.chain_stream_orderbooks_filter(market_ids=[inj_usdt_market])
36+
derivative_orderbooks_filter = composer.chain_stream_orderbooks_filter(market_ids=[inj_usdt_perp_market])
4937
positions_filter = composer.chain_stream_positions_filter(
50-
subaccount_ids=[subaccount_id],
51-
market_ids=[inj_usdt_perp_market]
52-
)
53-
oracle_price_filter = composer.chain_stream_oracle_price_filter(
54-
symbols=["INJ", "USDT"]
38+
subaccount_ids=[subaccount_id], market_ids=[inj_usdt_perp_market]
5539
)
40+
oracle_price_filter = composer.chain_stream_oracle_price_filter(symbols=["INJ", "USDT"])
5641
stream = await client.chain_stream(
5742
bank_balances_filter=bank_balances_filter,
5843
subaccount_deposits_filter=subaccount_deposits_filter,
@@ -63,15 +48,15 @@ async def main() -> None:
6348
spot_orderbooks_filter=spot_orderbooks_filter,
6449
derivative_orderbooks_filter=derivative_orderbooks_filter,
6550
positions_filter=positions_filter,
66-
oracle_price_filter=oracle_price_filter
51+
oracle_price_filter=oracle_price_filter,
6752
)
6853
async for event in stream:
69-
print(json_format.MessageToJson(
70-
message=event,
71-
including_default_value_fields=True,
72-
preserving_proto_field_name=True)
54+
print(
55+
json_format.MessageToJson(
56+
message=event, including_default_value_fields=True, preserving_proto_field_name=True
57+
)
7358
)
7459

7560

76-
if __name__ == '__main__':
61+
if __name__ == "__main__":
7762
asyncio.get_event_loop().run_until_complete(main())

0 commit comments

Comments
 (0)