Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
NFTsData Struct Reference

Represents an NFT state at a particular ledger. More...

#include <DBHelpers.hpp>

Public Member Functions

 NFTsData (ripple::uint256 const &tokenID, ripple::AccountID const &owner, ripple::Blob const &uri, ripple::TxMeta const &meta)
 Construct a new NFTsData object.
 
 NFTsData (ripple::uint256 const &tokenID, ripple::AccountID const &owner, ripple::TxMeta const &meta, bool isBurned)
 Construct a new NFTsData object.
 
 NFTsData (ripple::uint256 const &tokenID, std::uint32_t const ledgerSequence, ripple::AccountID const &owner, ripple::Blob const &uri)
 Construct a new NFTsData object.
 
 NFTsData (ripple::uint256 const &tokenID, ripple::TxMeta const &meta, ripple::Blob const &uri)
 Construct a new NFTsData object with only the URI changed.
 

Public Attributes

ripple::uint256 tokenID
 
std::uint32_t ledgerSequence
 
std::optional< std::uint32_t > transactionIndex
 
ripple::AccountID owner
 
std::optional< ripple::Blob > uri
 
bool isBurned = false
 
bool onlyUriChanged = false
 

Detailed Description

Represents an NFT state at a particular ledger.

Gets written to nf_tokens table and the like.

The transaction index is only stored because we want to store only the final state of an NFT per ledger. Since we pull this from transactions we keep track of which tx index created this so we can de-duplicate, as it is possible for one ledger to have multiple txs that change the state of the same NFT.

We only set the uri if this is a mint tx, or if we are loading initial state from NFTokenPage objects.

Constructor & Destructor Documentation

◆ NFTsData() [1/4]

NFTsData::NFTsData ( ripple::uint256 const & tokenID,
ripple::AccountID const & owner,
ripple::Blob const & uri,
ripple::TxMeta const & meta )
inline

Construct a new NFTsData object.

Note
This constructor is used when parsing an NFTokenMint tx Unfortunately because of the extreme edge case of being able to re-mint an NFT with the same ID, we must explicitly record a null URI. For this reason, we always write this field as a result of this tx.
Parameters
tokenIDThe token ID
ownerThe owner
uriThe URI
metaThe transaction metadata

◆ NFTsData() [2/4]

NFTsData::NFTsData ( ripple::uint256 const & tokenID,
ripple::AccountID const & owner,
ripple::TxMeta const & meta,
bool isBurned )
inline

Construct a new NFTsData object.

Note
This constructor is used when parsing an NFTokenBurn or NFTokenAcceptOffer tx
Parameters
tokenIDThe token ID
ownerThe owner
metaThe transaction metadata
isBurnedWhether the NFT is burned

◆ NFTsData() [3/4]

NFTsData::NFTsData ( ripple::uint256 const & tokenID,
std::uint32_t const ledgerSequence,
ripple::AccountID const & owner,
ripple::Blob const & uri )
inline

Construct a new NFTsData object.

Note
This constructor is used when parsing an NFTokenPage directly from ledger state. Unfortunately because of the extreme edge case of being able to re-mint an NFT with the same ID, we must explicitly record a null URI. For this reason, we always write this field as a result of this tx.
Parameters
tokenIDThe token ID
ledgerSequenceThe ledger sequence
ownerThe owner
uriThe URI

◆ NFTsData() [4/4]

NFTsData::NFTsData ( ripple::uint256 const & tokenID,
ripple::TxMeta const & meta,
ripple::Blob const & uri )
inline

Construct a new NFTsData object with only the URI changed.

Parameters
tokenIDThe token ID
metaThe transaction metadata
uriThe new URI

The documentation for this struct was generated from the following file: