Tx Commands

The bb tx status / bb tx wait verbs confirm whether a broadcast transaction landed on chain. They hit the chain's REST/RPC endpoints directly β€” Cosmos LCD first, with automatic fall-through to the EVM JSON-RPC for eth_sendRawTransaction-broadcast hashes. No indexer round-trip.

Use these to close the loop after bb deploy (or any external broadcast).

bb tx <module> (chain-binary tx submission) and bb tx status <hash> (SDK CLI status fetch) coexist under the same bb tx umbrella. The chain-binary tx subcommands live under their module names (bb tx tokenization …, bb tx bank …); status and wait are the SDK additions.

Subcommands

bb tx status <hash>                 # one-shot status fetch
bb tx wait   <hash> [--timeout 60s] # poll until committed/failed

tx status <hash>

Fetches one transaction by hash. Tries the Cosmos LCD's /cosmos/tx/v1beta1/txs/{hash} endpoint first; if the hash isn't recognized there, falls through to the EVM JSON-RPC's eth_getTransactionReceipt to handle keccak256 hashes from EVM-routed broadcasts.

bb tx status 0F46899E29754227DE90F702754CDC74FD39EA37527F2C1E307655C15E910D81 --mainnet
# {
#   "ok": true,
#   "data": {
#     "via": "cosmos",
#     "hash": "0F46899E...",
#     "height": "10000000",
#     "code": 0,
#     "gasUsed": "156490",
#     "events": [...]
#   },
#   "warnings": [],
#   "error": null
# }

Pipe through jq -r .data.code (or .data.hash, .data.height, etc.) for shell-friendly field extraction.

For successful EVM-routed transactions, via is "evm" and the data shape includes the same fields populated from eth_getTransactionReceipt.

Exit codes

Code
Meaning

0

Transaction committed (Cosmos code === 0 or EVM status === '0x1')

1

Transaction included on chain but failed (non-zero Cosmos code or EVM revert)

2

RPC error or transaction not found via either endpoint

Pair with tx wait (below) when the tx may not be indexed yet.

Hash format

Both Cosmos sha256 and EVM keccak256 hashes are accepted, with or without a 0x prefix, in any case. The CLI normalizes to upper-case hex internally:

Network selection

Same flags as the rest of the CLI: --mainnet | --testnet | --local | --url <api-url> | --node-url <chain-lcd-url>. The --node-url override is useful when querying a private chain at a custom LCD endpoint.

For EVM hashes, the CLI uses the matching EVM RPC URL from NETWORK_CONFIGS[network].evmRpcUrl. Override via --evm-rpc-url <url>.

tx wait <hash>

Polls the same endpoints until the transaction is found and committed (or fails). Use after deploy when the tx hash is fresh and may not be indexed yet.

Flag
Default
Description

--timeout <seconds>

60

Max seconds to wait before exiting non-zero

--interval <seconds>

2

Polling interval

--condensed

off

Single-line JSON envelope

--output-file <path>

β€”

Write the envelope to a file instead of stdout

Exit codes

Same as tx status, plus:

  • 2 is also returned on timeout. The error envelope includes error.code === "timeout" and a hint: pointing at re-running tx status later or extending --timeout.

Worked example: deploy β†’ wait β†’ confirm

Why no indexer route?

The BitBadges indexer doesn't expose a public tx-by-hash query. Hitting the chain RPC directly is the canonical way to confirm a tx β€” same path the indexer's own poller uses internally. This keeps tx working even when the indexer is degraded or in a regional outage.

Last updated