xrpld
Loading...
Searching...
No Matches
xrpl::keylet Namespace Reference

Keylet computation functions. More...

Functions

Keylet account (AccountID const &id) noexcept
 AccountID root.
Keylet const & amendments () noexcept
 The index of the amendment table.
Keylet child (UInt256 const &key) noexcept
 Any item that can be in an owner dir.
Keylet const & skip () noexcept
 The index of the "short" skip list.
Keylet skip (LedgerIndex ledger) noexcept
 The index of the long skip for a particular ledger range.
Keylet const & feeSettings () noexcept
 The (fixed) index of the object containing the ledger fees.
Keylet const & negativeUNL () noexcept
 The (fixed) index of the object containing the ledger negativeUNL.
Keylet book (Book const &b)
 The beginning of an order book.
Keylet quality (Keylet const &k, std::uint64_t const q) noexcept
 The initial directory page for a specific quality.
Keylet next (Keylet const &k)
 The directory for the next lower quality.
Keylet signerList (AccountID const &account) noexcept
 A SignerList.
Keylet sponsorship (AccountID const &sponsor, AccountID const &sponsee) noexcept
 A Sponsorship.
Keylet unchecked (UInt256 const &key) noexcept
 Any ledger entry.
Keylet ownerDir (AccountID const &id) noexcept
 The root page of an account's directory.
Keylet escrow (AccountID const &src, SeqProxy const &seq) noexcept
 An escrow entry.
Keylet payChannel (AccountID const &src, AccountID const &dst, SeqProxy const &seq) noexcept
 A PaymentChannel.
Keylet nftokenOffer (AccountID const &owner, SeqProxy const &seq)
 An offer from an account to buy or sell an NFT.
Keylet nftokenOffer (UInt256 const &offer)
Keylet nftBuys (UInt256 const &id) noexcept
 The directory of buy offers for the specified NFT.
Keylet nftSells (UInt256 const &id) noexcept
 The directory of sell offers for the specified NFT.
Keylet amm (Asset const &issue1, Asset const &issue2) noexcept
 AMM entry.
Keylet amm (UInt256 const &amm) noexcept
Keylet delegate (AccountID const &account, AccountID const &authorizedAccount) noexcept
 A keylet for Delegate object.
Keylet bridge (STXChainBridge const &bridge, STXChainBridge::ChainType chainType)
Keylet xChainClaimID (STXChainBridge const &bridge, std::uint64_t const seq)
Keylet xChainCreateAccountClaimID (STXChainBridge const &bridge, std::uint64_t const seq)
Keylet did (AccountID const &account) noexcept
Keylet oracle (AccountID const &account, std::uint32_t const documentID) noexcept
Keylet credential (AccountID const &subject, AccountID const &issuer, Slice const &credType) noexcept
Keylet credential (UInt256 const &key) noexcept
Keylet mptokenIssuance (MPTID const &issuanceID) noexcept
Keylet mptokenIssuance (UInt256 const &issuanceKey)
Keylet mptoken (MPTID const &issuanceID, AccountID const &holder) noexcept
Keylet mptoken (UInt256 const &mptokenKey)
Keylet mptoken (UInt256 const &issuanceKey, AccountID const &holder) noexcept
Keylet vault (AccountID const &owner, SeqProxy const &seq) noexcept
Keylet vault (UInt256 const &vaultKey)
Keylet loanBroker (AccountID const &owner, SeqProxy const &seq) noexcept
Keylet loanBroker (UInt256 const &key)
Keylet loan (UInt256 const &loanBrokerID, SeqProxy const &loanSeq) noexcept
Keylet loan (UInt256 const &key)
Keylet permissionedDomain (AccountID const &account, SeqProxy const &seq) noexcept
Keylet permissionedDomain (UInt256 const &domainID) noexcept
static Keylet signerList (AccountID const &account, std::uint32_t const page) noexcept
Keylet trustLine (AccountID const &id0, AccountID const &id1, Currency const &currency) noexcept
 The index of a trust line for a given currency.
Keylet trustLine (AccountID const &id, Issue const &issue) noexcept
Keylet offer (AccountID const &id, SeqProxy const &seq) noexcept
 An offer from an account.
Keylet offer (UInt256 const &key) noexcept
Keylet ticket (AccountID const &id, SeqProxy const &ticketSeq)
 A ticket belonging to an account.
Keylet ticket (UInt256 const &key)
Keylet check (AccountID const &id, SeqProxy const &seq) noexcept
 A Check.
Keylet check (UInt256 const &key) noexcept
Keylet txProposal (AccountID const &target, std::uint32_t ticketSequence) noexcept
 A TransactionProposal.
