20#include <xrpl/basics/Slice.h>
21#include <xrpl/basics/base_uint.h>
22#include <xrpl/basics/safe_cast.h>
23#include <xrpl/beast/utility/instrumentation.h>
24#include <xrpl/protocol/AccountID.h>
25#include <xrpl/protocol/Asset.h>
26#include <xrpl/protocol/Book.h>
27#include <xrpl/protocol/Indexes.h>
28#include <xrpl/protocol/LedgerFormats.h>
29#include <xrpl/protocol/Protocol.h>
30#include <xrpl/protocol/SField.h>
31#include <xrpl/protocol/STXChainBridge.h>
32#include <xrpl/protocol/SeqProxy.h>
33#include <xrpl/protocol/UintTypes.h>
34#include <xrpl/protocol/digest.h>
35#include <xrpl/protocol/nftPageMask.h>
37#include <boost/endian/conversion.hpp>
105template <
class... Args>
109 return sha512Half(safe_cast<std::uint16_t>(space), args...);
116 isConsistent(book),
"ripple::getBookBase : input is consistent");
134 static constexpr uint256 nextq(
135 "0000000000000000000000000000000000000000000000010000000000000000");
136 return uBase + nextq;
156 XRPL_ASSERT(ticketSeq.
isTicket(),
"ripple::getTicketIndex : valid input");
164 sequence = boost::endian::native_to_big(sequence);
165 memcpy(u.
data(), &sequence,
sizeof(sequence));
166 memcpy(u.
data() +
sizeof(sequence), account.
data(),
sizeof(account));
274 k.type == ltDIR_NODE,
"ripple::keylet::quality : valid input type");
286 return {ltDIR_NODE, x};
293 k.
type == ltDIR_NODE,
294 "ripple::keylet::next_t::operator() : valid input type");
347 hashes.
reserve(authCreds.size());
348 for (
auto const& o : authCreds)
374 return {ltDIR_NODE, key};
398 return {ltNFTOKEN_PAGE,
uint256{buf}};
406 return {ltNFTOKEN_PAGE,
id};
413 k.
type == ltNFTOKEN_PAGE,
"ripple::keylet::nftpage : valid input type");
414 return {ltNFTOKEN_PAGE, (k.
key & ~nft::pageMask) + (token &
nft::pageMask)};
439 auto const& [minI, maxI] =
461 auto const& issue =
bridge.issue(chainType);
472 ltXCHAIN_OWNED_CLAIM_ID,
475 bridge.lockingChainDoor(),
476 bridge.lockingChainIssue(),
477 bridge.issuingChainDoor(),
478 bridge.issuingChainIssue(),
486 ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID,
489 bridge.lockingChainDoor(),
490 bridge.lockingChainIssue(),
491 bridge.issuingChainDoor(),
492 bridge.issuingChainIssue(),
539 Slice const& credType)
noexcept
550 ltPERMISSIONED_DOMAIN,
557 return {ltPERMISSIONED_DOMAIN, domainID};
A currency issued by an account.
A type that represents either a sequence value or a ticket value.
constexpr std::uint32_t value() const
constexpr bool isTicket() const
An immutable linear range of bytes.
static constexpr std::size_t size()
T emplace_back(T... args)
Keylet quality(Keylet const &k, std::uint64_t q) noexcept
The initial directory page for a specific quality.
Keylet mptoken(MPTID const &issuanceID, AccountID const &holder) noexcept
Keylet oracle(AccountID const &account, std::uint32_t const &documentID) noexcept
Keylet child(uint256 const &key) noexcept
Any item that can be in an owner dir.
Keylet permissionedDomain(AccountID const &account, std::uint32_t seq) noexcept
Keylet const & negativeUNL() noexcept
The (fixed) index of the object containing the ledger negativeUNL.
Keylet amm(Asset const &issue1, Asset const &issue2) noexcept
AMM entry.
Keylet line(AccountID const &id0, AccountID const &id1, Currency const ¤cy) noexcept
The index of a trust line for a given currency.
Keylet const & amendments() noexcept
The index of the amendment table.
Keylet nftpage(Keylet const &k, uint256 const &token)
Keylet mptIssuance(std::uint32_t seq, AccountID const &issuer) noexcept
Keylet xChainClaimID(STXChainBridge const &bridge, std::uint64_t seq)
Keylet did(AccountID const &account) noexcept
Keylet page(uint256 const &root, std::uint64_t index=0) noexcept
A page in a directory.
Keylet unchecked(uint256 const &key) noexcept
Any ledger entry.
Keylet escrow(AccountID const &src, std::uint32_t seq) noexcept
An escrow entry.
Keylet nftpage_min(AccountID const &owner)
NFT page keylets.
Keylet bridge(STXChainBridge const &bridge, STXChainBridge::ChainType chainType)
Keylet const & fees() noexcept
The (fixed) index of the object containing the ledger fees.
Keylet nftpage_max(AccountID const &owner)
A keylet for the owner's last possible NFT page.
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Keylet nft_buys(uint256 const &id) noexcept
The directory of buy offers for the specified NFT.
Keylet const & skip() noexcept
The index of the "short" skip list.
Keylet nft_sells(uint256 const &id) noexcept
The directory of sell offers for the specified NFT.
Keylet signers(AccountID const &account) noexcept
A SignerList.
Keylet xChainCreateAccountClaimID(STXChainBridge const &bridge, std::uint64_t seq)
Keylet nftoffer(AccountID const &owner, std::uint32_t seq)
An offer from an account to buy or sell an NFT.
Keylet check(AccountID const &id, std::uint32_t seq) noexcept
A Check.
Keylet offer(AccountID const &id, std::uint32_t seq) noexcept
An offer from an account.
Keylet depositPreauth(AccountID const &owner, AccountID const &preauthorized) noexcept
A DepositPreauth.
Keylet payChan(AccountID const &src, AccountID const &dst, std::uint32_t seq) noexcept
A PaymentChannel.
uint256 constexpr pageMask(std::string_view("0000000000000000000000000000000000000000ffffffffffffffffffffffff"))
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool isConsistent(Book const &book)
LedgerNameSpace
Type-specific prefix for calculating ledger indices.
@ XCHAIN_CREATE_ACCOUNT_CLAIM_ID
@ DEPOSIT_PREAUTH_CREDENTIALS
std::uint64_t getQuality(uint256 const &uBase)
base_uint< 192 > MPTID
MPTID is a 192-bit value representing MPT Issuance ID, which is a concatenation of a 32-bit sequence ...
static uint256 indexHash(LedgerNameSpace space, Args const &... args)
uint256 getQualityNext(uint256 const &uBase)
uint256 getTicketIndex(AccountID const &account, std::uint32_t uSequence)
@ ltCHILD
A special type, matching any ledger type except directory nodes.
@ ltANY
A special type, matching any ledger entry type.
@ credential
Credentials signature.
MPTID makeMptID(std::uint32_t sequence, AccountID const &account)
sha512_half_hasher::result_type sha512Half(Args const &... args)
Returns the SHA512-Half of a series of objects.
uint256 getBookBase(Book const &book)
A pair of SHAMap key and LedgerEntryType.
Keylet operator()(Book const &b) const
Keylet operator()(Keylet const &k) const
Keylet operator()(AccountID const &id, std::uint32_t ticketSeq) const