rippled
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
ripple::nft Namespace Reference

Classes

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

Typedefs

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

Functions

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 getSerial (uint256 const &id)
 
Taxon cipheredTaxon (std::uint32_t tokenSeq, Taxon taxon)
 
Taxon getTaxon (uint256 const &id)
 
AccountID getIssuer (uint256 const &id)
 
uint256 constexpr pageMask (std::string_view("0000000000000000000000000000000000000000ffffffffffffffffffffffff"))
 
Rate transferFeeAsRate (std::uint16_t fee)
 Given a transfer fee (in basis points) convert it to a transfer rate.
 
static std::shared_ptr< SLE const > locatePage (ReadView const &view, AccountID const &owner, uint256 const &id)
 
static std::shared_ptr< SLElocatePage (ApplyView &view, AccountID const &owner, uint256 const &id)
 
static std::shared_ptr< SLEgetPageForToken (ApplyView &view, AccountID const &owner, uint256 const &id, std::function< void(ApplyView &, AccountID const &)> const &createCallback)
 
bool compareTokens (uint256 const &a, uint256 const &b)
 
TER changeTokenURI (ApplyView &view, AccountID const &owner, uint256 const &nftokenID, std::optional< ripple::Slice > const &uri)
 
TER insertToken (ApplyView &view, AccountID owner, STObject &&nft)
 Insert the token in the owner's token directory.
 
static bool mergePages (ApplyView &view, std::shared_ptr< SLE > const &p1, std::shared_ptr< SLE > const &p2)
 
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, std::shared_ptr< SLE > &&curr)
 Remove the token from the owner's token 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)
 
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.
 
TER notTooManyOffers (ReadView const &view, uint256 const &nftokenID)
 Returns tesSUCCESS if NFToken has few enough offers that it can be burned.
 
bool deleteTokenOffer (ApplyView &view, std::shared_ptr< SLE > const &offer)
 Deletes the given token offer.
 
bool repairNFTokenDirectoryLinks (ApplyView &view, AccountID const &owner)
 Repairs the links in an NFTokenPage directory.
 
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=lsfSellNFToken)
 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=lsfSellNFToken)
 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=lsfSellNFToken)
 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)
 

Variables

constexpr std::uint16_t const flagBurnable = 0x0001
 
constexpr std::uint16_t const flagOnlyXRP = 0x0002
 
constexpr std::uint16_t const flagCreateTrustLines = 0x0004
 
constexpr std::uint16_t const flagTransferable = 0x0008
 
constexpr std::uint16_t const flagMutable = 0x0010
 

Typedef Documentation

◆ Taxon

Definition at line 39 of file nft.h.

Function Documentation

◆ toTaxon()

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

Definition at line 42 of file nft.h.

◆ toUInt32()

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

Definition at line 48 of file nft.h.

◆ getFlags()

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

Definition at line 60 of file nft.h.

◆ getTransferFee()

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

Definition at line 68 of file nft.h.

◆ getSerial()

std::uint32_t ripple::nft::getSerial ( uint256 const &  id)

Definition at line 76 of file nft.h.

◆ cipheredTaxon()

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

Definition at line 84 of file nft.h.

◆ getTaxon()

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

Definition at line 108 of file nft.h.

◆ getIssuer()

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

Definition at line 120 of file nft.h.

◆ pageMask()

uint256 constexpr ripple::nft::pageMask ( std::string_view("0000000000000000000000000000000000000000ffffffffffffffffffffffff")  )
constexpr

◆ transferFeeAsRate()

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

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

Definition at line 45 of file Rate2.cpp.

◆ locatePage() [1/2]

static std::shared_ptr< SLE const > ripple::nft::locatePage ( ReadView const &  view,
AccountID const &  owner,
uint256 const &  id 
)
static

Definition at line 38 of file NFTokenUtils.cpp.

◆ locatePage() [2/2]