Keylet txProposal (UInt256 const &key) noexcept
Keylet depositPreauth (AccountID const &owner, AccountID const &preauthorized) noexcept
 A DepositPreauth.
Keylet depositPreauth (AccountID const &owner, std::set< std::pair< AccountID, Slice > > const &authCreds) noexcept
Keylet depositPreauth (UInt256 const &key) noexcept
Keylet page (UInt256 const &root, std::uint64_t const index=0) noexcept
 A page in a directory.
Keylet page (Keylet const &root, std::uint64_t const index=0) noexcept
Keylet nftokenPageMin (AccountID const &owner)
 NFT page keylets.
Keylet nftokenPageMax (AccountID const &owner)
 A keylet for the owner's last possible NFT page.
Keylet nftokenPage (Keylet const &k, UInt256 const &token)

Detailed Description

Keylet computation functions.

Entries in the ledger are located using 256-bit locators. The locators are calculated using a wide range of parameters specific to the entry whose locator we are calculating (e.g. an account's locator is derived from the account's address, whereas the locator for an offer is derived from the account and the offer sequence.)

To enhance type safety during lookup and make the code more robust, we use keylets, which contain not only the locator of the object but also the type of the object being referenced.

These functions each return a type-specific keylet.

Function Documentation

◆ account()

Keylet xrpl::keylet::account ( AccountID const & id)
noexcept

AccountID root.

Definition at line 220 of file Indexes.cpp.

◆ amendments()

Keylet const & xrpl::keylet::amendments ( )
noexcept

The index of the amendment table.

Definition at line 248 of file Indexes.cpp.

◆ child()

Keylet xrpl::keylet::child ( UInt256 const & key)
noexcept

Any item that can be in an owner dir.

Definition at line 226 of file Indexes.cpp.

◆ skip() [1/2]

Keylet const & xrpl::keylet::skip ( )
noexcept

The index of the "short" skip list.

The "short" skip list is a node (at a fixed index) that holds the hashes of ledgers since the last flag ledger. It will contain, at most, 256 hashes.

Definition at line 232 of file Indexes.cpp.

◆ skip() [2/2]

Keylet xrpl::keylet::skip ( LedgerIndex ledger)
noexcept

The index of the long skip for a particular ledger range.

The "long" skip list is a node that holds the hashes of (up to) 256 flag ledgers.

It can be used to efficiently skip back to any ledger using only two hops: the first hop gets the "long" skip list for the ledger it wants to retrieve and uses it to get the hash of the flag ledger whose short skip list will contain the hash of the requested ledger.

Definition at line 239 of file Indexes.cpp.

◆ feeSettings()

Keylet const & xrpl::keylet::feeSettings ( )
noexcept

The (fixed) index of the object containing the ledger fees.

Definition at line 255 of file Indexes.cpp.

◆ negativeUNL()

Keylet const & xrpl::keylet::negativeUNL ( )
noexcept

The (fixed) index of the object containing the ledger negativeUNL.

Definition at line 262 of file Indexes.cpp.

◆ book()

Keylet xrpl::keylet::book ( Book const & b)

The beginning of an order book.

Definition at line 269 of file Indexes.cpp.

◆ trustLine() [1/2]

Keylet xrpl::keylet::trustLine ( AccountID const & id0,
AccountID const & id1,
Currency const & currency )
noexcept

The index of a trust line for a given currency.

Note that a trustline is shared between two accounts (commonly referred to as the issuer and the holder); if Alice sets up a trust line to Bob for BTC, and Bob trusts Alice for BTC, here is only a single BTC trust line between them.

Definition at line 275 of file Indexes.cpp.

◆ trustLine() [2/2]

Keylet xrpl::keylet::trustLine ( AccountID const & id,
Issue const & issue )
noexcept

Definition at line 114 of file Indexes.h.

◆ offer() [1/2]

Keylet xrpl::keylet::offer ( AccountID const & id,
SeqProxy const & seq )
noexcept

An offer from an account.

Definition at line 298 of file Indexes.cpp.

◆ offer() [2/2]

Keylet xrpl::keylet::offer ( UInt256 const & key)
noexcept

Definition at line 128 of file Indexes.h.

◆ quality()

Keylet xrpl::keylet::quality ( Keylet const & k,
std::uint64_t const q )
noexcept

The initial directory page for a specific quality.

Definition at line 304 of file Indexes.cpp.

◆ next()

Keylet xrpl::keylet::next ( Keylet const & k)

The directory for the next lower quality.

Definition at line 325 of file Indexes.cpp.

◆ ticket() [1/2]

Keylet xrpl::keylet::ticket ( AccountID const & id,
SeqProxy const & ticketSeq )

A ticket belonging to an account.

Definition at line 332 of file Indexes.cpp.

