rippled
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

static std::shared_ptr< SLE const > locatePage (ReadView const &view, AccountID owner, uint256 const &id)
 
static std::shared_ptr< SLElocatePage (ApplyView &view, AccountID 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 insertToken (ApplyView &view, AccountID owner, STObject &&nft)
 Insert the token in the owner's token directory. More...
 
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. More...
 
TER removeToken (ApplyView &view, AccountID const &owner, uint256 const &nftokenID, std::shared_ptr< SLE > &&curr)
 Remove the token from the owner's token directory. More...
 
std::optional< STObjectfindToken (ReadView const &view, AccountID const &owner, uint256 const &nftokenID)
 Finds the specified token in the owner's token directory. More...
 
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. More...
 
TER notTooManyOffers (ReadView const &view, uint256 const &nftokenID)
 Returns tesSUCCESS if NFToken has few enough offers that it can be burned. More...
 
bool deleteTokenOffer (ApplyView &view, std::shared_ptr< SLE > const &offer)
 Deletes the given token offer. More...
 
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)
 
Rate transferFeeAsRate (std::uint16_t fee)
 Given a transfer fee (in basis points) convert it to a transfer rate. More...
 
constexpr uint256 pageMask (std::string_view("0000000000000000000000000000000000000000ffffffffffffffffffffffff"))
 

Variables

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

Typedef Documentation

◆ Taxon

Definition at line 37 of file NFTokenUtils.h.

Function Documentation

◆ locatePage() [1/2]

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

Definition at line 37 of file NFTokenUtils.cpp.

◆ locatePage() [2/2]

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

Definition at line 51 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 65 of file NFTokenUtils.cpp.

◆ compareTokens()

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

Definition at line 227 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 243 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 283 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 349 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 362 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 483 of file NFTokenUtils.cpp.

◆ findTokenAndPage()

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

Definition at line 505 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 528 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 578 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 605 of file NFTokenUtils.cpp.

◆ toTaxon()

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

Definition at line 40 of file NFTokenUtils.h.

◆ toUInt32()

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

Definition at line 46 of file NFTokenUtils.h.

◆ getFlags()

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

Definition at line 120 of file NFTokenUtils.h.

◆ getTransferFee()

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

Definition at line 128 of file NFTokenUtils.h.

◆ getSerial()

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

Definition at line 136 of file NFTokenUtils.h.

◆ cipheredTaxon()

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

Definition at line 144 of file NFTokenUtils.h.

◆ getTaxon()

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

Definition at line 168 of file NFTokenUtils.h.

◆ getIssuer()

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

Definition at line 180 of file NFTokenUtils.h.

◆ 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 39 of file Rate2.cpp.

◆ pageMask()

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

Variable Documentation

◆ flagBurnable

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

Definition at line 51 of file NFTokenUtils.h.

◆ flagOnlyXRP

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

Definition at line 52 of file NFTokenUtils.h.

◆ flagCreateTrustLines

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

Definition at line 53 of file NFTokenUtils.h.

◆ flagTransferable

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

Definition at line 54 of file NFTokenUtils.h.