1#include <test/jtx/flags.h>
2#include <test/jtx/token.h>
4#include <xrpld/app/tx/detail/NFTokenMint.h>
6#include <xrpl/protocol/SField.h>
7#include <xrpl/protocol/jss.h>
18 jv[sfAccount.jsonName] = account.human();
19 jv[sfNFTokenTaxon.jsonName] = nfTokenTaxon;
20 jv[sfTransactionType.jsonName] = jss::NFTokenMint;
39 jt.
jv[sfURI.jsonName] =
uri_;
58 env.
le(
issuer)->at(~sfMintedNFTokens).value_or(0)};
83 jv[sfAccount.jsonName] = account.human();
84 jv[sfNFTokenID.jsonName] =
to_string(nftokenID);
85 jv[jss::TransactionType] = jss::NFTokenBurn;
96 jv[sfAccount.jsonName] = account.human();
97 jv[sfNFTokenID.jsonName] =
to_string(nftokenID);
99 jv[jss::TransactionType] = jss::NFTokenCreateOffer;
118 jt.
jv[sfDestination.jsonName] =
dest_;
126 jv[sfAccount.jsonName] = account.human();
127 if (!empty(nftokenOffers))
130 for (
uint256 const& nftokenOffer : nftokenOffers)
133 jv[jss::TransactionType] = jss::NFTokenCancelOffer;
163 jv[sfAccount.jsonName] = account.human();
164 jv[sfNFTokenBuyOffer.jsonName] =
to_string(offerIndex);
165 jv[jss::TransactionType] = jss::NFTokenAcceptOffer;
173 jv[sfAccount.jsonName] = account.human();
174 jv[sfNFTokenSellOffer.jsonName] =
to_string(offerIndex);
175 jv[jss::TransactionType] = jss::NFTokenAcceptOffer;
186 jv[sfAccount.jsonName] = account.human();
187 jv[sfNFTokenBuyOffer.jsonName] =
to_string(buyOfferIndex);
188 jv[sfNFTokenSellOffer.jsonName] =
to_string(sellOfferIndex);
189 jv[jss::TransactionType] = jss::NFTokenAcceptOffer;
203 jt[sfNFTokenMinter.fieldName] = minter.
human();
217 jv[sfAccount.jsonName] = account.human();
218 jv[sfNFTokenID.jsonName] =
to_string(nftokenID);
219 jv[jss::TransactionType] = jss::NFTokenModify;
Value & append(Value const &value)
Append value to array at the end.
static uint256 createNFTokenID(std::uint16_t flags, std::uint16_t fee, AccountID const &issuer, nft::Taxon taxon, std::uint32_t tokenSeq)
Json::Value getJson(JsonOptions=JsonOptions::none) const override
Immutable cryptographic account descriptor.
std::string const & human() const
Returns the human readable public key.
A transaction testing environment.
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Sets the optional amount field on an NFTokenMint.
void operator()(Env &, JTx &jtx) const
STAmount const brokerFee_
void operator()(Env &, JTx &jtx) const
void operator()(Env &, JTx &jtx) const
void operator()(Env &, JTx &jtx) const
Sets the optional Issuer on an NFTokenMint.
void operator()(Env &, JTx &jtx) const
void operator()(Env &, JTx &jtx) const
void operator()(Env &, JTx &jtx) const
void operator()(Env &, JTx &jtx) const
Sets the optional TransferFee on an NFTokenMint.
void operator()(Env &, JTx &jtx) const
@ arrayValue
array value (ordered list)
Taxon toTaxon(std::uint32_t i)
Json::Value clearMinter(jtx::Account const &account)
Clear any authorized minter from an account root.
uint256 getNextID(jtx::Env const &env, jtx::Account const &issuer, std::uint32_t nfTokenTaxon, std::uint16_t flags, std::uint16_t xferFee)
Get the next NFTokenID that will be issued.
uint256 getID(jtx::Env const &env, jtx::Account const &issuer, std::uint32_t nfTokenTaxon, std::uint32_t nftSeq, std::uint16_t flags, std::uint16_t xferFee)
Get the NFTokenID for a particular nftSequence.
Json::Value setMinter(jtx::Account const &account, jtx::Account const &minter)
Set the authorized minter on an account root.
Json::Value createOffer(jtx::Account const &account, uint256 const &nftokenID, STAmount const &amount)
Create an NFTokenOffer.
Json::Value acceptSellOffer(jtx::Account const &account, uint256 const &offerIndex)
Accept an NFToken sell offer.
Json::Value modify(jtx::Account const &account, uint256 const &nftokenID)
Modify an NFToken.
Json::Value acceptBuyOffer(jtx::Account const &account, uint256 const &offerIndex)
Accept an NFToken buy offer.
static Json::Value cancelOfferImpl(jtx::Account const &account, T const &nftokenOffers)
Json::Value mint(jtx::Account const &account, std::uint32_t nfTokenTaxon)
Mint an NFToken.
Json::Value burn(jtx::Account const &account, uint256 const &nftokenID)
Burn an NFToken.
Json::Value cancelOffer(jtx::Account const &account, std::initializer_list< uint256 > const &nftokenOffers)
Cancel NFTokenOffers.
Json::Value brokerOffers(jtx::Account const &account, uint256 const &buyOfferIndex, uint256 const &sellOfferIndex)
Broker two NFToken offers.
Json::Value fclear(Account const &account, std::uint32_t off)
Remove account flag.
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr std::uint32_t asfAuthorizedNFTokenMinter
std::string to_string(base_uint< Bits, Tag > const &a)
Execution context for applying a JSON transaction.