static std::shared_ptr< SLE > ripple::nft::locatePage ( ApplyView view,
AccountID const &  owner,
uint256 const &  id 
)
static

Definition at line 52 of file NFTokenUtils.cpp.

◆ getPageForToken()

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

Definition at line 66 of file NFTokenUtils.cpp.

◆ compareTokens()

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

Definition at line 216 of file NFTokenUtils.cpp.

◆ changeTokenURI()

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

Definition at line 231 of file NFTokenUtils.cpp.

◆ insertToken()

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

Insert the token in the owner's token directory.

Definition at line 265 of file NFTokenUtils.cpp.

◆ mergePages()

static bool ripple::nft::mergePages ( ApplyView view,
std::shared_ptr< SLE > const &  p1,
std::shared_ptr< SLE > const &  p2 
)
static

Definition at line 307 of file NFTokenUtils.cpp.

◆ removeToken() [1/2]

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

Remove the token from the owner's token directory.

Definition at line 373 of file NFTokenUtils.cpp.

◆ removeToken() [2/2]

TER ripple::nft::removeToken ( ApplyView view,
AccountID const &  owner,
uint256 const &  nftokenID,
std::shared_ptr< SLE > &&  curr 
)

Remove the token from the owner's token directory.

Definition at line 386 of file NFTokenUtils.cpp.

◆ findToken()

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

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

Definition at line 545 of file NFTokenUtils.cpp.

◆ findTokenAndPage()

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

Definition at line 567 of file NFTokenUtils.cpp.

◆ removeTokenOffersWithLimit()

std::size_t ripple::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 590 of file NFTokenUtils.cpp.

◆ notTooManyOffers()

TER ripple::nft::notTooManyOffers ( ReadView const &  view,
uint256 const &  nftokenID 
)

Returns tesSUCCESS if NFToken has few enough offers that it can be burned.

Definition at line 640 of file NFTokenUtils.cpp.

◆ deleteTokenOffer()

bool ripple::nft::deleteTokenOffer ( ApplyView view,
std::shared_ptr< SLE > const &  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 667 of file NFTokenUtils.cpp.

◆ repairNFTokenDirectoryLinks()

bool ripple::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 702 of file NFTokenUtils.cpp.

◆ tokenOfferCreatePreflight()

NotTEC ripple::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::uint32_t  txFlags 
)

Preflight checks shared by NFTokenCreateOffer and NFTokenMint.

Definition at line 822 of file NFTokenUtils.cpp.

◆ tokenOfferCreatePreclaim()

TER ripple::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::uint32_t  txFlags 
)

Preclaim checks shared by NFTokenCreateOffer and NFTokenMint.

Definition at line 871 of file NFTokenUtils.cpp.

◆ tokenOfferCreateApply()

TER ripple::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 
)

doApply implementation shared by NFTokenCreateOffer and NFTokenMint

Definition at line 984 of file NFTokenUtils.cpp.

◆ checkTrustlineAuthorized()

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

Definition at line 1058 of file NFTokenUtils.cpp.

◆ checkTrustlineDeepFrozen()

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

Definition at line 1114 of file NFTokenUtils.cpp.

Variable Documentation

◆ flagBurnable

constexpr std::uint16_t const ripple::nft::flagBurnable = 0x0001
constexpr

Definition at line 53 of file nft.h.

◆ flagOnlyXRP

constexpr std::uint16_t const ripple::nft::flagOnlyXRP = 0x0002
constexpr

Definition at line 54 of file nft.h.

◆ flagCreateTrustLines

constexpr std::uint16_t const ripple::nft::flagCreateTrustLines = 0x0004
constexpr

Definition at line 55 of file nft.h.

◆ flagTransferable

constexpr std::uint16_t const ripple::nft::flagTransferable = 0x0008
constexpr

Definition at line 56 of file nft.h.

◆ flagMutable

constexpr std::uint16_t const ripple::nft::flagMutable = 0x0010
constexpr

Definition at line 57 of file nft.h.