xrpld
Loading...
Searching...
No Matches
xrpl::nft Namespace Reference

Classes

struct  TokenAndPage
 Finds the token in the owner's token directory. More...
struct  TaxonTag

Typedefs

using Taxon = TaggedInteger<std::uint32_t, TaxonTag>

Functions

std::size_t removeTokenOffersWithLimit (ApplyView &view, Keylet const &directory, std::size_t maxDeletableOffers)
 Delete up to a specified number of offers from the specified token offer directory.
std::optional< STObjectfindToken (ReadView const &view, AccountID const &owner, uint256 const &nftokenID)
 Finds the specified token in the owner's token directory.
std::optional< TokenAndPagefindTokenAndPage (ApplyView &view, AccountID const &owner, uint256 const &nftokenID)
TER insertToken (ApplyView &view, AccountID owner, STObject &&nft)
 Insert the token in the owner's token directory.
TER removeToken (ApplyView &view, AccountID const &owner, uint256 const &nftokenID)
 Remove the token from the owner's token directory.
TER removeToken (ApplyView &view, AccountID const &owner, uint256 const &nftokenID, SLE::ref curr)
 Remove the token from the owner's token directory.
bool deleteTokenOffer (ApplyView &view, SLE::ref offer)
 Deletes the given token offer.
bool repairNFTokenDirectoryLinks (ApplyView &view, AccountID const &owner)
 Repairs the links in an NFTokenPage directory.
bool compareTokens (uint256 const &a, uint256 const &b)
TER changeTokenURI (ApplyView &view, AccountID const &owner, uint256 const &nftokenID, std::optional< xrpl::Slice > const &uri)
NotTEC tokenOfferCreatePreflight (AccountID const &acctID, STAmount const &amount, std::optional< AccountID > const &dest, std::optional< std::uint32_t > const &expiration, std::uint16_t nftFlags, Rules const &rules, std::optional< AccountID > const &owner=std::nullopt, std::uint32_t txFlags=tfSellNFToken)
 Preflight checks shared by NFTokenCreateOffer and NFTokenMint.
TER tokenOfferCreatePreclaim (ReadView const &view, AccountID const &acctID, AccountID const &nftIssuer, STAmount const &amount, std::optional< AccountID > const &dest, std::uint16_t nftFlags, std::uint16_t xferFee, beast::Journal j, std::optional< AccountID > const &owner=std::nullopt, std::uint32_t txFlags=tfSellNFToken)
 Preclaim checks shared by NFTokenCreateOffer and NFTokenMint.
TER tokenOfferCreateApply (ApplyView &view, AccountID const &acctID, STAmount const &amount, std::optional< AccountID > const &dest, std::optional< std::uint32_t > const &expiration, SeqProxy seqProxy, uint256 const &nftokenID, XRPAmount const &priorBalance, beast::Journal j, std::uint32_t txFlags=tfSellNFToken)
 doApply implementation shared by NFTokenCreateOffer and NFTokenMint
TER checkTrustlineAuthorized (ReadView const &view, AccountID const id, beast::Journal const j, Issue const &issue)
TER checkTrustlineDeepFrozen (ReadView const &view, AccountID const id, beast::Journal const j, Issue const &issue)
Taxon toTaxon (std::uint32_t i)
std::uint32_t toUInt32 (Taxon t)
std::uint16_t getFlags (uint256 const &id)
std::uint16_t getTransferFee (uint256 const &id)
std::uint32_t getSequence (uint256 const &id)
Taxon cipheredTaxon (std::uint32_t tokenSeq, Taxon taxon)
Taxon getTaxon (uint256 const &id)
AccountID getIssuer (uint256 const &id)
constexpr uint256 kPageMask (std::string_view("0000000000000000000000000000000000000000ffffffffffffffffffffffff"))
Rate transferFeeAsRate (std::uint16_t fee)
 Given a transfer fee (in basis points) convert it to a transfer rate.
static SLE::const_pointer locatePage (ReadView const &view, AccountID const &owner, uint256 const &id)
static SLE::pointer locatePage (ApplyView &view, AccountID const &owner, uint256 const &id)
static SLE::pointer getPageForToken (ApplyView &view, AccountID const &owner, uint256 const &id, std::function< void(ApplyView &, AccountID const &)> const &createCallback)
static bool mergePages (ApplyView &view, SLE::ref p1, SLE::ref p2)

Variables

