20 #ifndef RIPPLE_TX_IMPL_DETAILS_NFTOKENUTILS_H_INCLUDED
21 #define RIPPLE_TX_IMPL_DETAILS_NFTOKENUTILS_H_INCLUDED
23 #include <ripple/basics/base_uint.h>
24 #include <ripple/basics/tagged_integer.h>
25 #include <ripple/ledger/ApplyView.h>
26 #include <ripple/protocol/AccountID.h>
27 #include <ripple/protocol/TER.h>
42 return static_cast<Taxon>(i);
123 memcpy(&flags,
id.begin(), 2);
124 return boost::endian::big_to_native(flags);
131 memcpy(&fee,
id.begin() + 2, 2);
132 return boost::endian::big_to_native(fee);
139 memcpy(&seq,
id.begin() + 28, 4);
140 return boost::endian::big_to_native(seq);
164 return taxon ^
toTaxon(((384160001 * tokenSeq) + 2459));
171 memcpy(&taxon,
id.begin() + 24, 4);
172 taxon = boost::endian::big_to_native(taxon);
192 #endif // RIPPLE_TX_IMPL_DETAILS_NFTOKENUTILS_H_INCLUDED
A pair of SHAMap key and LedgerEntryType.
std::uint16_t getFlags(uint256 const &id)
std::shared_ptr< SLE > page
std::optional< TokenAndPage > findTokenAndPage(ApplyView &view, AccountID const &owner, uint256 const &nftokenID)
Finds the token in the owner's token directory.
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.
constexpr const std::uint16_t flagTransferable
TER notTooManyOffers(ReadView const &view, uint256 const &nftokenID)
Returns tesSUCCESS if NFToken has few enough offers that it can be burned.
constexpr const std::uint16_t flagOnlyXRP
std::optional< STObject > findToken(ReadView const &view, AccountID const &owner, uint256 const &nftokenID)
Finds the specified token in the owner's token directory.
Taxon toTaxon(std::uint32_t i)
TER removeToken(ApplyView &view, AccountID const &owner, uint256 const &nftokenID)
Remove the token from the owner's token directory.
bool compareTokens(uint256 const &a, uint256 const &b)
Writeable view to a ledger, for applying a transaction.
AccountID getIssuer(uint256 const &id)
TokenAndPage(STObject const &token_, std::shared_ptr< SLE > page_)
std::uint32_t toUInt32(Taxon t)
std::uint32_t getSerial(uint256 const &id)
constexpr const std::uint16_t flagBurnable
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
tagged_integer< std::uint32_t, TaxonTag > Taxon
static base_uint fromVoid(void const *data)
constexpr const std::uint16_t flagCreateTrustLines
A type-safe wrap around standard integral types.
std::uint16_t getTransferFee(uint256 const &id)
Taxon cipheredTaxon(std::uint32_t tokenSeq, Taxon taxon)
Taxon getTaxon(uint256 const &id)
TER insertToken(ApplyView &view, AccountID owner, STObject &&nft)
Insert the token in the owner's token directory.
bool deleteTokenOffer(ApplyView &view, std::shared_ptr< SLE > const &offer)
Deletes the given token offer.