Skip to content

Commit b26ce93

Browse files
author
peiyun@inj21
committed
change chainclient to chain_client
1 parent 8e1c917 commit b26ce93

File tree

8 files changed

+22
-17
lines changed

8 files changed

+22
-17
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
1818
AUTHOR = "Injective Labs"
1919
REQUIRES_PYTHON = ">=3.9.0"
20-
VERSION = "0.2.0"
20+
VERSION = "0.2.2"
2121

2222
REQUIRED = [
2323
"grpcio",
File renamed without changes.
File renamed without changes.

src/injective/exchange_api/examples/example.py

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,30 @@
1818
import grpc
1919

2020

21-
import exchange_api.injective_accounts_rpc_pb2 as accounts_rpc_pb
22-
import exchange_api.injective_accounts_rpc_pb2_grpc as accounts_rpc_grpc
23-
import exchange_api.injective_derivative_exchange_rpc_pb2 as derivative_exchange_rpc_pb
24-
import exchange_api.injective_derivative_exchange_rpc_pb2_grpc as derivative_exchange_rpc_grpc
25-
import exchange_api.injective_exchange_rpc_pb2 as exchange_rpc_pb
26-
import exchange_api.injective_exchange_rpc_pb2_grpc as exchange_rpc_grpc
27-
import exchange_api.injective_insurance_rpc_pb2 as insurance_rpc_pb
28-
import exchange_api.injective_insurance_rpc_pb2_grpc as insurance_rpc_grpc
29-
import exchange_api.injective_oracle_rpc_pb2 as oracle_rpc_pb
30-
import exchange_api.injective_oracle_rpc_pb2_grpc as oracle_rpc_grpc
31-
import exchange_api.injective_spot_exchange_rpc_pb2 as spot_exchange_rpc_pb
32-
import exchange_api.injective_spot_exchange_rpc_pb2_grpc as spot_exchange_rpc_grpc
21+
import injective.exchange_api.injective_accounts_rpc_pb2 as accounts_rpc_pb
22+
import injective.exchange_api.injective_accounts_rpc_pb2_grpc as accounts_rpc_grpc
23+
import injective.exchange_api.injective_derivative_exchange_rpc_pb2 as derivative_exchange_rpc_pb
24+
import injective.exchange_api.injective_derivative_exchange_rpc_pb2_grpc as derivative_exchange_rpc_grpc
25+
import injective.exchange_api.injective_exchange_rpc_pb2 as exchange_rpc_pb
26+
import injective.exchange_api.injective_exchange_rpc_pb2_grpc as exchange_rpc_grpc
27+
import injective.exchange_api.injective_insurance_rpc_pb2 as insurance_rpc_pb
28+
import injective.exchange_api.injective_insurance_rpc_pb2_grpc as insurance_rpc_grpc
29+
import injective.exchange_api.injective_oracle_rpc_pb2 as oracle_rpc_pb
30+
import injective.exchange_api.injective_oracle_rpc_pb2_grpc as oracle_rpc_grpc
31+
import injective.exchange_api.injective_spot_exchange_rpc_pb2 as spot_exchange_rpc_pb
32+
import injective.exchange_api.injective_spot_exchange_rpc_pb2_grpc as spot_exchange_rpc_grpc
3333

3434

3535
async def main() -> None:
36-
async with grpc.aio.insecure_channel('localhost:9910') as channel:
36+
async with grpc.aio.insecure_channel("localhost:9910") as channel:
3737
exchange_rpc = exchange_rpc_grpc.InjectiveExchangeRPCStub(channel)
3838
spot_exchange_rpc = spot_exchange_rpc_grpc.InjectiveSpotExchangeRPCStub(channel)
3939

4040
resp = await exchange_rpc.Version(exchange_rpc_pb.VersionRequest())
41-
print("-- Connected to Injective Exchange (version: %s, built %s)" % (resp.version, resp.meta_data["BuildDate"]))
41+
print(
42+
"-- Connected to Injective Exchange (version: %s, built %s)"
43+
% (resp.version, resp.meta_data["BuildDate"])
44+
)
4245

4346
resp = await spot_exchange_rpc.Markets(spot_exchange_rpc_pb.MarketsRequest())
4447
print("\n-- Available markets:")
@@ -47,12 +50,14 @@ async def main() -> None:
4750

4851
selected_market = resp.markets[0]
4952
print("\n-- Watching for order updates on market %s" % selected_market.ticker)
50-
stream_req = spot_exchange_rpc_pb.StreamOrdersRequest(market_id=selected_market.market_id)
53+
stream_req = spot_exchange_rpc_pb.StreamOrdersRequest(
54+
market_id=selected_market.market_id
55+
)
5156
orders_stream = spot_exchange_rpc.StreamOrders(stream_req)
5257
async for order in orders_stream:
5358
print("\n-- Order Update:", order)
5459

5560

56-
if __name__ == '__main__':
61+
if __name__ == "__main__":
5762
logging.basicConfig(level=logging.INFO)
5863
asyncio.get_event_loop().run_until_complete(main())

0 commit comments

Comments
 (0)