constexpr std::uint16_t const kFlagBurnable = 0x0001
constexpr std::uint16_t const kFlagOnlyXrp = 0x0002
constexpr std::uint16_t const kFlagCreateTrustLines = 0x0004
constexpr std::uint16_t const kFlagTransferable = 0x0008
constexpr std::uint16_t const kFlagMutable = 0x0010

Typedef Documentation

◆ Taxon

Definition at line 18 of file nft.h.

Function Documentation

◆ removeTokenOffersWithLimit()

std::size_t xrpl::nft::removeTokenOffersWithLimit ( ApplyView & view,
Keylet const & directory,
std::size_t maxDeletableOffers )

Delete up to a specified number of offers from the specified token offer directory.

Definition at line 572 of file NFTokenHelpers.cpp.

◆ findToken()

std::optional< STObject > xrpl::nft::findToken ( ReadView const & view,
AccountID const & owner,
uint256 const & nftokenID )

Finds the specified token in the owner's token directory.

Definition at line 532 of file NFTokenHelpers.cpp.

◆ findTokenAndPage()

std::optional< TokenAndPage > xrpl::nft::findTokenAndPage ( ApplyView & view,
AccountID const & owner,
uint256 const & nftokenID )

Definition at line 551 of file NFTokenHelpers.cpp.

◆ insertToken()

TER xrpl::nft::insertToken ( ApplyView & view,
AccountID owner,
STObject && nft )

Insert the token in the owner's token directory.

Definition at line 263 of file NFTokenHelpers.cpp.

◆ removeToken() [1/2]

TER xrpl::nft::removeToken ( ApplyView & view,
AccountID const & owner,
uint256 const & nftokenID )

Remove the token from the owner's token directory.

Definition at line 356 of file NFTokenHelpers.cpp.

◆ removeToken() [2/2]

TER xrpl::nft::removeToken ( ApplyView & view,
AccountID const & owner,
uint256 const & nftokenID,
SLE::ref page )

Remove the token from the owner's token directory.

Definition at line 369 of file NFTokenHelpers.cpp.

◆ deleteTokenOffer()

bool xrpl::nft::deleteTokenOffer ( ApplyView & view,
SLE::ref offer )

Deletes the given token offer.

An offer is tracked in two separate places:

  • The token's 'buy' directory, if it's a buy offer; or
  • The token's 'sell' directory, if it's a sell offer; and
  • The owner directory of the account that placed the offer.

The offer also consumes one incremental reserve.

Definition at line 622 of file NFTokenHelpers.cpp.

◆ repairNFTokenDirectoryLinks()

bool xrpl::nft::repairNFTokenDirectoryLinks ( ApplyView & view,
AccountID const & owner )

Repairs the links in an NFTokenPage directory.

Returns true if a repair took place, otherwise false.

Definition at line 650 of file NFTokenHelpers.cpp.

◆ compareTokens()

bool xrpl::nft::compareTokens ( uint256 const & a,
uint256 const & b )

Definition at line 213 of file NFTokenHelpers.cpp.

◆ changeTokenURI()

TER xrpl::nft::changeTokenURI ( ApplyView & view,
AccountID const & owner,
uint256 const & nftokenID,
std::optional< xrpl::Slice > const & uri )

Definition at line 227 of file NFTokenHelpers.cpp.

◆ tokenOfferCreatePreflight()

NotTEC xrpl::nft::tokenOfferCreatePreflight ( AccountID const & acctID,
STAmount const & amount,
std::optional< AccountID > const & dest,
std::optional< std::uint32_t > const & expiration,
std::uint16_t nftFlags,
Rules const & rules,
std::optional< AccountID > const & owner = std::nullopt,
std::uint32_t txFlags = tfSellNFToken )

Preflight checks shared by NFTokenCreateOffer and NFTokenMint.

Definition at line 769 of file NFTokenHelpers.cpp.

◆ tokenOfferCreatePreclaim()

TER xrpl::nft::tokenOfferCreatePreclaim ( ReadView const & view,
AccountID const & acctID,
AccountID const & nftIssuer,
STAmount const & amount,
std::optional< AccountID > const & dest,
std::uint16_t nftFlags,
std::uint16_t xferFee,
beast::Journal j,
std::optional< AccountID > const & owner = std::nullopt,
std::uint32_t txFlags = tfSellNFToken )

Preclaim checks shared by NFTokenCreateOffer and NFTokenMint.

Definition at line 820 of file NFTokenHelpers.cpp.

◆ tokenOfferCreateApply()