◆ ticket() [2/2]

Keylet xrpl::keylet::ticket ( UInt256 const & key)

Definition at line 154 of file Indexes.h.

◆ signerList() [1/2]

Keylet xrpl::keylet::signerList ( AccountID const & account)
noexcept

A SignerList.

Definition at line 348 of file Indexes.cpp.

◆ sponsorship()

Keylet xrpl::keylet::sponsorship ( AccountID const & sponsor,
AccountID const & sponsee )
noexcept

A Sponsorship.

Definition at line 354 of file Indexes.cpp.

◆ check() [1/2]

Keylet xrpl::keylet::check ( AccountID const & id,
SeqProxy const & seq )
noexcept

A Check.

Definition at line 360 of file Indexes.cpp.

◆ check() [2/2]

Keylet xrpl::keylet::check ( UInt256 const & key)
noexcept

Definition at line 180 of file Indexes.h.

◆ txProposal() [1/2]

Keylet xrpl::keylet::txProposal ( AccountID const & target,
std::uint32_t ticketSequence )
noexcept

A TransactionProposal.

Definition at line 366 of file Indexes.cpp.

◆ txProposal() [2/2]

Keylet xrpl::keylet::txProposal ( UInt256 const & key)
noexcept

Definition at line 194 of file Indexes.h.

◆ depositPreauth() [1/3]

Keylet xrpl::keylet::depositPreauth ( AccountID const & owner,
AccountID const & preauthorized )
noexcept

A DepositPreauth.

Definition at line 374 of file Indexes.cpp.

◆ depositPreauth() [2/3]

Keylet xrpl::keylet::depositPreauth ( AccountID const & owner,
std::set< std::pair< AccountID, Slice > > const & authCreds )
noexcept

Definition at line 381 of file Indexes.cpp.

◆ depositPreauth() [3/3]

Keylet xrpl::keylet::depositPreauth ( UInt256 const & key)
noexcept

Definition at line 213 of file Indexes.h.

◆ unchecked()

Keylet xrpl::keylet::unchecked ( UInt256 const & key)
noexcept

Any ledger entry.

Definition at line 397 of file Indexes.cpp.

◆ ownerDir()

Keylet xrpl::keylet::ownerDir ( AccountID const & id)
noexcept

The root page of an account's directory.

Definition at line 403 of file Indexes.cpp.

◆ page() [1/2]

Keylet xrpl::keylet::page ( UInt256 const & root,
std::uint64_t const index = 0 )
noexcept

A page in a directory.

Definition at line 409 of file Indexes.cpp.

◆ page() [2/2]

Keylet xrpl::keylet::page ( Keylet const & root,
std::uint64_t const index = 0 )
noexcept

Definition at line 241 of file Indexes.h.

◆ escrow()

Keylet xrpl::keylet::escrow ( AccountID const & src,
SeqProxy const & seq )
noexcept

An escrow entry.

Definition at line 418 of file Indexes.cpp.

◆ payChannel()

Keylet xrpl::keylet::payChannel ( AccountID const & src,
AccountID const & dst,
SeqProxy const & seq )
noexcept

A PaymentChannel.

Definition at line 424 of file Indexes.cpp.

◆ nftokenPageMin()

Keylet xrpl::keylet::nftokenPageMin ( AccountID const & owner)

NFT page keylets.

Unlike objects whose ledger identifiers are produced by hashing data, NFT page identifiers are composite identifiers, consisting of the owner's 160-bit AccountID, followed by a 96-bit value that determines which NFT tokens are candidates for that page. A keylet for the owner's first possible NFT page.

Definition at line 430 of file Indexes.cpp.

◆ nftokenPageMax()

Keylet xrpl::keylet::nftokenPageMax ( AccountID const & owner)

A keylet for the owner's last possible NFT page.

Definition at line 438 of file Indexes.cpp.

◆ nftokenPage()

Keylet xrpl::keylet::nftokenPage ( Keylet const & k,
UInt256 const & token )

Definition at line 446 of file Indexes.cpp.

◆ nftokenOffer() [1/2]

Keylet xrpl::keylet::nftokenOffer ( AccountID const & owner,
SeqProxy const & seq )

An offer from an account to buy or sell an NFT.

Definition at line 453 of file Indexes.cpp.

◆ nftokenOffer() [2/2]

Keylet xrpl::keylet::nftokenOffer ( UInt256 const & offer)

Definition at line 292 of file Indexes.h.

◆ nftBuys()

Keylet xrpl::keylet::nftBuys ( UInt256 const & id)
noexcept

The directory of buy offers for the specified NFT.

Definition at line 459 of file Indexes.cpp.

◆ nftSells()

