rippled
Loading...
Searching...
No Matches
Classes | Functions | Variables
ripple::keylet Namespace Reference

Keylet computation funclets. More...

Classes

struct  book_t
 The beginning of an order book. More...
 
struct  next_t
 The directory for the next lower quality. More...
 
struct  ticket_t
 A ticket belonging to an account. 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 & fees () 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 quality (Keylet const &k, std::uint64_t q) noexcept
 The initial directory page for a specific quality.
 
Keylet signers (AccountID const &account) noexcept
 A SignerList.
 
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, std::uint32_t seq) noexcept
 An escrow entry.
 
Keylet payChan (AccountID const &src, AccountID const &dst, std::uint32_t seq) noexcept
 A PaymentChannel.
 
Keylet nftoffer (AccountID const &owner, std::uint32_t seq)
 An offer from an account to buy or sell an NFT.
 
Keylet nftoffer (uint256 const &offer)
 
Keylet nft_buys (uint256 const &id) noexcept
 The directory of buy offers for the specified NFT.
 
Keylet nft_sells (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 seq)
 
Keylet xChainCreateAccountClaimID (STXChainBridge const &bridge, std::uint64_t 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 mptIssuance (std::uint32_t seq, AccountID const &issuer) noexcept
 
Keylet mptIssuance (MPTID const &issuanceID) noexcept
 
Keylet mptIssuance (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, std::uint32_t seq) noexcept
 
Keylet vault (uint256 const &vaultKey)
 
Keylet permissionedDomain (AccountID const &account, std::uint32_t seq) noexcept
 
Keylet permissionedDomain (uint256 const &domainID) noexcept
 
static Keylet signers (AccountID const &account, std::uint32_t page) noexcept
 
Keylet line (AccountID const &id0, AccountID const &id1, Currency const &currency) noexcept
 The index of a trust line for a given currency.
 
Keylet line (AccountID const &id, Issue const &issue) noexcept
 
Keylet offer (AccountID const &id, std::uint32_t seq) noexcept
 An offer from an account.
 
Keylet offer (uint256 const &key) noexcept
 
Keylet check (AccountID const &id, std::uint32_t seq) noexcept
 A Check.
 
Keylet check (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 index=0) noexcept
 A page in a directory.
 
Keylet page (Keylet const &root, std::uint64_t index=0) noexcept
 
Keylet nftpage_min (AccountID const &owner)
 NFT page keylets.
 
Keylet nftpage_max (AccountID const &owner)
 A keylet for the owner's last possible NFT page.
 
Keylet nftpage (Keylet const &k, uint256 const &token)
 

Variables

static book_t const book {}
 
static next_t const next {}
 
static ticket_t const ticket {}
 

Detailed Description

Keylet computation funclets.

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 ripple::keylet::account ( AccountID const &  id)
noexcept

AccountID root.

Definition at line 184 of file Indexes.cpp.

◆ amendments()

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

The index of the amendment table.

Definition at line 214 of file Indexes.cpp.

◆ child()

Keylet ripple::keylet::child ( uint256 const &  key)
noexcept

Any item that can be in an owner dir.

Definition at line 190 of file Indexes.cpp.

◆ skip() [1/2]

Keylet const & ripple::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 196 of file Indexes.cpp.

◆ skip() [2/2]

Keylet ripple::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 204 of file Indexes.cpp.

◆ fees()

Keylet const & ripple::keylet::fees ( )
noexcept

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

Definition at line 222 of file Indexes.cpp.

◆ negativeUNL()

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

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

Definition at line 230 of file Indexes.cpp.

◆ line() [1/2]

Keylet ripple::keylet::line ( 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 244 of file Indexes.cpp.

◆ line() [2/2]

Keylet ripple::keylet::line ( AccountID const &  id,
Issue const &  issue 
)
noexcept

Definition at line 122 of file Indexes.h.

◆ offer() [1/2]

Keylet ripple::keylet::offer ( AccountID const &  id,
std::uint32_t  seq 
)
noexcept

An offer from an account.

Definition at line 274 of file Indexes.cpp.

◆ offer() [2/2]

Keylet ripple::keylet::offer ( uint256 const &  key)
noexcept

Definition at line 134 of file Indexes.h.

◆ quality()

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

The initial directory page for a specific quality.

Definition at line 280 of file Indexes.cpp.

◆ signers() [1/2]

Keylet ripple::keylet::signers ( AccountID const &  account)
noexcept

A SignerList.

Definition at line 330 of file Indexes.cpp.

◆ check() [1/2]

Keylet ripple::keylet::check ( AccountID const &  id,
std::uint32_t  seq 
)
noexcept

A Check.

Definition at line 336 of file Indexes.cpp.

◆ check() [2/2]

Keylet ripple::keylet::check ( uint256 const &  key)
noexcept

Definition at line 183 of file Indexes.h.

◆ depositPreauth() [1/3]

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

A DepositPreauth.

Definition at line 342 of file Indexes.cpp.

◆ depositPreauth() [2/3]

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

Definition at line 351 of file Indexes.cpp.

◆ depositPreauth() [3/3]

Keylet ripple::keylet::depositPreauth ( uint256 const &  key)
noexcept

Definition at line 200 of file Indexes.h.

◆ unchecked()

Keylet ripple::keylet::unchecked ( uint256 const &  key)
noexcept

Any ledger entry.

Definition at line 368 of file Indexes.cpp.

◆ ownerDir()

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

The root page of an account's directory.

Definition at line 374 of file Indexes.cpp.

◆ page() [1/2]

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

A page in a directory.

Definition at line 380 of file Indexes.cpp.

◆ page() [2/2]

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

Definition at line 222 of file Indexes.h.

◆ escrow()

Keylet ripple::keylet::escrow ( AccountID const &  src,
std::uint32_t  seq 
)
noexcept

An escrow entry.

Definition at line 389 of file Indexes.cpp.

◆ payChan()

Keylet ripple::keylet::payChan ( AccountID const &  src,
AccountID const &  dst,
std::uint32_t  seq 
)
noexcept

A PaymentChannel.

Definition at line 395 of file Indexes.cpp.

◆ nftpage_min()

Keylet ripple::keylet::nftpage_min ( 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 403 of file Indexes.cpp.

◆ nftpage_max()

Keylet ripple::keylet::nftpage_max ( AccountID const &  owner)

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

Definition at line 411 of file Indexes.cpp.

◆ nftpage()

Keylet ripple::keylet::nftpage ( Keylet const &  k,
uint256 const &  token 
)

Definition at line 419 of file Indexes.cpp.

◆ nftoffer() [1/2]

Keylet ripple::keylet::nftoffer ( AccountID const &  owner,
std::uint32_t  seq 
)

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

Definition at line 427 of file Indexes.cpp.

◆ nftoffer() [2/2]

Keylet ripple::keylet::nftoffer ( uint256 const &  offer)

Definition at line 263 of file Indexes.h.

◆ nft_buys()

Keylet ripple::keylet::nft_buys ( uint256 const &  id)
noexcept

The directory of buy offers for the specified NFT.

Definition at line 434 of file Indexes.cpp.

◆ nft_sells()

Keylet ripple::keylet::nft_sells ( uint256 const &  id)
noexcept

The directory of sell offers for the specified NFT.

Definition at line 440 of file Indexes.cpp.

◆ amm() [1/2]

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

AMM entry.

Definition at line 446 of file Indexes.cpp.

◆ amm() [2/2]

Keylet ripple::keylet::amm ( uint256 const &  amm)
noexcept

Definition at line 459 of file Indexes.cpp.

◆ delegate()

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

A keylet for Delegate object.

Definition at line 465 of file Indexes.cpp.

◆ bridge()

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

Definition at line 473 of file Indexes.cpp.

◆ xChainClaimID()

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

Definition at line 486 of file Indexes.cpp.

◆ xChainCreateAccountClaimID()

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

Definition at line 500 of file Indexes.cpp.

◆ did()

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

Definition at line 514 of file Indexes.cpp.

◆ oracle()

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

Definition at line 520 of file Indexes.cpp.

◆ credential() [1/2]

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

Definition at line 553 of file Indexes.cpp.

◆ credential() [2/2]

Keylet ripple::keylet::credential ( uint256 const &  key)
noexcept

Definition at line 311 of file Indexes.h.

◆ mptIssuance() [1/3]

Keylet ripple::keylet::mptIssuance ( std::uint32_t  seq,
AccountID const &  issuer 
)
noexcept

Definition at line 526 of file Indexes.cpp.

◆ mptIssuance() [2/3]

Keylet ripple::keylet::mptIssuance ( MPTID const &  issuanceID)
noexcept

Definition at line 532 of file Indexes.cpp.

◆ mptIssuance() [3/3]

Keylet ripple::keylet::mptIssuance ( uint256 const &  issuanceKey)

Definition at line 323 of file Indexes.h.

◆ mptoken() [1/3]

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

Definition at line 540 of file Indexes.cpp.

◆ mptoken() [2/3]

Keylet ripple::keylet::mptoken ( uint256 const &  mptokenKey)

Definition at line 332 of file Indexes.h.

◆ mptoken() [3/3]

Keylet ripple::keylet::mptoken ( uint256 const &  issuanceKey,
AccountID const &  holder 
)
noexcept

Definition at line 546 of file Indexes.cpp.

◆ vault() [1/2]

Keylet ripple::keylet::vault ( AccountID const &  owner,
std::uint32_t  seq 
)
noexcept

Definition at line 564 of file Indexes.cpp.

◆ vault() [2/2]

Keylet ripple::keylet::vault ( uint256 const &  vaultKey)

Definition at line 344 of file Indexes.h.

◆ permissionedDomain() [1/2]

Keylet ripple::keylet::permissionedDomain ( AccountID const &  account,
std::uint32_t  seq 
)
noexcept

Definition at line 570 of file Indexes.cpp.

◆ permissionedDomain() [2/2]

Keylet ripple::keylet::permissionedDomain ( uint256 const &  domainID)
noexcept

Definition at line 578 of file Indexes.cpp.

◆ signers() [2/2]

static Keylet ripple::keylet::signers ( AccountID const &  account,
std::uint32_t  page 
)
staticnoexcept

Definition at line 323 of file Indexes.cpp.

Variable Documentation

◆ book

book_t const ripple::keylet::book {}
static

Definition at line 105 of file Indexes.h.

◆ next

next_t const ripple::keylet::next {}
static

Definition at line 152 of file Indexes.h.

◆ ticket

ticket_t const ripple::keylet::ticket {}
static

Definition at line 171 of file Indexes.h.