TER xrpl::nft::tokenOfferCreateApply ( ApplyView & view,
AccountID const & acctID,
STAmount const & amount,
std::optional< AccountID > const & dest,
std::optional< std::uint32_t > const & expiration,
SeqProxy seqProxy,
uint256 const & nftokenID,
XRPAmount const & priorBalance,
beast::Journal j,
std::uint32_t txFlags = tfSellNFToken )

doApply implementation shared by NFTokenCreateOffer and NFTokenMint

Definition at line 920 of file NFTokenHelpers.cpp.

◆ checkTrustlineAuthorized()

TER xrpl::nft::checkTrustlineAuthorized ( ReadView const & view,
AccountID const id,
beast::Journal const j,
Issue const & issue )

Definition at line 992 of file NFTokenHelpers.cpp.

◆ checkTrustlineDeepFrozen()

TER xrpl::nft::checkTrustlineDeepFrozen ( ReadView const & view,
AccountID const id,
beast::Journal const j,
Issue const & issue )

Definition at line 1044 of file NFTokenHelpers.cpp.

◆ toTaxon()

Taxon xrpl::nft::toTaxon ( std::uint32_t i)

Definition at line 21 of file nft.h.

◆ toUInt32()

std::uint32_t xrpl::nft::toUInt32 ( Taxon t)

Definition at line 27 of file nft.h.

◆ getFlags()

std::uint16_t xrpl::nft::getFlags ( uint256 const & id)

Definition at line 39 of file nft.h.

◆ getTransferFee()

std::uint16_t xrpl::nft::getTransferFee ( uint256 const & id)

Definition at line 47 of file nft.h.

◆ getSequence()

std::uint32_t xrpl::nft::getSequence ( uint256 const & id)

Definition at line 55 of file nft.h.

◆ cipheredTaxon()

Taxon xrpl::nft::cipheredTaxon ( std::uint32_t tokenSeq,
Taxon taxon )

Definition at line 63 of file nft.h.

◆ getTaxon()

Taxon xrpl::nft::getTaxon ( uint256 const & id)

Definition at line 87 of file nft.h.

◆ getIssuer()

AccountID xrpl::nft::getIssuer ( uint256 const & id)

Definition at line 99 of file nft.h.

◆ kPageMask()

uint256 xrpl::nft::kPageMask ( std::string_view("0000000000000000000000000000000000000000ffffffffffffffffffffffff") )
constexpr

◆ transferFeeAsRate()

Rate xrpl::nft::transferFeeAsRate ( std::uint16_t fee)

Given a transfer fee (in basis points) convert it to a transfer rate.

Definition at line 26 of file Rate2.cpp.

◆ locatePage() [1/2]

SLE::const_pointer xrpl::nft::locatePage ( ReadView const & view,
AccountID const & owner,
uint256 const & id )
static

Definition at line 45 of file NFTokenHelpers.cpp.

◆ locatePage() [2/2]

SLE::pointer xrpl::nft::locatePage ( ApplyView & view,
AccountID const & owner,
uint256 const & id )
static

Definition at line 58 of file NFTokenHelpers.cpp.

◆ getPageForToken()

SLE::pointer xrpl::nft::getPageForToken ( ApplyView & view,
AccountID const & owner,
uint256 const & id,
std::function< void(ApplyView &, AccountID const &)> const & createCallback )
static

Definition at line 71 of file NFTokenHelpers.cpp.

◆ mergePages()

bool xrpl::nft::mergePages ( ApplyView & view,
SLE::ref p1,
SLE::ref p2 )
static

Definition at line 299 of file NFTokenHelpers.cpp.

Variable Documentation

◆ kFlagBurnable

std::uint16_t const xrpl::nft::kFlagBurnable = 0x0001
constexpr

Definition at line 32 of file nft.h.

◆ kFlagOnlyXrp

std::uint16_t const xrpl::nft::kFlagOnlyXrp = 0x0002
constexpr

Definition at line 33 of file nft.h.

◆ kFlagCreateTrustLines

std::uint16_t const xrpl::nft::kFlagCreateTrustLines = 0x0004
constexpr

Definition at line 34 of file nft.h.

◆ kFlagTransferable

std::uint16_t const xrpl::nft::kFlagTransferable = 0x0008
constexpr

Definition at line 35 of file nft.h.

◆ kFlagMutable

std::uint16_t const xrpl::nft::kFlagMutable = 0x0010
constexpr

Definition at line 36 of file nft.h.