22#include <xrpl/basics/base_uint.h>
23#include <xrpl/protocol/AccountID.h>
36using Blob = std::vector<unsigned char>;
53 std::vector<LedgerObject> objects;
54 std::optional<ripple::uint256> cursor;
61 std::vector<LedgerObject> offers;
62 std::optional<ripple::uint256> cursor;
68struct TransactionAndMetadata {
71 std::uint32_t ledgerSequence = 0;
72 std::uint32_t date = 0;
74 TransactionAndMetadata() =
default;
87 std::uint32_t ledgerSequence,
90 : transaction{std::move(transaction)}
91 , metadata{std::move(metadata)}
92 , ledgerSequence{ledgerSequence}
103 : transaction{std::get<0>(
data)}
104 , metadata{std::get<1>(
data)}
105 , ledgerSequence{std::get<2>(
data)}
106 , date{std::get<3>(
data)}
119 return transaction == other.transaction && metadata == other.metadata &&
120 ledgerSequence == other.ledgerSequence && date == other.date;
127struct TransactionsCursor {
128 std::uint32_t ledgerSequence = 0;
129 std::uint32_t transactionIndex = 0;
131 TransactionsCursor() =
default;
140 : ledgerSequence{ledgerSequence}, transactionIndex{transactionIndex}
150 : ledgerSequence{std::get<0>(
data)}, transactionIndex{std::get<1>(
data)}
162 [[nodiscard]] std::tuple<std::uint32_t, std::uint32_t>
165 return std::make_tuple(ledgerSequence, transactionIndex);
173 std::vector<TransactionAndMetadata> txns;
174 std::optional<TransactionsCursor> cursor;
181 ripple::uint256 tokenID;
182 std::uint32_t ledgerSequence{};
183 ripple::AccountID owner;
198 NFT(ripple::uint256
const& tokenID,
199 std::uint32_t ledgerSequence,
200 ripple::AccountID
const& owner,
204 , ledgerSequence{ledgerSequence}
206 , uri{std::move(uri)}
219 NFT(ripple::uint256
const& tokenID,
220 std::uint32_t ledgerSequence,
221 ripple::AccountID
const& owner,
223 : NFT(tokenID, ledgerSequence, owner, {}, isBurned)
239 return tokenID == other.tokenID && ledgerSequence == other.ledgerSequence;
247 std::vector<NFT> nfts;
248 std::optional<ripple::uint256> cursor;
255 std::vector<Blob> mptokens;
256 std::optional<ripple::AccountID> cursor;
263 std::uint32_t minSequence = 0;
264 std::uint32_t maxSequence = 0;
275 ripple::uint256 feature;
276 bool isSupportedByXRPL =
false;
277 bool isSupportedByClio =
false;
278 bool isRetired =
false;
286 static ripple::uint256
297 return name == other.name;
312 : name{std::forward<decltype(val)>(val)}
317 operator std::string
const&()
const;
320 operator std::string_view()
const;
323 operator ripple::uint256()
const;
334constexpr ripple::uint256 kFIRST_KEY{
335 "0000000000000000000000000000000000000000000000000000000000000000"
337constexpr ripple::uint256 kLAST_KEY{
338 "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
340constexpr ripple::uint256 kHI192{
341 "0000000000000000000000000000000000000000000000001111111111111111"
This namespace implements the data access layer and related components.
Definition AmendmentCenter.cpp:75
auto operator<=>(AmendmentKey const &other) const =default
Comparison operators.
AmendmentKey(std::convertible_to< std::string > auto &&val)
Construct a new AmendmentKey.
Definition Types.hpp:311
Represents an amendment in the XRPL.
Definition Types.hpp:273
bool operator==(Amendment const &other) const
Equality comparison operator.
Definition Types.hpp:295
static ripple::uint256 getAmendmentId(std::string_view const name)
Get the amendment Id from its name.
Definition AmendmentCenter.cpp:218
Represents a page of book offer objects.
Definition Types.hpp:60
Represents an object in the ledger.
Definition Types.hpp:41
Represents a page of LedgerObjects.
Definition Types.hpp:52
Stores a range of sequences as a min and max pair.
Definition Types.hpp:262
Represents an array of MPTokens.
Definition Types.hpp:254
NFT(ripple::uint256 const &tokenID, std::uint32_t ledgerSequence, ripple::AccountID const &owner, Blob uri, bool isBurned)
Construct a new NFT object.
Definition Types.hpp:198
bool operator==(NFT const &other) const
Check if the NFT is the same as another.
Definition Types.hpp:237
NFT(ripple::uint256 const &tokenID, std::uint32_t ledgerSequence, ripple::AccountID const &owner, bool isBurned)
Construct a new NFT object.
Definition Types.hpp:219
Represents a bundle of NFTs with a cursor to the next page.
Definition Types.hpp:246
Represests a bundle of transactions with metadata and a cursor to the next page.
Definition Types.hpp:172
Represents a cursor into the transactions table.
Definition Types.hpp:127
TransactionsCursor(std::tuple< std::uint32_t, std::uint32_t > data)
Construct a new Transactions Cursor object.
Definition Types.hpp:149
TransactionsCursor(std::uint32_t ledgerSequence, std::uint32_t transactionIndex)
Construct a new Transactions Cursor object.
Definition Types.hpp:139
std::tuple< std::uint32_t, std::uint32_t > asTuple() const
Convert the cursor to a tuple of seq and index.
Definition Types.hpp:163