Calldata decoder (ABI or selector DB)

$0.003 per call · USDC via x402 · POST /api/calldata-decode

Decode EVM smart-contract transaction calldata into the function name and typed parameters. Send POST /api/calldata-decode with the required field data and pay $0.003 per call over x402 or MPP (there is no free tier). It returns a JSON object with selector, decoded, name, signature, params and 1 more.

Supply an ABI (from /api/contract-abi) or a signature like transfer(address,uint256) for a fully offline decode; with neither, the 4-byte selector is resolved via the openchain.xyz signature database (4byte.directory fallback) and each candidate signature is tried. Unknown selectors return a documented partial decode (selector + raw 32-byte words) instead of an error.

Category: Crypto & onchain data · Tags: crypto calldata decode abi selector evm transaction smart-contract

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
datastringyes0x-prefixed calldata (selector + encoded args). Max 100KB. Also accepted as input, body, payload, content.
abiarraynoOptional contract ABI (JSON array) - enables a fully offline decode with parameter names.
signaturestringnoOptional function signature, e.g. transfer(address,uint256) - offline decode without a full ABI.

Example request

curl -i -X POST https://agent402.tools/api/calldata-decode \
  -H "Content-Type: application/json" \
  -d '{"data":"0xa9059cbb000000000000000000000000abf4fabd7c416fb67202e5f9002389fc75e2a9d000000000000000000000000000000000000000000000000000000000000f4240"}'

Without payment this returns HTTP 402 Payment Required with the exact price for calldata-decode; any x402 v2 or MPP client pays it and retries.

Example response

{
  "selector": "0xa9059cbb",
  "decoded": true,
  "name": "transfer",
  "signature": "transfer(address,uint256)",
  "params": [
    {
      "type": "address",
      "name": null,
      "value": "0xabf4fabd7c416fb67202e5f9002389fc75e2a9d0"
    },
    {
      "type": "uint256",
      "name": null,
      "value": "1000000"
    }
  ],
  "source": "openchain.xyz"
}
FieldTypeAlways presentIn the example
selectorstringyes0xa9059cbb
decodedbooleanyestrue
namestringyestransfer
signaturestringyestransfer(address,uint256)
paramsarray of objectsyes2 items in the example
sourcestringyesopenchain.xyz

From an MCP client

catalog.call {
  "slug": "calldata-decode",
  "params": {
    "data": "0xa9059cbb000000000000000000000000abf4fabd7c416fb67202e5f9002389fc75e2a9d000000000000000000000000000000000000000000000000000000000000f4240"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for calldata-decode; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/calldata-decode", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "data": "0xa9059cbb000000000000000000000000abf4fabd7c416fb67202e5f9002389fc75e2a9d000000000000000000000000000000000000000000000000000000000000f4240"
  }),
});

Part of these workflows

Calldata decoder (ABI or selector DB) is one step in this skill pack, each sold as a single call:

Related tools

Verified contract ABI (Sourcify)

$0.003 · POST /api/contract-abi

Fetch the verified ABI for a contract address from Sourcify, plus a ready-to-use list of human-readable function signatu…

Function selector / event topic lookup

$0.002 · POST /api/selector-lookup

Resolve a 4-byte function selector or a 32-byte event topic hash to its known human-readable Solidity signatures, via th…

Transaction simulation (eth_call + gas)

$0.005 · POST /api/tx-simulate

Dry-run a prospective smart-contract call or transaction without broadcasting it: executes eth_call and eth_estimateGas …

Verified contract source (Sourcify)

$0.005 · POST /api/contract-source

Fetch the verified Solidity source files and compiler metadata for a contract address from Sourcify's open verification …

Gas snapshot (slow / standard / fast)

$0.005 · POST /api/gas-snapshot

Live gas price snapshot for a chain - slow / standard / fast tiers in gwei, plus the latest base fee. Sampled from eth_f…

Solidity heuristic pattern scan

FREE w/ compute · or $0.01 · POST /api/solidity-scan

Deterministic static pattern scan of Solidity smart-contract source text - a fixed ruleset flagging tx.origin authentica…