20 #include <ripple/rpc/NFTokenID.h>
22 #include <ripple/app/ledger/LedgerMaster.h>
23 #include <ripple/app/ledger/OpenLedger.h>
24 #include <ripple/app/misc/Transaction.h>
25 #include <ripple/ledger/View.h>
26 #include <ripple/net/RPCErr.h>
27 #include <ripple/protocol/AccountID.h>
28 #include <ripple/protocol/Feature.h>
29 #include <ripple/rpc/Context.h>
30 #include <ripple/rpc/impl/RPCHelpers.h>
31 #include <boost/algorithm/string/case_conv.hpp>
39 TxMeta const& transactionMeta)
44 TxType const tt = serializedTx->getTxnType();
70 SField const& fName = node.getFName();
77 toAddPrevNFTs.
begin(),
81 return nft.getFieldH256(sfNFTokenID);
103 toAddPrevNFTs.
begin(),
107 return nft.getFieldH256(sfNFTokenID);
114 toAddFinalNFTs.
begin(),
115 toAddFinalNFTs.
end(),
118 return nft.getFieldH256(sfNFTokenID);
125 if (finalIDs.
size() != prevIDs.
size() + 1)
135 if (diff.first == finalIDs.
end())
159 sort(tokenIDResult.
begin(), tokenIDResult.
end());
161 unique(tokenIDResult.
begin(), tokenIDResult.
end()),
162 tokenIDResult.
end());
163 return tokenIDResult;
170 TxMeta const& transactionMeta)
176 if (
auto const type = transaction->getTxnType(); type ==
ttNFTOKEN_MINT)
187 if (result.
size() > 0)
196 for (
auto const& nftID : result)
const STBase & peekAtField(SField const &field) const
const STArray & getFieldArray(SField const &field) const
const SF_UINT256 sfNFTokenID
@ arrayValue
array value (ordered list)
T back_inserter(T... args)
TxType
Transaction type identifiers.
const SField sfFinalFields
@ ttNFTOKEN_ACCEPT_OFFER
This transaction accepts an existing offer to buy or sell an existing NFT.
const SField sfDeletedNode
std::vector< uint256 > getNFTokenIDFromDeletedOffer(TxMeta const &transactionMeta)
std::optional< uint256 > getNFTokenIDFromPage(TxMeta const &transactionMeta)
void insertNFTokenID(Json::Value &response, std::shared_ptr< STTx const > const &transaction, TxMeta const &transactionMeta)
Value & append(const Value &value)
Append value to array at the end.
@ ltNFTOKEN_OFFER
A ledger object which identifies an offer to buy or sell an NFT.
@ ttNFTOKEN_MINT
This transaction mints a new NFT.
const SField sfModifiedNode
@ ttNFTOKEN_CANCEL_OFFER
This transaction cancels an existing offer to buy or sell an existing NFT.
bool canHaveNFTokenID(std::shared_ptr< STTx const > const &serializedTx, TxMeta const &transactionMeta)
Add a nftoken_ids field to the meta output parameter.
const SField sfPreviousFields
@ ltNFTOKEN_PAGE
A ledger object which contains a list of NFTs.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
const SF_UINT16 sfLedgerEntryType
bool isFieldPresent(SField const &field) const
const SField sfCreatedNode
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.