Keylet xrpl::keylet::nftSells ( UInt256 const & id)
noexcept

The directory of sell offers for the specified NFT.

Definition at line 465 of file Indexes.cpp.

◆ amm() [1/2]

Keylet xrpl::keylet::amm ( Asset const & issue1,
Asset const & issue2 )
noexcept

AMM entry.

Definition at line 471 of file Indexes.cpp.

◆ amm() [2/2]

Keylet xrpl::keylet::amm ( UInt256 const & amm)
noexcept

Definition at line 505 of file Indexes.cpp.

◆ delegate()

Keylet xrpl::keylet::delegate ( AccountID const & account,
AccountID const & authorizedAccount )
noexcept

A keylet for Delegate object.

Definition at line 511 of file Indexes.cpp.

◆ bridge()

Keylet xrpl::keylet::bridge ( STXChainBridge const & bridge,
STXChainBridge::ChainType chainType )

Definition at line 517 of file Indexes.cpp.

◆ xChainClaimID()

Keylet xrpl::keylet::xChainClaimID ( STXChainBridge const & bridge,
std::uint64_t const seq )

Definition at line 527 of file Indexes.cpp.

◆ xChainCreateAccountClaimID()

Keylet xrpl::keylet::xChainCreateAccountClaimID ( STXChainBridge const & bridge,
std::uint64_t const seq )

Definition at line 541 of file Indexes.cpp.

◆ did()

Keylet xrpl::keylet::did ( AccountID const & account)
noexcept

Definition at line 555 of file Indexes.cpp.

◆ oracle()

Keylet xrpl::keylet::oracle ( AccountID const & account,
std::uint32_t const documentID )
noexcept

Definition at line 561 of file Indexes.cpp.

◆ credential() [1/2]

Keylet xrpl::keylet::credential ( AccountID const & subject,
AccountID const & issuer,
Slice const & credType )
noexcept

Definition at line 585 of file Indexes.cpp.

◆ credential() [2/2]

Keylet xrpl::keylet::credential ( UInt256 const & key)
noexcept

Definition at line 345 of file Indexes.h.

◆ mptokenIssuance() [1/2]

Keylet xrpl::keylet::mptokenIssuance ( MPTID const & issuanceID)
noexcept

Definition at line 567 of file Indexes.cpp.

◆ mptokenIssuance() [2/2]

Keylet xrpl::keylet::mptokenIssuance ( UInt256 const & issuanceKey)

Definition at line 354 of file Indexes.h.

◆ mptoken() [1/3]

Keylet xrpl::keylet::mptoken ( MPTID const & issuanceID,
AccountID const & holder )
noexcept

Definition at line 573 of file Indexes.cpp.

◆ mptoken() [2/3]

Keylet xrpl::keylet::mptoken ( UInt256 const & mptokenKey)

Definition at line 363 of file Indexes.h.

◆ mptoken() [3/3]

Keylet xrpl::keylet::mptoken ( UInt256 const & issuanceKey,
AccountID const & holder )
noexcept

Definition at line 579 of file Indexes.cpp.

◆ vault() [1/2]

Keylet xrpl::keylet::vault ( AccountID const & owner,
SeqProxy const & seq )
noexcept

Definition at line 591 of file Indexes.cpp.

◆ vault() [2/2]

Keylet xrpl::keylet::vault ( UInt256 const & vaultKey)

Definition at line 375 of file Indexes.h.

◆ loanBroker() [1/2]

Keylet xrpl::keylet::loanBroker ( AccountID const & owner,
SeqProxy const & seq )
noexcept

Definition at line 597 of file Indexes.cpp.

◆ loanBroker() [2/2]

Keylet xrpl::keylet::loanBroker ( UInt256 const & key)

Definition at line 384 of file Indexes.h.

◆ loan() [1/2]

Keylet xrpl::keylet::loan ( UInt256 const & loanBrokerID,
SeqProxy const & loanSeq )
noexcept

Definition at line 603 of file Indexes.cpp.

◆ loan() [2/2]

Keylet xrpl::keylet::loan ( UInt256 const & key)

Definition at line 393 of file Indexes.h.

◆ permissionedDomain() [1/2]

Keylet xrpl::keylet::permissionedDomain ( AccountID const & account,
SeqProxy const & seq )
noexcept

Definition at line 609 of file Indexes.cpp.

◆ permissionedDomain() [2/2]

Keylet xrpl::keylet::permissionedDomain ( UInt256 const & domainID)
noexcept

Definition at line 617 of file Indexes.cpp.

◆ signerList() [2/2]

Keylet xrpl::keylet::signerList ( AccountID const & account,
std::uint32_t const page )
staticnoexcept

Definition at line 342 of file Indexes.cpp.