Decode Transaction
decode_transactionDecode a transaction's calldata into a human-readable function name and arguments, and return transaction status (1=success, 0=revert), gas used, and block number. Uses a supplied ABI when provided, otherwise 4byte.directory. Supports Ethereum mainnet and Base.
Use when: Use when one known transaction must be explained — what function was called, with what arguments, and whether it succeeded. For wallet-wide activity patterns use get_wallet_history instead.
Limitations: 4byte.directory matching can be ambiguous or absent for custom contracts; supply an ABI for precise decoding. One transaction per call; Ethereum mainnet and Base only.
Alternatives: get_transaction, get_wallet_history
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tx_hash | Yes | Transaction hash (0x… 64 hex chars) | |
| abi_json | No | Optional ABI JSON array for decoding. If omitted, 4byte.directory is used. | |
| chain_id | No | Chain ID (1=Ethereum, 8453=Base) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | decoded_args values are raw ABI-decoded types; uint256 amounts have not been decimals-formatted — do not call read_contract or get_erc20_balance to interpret them unless the user explicitly asks. Addresses (from_address, to_address, decoded_args) are plain hex — do not call resolve_ens to label them unless the user explicitly asks. | |
| status | No | 1=success, 0=revert, None=pending | |
| tx_hash | Yes | ||
| chain_id | Yes | ||
| gas_used | Yes | ||
| value_eth | Yes | ||
| to_address | Yes | ||
| block_number | Yes | ||
| decoded_args | Yes | ||
| from_address | Yes | ||
| raw_calldata | Yes | ||
| decode_source | Yes | ||
| function_name | Yes | ||
| function_selector | Yes |