Crypto transactions can mutate the state of the blockchain, including moving assets of value like ERC721 NFTs or ERC20 tokens or setting approvals to move an asset in the future. Stelo makes it clear which assets of value are entering or leaving a user's wallet (or which approvals are being set) for every transaction or signature. We call these Asset Changes.

For transactions, we use simulation - we execute the transaction at the latest block on a node without submitting the transaction on-chain. We listen for transfer or approve events emitted by the transaction and map them to Asset Changes.

For signatures, we use interpretation - we run the signature request through a series of parsers, extract the relevant fields and map them to Asset Changes.

The transaction and signature endpoints return a list of AssetChange objects (type description here).

Understanding Asset Changes

An Asset Change can be one of four types:

  • TRANSFER_IN represents a standard transfer into the user's wallet.
  • TRANSFER_OUT represents a standard transfer out of the user's wallet.
  • APPROVE represents ERC20 approvals or token-specific ERC721 approvals.
  • APPROVE_ALL represents ERC721 or ERC1155 "approve all".

In addition to a type, each Asset Change has an Asset object (type description) and an Entity object (type description).

The Asset object contains enriched information about the asset being transferred or approved - including the asset type, the token id, the price in USD, etc.

Note that there is one Asset Change object for every individual token id being transferred. So if a transaction were transferring two tokens from the same ERC721 contract, there would be two Asset Change objects.

The Entity object contains enriched information about the counterparty (an Account or a Contract), if any, who is on the other side of the transaction.

See the enrichment page for more information on enrichedAsset and Entity objects.