Skip to content

Commit

Permalink
add query tx by event
Browse files Browse the repository at this point in the history
  • Loading branch information
zakir-code committed Oct 10, 2023
1 parent 8bfdb0a commit 781fcfb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fxsdk/client/grpc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from fxsdk.x.cosmos.staking.v1beta1.staking_pb2 import Params as StakingParams
from fxsdk.x.cosmos.tx.v1beta1.service_pb2 import BROADCAST_MODE_SYNC, BroadcastMode, BroadcastTxRequest, \
SimulateRequest, \
GetTxRequest, GetTxResponse
GetTxRequest, GetTxResponse, OrderBy, GetTxsEventRequest, GetTxsEventResponse
from fxsdk.x.cosmos.tx.v1beta1.service_pb2_grpc import ServiceStub as TxClient
from fxsdk.x.cosmos.tx.v1beta1.tx_pb2 import Fee, Tx, TxRaw
from fxsdk.x.cosmos.base.node.v1beta1.query_pb2_grpc import ServiceStub as CosmosNodeClient
Expand Down Expand Up @@ -127,6 +127,11 @@ def query_node_info(self) -> DefaultNodeInfo:
def query_tx(self, tx_hash: str) -> GetTxResponse:
return TxClient(self.channel).GetTx(GetTxRequest(hash=tx_hash))

def query_txs_by_event(self, events, order_by: OrderBy, page: int, limit: int) -> GetTxsEventResponse:
return TxClient(self.channel).GetTxsEvent(GetTxsEventRequest(
events=events, order_by=order_by, page=page, limit=limit
))

def bank_send(self, tx_builder: TxBuilder, to: str, amount: [Coin],
mode: BroadcastMode = BROADCAST_MODE_SYNC) -> TxResponse:
msg = new_msg_send(from_address=tx_builder.address(), to_address=to, amount=amount)
Expand Down

0 comments on commit 781fcfb

Please sign in to comment.