1#include <xrpl/tx/transactors/nft/NFTokenCreateOffer.h>
3#include <xrpl/basics/base_uint.h>
4#include <xrpl/ledger/ReadView.h>
5#include <xrpl/ledger/View.h>
6#include <xrpl/ledger/helpers/NFTokenHelpers.h>
7#include <xrpl/protocol/SField.h>
8#include <xrpl/protocol/STLedgerEntry.h>
9#include <xrpl/protocol/STTx.h>
10#include <xrpl/protocol/TER.h>
11#include <xrpl/protocol/TxFlags.h>
12#include <xrpl/protocol/XRPAmount.h>
13#include <xrpl/protocol/nft.h>
14#include <xrpl/tx/Transactor.h>
22 return tfNFTokenCreateOfferMask;
36 ctx.
tx[~sfDestination],
37 ctx.
tx[~sfExpiration],
54 uint256 const nftokenID = ctx.
tx[sfNFTokenID];
57 ctx.
view, ctx.
tx[ctx.
tx.
isFlag(tfSellNFToken) ? sfAccount : sfOwner], nftokenID))
66 ctx.
tx[~sfDestination],
82 ctx_.tx[~sfDestination],
83 ctx_.tx[~sfExpiration],
84 ctx_.tx.getSeqProxy(),
A generic endpoint for log messages.
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
static TER preclaim(PreclaimContext const &ctx)
void visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override
Inspect a single ledger entry modified by this transaction.
static NotTEC preflight(PreflightContext const &ctx)
bool finalizeInvariants(STTx const &tx, TER result, XRPAmount fee, ReadView const &view, beast::Journal const &j) override
Check transaction-specific post-conditions after all entries have been visited.
std::shared_ptr< STLedgerEntry const > const & const_ref
bool isFlag(std::uint32_t) const
std::uint32_t getFlags() const
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=tfSellNFToken)
Preclaim checks shared by NFTokenCreateOffer and NFTokenMint.
std::optional< STObject > findToken(ReadView const &view, AccountID const &owner, uint256 const &nftokenID)
Finds the specified token in the owner's token directory.
AccountID getIssuer(uint256 const &id)
std::uint16_t getTransferFee(uint256 const &id)
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=tfSellNFToken)
doApply implementation shared by NFTokenCreateOffer and NFTokenMint
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=tfSellNFToken)
Preflight checks shared by NFTokenCreateOffer and NFTokenMint.
std::uint16_t getFlags(uint256 const &id)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
TERSubset< CanCvtToNotTEC > NotTEC
bool isTesSuccess(TER x) noexcept
TERSubset< CanCvtToTER > TER
State information when determining if a tx is likely to claim a fee.
State information when preflighting a tx.