rippled
Loading...
Searching...
No Matches
NFTokenUtils.h
1#ifndef XRPL_TX_IMPL_DETAILS_NFTOKENUTILS_H_INCLUDED
2#define XRPL_TX_IMPL_DETAILS_NFTOKENUTILS_H_INCLUDED
3
4#include <xrpld/app/tx/detail/Transactor.h>
5
6#include <xrpl/basics/base_uint.h>
7#include <xrpl/ledger/ApplyView.h>
8#include <xrpl/protocol/AccountID.h>
9#include <xrpl/protocol/TER.h>
10#include <xrpl/protocol/nft.h>
11
12namespace ripple {
13
14namespace nft {
15
20 ApplyView& view,
21 Keylet const& directory,
22 std::size_t maxDeletableOffers);
23
25TER
26notTooManyOffers(ReadView const& view, uint256 const& nftokenID);
27
31 ReadView const& view,
32 AccountID const& owner,
33 uint256 const& nftokenID);
34
37{
40
42 : token(token_), page(std::move(page_))
43 {
44 }
45};
48 ApplyView& view,
49 AccountID const& owner,
50 uint256 const& nftokenID);
51
53TER
54insertToken(ApplyView& view, AccountID owner, STObject&& nft);
55
57TER
58removeToken(ApplyView& view, AccountID const& owner, uint256 const& nftokenID);
59
60TER
62 ApplyView& view,
63 AccountID const& owner,
64 uint256 const& nftokenID,
66
76bool
78
83bool
85
86bool
87compareTokens(uint256 const& a, uint256 const& b);
88
89TER
91 ApplyView& view,
92 AccountID const& owner,
93 uint256 const& nftokenID,
95
99 AccountID const& acctID,
100 STAmount const& amount,
101 std::optional<AccountID> const& dest,
102 std::optional<std::uint32_t> const& expiration,
103 std::uint16_t nftFlags,
104 Rules const& rules,
106 std::uint32_t txFlags = lsfSellNFToken);
107
109TER
111 ReadView const& view,
112 AccountID const& acctID,
113 AccountID const& nftIssuer,
114 STAmount const& amount,
115 std::optional<AccountID> const& dest,
116 std::uint16_t nftFlags,
117 std::uint16_t xferFee,
120 std::uint32_t txFlags = lsfSellNFToken);
121
123TER
125 ApplyView& view,
126 AccountID const& acctID,
127 STAmount const& amount,
128 std::optional<AccountID> const& dest,
129 std::optional<std::uint32_t> const& expiration,
130 SeqProxy seqProxy,
131 uint256 const& nftokenID,
132 XRPAmount const& priorBalance,
134 std::uint32_t txFlags = lsfSellNFToken);
135
136TER
138 ReadView const& view,
139 AccountID const id,
140 beast::Journal const j,
141 Issue const& issue);
142
143TER
145 ReadView const& view,
146 AccountID const id,
147 beast::Journal const j,
148 Issue const& issue);
149
150} // namespace nft
151
152} // namespace ripple
153
154#endif // XRPL_TX_IMPL_DETAILS_NFTOKENUTILS_H_INCLUDED
A generic endpoint for log messages.
Definition Journal.h:41
Writeable view to a ledger, for applying a transaction.
Definition ApplyView.h:124
A currency issued by an account.
Definition Issue.h:14
A view into a ledger.
Definition ReadView.h:32
Rules controlling protocol behavior.
Definition Rules.h:19
A type that represents either a sequence value or a ticket value.
Definition SeqProxy.h:37
T is_same_v
TER removeToken(ApplyView &view, AccountID const &owner, uint256 const &nftokenID)
Remove the token from the owner's token directory.
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::uint32_t txFlags)
Preflight checks shared by NFTokenCreateOffer and NFTokenMint.
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)
doApply implementation shared by NFTokenCreateOffer and NFTokenMint
TER checkTrustlineDeepFrozen(ReadView const &view, AccountID const id, beast::Journal const j, Issue const &issue)
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::uint32_t txFlags)
Preclaim checks shared by NFTokenCreateOffer and NFTokenMint.
bool repairNFTokenDirectoryLinks(ApplyView &view, AccountID const &owner)
Repairs the links in an NFTokenPage directory.
bool deleteTokenOffer(ApplyView &view, std::shared_ptr< SLE > const &offer)
Deletes the given token offer.
std::optional< TokenAndPage > findTokenAndPage(ApplyView &view, AccountID const &owner, uint256 const &nftokenID)
TER insertToken(ApplyView &view, AccountID owner, STObject &&nft)
Insert the token in the owner's token directory.
TER notTooManyOffers(ReadView const &view, uint256 const &nftokenID)
Returns tesSUCCESS if NFToken has few enough offers that it can be burned.
std::optional< STObject > findToken(ReadView const &view, AccountID const &owner, uint256 const &nftokenID)
Finds the specified token in the owner's token directory.
bool compareTokens(uint256 const &a, uint256 const &b)
TER changeTokenURI(ApplyView &view, AccountID const &owner, uint256 const &nftokenID, std::optional< ripple::Slice > const &uri)
std::size_t removeTokenOffersWithLimit(ApplyView &view, Keylet const &directory, std::size_t maxDeletableOffers)
Delete up to a specified number of offers from the specified token offer directory.
TER checkTrustlineAuthorized(ReadView const &view, AccountID const id, beast::Journal const j, Issue const &issue)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:29
base_uint< 256 > uint256
Definition base_uint.h:539
TERSubset< CanCvtToTER > TER
Definition TER.h:630
STL namespace.
Finds the token in the owner's token directory.
TokenAndPage(STObject const &token_, std::shared_ptr< SLE > page_)
std::shared_ptr< SLE > page