File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ # Copyright 2021 Injective Labs
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+ """Injective Exchange API client for Python. Example only."""
15+
16+ import asyncio
17+ import logging
18+
19+ from pyinjective .async_client import AsyncClient
20+ from pyinjective .constant import Network
21+
22+ async def main () -> None :
23+ network = Network .testnet ()
24+ client = AsyncClient (network , insecure = False )
25+ tx_hash = "7746BC12EB82B4D59D036FBFF2F67BDCA6F62A20B3DBC25661707DD61D4DC1B7"
26+ tx_logs = await client .get_tx (tx_hash = tx_hash )
27+ print (tx_logs )
28+
29+ if __name__ == '__main__' :
30+ logging .basicConfig (level = logging .INFO )
31+ asyncio .get_event_loop ().run_until_complete (main ())
Original file line number Diff line number Diff line change 1414 query_pb2_grpc as tendermint_query_grpc ,
1515 query_pb2 as tendermint_query ,
1616)
17+
1718from .proto .cosmos .auth .v1beta1 import (
1819 query_pb2_grpc as auth_query_grpc ,
1920 query_pb2 as auth_query ,
@@ -142,6 +143,12 @@ def __init__(
142143 start = True
143144 )
144145
146+ async def get_tx (self , tx_hash ):
147+ return await self .stubTx .GetTx (
148+ tx_service .GetTxRequest (
149+ hash = tx_hash )
150+ )
151+
145152 async def close_exchange_channel (self ):
146153 await self .exchange_channel .close ()
147154
You can’t perform that action at this time.
0 commit comments