20#include <xrpld/app/tx/detail/NFTokenCancelOffer.h>
21#include <xrpld/app/tx/detail/NFTokenUtils.h>
23#include <xrpl/ledger/View.h>
24#include <xrpl/protocol/Feature.h>
25#include <xrpl/protocol/TxFlags.h>
27#include <boost/endian/conversion.hpp>
43 if (
auto const& ids = ctx.
tx[sfNFTokenOffers];
60 auto const account = ctx.
tx[sfAccount];
62 auto const& ids = ctx.
tx[sfNFTokenOffers];
65 ids.begin(), ids.end(), [&ctx, &account](
uint256 const&
id) {
66 auto const offer = ctx.view.read(keylet::child(id));
75 if (offer->getType() != ltNFTOKEN_OFFER)
79 if (hasExpired(ctx.view, (*offer)[~sfExpiration]))
83 if ((*offer)[sfOwner] == account)
87 if (auto const dest = (*offer)[~sfDestination]; dest == account)
102 for (
auto const&
id :
ctx_.
tx[sfNFTokenOffers])
107 JLOG(
j_.
fatal()) <<
"Unable to delete token offer " <<
id
108 <<
" (ledger " <<
view().
seq() <<
")";
T adjacent_find(T... args)
virtual std::shared_ptr< SLE > peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
static NotTEC preflight(PreflightContext const &ctx)
static TER preclaim(PreclaimContext const &ctx)
LedgerIndex seq() const
Returns the sequence number of the base ledger.
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
std::uint32_t getFlags() const
STVector256 const & getFieldV256(SField const &field) const
std::vector< uint256 >::iterator begin()
std::vector< uint256 >::iterator end()
Keylet nftoffer(AccountID const &owner, std::uint32_t seq)
An offer from an account to buy or sell an NFT.
bool deleteTokenOffer(ApplyView &view, std::shared_ptr< SLE > const &offer)
Deletes the given token offer.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::size_t constexpr maxTokenOfferCancelCount
The maximum number of token offers that can be canceled at once.
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
constexpr std::uint32_t const tfNFTokenCancelOfferMask
bool isTesSuccess(TER x) noexcept
TERSubset< CanCvtToNotTEC > NotTEC
State information when determining if a tx is likely to claim a fee.
State information when preflighting a tx.