eth_calldata
Split calldata into named, typed arguments — or build calldata from them.
Instructions
Split calldata into named, typed arguments — or build calldata from them.
signature is human-readable, e.g. "transfer(address to, uint256 amount)";
parameter names are optional and come back as args[].name (null when the
signature declares none), with args[].components naming a struct's members.
action=encode (needs values) -> {action, signature (canonical), selector,
calldata, args}; values may be omitted for a zero-argument signature.
action=decode (needs data) -> {action, signature, selector,
selector_matches, args}; ints are decimal strings and addresses EIP-55
checksummed. When the calldata's leading 4 bytes are not this signature's
selector the arguments are still decoded, but selector_matches is false and
data_selector + reason report the mismatch — the values are then almost
certainly meaningless.
Example: eth_calldata("decode", "transfer(address to, uint256 amount)", "0xa9059cbb...") -> args=[{name="to", ...}, {name="amount", ...}].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | 0x-prefixed calldata to decode: the 4-byte selector followed by the encoded arguments (required for action=decode). | |
| action | Yes | 'encode' a call's arguments into calldata, or 'decode' calldata into named arguments. | |
| values | No | Argument values to encode, positionally matching the signature's parameters; ints accept int/decimal/0x-hex, bytes are 0x-hex, tuples and arrays are nested lists. A stringified JSON array is accepted. Omit for a zero-argument signature. | |
| signature | Yes | A human-readable Solidity function signature, e.g. 'transfer(address to, uint256 amount)'. Parameter names are optional and are reported back; data locations, aliases (uint->uint256) and a trailing 'external returns (...)' clause are normalized away. |