Query Transactions
Querying transaction commands use the following format:
secretcli query tx \
--type=[hash|acc_seq|signature] \
[hash|acc_seq|signature] \
[flags]
Use the transaction search command to query for transactions matching a specific set of
events
, which are added on every transaction.Each event contains a key-value pair in the form of
{eventType}.{eventAttribute}={value}
.Events can be combined to query for more specific results using the
&
symbol.You can query transactions by
events
as follows:secretcli q txs --events='message.sender=secret1...'
And for using multiple
events
:secretcli q txs --events='message.sender=secret1...&message.action=withdraw_delegator_reward'
The pagination is supported as well via
page
and limit
:secretcli q txs --events='message.sender=secret1...' --page=1 --limit=20
Note: The action tag always equals the message type returned by the
Type()
function of the relevant message.You can find a list of available
events
on each of the SDK modules:You can query a single transaction by its hash using the following command:
secretcli q tx [hash]
There are four flags associated with querying Secret Network transactions using the
secretcli.
The
--height [int]
flag uses a specific height to query the state of the Secret Network (there will be an error if the node is pruning state). The
--node [string]
flag uses <host>:<port> to connect with the Tendermint RPC for a specific chain (default is "tcp://localhost:26657"). The
--type [string]
flag is for querying a tx, and can be the 'hash' (default), 'acc_seq', or 'signature'. The
--help
flag will generate an output giving further details on flags to use with the tx
class of secretcli
commands, and information about global flags
to use with the secretcli
. Last modified 7mo ago