Skip to main content

Module nftindex

Module nftindex 

Source
Expand description

What NFT transactions do to tokens, for the NFT index (nft_info, nft_history, nfts_by_issuer), following Clio’s NFTHelpers.

Only successful transactions count. Each one lists the tokens whose history it belongs to; a mint, a burn or an accepted offer also gives the token’s owner after it (a burn marks the token burned), a mint and NFTokenModify its URI. Owners come from the metadata, the way Clio finds them: the minted token is the one added to the NFT pages, and the owner of a page is the first 20 bytes of its key.

Within a ledger the last change of each kind wins. Clio keeps one record per token per ledger, so a token minted and then sold in the same ledger loses its URI and its place in the issuer’s list there; here the mint’s URI and issuer entry stay.

Structs§

NftLedger
What a ledger did to tokens.
NftTx
What one transaction did.

Functions§

nft_ledger
What a ledger’s transactions did to tokens, applied in TransactionIndex order. It never fails: a transaction that can’t be decoded or read (say, a field from an amendment this build doesn’t know) goes to problems, so the index never holds up loading.
nft_page
The tokens of an NFT page in the state, as rows that put each token at the page’s owner: the starting point for a store whose history begins after the first NFTs, as Clio fills its tables from its first ledger.
nft_tx_json
What a transaction did to tokens, from its JSON; Ok(None) if it is not a successful NFT transaction.

Type Aliases§

TokenId