20 #include <ripple/app/tx/impl/NFTokenCreateOffer.h>
21 #include <ripple/app/tx/impl/details/NFTokenUtils.h>
22 #include <ripple/ledger/View.h>
23 #include <ripple/protocol/Feature.h>
24 #include <ripple/protocol/TxFlags.h>
25 #include <ripple/protocol/st.h>
26 #include <boost/endian/conversion.hpp>
66 if (!isSellOffer && !amount)
77 if (owner.has_value() == isSellOffer)
80 if (owner && owner == account)
130 ctx.
view, issuer, amount.getCurrency(), amount.getIssuer()))
147 amount.getCurrency(),
164 FreezeHandling::fhZERO_IF_FROZEN,
173 amount.getCurrency(),
175 FreezeHandling::fhZERO_IF_FROZEN,
264 auto offer = std::make_shared<SLE>(offerID);
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
const SF_UINT32 sfOwnerCount
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
const uint256 fixNFTokenNegOffer
std::uint16_t getFlags(uint256 const &id)
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
const SF_UINT64 sfOwnerNode
const SF_ACCOUNT sfDestination
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
const SF_UINT256 sfNFTokenID
constexpr const std::uint16_t flagTransferable
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const ¤cy, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Keylet nftoffer(AccountID const &owner, std::uint32_t seq)
An offer from an account to buy or sell an NFT.
int signum() const noexcept
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
constexpr const std::uint16_t flagOnlyXRP
SeqProxy getSeqProxy() const
std::optional< STObject > findToken(ReadView const &view, AccountID const &owner, uint256 const &nftokenID)
Finds the specified token in the owner's token directory.
static TER preclaim(PreclaimContext const &ctx)
const SF_UINT64 sfNFTokenOfferNode
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
const SF_UINT32 sfExpiration
AccountID getIssuer(uint256 const &id)
void adjustOwnerCount(ApplyView &view, std::shared_ptr< SLE > const &sle, std::int32_t amount, beast::Journal j)
Adjust the owner count up or down.
Keylet account(AccountID const &id) noexcept
AccountID root.
@ tefNFTOKEN_IS_NOT_TRANSFERABLE
const uint256 featureDisallowIncoming
const SF_ACCOUNT sfNFTokenMinter
static NotTEC preflight(PreflightContext const &ctx)
Keylet nft_sells(uint256 const &id) noexcept
The directory of sell offers for the specified NFT.
virtual bool exists(Keylet const &k) const =0
Determine if a state item exists.
std::uint32_t getFlags() const
constexpr const std::uint32_t tfSellNFToken
bool isXRP(AccountID const &c)
Keylet nft_buys(uint256 const &id) noexcept
The directory of buy offers for the specified NFT.
Keylet line(AccountID const &id0, AccountID const &id1, Currency const ¤cy) noexcept
The index of a trust line for a given currency.
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
State information when determining if a tx is likely to claim a fee.
constexpr std::uint32_t value() const
virtual void insert(std::shared_ptr< SLE > const &sle)=0
Insert a new state SLE.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
const uint256 featureNonFungibleTokensV1
@ lsfDisallowIncomingNFTokenOffer
virtual Rules const & rules() const =0
Returns the tx processing rules.
constexpr const std::uint32_t tfNFTokenCreateOfferMask
bool negative() const noexcept
bool isFlag(std::uint32_t) const
@ tecINSUFFICIENT_RESERVE
constexpr const std::uint16_t flagCreateTrustLines
const SF_ACCOUNT sfAccount
const uint256 fixNonFungibleTokensV1_2
std::uint16_t getTransferFee(uint256 const &id)
State information when preflighting a tx.
std::optional< std::uint64_t > dirInsert(Keylet const &directory, uint256 const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
Insert an entry to a directory.
bool isFrozen(ReadView const &view, AccountID const &account, Currency const ¤cy, AccountID const &issuer)
TERSubset< CanCvtToNotTEC > NotTEC
Number root(Number f, unsigned d)