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
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_INrepresents a standard transfer into the user's wallet.
TRANSFER_OUTrepresents a standard transfer out of the user's wallet.
APPROVErepresents ERC20 approvals or token-specific ERC721 approvals.
APPROVE_ALLrepresents 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.
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 enriched