Skip to content

Commit

Permalink
(fix) Fixed issues found by Black
Browse files Browse the repository at this point in the history
  • Loading branch information
abel committed Sep 20, 2023
1 parent afac173 commit 74140e9
Showing 1 changed file with 16 additions and 31 deletions.
47 changes: 16 additions & 31 deletions examples/chain_client/49_ChainStream.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from google.protobuf import json_format

from pyinjective.composer import Composer
from pyinjective.async_client import AsyncClient
from pyinjective.composer import Composer
from pyinjective.core.network import Network


Expand All @@ -21,38 +21,23 @@ async def main() -> None:
bank_balances_filter = composer.chain_stream_bank_balances_filter(
accounts=["inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r"]
)
subaccount_deposits_filter = composer.chain_stream_subaccount_deposits_filter(
subaccount_ids=[subaccount_id]
)
spot_trades_filter = composer.chain_stream_trades_filter(
subaccount_ids=["*"],
market_ids=[inj_usdt_market]
)
subaccount_deposits_filter = composer.chain_stream_subaccount_deposits_filter(subaccount_ids=[subaccount_id])
spot_trades_filter = composer.chain_stream_trades_filter(subaccount_ids=["*"], market_ids=[inj_usdt_market])
derivative_trades_filter = composer.chain_stream_trades_filter(
subaccount_ids=["*"],
market_ids=[inj_usdt_perp_market]
subaccount_ids=["*"], market_ids=[inj_usdt_perp_market]
)
spot_orders_filter = composer.chain_stream_orders_filter(
subaccount_ids=[subaccount_id],
market_ids=[inj_usdt_market]
subaccount_ids=[subaccount_id], market_ids=[inj_usdt_market]
)
derivative_orders_filter = composer.chain_stream_orders_filter(
subaccount_ids=[subaccount_id],
market_ids=[inj_usdt_perp_market]
)
spot_orderbooks_filter = composer.chain_stream_orderbooks_filter(
market_ids=[inj_usdt_market]
)
derivative_orderbooks_filter = composer.chain_stream_orderbooks_filter(
market_ids=[inj_usdt_perp_market]
subaccount_ids=[subaccount_id], market_ids=[inj_usdt_perp_market]
)
spot_orderbooks_filter = composer.chain_stream_orderbooks_filter(market_ids=[inj_usdt_market])
derivative_orderbooks_filter = composer.chain_stream_orderbooks_filter(market_ids=[inj_usdt_perp_market])
positions_filter = composer.chain_stream_positions_filter(
subaccount_ids=[subaccount_id],
market_ids=[inj_usdt_perp_market]
)
oracle_price_filter = composer.chain_stream_oracle_price_filter(
symbols=["INJ", "USDT"]
subaccount_ids=[subaccount_id], market_ids=[inj_usdt_perp_market]
)
oracle_price_filter = composer.chain_stream_oracle_price_filter(symbols=["INJ", "USDT"])
stream = await client.chain_stream(
bank_balances_filter=bank_balances_filter,
subaccount_deposits_filter=subaccount_deposits_filter,
Expand All @@ -63,15 +48,15 @@ async def main() -> None:
spot_orderbooks_filter=spot_orderbooks_filter,
derivative_orderbooks_filter=derivative_orderbooks_filter,
positions_filter=positions_filter,
oracle_price_filter=oracle_price_filter
oracle_price_filter=oracle_price_filter,
)
async for event in stream:
print(json_format.MessageToJson(
message=event,
including_default_value_fields=True,
preserving_proto_field_name=True)
print(
json_format.MessageToJson(
message=event, including_default_value_fields=True, preserving_proto_field_name=True
)
)


if __name__ == '__main__':
if __name__ == "__main__":
asyncio.get_event_loop().run_until_complete(main())

0 comments on commit 74140e9

Please sign in to comment.