Transactions API

Every balance one transaction changed

Per address and asset, the balance before and after one transaction and the signed difference — native coin and fee, fungible tokens and NFTs. RHC, ETH, OP and SCROLL.

GET/api/external/transaction-analysis/transaction-state-changes/{chain}/{hash}

What it returns

Per address and asset, the balance before and after one transaction — the native coin (the fee paid included, and the block producer's share of it), every fungible token and every NFT. Amounts are raw base units as decimal strings, paired with the token decimals; change is signed (negative when the balance fell). An ERC-721 row lists the token ids that moved in nftMovements instead of a change, and its balances are counts of tokens held; an ERC-1155 row names the tokenId its balances are of. balanceBefore and balanceAfter are null when no balance is held for that address (the zero address of a mint). An unknown transaction hash returns 404, never an empty list. Up to about 8 seconds on ETH, under 2 on the other chains. RHC, ETH, OP and SCROLL.

Chains

  • Ethereum ETH
  • Robinhood Chain RHC
  • Optimism OP
  • Scroll SCROLL

Request

Send your key in the x-dex-data-key header. Replace each <placeholder> with a real value.

curl -H "x-dex-data-key: $DEXDATA_API_KEY" \
  "https://api.dexdata.io/api/external/transaction-analysis/transaction-state-changes/ETH/<hash>"
Parameters
ParameterDescription
chain

path · string · required

RHC, ETH, OP or SCROLL; every other chain returns 400, because no wired source answers balances before and after a transaction for it.
hash

path · string · required

The transaction hash: 0x followed by 64 hexadecimal characters. Not a Solana signature (base58) — Solana is not served by this resource.

Response fields

A JSON response. Every field is always present; null means the value could not be established, never zero.

Response fields of Every balance one transaction changed
FieldTypeDescription
hashstringThe transaction asked about, lowercase.
stateChangesobject[]One row per address and asset whose balance the transaction changed.
stateChanges[].addressstringThe address whose balance changed, lowercase.
stateChanges[].assetstringnative for the chain's own coin, token for everything else.
stateChanges[].tokenobject | nullThe token; null on a native row.
stateChanges[].token.addressstringThe token contract, lowercase.
stateChanges[].token.standardstringThe token standard: "ERC-20", "ERC-721", "ERC-1155", …
stateChanges[].token.symbolstring | null
stateChanges[].token.decimalsinteger | nullDivide the raw amounts by 10^decimals. null on an NFT, or when unknown.
stateChanges[].tokenIdstring | nullThe ERC-1155 token id the balances are of; null on every other row.
stateChanges[].balanceBeforestring | nullRaw base units (an NFT: tokens held) before the transaction.
stateChanges[].balanceAfterstring | nullRaw base units (an NFT: tokens held) after the transaction.
stateChanges[].changestring | nullbalanceAfter minus balanceBefore, signed raw base units. null on an ERC-721 row.
stateChanges[].nftMovementsobject[] | nullThe ERC-721 token ids that moved for this address; null on every other row.
stateChanges[].nftMovements[].tokenIdstring
stateChanges[].nftMovements[].directionstringin when the address received the token, out when it gave it up.
stateChanges[].isBlockProducerbooleantrue on the fee recipient of the block, whose native balance rose by its share of the fee (on a rollup, part of the fee goes elsewhere).

Start building with DexData today

Sign in, create a key and make your first call in a minute. Free credits every month, and you only pay for calls that succeed.

Get a free API key