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

Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm. More...

Namespaces

namespace  detail
namespace  compression_algorithms
namespace  intr_ptr
namespace  cryptoconditions
namespace  perf
 Dummy class for unit tests.
namespace  NodeStore
namespace  Resource
namespace  git
namespace  directory
namespace  credentials
namespace  nft
namespace  permissioned_dex
namespace  RPC
 API version numbers used in later API versions.
namespace  BuildInfo
 Versioning information for this build.
namespace  keylet
 Keylet computation functions.
namespace  jss
namespace  Lending
namespace  test
namespace  b58_ref
namespace  unit
namespace  Attestations
namespace  ledger_entries
namespace  protocol_autogen
namespace  transactions
namespace  util
namespace  path
namespace  base64
namespace  openssl
namespace  STParsedJSONDetail
namespace  tests
namespace  PeerFinder
namespace  InnerObjectFormatsUnitTestDetail
namespace  LedgerReplayParameters
namespace  ledger_trie_detail
namespace  compression
namespace  CrawlOptions
namespace  Tuning
namespace  metrics
namespace  reduce_relay
namespace  RPCCall
 Processes XRPL RPC calls.
namespace  LedgerEntryHelpers

Classes

class  BaseUInt
 Integers of any length that is a multiple of 32-bits. More...
class  Buffer
 Like std::vector<char> but better. More...
class  NetClock
struct  less
struct  equal_to
class  CountedObjects
 Manages all counted object types. More...
class  CountedObject
 Tracks the number of instances of an object. More...
class  DecayingSample
 Sampling function using exponential decay to provide a continuous value. More...
class  DecayWindow
 Sampling function using exponential decay to provide a continuous value. More...
class  HardenedHash
 Seed functor once per construction. More...
struct  StaticCastTagSharedIntrusive
 Tag to create an intrusive pointer from another intrusive pointer by using a static cast. More...
struct  DynamicCastTagSharedIntrusive
 Tag to create an intrusive pointer from another intrusive pointer by using a dynamic cast. More...
struct  SharedIntrusiveAdoptIncrementStrongTag
 When creating or adopting a raw pointer, controls whether the strong count is incremented or not. More...
struct  SharedIntrusiveAdoptNoIncrementTag
 When creating or adopting a raw pointer, controls whether the strong count is incremented or not. More...
class  SharedIntrusive
 A shared intrusive pointer class that supports weak pointers. More...
class  WeakIntrusive
 A weak intrusive pointer class for the SharedIntrusive pointer class. More...
class  SharedWeakUnion
 A combination of a strong and a weak intrusive pointer stored in the space of a single pointer. More...
struct  IntrusiveRefCounts
 Implement the strong count, weak count, and bit flags for an intrusive pointer. More...
class  CollectionAndDelimiter
class  CollectionAndDelimiter< Collection[N]>
class  CollectionAndDelimiter< char[N]>
class  LocalValue
class  Logs
 Manages partitions for logging. More...
struct  MallocTrimReport
struct  MantissaRange
 MantissaRange defines a range for the mantissa of a normalized Number. More...
class  Number
 Number is a floating point type that can represent a wide range of values. More...
class  SaveNumberRoundMode
class  NumberRoundModeGuard
class  NumberMantissaScaleGuard
 Sets the new scale and restores the old scale when it leaves scope. More...
class  PartitionedUnorderedMap
class  Resolver
class  ResolverAsio
class  ScopeExit
class  ScopeFail
class  ScopeSuccess
class  ScopeUnlock
 Automatically unlocks and re-locks a unique_lock object. More...
class  SHAMapHash
class  SharedWeakCachePointer
 A combination of a std::shared_ptr and a std::weak_pointer. More...
class  SlabAllocator
class  SlabAllocatorSet
 A collection of slab allocators of various sizes for a given type. More...
class  Slice
 An immutable linear range of bytes. More...
class  PackedSpinlock
 Classes to handle arrays of spinlocks packed into a single atomic integer: More...
class  Spinlock
 A spinlock implemented on top of an atomic integer. More...
struct  ParsedUrl
class  TaggedInteger
 A type-safe wrap around standard integral types. More...
class  TaggedCache
 Map/cache combination. More...
class  UptimeClock
 Tracks program uptime to seconds precision. More...
class  Section
 Holds a collection of configuration values. More...
class  BasicConfig
 Holds unparsed configuration information. More...
struct  Sections
struct  Keys
class  ClosureCounter
 The role of a ClosureCounter is to assist in shutdown by letting callers wait for the completion of closures (of a specific type signature) that they previously registered. More...
class  BasicSemaphore
class  Workers
 Workers is effectively a thread pool. More...
class  HashRouter
 Routing table for objects identified by hash. More...
class  Job
struct  CoroCreateT
class  JobQueue
 A pool of threads to perform work. More...
struct  JobTypeData
class  JobTypeInfo
 Holds all the 'static' information about a job, which does not change. More...
class  JobTypes
class  LoadEvent
class  LoadMonitor
class  NetworkIDService
 Service that provides access to the network ID. More...
struct  PeerReservation
struct  KeyEqual
class  PeerReservationTable
class  Validations
 Maintains current and recent ledger validations. More...
class  ServiceRegistry
 Service registry for dependency injection. More...
class  CsprngEngine
 A cryptographically secure random number engine. More...
class  RFC1751
class  JsonPropertyStream
 A PropertyStream::Sink which produces a json::Value of type ValueType::Object. More...
class  AcceptedLedgerTx
 A transaction that is in a closed ledger. More...
class  AmendmentTable
 The amendment table stores the list of enabled and potential amendments. More...
class  ApplyView
 Writeable view to a ledger, for applying a transaction. More...
class  ApplyViewImpl
 Editable, discardable view that can build metadata for one tx. More...
class  BookDirs
class  CachedView
 Wraps a DigestAwareReadView to provide caching. More...
class  CanonicalTXSet
 Holds transactions which were deferred to the next pass of consensus. More...
class  Dir
 A class that simplifies iterating ledger directory pages. More...
struct  LoanPaymentParts
struct  LoanState
 This structure captures the parts of a loan state. More...
struct  LoanProperties
struct  CreateGenesisT
class  Ledger
 Holds a ledger. More...
struct  OpenLedgerT
 Open ledger construction tag. More...
struct  BatchViewT
 Batch view construction tag. More...
class  OpenView
 Writable ledger view that accumulates state and tx changes. More...
class  OrderBookDB
 Tracks order books in the ledger. More...
class  PaymentSandbox
 A wrapper which makes credits unavailable to balances. More...
class  PendingSaves
 Keeps track of which ledgers haven't been fully saved. More...
class  RawView
 Interface for ledger entry changes. More...
class  TxsRawView
 Interface for changing ledger entries with transactions. More...
class  ReadView
 A view into a ledger. More...
class  DigestAwareReadView
 ReadView that associates keys with digests. More...
class  Sandbox
 Discardable, editable view to a ledger. More...
class  HTTPClient
 Provides an asynchronous HTTP client implementation with optional SSL. More...
class  HTTPClientSSLContext
class  NodeObject
 A simple object that the Ledger uses to store entries. More...
struct  AmountType
struct  BadAsset
class  Asset
class  Book
 Specifies an order book. More...
struct  ConfidentialRecipient
 Bundles an ElGamal public key with its associated encrypted amount. More...
struct  EcPair
 Holds two secp256k1 public key components representing an ElGamal ciphertext (C1, C2). More...
struct  OpensslRipemd160Hasher
 Message digest functions used in the codebase. More...
struct  OpensslSha512Hasher
 SHA-512 digest. More...
struct  OpensslSha256Hasher
 SHA-256 digest. More...
struct  RipeshaHasher
 Returns the RIPEMD-160 digest of the SHA256 hash of the message. More...
class  FeatureBitset
struct  Fees
 Reflects the fee settings for a particular ledger. More...
struct  KeyletDesc
class  InnerObjectFormats
 Manages the list of known inner object formats. More...
class  IOUAmount
 Floating point representation of amounts with high dynamic range. More...
class  Issue
 A currency issued by an account. More...
struct  Keylet
 A pair of SHAMap key and LedgerEntryType. More...
class  KnownFormats
 Manages a list of known formats. More...
class  LedgerFormats
 Holds the list of known ledger entry formats. More...
struct  LedgerHeader
 Information about the notional ledger backing the view. More...
class  MPTAmount
class  MPTIssue
class  PathAsset
class  Permission
class  PublicKey
 A public key. More...
struct  STExchange< STBlob, PublicKey >
struct  TAmounts
 Represents a pair of input and output currencies. More...
class  Quality
 Represents the logical ratio of output currency to input currency. More...
class  QualityFunction
 Average quality of a path as a function of out: q(out) = m * out + b, where m = -1 / poolGets, b = poolPays / poolGets. More...
struct  Rate
 Represents a transfer rate. More...
class  Rules
 Rules controlling protocol behavior. More...
class  CurrentTransactionRulesGuard
 RAII class to set and restore the current transaction rules. More...
class  SecretKey
 A secret key. More...
class  Seed
 Seeds are used to generate deterministic secret keys. More...
class  SeqProxy
 A type that represents either a sequence value or a ticket value. More...
class  Serializer
class  SerialIter
class  STBitString
class  STInteger
class  SField
 Identifies fields. More...
struct  TypedField
 A field with a type known at compile time. More...
struct  OptionaledField
 Indicate std::optional field semantics. More...
class  SOElement
 An element in a SOTemplate. More...
class  SOTemplate
 Defines the fields and their attributes within a STObject. More...
class  STAccount
class  STAmount
class  STArray
struct  JsonOptions
 Note, should be treated as flags that can be | and &. More...
class  STBase
 A type which can be exported to a well known binary format. More...
class  STBlob
class  STCurrency
struct  STExchange
 Convert between serialized type U and C++ type T. More...
struct  STExchange< STInteger< U >, T >
struct  STExchange< STBlob, Slice >
struct  STExchange< STBlob, Buffer >
class  STIssue
class  STLedgerEntry
class  STNumber
 A serializable number. More...
struct  NumberParts
class  STObject
class  STParsedJSONObject
 Holds the serialized result of parsing an input JSON object. More...
class  STPathElement
class  STPath
class  STPathSet
class  STTakesAsset
 Intermediate class for any STBase-derived class to store an Asset. More...
class  STTx
class  STValidation
class  STVector256
class  STXChainBridge
class  TERSubset
class  CanCvtToNotTEC
class  CanCvtToNotTEC< TELcodes >
class  CanCvtToNotTEC< TEMcodes >
class  CanCvtToNotTEC< TEFcodes >
class  CanCvtToNotTEC< TERcodes >
class  CanCvtToNotTEC< TEScodes >
class  CanCvtToTER
class  CanCvtToTER< TELcodes >
class  CanCvtToTER< TEMcodes >
class  CanCvtToTER< TEFcodes >
class  CanCvtToTER< TERcodes >
class  CanCvtToTER< TEScodes >
class  CanCvtToTER< TECcodes >
class  CanCvtToTER< NotTEC >
class  TxFormats
 Manages the list of known transaction formats. More...
class  TxMeta
struct  XChainClaimAttestation
struct  XChainCreateAccountAttestation
class  XChainAttestationsBase
class  XChainClaimAttestations
class  XChainCreateAccountAttestations
class  XRPAmount
class  LockedSociSession
class  DatabaseCon
struct  LedgerHashPair
struct  LedgerRange
class  RelationalDatabase
class  DBConfig
 DBConfig is used when a client wants to delay opening a soci::session after parsing the config parameters. More...
class  Checkpointer
class  BaseHTTPPeer
 Represents an active connection. More...
class  BasePeer
class  BaseWSPeer
 Represents an active WebSocket connection. More...
class  Door
 A listening socket. More...
class  IOList
 Manages a set of objects performing asynchronous I/O. More...
class  PlainHTTPPeer
class  PlainWSPeer
class  Server
 A multi-protocol server. More...
class  ServerImpl
class  SSLHTTPPeer
class  SSLWSPeer
struct  Handoff
 Used to indicate the result of a server connection handoff. More...
class  InfoSubRequest
class  InfoSub
 Manages a client's subscription to data feeds. More...
class  LoadFeeTrack
 Manages the current fee schedule. More...
struct  Manifest
struct  ValidatorToken
class  ManifestCache
 Remembers manifests with the highest sequence number. More...
class  NetworkOPs
 Provides server functionality for clients. More...
struct  Port
 Configuration information for a Server listening port. More...
struct  ParsedPort
class  Session
 Persistent state information for a connection session. More...
class  SimpleWriter
 Deprecated: Writer that serializes a HTTP/1 message. More...
struct  SavedState
class  Writer
class  WSMsg
class  StreambufWSMsg
struct  WSSession
class  TaggedPointer
 TaggedPointer is a combination of a pointer and a mask stored in the lowest two bits. More...
class  Family
class  SHAMap
 A SHAMap is both a radix tree with a fan-out of 16 and a Merkle tree. More...
class  SHAMapAccountStateLeafNode
 A leaf node for a state object. More...
class  SHAMapAddNode
class  SHAMapInnerNode
class  SHAMapItem
class  SHAMapLeafNode
class  SHAMapMissingNode
class  SHAMapNodeID
 Identifies a node inside a SHAMap. More...
class  SHAMapSyncFilter
class  SHAMapTreeNode
class  SHAMapTxLeafNode
 A leaf node for a transaction. More...
class  SHAMapTxPlusMetaLeafNode
 A leaf node for a transaction and its associated metadata. More...
class  ApplyContext
 State information when applying a tx. More...
struct  ApplyResult
class  TxConsequences
 Class describing the consequences to the account of applying a transaction if the transaction consumes the maximum XRP allowed. More...
struct  PreflightResult
 Describes the results of the preflight check. More...
struct  PreclaimResult
 Describes the results of the preclaim check. More...
class  ValidAMM
class  ValidBookDirectory
class  TransfersNotFrozen
 Invariant: frozen trust line balance change is not allowed. More...
class  InvariantChecker_PROTOTYPE
 Prototype for invariant check implementations. More...
class  TransactionFeeCheck
 Invariant: We should never charge a transaction a negative fee or a fee that is larger than what the transaction itself specifies. More...
class  XRPNotCreated
 Invariant: A transaction must not create XRP and should only destroy the XRP fee. More...
class  AccountRootsNotDeleted
 Invariant: we cannot remove an account ledger entry. More...
class  AccountRootsDeletedClean
 Invariant: a deleted account must not have any objects left. More...
class  XRPBalanceChecks
 Invariant: An account XRP balance must be in XRP and take a value between 0 and INITIAL_XRP drops, inclusive. More...
class  LedgerEntryTypesMatch
 Invariant: corresponding modified ledger entries should match in type and added entries should be a valid type. More...
class  NoXRPTrustLines
 Invariant: Trust lines using XRP are not allowed. More...
class  NoDeepFreezeTrustLinesWithoutFreeze
 Invariant: Trust lines with deep freeze flag are not allowed if normal freeze flag is not set. More...
class  NoBadOffers
 Invariant: offers should be for non-negative amounts and must not be XRP to XRP. More...
class  NoZeroEscrow
 Invariant: an escrow entry must take a value between 0 and INITIAL_XRP drops exclusive. More...
class  ValidNewAccountRoot
 Invariant: a new account root must be the consequence of a payment, must have the right starting sequence, and the payment may not create more than one new account root. More...
class  ValidClawback
 Invariant: Token holder's trustline balance cannot be negative after Clawback. More...
class  ValidPseudoAccounts
 Invariants: Pseudo-accounts have valid and consistent properties. More...
class  NoModifiedUnmodifiableFields
 Invariants: Some fields are unmodifiable. More...
class  ValidAmounts
 Verify that MPT/XRP STAmounts are canonical in any ledger entries left after the transaction applies. More...
class  ValidLoanBroker
 Invariants: Loan brokers are internally consistent. More...
class  ValidLoan
 Invariants: Loans are internally consistent. More...
class  ValidMPTIssuance
class  ValidMPTPayment
 Verify public MPT amount and outstanding amount accounting. More...
class  ValidConfidentialMPToken
 Invariants: Confidential MPToken consistency. More...
class  ValidMPTTransfer
class  ValidNFTokenPage
 Invariant: Validates several invariants for NFToken pages. More...
class  NFTokenCountTracking
 Invariant: Validates counts of NFTokens after all transaction types. More...
class  ValidPermissionedDEX
class  ValidPermissionedDomain
 Invariants: Permissioned Domains must have some rules and AcceptedCredentials must have length between 1 and 10 inclusive. More...
class  ValidVault
class  AMMOffer
 Represents synthetic AMM offer in BookStep. More...
class  AMMLiquidity
 AMMLiquidity class provides AMM offers to BookStep class. More...
class  BookTip
 Iterates and consumes raw offers in an order book. More...
struct  EitherAmount
class  Step
 A step in a payment path. More...
struct  StrandContext
 Context needed to build Strand Steps and for error checking. More...
struct  StrandResult
 Result of flow() execution of a single Strand. More...
class  TOffer
class  TOfferStreamBase
class  FlowOfferStream
 Presents and consumes the offers in an order book. More...
class  SignerEntries
struct  PreflightContext
 State information when preflighting a tx. More...
struct  PreclaimContext
 State information when determining if a tx is likely to claim a fee. More...
class  Transactor
class  AccountDelete
class  AccountSet
class  SetRegularKey
class  SignerListSet
 See the README.md for an overview of the SignerListSet transaction that this class implements. More...
class  XChainCreateBridge
class  BridgeModify
class  XChainClaim
class  XChainCommit
class  XChainCreateClaimID
class  XChainAddClaimAttestation
class  XChainAddAccountCreateAttestation
class  XChainCreateAccountCommit
class  CheckCancel
class  CheckCash
class  CheckCreate
class  CredentialAccept
class  CredentialCreate
class  CredentialDelete
class  DelegateSet
class  AMMBid
 AMMBid implements AMM bid Transactor. More...
class  AMMClawback
class  AMMContext
 Maintains AMM info per overall payment engine execution and individual iteration. More...
class  AMMCreate
 AMMCreate implements Automatic Market Maker(AMM) creation Transactor. More...
class  AMMDelete
 AMMDelete implements AMM delete transactor. More...
class  AMMDeposit
 AMMDeposit implements AMM deposit Transactor. More...
class  AMMVote
 AMMVote implements AMM vote Transactor. More...
class  AMMWithdraw
class  OfferCancel
class  OfferCreate
 Transactor specialized for creating offers in the ledger. More...
class  DIDDelete
class  DIDSet
class  EscrowCancel
class  EscrowCreate
class  EscrowFinish
class  LoanBrokerCoverClawback
class  LoanBrokerCoverDeposit
class  LoanBrokerCoverWithdraw
class  LoanBrokerDelete
class  LoanBrokerSet
class  LoanDelete
class  LoanManage
class  LoanPay
class  LoanSet
class  NFTokenAcceptOffer
class  NFTokenBurn
class  NFTokenCancelOffer
class  NFTokenCreateOffer
class  NFTokenMint
class  NFTokenModify
class  OracleDelete
 Price Oracle is a system that acts as a bridge between a blockchain network and the external world, providing off-chain price data to decentralized applications (dApps) on the blockchain. More...
class  OracleSet
 Price Oracle is a system that acts as a bridge between a blockchain network and the external world, providing off-chain price data to decentralized applications (dApps) on the blockchain. More...
class  DepositPreauth
class  Payment
class  PaymentChannelClaim
class  PaymentChannelCreate
class  PaymentChannelFund
class  PermissionedDomainDelete
class  PermissionedDomainSet
class  Batch
class  Change
class  LedgerStateFix
class  TicketCreate
class  Clawback
class  ConfidentialMPTClawback
 Allows an MPT issuer to clawback confidential balances from a holder. More...
class  ConfidentialMPTConvert
 Converts public (plaintext) MPT balance to confidential (encrypted) balance. More...
class  ConfidentialMPTConvertBack
 Converts confidential (encrypted) MPT balance back to public (plaintext) balance. More...
class  ConfidentialMPTMergeInbox
 Merges the confidential inbox balance into the spending balance. More...
class  ConfidentialMPTSend
 Transfers confidential MPT tokens between holders privately. More...
struct  MPTAuthorizeArgs
class  MPTokenAuthorize
struct  MPTCreateArgs
class  MPTokenIssuanceCreate
class  MPTokenIssuanceDestroy
class  MPTokenIssuanceSet
class  TrustSet
class  VaultClawback
class  VaultCreate
class  VaultDelete
class  VaultDeposit
class  VaultSet
class  VaultWithdraw
class  DebugSink
class  AsyncObject
 Mix-in to track when all pending I/O is complete. More...
class  ResolverAsioImpl
class  HTTPClientImp
class  CheckpointersCollection
class  BookStep
class  BookPaymentStep
class  BookOfferCrossingStep
class  DirectStepI
class  DirectIPaymentStep
class  DirectIOfferCrossingStep
class  MPTEndpointStep
class  MPTEndpointPaymentStep
class  MPTEndpointOfferCrossingStep
class  XRPEndpointStep
class  XRPEndpointPaymentStep
class  XRPEndpointOfferCrossingStep
struct  MPTMutabilityFlags
class  AccountSet_test
class  AccountTxPaging_test
class  AmendmentTable_test
class  Check_test
class  CheckMPT_test
class  Clawback_test
class  ClawbackMPT_test
class  ConfidentialTransfer_test
class  ConfidentialTransferExtended_test
class  Discrepancy_test
class  Freeze_test
class  LedgerLoad_test
class  LoadFeeTrack_test
class  NFTokenBaseUtil_test
class  NFTokenDisallowIncoming_test
class  NFTokenWOMintOffer_test
class  NFTokenWOModify_test
class  NfTokenWoExpiredOfferRemovalTest
class  NFTokenAllFeatures_test
class  NFTokenAuth_test
class  NFTokenBurn_test
class  NFTokenDir_test
class  OfferStream_test
class  SetRegularKey_test
class  Ticket_test
class  TrustAndBalance_test
class  Apply_test
class  Vault_test
class  FileUtilities_test
class  UnsignedInteger
class  hardened_hash_test
class  IOUAmount_test
class  KeyCache_test
class  Number_test
class  PerfLog_test
class  StringUtilities_test
class  TaggedCache_test
class  XRPAmount_test
class  Config_test
class  SociDB_test
class  Workers_test
class  ConfidentialTransferTestBase
class  TestSuite
class  ProtocolVersion_test
class  short_read_test
class  BuildInfo_test
class  Hooks_test
class  InnerObjectFormatsParsedJSON_test
class  Issue_test
class  Memo_test
class  PublicKey_test
class  Quality_test
class  SecretKey_test
class  Seed_test
struct  SeqProxy_test
struct  Serializer_test
struct  STAccount_test
class  STAmount_test
struct  STInteger_test
struct  STNumber_test
class  STObject_test
class  STParsedJSON_test
class  STTx_test
class  InnerObjectFormatsSerializer_test
class  STValidation_test
struct  TER_test
class  AccountCurrencies_test
class  AmendmentBlocked_test
class  Connect_test
class  Feature_test
class  GetCounts_test
class  LedgerClosed_test
class  LedgerData_test
class  LedgerHeader_test
class  NoRippleCheck_test
class  NoRippleCheckLimits_test
class  OwnerInfo_test
class  Peers_test
class  Transaction_test
class  TransactionEntry_test
class  TransactionHistory_test
class  Version_test
class  TestSink
class  RCLCensorshipDetector
class  RCLConsensus
 Manages the generic consensus algorithm for use by the RCL. More...
class  RclConsensusLogger
 Collects logging information. More...
class  RCLCxLedger
 Represents a ledger in RCLConsensus. More...
class  RCLCxPeerPos
 A peer's signed, proposed position for use in RCLConsensus. More...
class  RCLCxTx
 Represents a transaction in RCLConsensus. More...
class  RCLTxSet
 Represents a set of transactions in RCLConsensus. More...
class  RCLValidation
 Wrapper over STValidation for generic Validation code. More...
class  RCLValidatedLedger
 Wraps a ledger instance for use in generic Validations LedgerTrie. More...
class  RCLValidationsAdaptor
 Generic validations adaptor class for RCL. More...
class  AbstractFetchPackContainer
 An interface facilitating retrieval of fetch packs without an application or ledgermaster object. More...
class  AcceptedLedger
 A ledger that has become irrevocable. More...
class  AccountStateSF
class  ConsensusTransSetSF
class  InboundLedgersImp
class  InboundTransactionSet
class  InboundTransactionsImp
class  LedgerCleanerImp
class  LedgerDeltaAcquire
 Manage the retrieval of a ledger delta (header and transactions) from the network. More...
class  LedgerReplayMsgHandler
class  LocalTx
class  LocalTxsImp
class  SkipListAcquire
 Manage the retrieval of a skip list in a ledger from the network. More...
class  TimeoutCounter
 This class is an "active" object. More...
class  TransactionAcquire
class  InboundLedger
class  InboundLedgers
 Manages the lifetime of inbound ledgers. More...
class  InboundTransactions
 Manages the acquisition and lifetime of transaction sets. More...
class  LedgerCleaner
 Check the ledger/transaction databases to make sure they have continuity. More...
class  LedgerHistory
 Retains historical ledgers. More...
class  LedgerHolder
 Hold a ledger in a thread-safe way. More...
class  LedgerMaster
class  LedgerReplay
class  LedgerReplayer
 Manages the lifetime of ledger replay tasks. More...
class  LedgerReplayTask
struct  LedgerFill
class  LocalTxs
class  OpenLedger
 Represents the open ledger. More...
struct  OrderBookDBConfig
 Configuration for OrderBookDB. More...
class  OrderBookDBImpl
class  TransactionMaster
class  TransactionStateSF
class  ApplicationImp
class  Application
class  CollectorManagerImp
class  CollectorManager
 Provides the beast::insight::Collector service. More...
class  Processor
class  GRPCServerImpl
class  GRPCServer
class  LoadManager
 Manages load sources. More...
class  NodeStoreScheduler
 A NodeStore::Scheduler which uses the JobQueue. More...
class  TrustedVotes
 TrustedVotes records the most recent votes from trusted validators. More...
struct  AmendmentState
 Current state of an amendment. More...
class  AmendmentSet
 The status of all amendments requested in a given window. More...
class  AmendmentTableImpl
 Track the list of "amendments". More...
class  FeeVote
 Manager to process fee votes. More...
class  FeeVoteImpl
class  NegativeUNLVote
 Manager to create NegativeUNL votes. More...
class  NetworkOPsImp
class  SHAMapStore
 class to create database, launch online delete thread, and related SQLite database More...
class  SHAMapStoreImp
class  Transaction
class  TxQ
 Transaction Queue. More...
class  ValidatorKeys
 Validator keys and manifest as set in configuration file. More...
struct  TrustChanges
 Changes in trusted nodes after updating validator list. More...
struct  ValidatorBlobInfo
 Used to represent the information stored in the blobs_v2 Json array. More...
class  ValidatorList
class  ValidatorSite
class  SQLiteDatabase
class  Consensus
 Generic implementation of consensus algorithm. More...
struct  ConsensusParms
 Consensus algorithm parameters. More...
class  ConsensusProposal
 Represents a proposed position taken during a round of consensus. More...
class  ConsensusTimer
 Measures the duration of phases of consensus. More...
struct  ConsensusCloseTimes
 Stores the set of initial close times. More...
struct  ConsensusResult
 Encapsulates the result of consensus. More...
class  DisputedTx
 A transaction discovered to be in dispute during consensus. More...
class  SpanTip
 The tip of a span of ledger ancestry. More...
class  LedgerTrie
 Ancestry trie of ledgers. More...
struct  ValidationParms
 Timing parameters to control validation staleness and expiration. More...
class  SeqEnforcer
 Enforce validation increasing sequence requirement. More...
struct  FeeSetup
 Fee schedule for startup / standalone, and to vote for. More...
class  Config
class  NetworkIDServiceImpl
 Implementation of NetworkIDService that reads from Config. More...
class  TimeKeeper
 Manages various times used by the server. More...
class  Cluster
class  ClusterNode
class  ConnectAttempt
 Manages an outbound connection attempt. More...
class  OverlayImpl
class  PeerImp
class  PeerSetImpl
class  PeerSetBuilderImpl
class  DummyPeerSet
class  TrafficCount
 TrafficCount is used to count ingress and egress wire bytes and number of messages. More...
class  ZeroCopyInputStream
 Implements ZeroCopyInputStream around a buffer sequence. More...
class  ZeroCopyOutputStream
 Implements ZeroCopyOutputStream around a Streambuf. More...
class  Message
class  Overlay
 Manages the set of connected peers. More...
class  Peer
 Represents a peer connection in the overlay. More...
class  PeerSet
 Supports data retrieval by managing a set of peers. More...
class  PeerSetBuilder
struct  SendAlways
 Sends a message to all peers. More...
struct  SendIfPred
 Sends a message to match peers. More...
struct  SendIfNotPred
 Sends a message to non-matching peers. More...
struct  MatchPeer
 Select the specific peer. More...
struct  PeerInCluster
 Select all peers (except optional excluded) that are in our cluster. More...
struct  PeerInSet
 Select all peers that are in the specified set. More...
class  AssetCache
class  PathFindMPT
class  Pathfinder
 Calculates payment paths. More...
class  PathRequest
class  PathRequestManager
class  RPCParser
struct  RPCCallImp
class  RPCSubImp
class  TrustLineBase
 Wraps a trust line SLE for convenience. More...
class  PathFindTrustLine
class  RPCTrustLine
class  WSInfoSub
struct  LedgerEntry
struct  TxResult
struct  TxArgs
struct  JsonBody
 Body that holds JSON. More...
class  RPCSub
 Subscription object for JSON RPC. More...
class  ServerHandler
class  NodeFamily

Concepts

concept  CAdoptTag
concept  Integral64
concept  SafeToCast
concept  StepAmount
concept  ValidIssueType
concept  AssetType
concept  ValidPathAsset
concept  ValidTaker
concept  IsArithmeticNumber
concept  IsArithmeticValueUnit
concept  IsArithmeticST
concept  IsArithmetic
concept  Addable
concept  IsArithmeticCompatible
concept  UnsignedMantissa

Typedefs

using uint128 = BaseUInt<128>
using uint160 = BaseUInt<160>
using uint256 = BaseUInt<256>
using uint192 = BaseUInt<192>
using Blob = std::vector<unsigned char>
 Storage for linear binary data.
using days
using weeks = std::chrono::duration<int, std::ratio_multiply<days::period, std::ratio<7>>>
using Stopwatch = beast::AbstractClock<std::chrono::steady_clock>
 A clock for measuring elapsed time.
using TestStopwatch = beast::ManualClock<std::chrono::steady_clock>
 A manual Stopwatch for unit tests.
using KeyCache = TaggedCache<uint256, int, true>
template<class T>
using ClosedInterval = boost::icl::closed_interval<T>
 A closed interval over the domain T.
template<class T>
using RangeSet = boost::icl::interval_set<T, std::less, ClosedInterval<T>>
 A set of closed intervals over the domain T.
template<class Key, class Value, class Hash = beast::Uhash<>, class Pred = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key const, Value>>>
using hash_map = std::unordered_map<Key, Value, Hash, Pred, Allocator>
template<class Key, class Value, class Hash = beast::Uhash<>, class Pred = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key const, Value>>>
using hash_multimap = std::unordered_multimap<Key, Value, Hash, Pred, Allocator>
template<class Value, class Hash = beast::Uhash<>, class Pred = std::equal_to<Value>, class Allocator = std::allocator<Value>>
using hash_set = std::unordered_set<Value, Hash, Pred, Allocator>
template<class Value, class Hash = beast::Uhash<>, class Pred = std::equal_to<Value>, class Allocator = std::allocator<Value>>
using hash_multiset = std::unordered_multiset<Value, Hash, Pred, Allocator>
using strong_hash = beast::Xxhasher
template<class Key, class Value, class Hash = HardenedHash<strong_hash>, class Pred = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key const, Value>>>
using hardened_hash_map = std::unordered_map<Key, Value, Hash, Pred, Allocator>
template<class Key, class Value, class Hash = HardenedHash<strong_hash>, class Pred = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key const, Value>>>
using hardened_partitioned_hash_map = PartitionedUnorderedMap<Key, Value, Hash, Pred, Allocator>
template<class Key, class Value, class Hash = HardenedHash<strong_hash>, class Pred = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key const, Value>>>
using hardened_hash_multimap = std::unordered_multimap<Key, Value, Hash, Pred, Allocator>
template<class Value, class Hash = HardenedHash<strong_hash>, class Pred = std::equal_to<Value>, class Allocator = std::allocator<Value>>
using hardened_hash_set = std::unordered_set<Value, Hash, Pred, Allocator>
template<class Value, class Hash = HardenedHash<strong_hash>, class Pred = std::equal_to<Value>, class Allocator = std::allocator<Value>>
using hardened_hash_multiset = std::unordered_multiset<Value, Hash, Pred, Allocator>
using IniFileSections = std::unordered_map<std::string, std::vector<std::string>>
using semaphore = BasicSemaphore<std::mutex, std::condition_variable>
using JobCounter = ClosureCounter<void>
using SLE = STLedgerEntry
using CachedSLEs = TaggedCache<uint256, SLE const>
using RCLValidations = Validations<RCLValidationsAdaptor>
 Alias for RCL-specific instantiation of generic Validations.
using NodeCache = TaggedCache<SHAMapHash, Blob>
using MultiplePaymentDestinations = std::vector<std::pair<AccountID, Number>>
using CachedLedger = CachedView<Ledger>
 A ledger wrapped in a CachedView.
using majorityAmendments_t = std::map<uint256, NetClock::time_point>
using EntryDeleter
 Deleter function prototype.
using AccountID = BaseUInt<160, detail::AccountIDTag>
 A 160-bit unsigned that uniquely identifies an account.
template<class T>
using Result = boost::outcome_v2::result<T, std::error_code>
using ripemd160_hasher = OpensslRipemd160Hasher
using sha256_hasher = OpensslSha256Hasher
using sha512_hasher = OpensslSha512Hasher
using sha512_half_hasher = detail::BasicSha512HalfHasher<false>
using sha512_half_hasher_s = detail::BasicSha512HalfHasher<true>
using LedgerFlagMap = std::map<std::string, std::uint32_t>
using MultiApiJson
using LedgerIndex = std::uint32_t
 A ledger index.
using TxID = uint256
 A transaction identifier.
using Amounts = TAmounts<STAmount, STAmount>
using LedgerHash = uint256
using SF_UINT8 = TypedField<STInteger<std::uint8_t>>
using SF_UINT16 = TypedField<STInteger<std::uint16_t>>
using SF_UINT32 = TypedField<STInteger<std::uint32_t>>
using SF_UINT64 = TypedField<STInteger<std::uint64_t>>
using SF_UINT96 = TypedField<STBitString<96>>
using SF_UINT128 = TypedField<STBitString<128>>
using SF_UINT160 = TypedField<STBitString<160>>
using SF_UINT192 = TypedField<STBitString<192>>
using SF_UINT256 = TypedField<STBitString<256>>
using SF_UINT384 = TypedField<STBitString<384>>
using SF_UINT512 = TypedField<STBitString<512>>
using SF_INT32 = TypedField<STInteger<std::int32_t>>
using SF_INT64 = TypedField<STInteger<std::int64_t>>
using SF_ACCOUNT = TypedField<STAccount>
using SF_AMOUNT = TypedField<STAmount>
using SF_ISSUE = TypedField<STIssue>
using SF_CURRENCY = TypedField<STCurrency>
using SF_NUMBER = TypedField<STNumber>
using SF_VL = TypedField<STBlob>
using SF_VECTOR256 = TypedField<STVector256>
using SF_XCHAIN_BRIDGE = TypedField<STXChainBridge>
using STUInt128 = STBitString<128>
using STUInt160 = STBitString<160>
using STUInt192 = STBitString<192>
using STUInt256 = STBitString<256>
using STUInt8 = STInteger<unsigned char>
using STUInt16 = STInteger<std::uint16_t>
using STUInt32 = STInteger<std::uint32_t>
using STUInt64 = STInteger<std::uint64_t>
using STInt32 = STInteger<std::int32_t>
using TERUnderlyingType = int
using NotTEC = TERSubset<CanCvtToNotTEC>
using TER = TERSubset<CanCvtToTER>
template<class T>
using B58Result = std::expected<T, std::error_code>
using FlagValue = std::uint32_t
 Transaction flags.
using FlagMap = std::map<std::string, FlagValue>
using FlagMapPairList = std::vector<std::pair<std::string, FlagMap>>
using Directory = BaseUInt<256, detail::DirectoryTag>
 Directory is an index into the directory of offer books.
using Currency = BaseUInt<160, detail::CurrencyTag>
 Currency is a hash representing a specific currency.
using NodeID = BaseUInt<160, detail::NodeIDTag>
 NodeID is a 160-bit hash representing one node.
using MPTID = BaseUInt<192>
 MPTID is a 192-bit value representing MPT Issuance ID, which is a concatenation of a 32-bit sequence (big endian) and a 160-bit account.
using Domain = BaseUInt<256>
 Domain is a 256-bit hash representing a specific domain.
template<class T>
using FeeLevel = unit::ValueUnit<unit::feelevelTag, T>
using FeeLevel64 = FeeLevel<std::uint64_t>
using FeeLevelDouble = FeeLevel<double>
template<class T>
using Bips = unit::ValueUnit<unit::BipsTag, T>
using Bips16 = Bips<std::uint16_t>
using Bips32 = Bips<std::uint32_t>
template<class T>
using TenthBips = unit::ValueUnit<unit::TenthBipsTag, T>
using TenthBips16 = TenthBips<std::uint16_t>
using TenthBips32 = TenthBips<std::uint32_t>
using Endpoints = std::unordered_map<std::string, boost::asio::ip::tcp::endpoint>
using http_request_type = boost::beast::http::request<boost::beast::http::dynamic_body>
using http_response_type = boost::beast::http::response<boost::beast::http::dynamic_body>
using FullBelowCache = detail::BasicFullBelowCache
using SHAMapTreeNodePtr = intr_ptr::SharedPtr<SHAMapTreeNode>
using TreeNodeCache
using InvariantChecks
using XChainModifyBridge = BridgeModify
using XChainAccountCreateCommit = XChainCreateAccountCommit
using EnableAmendment = Change
using SetFee = Change
using UNLModify = Change
using const_iterator = Dir::ConstIterator
using sha256_t = UnsignedInteger<256, std::size_t>
using UInt8Value = std::decay_t<typename SF_UINT8::type::value_type>
using UInt16Value = std::decay_t<typename SF_UINT16::type::value_type>
using UInt32Value = std::decay_t<typename SF_UINT32::type::value_type>
using UInt64Value = std::decay_t<typename SF_UINT64::type::value_type>
using UInt128Value = std::decay_t<typename SF_UINT128::type::value_type>
using UInt160Value = std::decay_t<typename SF_UINT160::type::value_type>
using UInt192Value = std::decay_t<typename SF_UINT192::type::value_type>
using UInt256Value = std::decay_t<typename SF_UINT256::type::value_type>
using Int32Value = std::decay_t<typename SF_INT32::type::value_type>
using NumberValue = std::decay_t<typename SF_NUMBER::type::value_type>
using AmountValue = std::decay_t<typename SF_AMOUNT::type::value_type>
using AccountValue = std::decay_t<typename SF_ACCOUNT::type::value_type>
using CurrencyValue = std::decay_t<typename SF_CURRENCY::type::value_type>
using IssueValue = std::decay_t<typename SF_ISSUE::type::value_type>
using Vector256Value = std::decay_t<typename SF_VECTOR256::type::value_type>
using BlobValue = std::decay_t<typename SF_VL::type::value_type>
using XChainBridgeValue = std::decay_t<typename SF_XCHAIN_BRIDGE::type::value_type>
using OrderedTxs = CanonicalTXSet
using socket_type = boost::beast::tcp_stream
using stream_type = boost::beast::ssl_stream<socket_type>
using request_type = boost::beast::http::request<boost::beast::http::empty_body>
using ProtocolVersion = std::pair<std::uint16_t, std::uint16_t>
 Represents a particular version of the peer-to-peer protocol.
using TxnsData = RelationalDatabase::AccountTxs
using TxnsDataBinary = RelationalDatabase::MetaTxsList
using TxnDataBinary = RelationalDatabase::txnMetaLedgerType
using AccountTxArgs = RelationalDatabase::AccountTxArgs
using AccountTxResult = RelationalDatabase::AccountTxResult
using LedgerSpecifier = RelationalDatabase::LedgerSpecifier
using FunctionType
using Prices

Enumerations

enum class  ReleaseStrongRefAction { NoOp , PartialDestroy , Destroy }
 Action to perform when releasing a strong pointer. More...
enum class  ReleaseWeakRefAction { NoOp , Destroy }
 Action to perform when releasing a weak pointer. More...
enum class  HashRouterFlags : std::uint16_t {
  UNDEFINED = 0x00 , BAD = 0x02 , SAVED = 0x04 , HELD = 0x08 ,
  TRUSTED = 0x10 , PRIVATE1 = 0x0100 , PRIVATE2 = 0x0200 , PRIVATE3 = 0x0400 ,
  PRIVATE4 = 0x0800 , PRIVATE5 = 0x1000 , PRIVATE6 = 0x2000
}
enum  JobType {
  JtInvalid = -1 , JtPack , JtPuboldledger , JtClient ,
  JtClientSubscribe , JtClientFeeChange , JtClientConsensus , JtClientAcctHist ,
  JtClientRpc , JtClientWebsocket , JtRpc , JtSweep ,
  JtValidationUt , JtManifest , JtUpdatePf , JtTransactionL ,
  JtReplayReq , JtLedgerReq , JtProposalUt , JtReplayTask ,
  JtTransaction , JtMissingTxn , JtRequestedTxn , JtBatch ,
  JtLedgerData , JtAdvance , JtPubledger , JtTxnData ,
  JtWal , JtValidationT , JtWrite , JtAccept ,
  JtProposalT , JtNetopCluster , JtNetopTimer , JtAdmin ,
  JtPeer , JtDisk , JtTxnProc , JtObSetup ,
  JtPathFind , JtHoRead , JtHoWrite , JtGeneric ,
  JtNsSyncRead , JtNsAsyncRead , JtNsWrite
}
enum class  StartUpType {
  Fresh , Normal , Load , LoadFile ,
  Replay , Network
}
enum  ApplyFlags : std::uint32_t {
  TapNone = 0x00 , TapFailHard = 0x10 , TapRetry = 0x20 , TapUnlimited = 0x400 ,
  TapBatch = 0x800 , TapDryRun = 0x1000
}
enum class  IsDeposit : bool { No = false , Yes = true }
enum class  LoanPaymentType { Regular = 0 , Late , Full , Overpayment }
enum class  FreezeHandling { IgnoreFreeze , ZeroIfFrozen }
 Controls the treatment of frozen account balances. More...
enum class  AuthHandling { IgnoreAuth , ZeroIfUnauthorized }
 Controls the treatment of unauthorized MPT balances. More...
enum class  SpendableHandling { SimpleBalance , FullBalance }
 Controls whether to include the account's full spendable balance. More...
enum class  WaiveTransferFee : bool { No = false , Yes }
enum class  AllowMPTOverflow : bool { No = false , Yes }
 Controls whether accountSend is allowed to overflow OutstandingAmount. More...
enum class  WaiveMPTCanTransfer : bool { No = false , Yes }
 Controls whether canTransfer enforces lsfMPTCanTransfer on MPTs. More...
enum class  AuthType { StrongAuth , WeakAuth , Legacy }
enum class  TruncateShares : bool { No = false , Yes = true }
 Controls whether to truncate shares instead of rounding. More...
enum class  WaiveUnrealizedLoss : bool { No = false , Yes = true }
 Controls whether the withdraw conversion helpers (assetsToSharesWithdraw and sharesToAssetsWithdraw) subtract sfLossUnrealized from sfAssetsTotal before computing the exchange rate. More...
enum class  SkipEntry : bool { No = false , Yes }
enum class  NodeObjectType : std::uint32_t {
  Unknown = 0 , Ledger = 1 , AccountNode = 3 , TransactionNode = 4 ,
  Dummy = 512
}
 The types of node objects. More...
enum class  TokenCodecErrc {
  Success = 0 , InputTooLarge , InputTooSmall , BadB58Character ,
  OutputTooSmall , MismatchedTokenType , MismatchedChecksum , InvalidEncodingChar ,
  OverflowAdd , Unknown
}
enum  ErrorCodeI {
  RpcUnknown = -1 , RpcSuccess = 0 , RpcBadSyntax = 1 , RpcJsonRpc = 2 ,
  RpcForbidden = 3 , RpcWrongNetwork = 4 , RpcNoPermission = 6 , RpcNoEvents = 7 ,
  RpcTooBusy = 9 , RpcSlowDown = 10 , RpcHighFee = 11 , RpcNotEnabled = 12 ,
  RpcNotReady = 13 , RpcAmendmentBlocked = 14 , RpcNoClosed = 15 , RpcNoCurrent = 16 ,
  RpcNoNetwork = 17 , RpcNotSynced = 18 , RpcActNotFound = 19 , RpcLgrNotFound = 21 ,
  RpcLgrNotValidated = 22 , RpcMasterDisabled = 23 , RpcTxnNotFound = 29 , RpcInvalidHotwallet = 30 ,
  RpcInvalidParams = 31 , RpcUnknownCommand = 32 , RpcNoPfRequest = 33 , RpcActMalformed = 35 ,
  RpcAlreadyMultisig = 36 , RpcAlreadySingleSig = 37 , RpcBadFeature = 40 , RpcBadIssuer = 41 ,
  RpcBadMarket = 42 , RpcBadSecret = 43 , RpcBadSeed = 44 , RpcChannelMalformed = 45 ,
  RpcChannelAmtMalformed = 46 , RpcCommandMissing = 47 , RpcDstActMalformed = 48 , RpcDstActMissing = 49 ,
  RpcDstActNotFound = 50 , RpcDstAmtMalformed = 51 , RpcDstAmtMissing = 52 , RpcDstIsrMalformed = 53 ,
  RpcLgrIdxsInvalid = 57 , RpcLgrIdxMalformed = 58 , RpcPublicMalformed = 62 , RpcSigningMalformed = 63 ,
  RpcSendmaxMalformed = 64 , RpcSrcActMalformed = 65 , RpcSrcActMissing = 66 , RpcSrcActNotFound = 67 ,
  RpcDelegateActNotFound = 68 , RpcSrcCurMalformed = 69 , RpcSrcIsrMalformed = 70 , RpcStreamMalformed = 71 ,
  RpcAtxDeprecated = 72 , RpcInternal = 73 , RpcNotImpl = 74 , RpcNotSupported = 75 ,
  RpcBadKeyType = 76 , RpcDbDeserialization = 77 , RpcExcessiveLgrRange = 78 , RpcInvalidLgrRange = 79 ,
  RpcExpiredValidatorList = 80 , RpcReportingUnsupported = 91 , RpcObjectNotFound = 92 , RpcIssueMalformed = 93 ,
  RpcOracleMalformed = 94 , RpcBadCredentials = 95 , RpcTxSigned = 96 , RpcDomainMalformed = 97 ,
  RpcEntryNotFound = 98 , RpcUnexpectedLedgerType = 99 , RpcLast = RpcUnexpectedLedgerType
}
enum  WarningCodeI { WarnRpcUnsupportedMajority = 1001 , WarnRpcAmendmentBlocked = 1002 , WarnRpcExpiredValidatorList = 1003 , WarnRpcFieldsDeprecated = 2004 }
 Codes returned in the warnings array of certain RPC commands. More...
enum class  VoteBehavior : int { Obsolete = -1 , DefaultNo = 0 , DefaultYes = 1 }
enum class  AmendmentSupport : int { Retired = -1 , Supported = 0 , Unsupported = 1 }
enum class  HashPrefix : std::uint32_t {
  TransactionId = detail::makeHashPrefix('T', 'X', 'N') , TxNode = detail::makeHashPrefix('S', 'N', 'D') , LeafNode = detail::makeHashPrefix('M', 'L', 'N') , InnerNode = detail::makeHashPrefix('M', 'I', 'N') ,
  LedgerMaster = detail::makeHashPrefix('L', 'W', 'R') , TxSign = detail::makeHashPrefix('S', 'T', 'X') , TxMultiSign = detail::makeHashPrefix('S', 'M', 'T') , Validation = detail::makeHashPrefix('V', 'A', 'L') ,
  Proposal = detail::makeHashPrefix('P', 'R', 'P') , Manifest = detail::makeHashPrefix('M', 'A', 'N') , PaymentChannelClaim = detail::makeHashPrefix('C', 'L', 'M') , Batch = detail::makeHashPrefix('B', 'C', 'H')
}
 Prefix for hashing functions. More...
enum class  KeyType { Secp256k1 = 0 , Ed25519 = 1 }
enum  LedgerEntryType : std::uint16_t {
  ltANY = 0 , ltCHILD = 0x1CD2 , ltNICKNAME = 0x006e , ltCONTRACT = 0x0063 ,
  ltGENERATOR_MAP
}
 Identifiers for on-ledger objects. More...
enum  LedgerSpecificFlags : std::uint32_t { XMACRO =(NULL_NAME, TO_VALUE, NULL_OUTPUT) }
enum class  LedgerShortcut { Current , Closed , Validated }
 Enumeration of ledger shortcuts for specifying which ledger to use. More...
enum  GranularPermissionType : std::uint32_t
 We have both transaction type permissions and granular type permissions. More...
enum  Delegation { Delegable , NotDelegable }
enum class  ECDSACanonicality { Canonical , FullyCanonical }
enum  SerializedTypeID { XMACRO =(NULL_NAME, TO_VALUE, NULL_OUTPUT) }
enum  SOEStyle { SoeInvalid = -1 , SoeRequired = 0 , SoeOptional = 1 , SoeDefault = 2 }
 Kind of element in each entry of an SOTemplate. More...
enum  SOETxMPTIssue { SoeMptNone , SoeMptSupported , SoeMptNotSupported }
 Amount fields that can support MPT. More...
enum class  TxnSql : char {
  New = 'N' , Conflict = 'C' , Held = 'H' , Validated = 'V' ,
  Included = 'I' , Unknown = 'U'
}
enum  TELcodes : TERUnderlyingType {
  telLOCAL_ERROR = -399 , telBAD_DOMAIN , telBAD_PATH_COUNT , telBAD_PUBLIC_KEY ,
  telFAILED_PROCESSING , telINSUF_FEE_P , telNO_DST_PARTIAL , telCAN_NOT_QUEUE ,
  telCAN_NOT_QUEUE_BALANCE , telCAN_NOT_QUEUE_BLOCKS , telCAN_NOT_QUEUE_BLOCKED , telCAN_NOT_QUEUE_FEE ,
  telCAN_NOT_QUEUE_FULL , telWRONG_NETWORK , telREQUIRES_NETWORK_ID , telNETWORK_ID_MAKES_TX_NON_CANONICAL ,
  telENV_RPC_FAILED
}
enum  TEMcodes : TERUnderlyingType {
  temMALFORMED = -299 , temBAD_AMOUNT , temBAD_CURRENCY , temBAD_EXPIRATION ,
  temBAD_FEE , temBAD_ISSUER , temBAD_LIMIT , temBAD_OFFER ,
  temBAD_PATH , temBAD_PATH_LOOP , temBAD_REGKEY , temBAD_SEND_XRP_LIMIT ,
  temBAD_SEND_XRP_MAX , temBAD_SEND_XRP_NO_DIRECT , temBAD_SEND_XRP_PARTIAL , temBAD_SEND_XRP_PATHS ,
  temBAD_SEQUENCE , temBAD_SIGNATURE , temBAD_SRC_ACCOUNT , temBAD_TRANSFER_RATE ,
  temDST_IS_SRC , temDST_NEEDED , temINVALID , temINVALID_FLAG ,
  temREDUNDANT , temRIPPLE_EMPTY , temDISABLED , temBAD_SIGNER ,
  temBAD_QUORUM , temBAD_WEIGHT , temBAD_TICK_SIZE , temINVALID_ACCOUNT_ID ,
  temCANNOT_PREAUTH_SELF , temINVALID_COUNT , temUNCERTAIN , temUNKNOWN ,
  temSEQ_AND_TICKET , temBAD_NFTOKEN_TRANSFER_FEE , temBAD_AMM_TOKENS , temXCHAIN_EQUAL_DOOR_ACCOUNTS ,
  temXCHAIN_BAD_PROOF , temXCHAIN_BRIDGE_BAD_ISSUES , temXCHAIN_BRIDGE_NONDOOR_OWNER , temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT ,
  temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT , temEMPTY_DID , temARRAY_EMPTY , temARRAY_TOO_LARGE ,
  temBAD_TRANSFER_FEE , temINVALID_INNER_BATCH , temBAD_MPT , temBAD_CIPHERTEXT
}
enum  TEFcodes : TERUnderlyingType {
  tefFAILURE = -199 , tefALREADY , tefBAD_ADD_AUTH , tefBAD_AUTH ,
  tefBAD_LEDGER , tefCREATED , tefEXCEPTION , tefINTERNAL ,
  tefNO_AUTH_REQUIRED , tefPAST_SEQ , tefWRONG_PRIOR , tefMASTER_DISABLED ,
  tefMAX_LEDGER , tefBAD_SIGNATURE , tefBAD_QUORUM , tefNOT_MULTI_SIGNING ,
  tefBAD_AUTH_MASTER , tefINVARIANT_FAILED , tefTOO_BIG , tefNO_TICKET ,
  tefNFTOKEN_IS_NOT_TRANSFERABLE , tefINVALID_LEDGER_FIX_TYPE
}
enum  TERcodes : TERUnderlyingType {
  terRETRY = -99 , terFUNDS_SPENT , terINSUF_FEE_B , terNO_ACCOUNT ,
  terNO_AUTH , terNO_LINE , terOWNERS , terPRE_SEQ ,
  terLAST , terNO_RIPPLE , terQUEUED , terPRE_TICKET ,
  terNO_AMM , terADDRESS_COLLISION , terNO_DELEGATE_PERMISSION , terLOCKED
}
enum  TEScodes : TERUnderlyingType { tesSUCCESS = 0 }
enum  TECcodes : TERUnderlyingType {
  tecCLAIM = 100 , tecPATH_PARTIAL = 101 , tecUNFUNDED_ADD = 102 , tecUNFUNDED_OFFER = 103 ,
  tecUNFUNDED_PAYMENT = 104 , tecFAILED_PROCESSING = 105 , tecDIR_FULL = 121 , tecINSUF_RESERVE_LINE = 122 ,
  tecINSUF_RESERVE_OFFER = 123 , tecNO_DST = 124 , tecNO_DST_INSUF_XRP = 125 , tecNO_LINE_INSUF_RESERVE = 126 ,
  tecNO_LINE_REDUNDANT = 127 , tecPATH_DRY = 128 , tecUNFUNDED = 129 , tecNO_ALTERNATIVE_KEY = 130 ,
  tecNO_REGULAR_KEY = 131 , tecOWNERS = 132 , tecNO_ISSUER = 133 , tecNO_AUTH = 134 ,
  tecNO_LINE = 135 , tecINSUFF_FEE = 136 , tecFROZEN = 137 , tecNO_TARGET = 138 ,
  tecNO_PERMISSION = 139 , tecNO_ENTRY = 140 , tecINSUFFICIENT_RESERVE = 141 , tecNEED_MASTER_KEY = 142 ,
  tecDST_TAG_NEEDED = 143 , tecINTERNAL = 144 , tecOVERSIZE = 145 , tecCRYPTOCONDITION_ERROR = 146 ,
  tecINVARIANT_FAILED = 147 , tecEXPIRED = 148 , tecDUPLICATE = 149 , tecKILLED = 150 ,
  tecHAS_OBLIGATIONS = 151 , tecTOO_SOON = 152 , tecHOOK_REJECTED = 153 , tecMAX_SEQUENCE_REACHED = 154 ,
  tecNO_SUITABLE_NFTOKEN_PAGE = 155 , tecNFTOKEN_BUY_SELL_MISMATCH = 156 , tecNFTOKEN_OFFER_TYPE_MISMATCH = 157 , tecCANT_ACCEPT_OWN_NFTOKEN_OFFER = 158 ,
  tecINSUFFICIENT_FUNDS = 159 , tecOBJECT_NOT_FOUND = 160 , tecINSUFFICIENT_PAYMENT = 161 , tecUNFUNDED_AMM = 162 ,
  tecAMM_BALANCE = 163 , tecAMM_FAILED = 164 , tecAMM_INVALID_TOKENS = 165 , tecAMM_EMPTY = 166 ,
  tecAMM_NOT_EMPTY = 167 , tecAMM_ACCOUNT = 168 , tecINCOMPLETE = 169 , tecXCHAIN_BAD_TRANSFER_ISSUE = 170 ,
  tecXCHAIN_NO_CLAIM_ID = 171 , tecXCHAIN_BAD_CLAIM_ID = 172 , tecXCHAIN_CLAIM_NO_QUORUM = 173 , tecXCHAIN_PROOF_UNKNOWN_KEY = 174 ,
  tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE = 175 , tecXCHAIN_WRONG_CHAIN = 176 , tecXCHAIN_REWARD_MISMATCH = 177 , tecXCHAIN_NO_SIGNERS_LIST = 178 ,
  tecXCHAIN_SENDING_ACCOUNT_MISMATCH = 179 , tecXCHAIN_INSUFF_CREATE_AMOUNT = 180 , tecXCHAIN_ACCOUNT_CREATE_PAST = 181 , tecXCHAIN_ACCOUNT_CREATE_TOO_MANY = 182 ,
  tecXCHAIN_PAYMENT_FAILED = 183 , tecXCHAIN_SELF_COMMIT = 184 , tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR = 185 , tecXCHAIN_CREATE_ACCOUNT_DISABLED = 186 ,
  tecEMPTY_DID = 187 , tecINVALID_UPDATE_TIME = 188 , tecTOKEN_PAIR_NOT_FOUND = 189 , tecARRAY_EMPTY = 190 ,
  tecARRAY_TOO_LARGE = 191 , tecLOCKED = 192 , tecBAD_CREDENTIALS = 193 , tecWRONG_ASSET = 194 ,
  tecLIMIT_EXCEEDED = 195 , tecPSEUDO_ACCOUNT = 196 , tecPRECISION_LOSS = 197 , tecNO_DELEGATE_PERMISSION = 198 ,
  tecBAD_PROOF = 199
}
enum class  TokenType : std::uint8_t {
  None = 1 , NodePublic = 28 , NodePrivate = 32 , AccountID = 0 ,
  AccountPublic = 35 , AccountSecret = 34 , FamilyGenerator = 41 , FamilySeed = 33
}
enum  TxType : std::uint16_t { TtNicknameSet = 6 , TtContract = 9 , TtSpinalTap = 11 , TtHookSet = 22 }
 Transaction type identifiers. More...
enum class  TxSearched { All , Some , Unknown }
enum class  AttestationMatch { NonDstMismatch , MatchExceptDst , Match }
enum class  ManifestDisposition {
  Accepted = 0 , Stale , BadMasterKey , BadEphemeralKey ,
  Invalid
}
enum class  OperatingMode {
  DISCONNECTED = 0 , CONNECTED = 1 , SYNCING = 2 , TRACKING = 3 ,
  FULL = 4
}
 Specifies the mode under which the server believes it's operating. More...
enum class  AmendmentVote : int { Obsolete = -1 , Up = 0 , Down = 1 }
enum class  SHAMapState { Modifying = 0 , Immutable = 1 , Synching = 2 , Invalid = 3 }
 Describes the current state of a given SHAMap. More...
enum class  SHAMapType { TRANSACTION = 1 , STATE = 2 , FREE = 3 }
enum class  SHAMapNodeType { TnInner = 1 , TnTransactionNm = 2 , TnTransactionMd = 3 , TnAccountState = 4 }
enum class  Validity { SigBad , SigGoodOnly , Valid }
 Describes the pre-processing validity of a transaction. More...
enum class  ApplyTransactionResult { Success , Fail , Retry }
 Enum class for return value from applyTransaction. More...
enum  Privilege {
  NoPriv = 0x0000 , CreateAcct = 0x0001 , CreatePseudoAcct = 0x0002 , MustDeleteAcct = 0x0004 ,
  MayDeleteAcct = 0x0008 , OverrideFreeze = 0x0010 , ChangeNftCounts = 0x0020 , CreateMptIssuance = 0x0040 ,
  DestroyMptIssuance = 0x0080 , MustAuthorizeMpt = 0x0100 , MayAuthorizeMpt = 0x0200 , MayDeleteMpt = 0x0400 ,
  MustModifyVault = 0x0800 , MayModifyVault = 0x1000 , MayCreateMpt = 0x2000
}
enum class  DebtDirection { Issues , Redeems }
enum class  QualityDirection { In , Out }
enum class  StrandDirection { Forward , Reverse }
enum class  OfferCrossing { No = 0 , Yes = 1 , Sell = 2 }
enum class  WithdrawAll : bool { No = false , Yes }
 AMMWithdraw implements AMM withdraw Transactor. More...
enum class  LedgerNameSpace : std::uint16_t {
  Account = 'a' , DirNode = 'd' , TrustLine = 'r' , Offer = 'o' ,
  OwnerDir = 'O' , BookDir = 'B' , SkipList = 's' , Escrow = 'u' ,
  Amendments = 'f' , FeeSettings = 'e' , Ticket = 'T' , SignerList = 'S' ,
  XRPPaymentChannel = 'x' , Check = 'C' , DepositPreauth = 'p' , DepositPreauthCredentials = 'P' ,
  NegativeUnl = 'N' , NftokenOffer = 'q' , NftokenBuyOffers = 'h' , NftokenSellOffers = 'i' ,
  Amm = 'A' , Bridge = 'H' , XchainClaimId = 'Q' , XchainCreateAccountClaimId = 'K' ,
  Did = 'I' , Oracle = 'R' , MPTokenIssuance = '~' , MPToken = 't' ,
  Credential = 'D' , PermissionedDomain = 'm' , Delegate = 'E' , Vault = 'V' ,
  LoanBroker = 'l' , Loan = 'L' , Contract = 'c' , Generator = 'g' ,
  Nickname = 'n'
}
 Type-specific prefix for calculating ledger indices. More...
enum class  BypassAccept : bool { No = false , Yes }
enum class  TransStatus {
  NEW = 0 , INVALID = 1 , INCLUDED = 2 , CONFLICTED = 3 ,
  COMMITTED = 4 , HELD = 5 , REMOVED = 6 , OBSOLETE = 7 ,
  INCOMPLETE = 8
}
enum class  ListDisposition {
  Accepted = 0 , Expired , Pending , SameSequence ,
  KnownSequence , Stale , Untrusted , UnsupportedVersion ,
  Invalid
}
enum class  PublisherStatus { Available = 0 , Expired , Unavailable , Revoked }
enum class  ConsensusMode { Proposing , Observing , WrongLedger , SwitchedLedger }
 Represents how a node currently participates in Consensus. More...
enum class  ConsensusPhase { Open , Establish , Accepted }
 Phases of consensus for a single ledger round. More...
enum class  ConsensusState { No , MovedOn , Expired , Yes }
 Whether we have or don't have a consensus. More...
enum class  ValStatus {
  Current , Stale , BadSeq , Multiple ,
  Conflicting
}
 Status of validation we received. More...
enum class  SizedItem : std::size_t {
  SweepInterval = 0 , TreeCacheSize , TreeCacheAge , LedgerSize ,
  LedgerAge , LedgerFetch , HashNodeDbCache , TxnDbCache ,
  LgrDbCache , OpenFinalLimit , BurstSize , RamSizeGb ,
  AccountIdCacheSize
}
enum class  ProtocolFeature { ValidatorListPropagation , ValidatorList2Propagation , LedgerReplay }
enum class  LineDirection : bool { Incoming = false , Outgoing = true }
 Describes how an account was found in a path, and how to find the next set of paths. More...
enum class  Role {
  GUEST , USER , IDENTIFIED , ADMIN ,
  PROXY , FORBID
}
 Indicates the level of administrative permission to grant. More...

Functions

template<class InputIter1, class InputIter2, class Action, class Comp>
void generalizedSetIntersection (InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2, Action action, Comp comp)
template<class FwdIter1, class InputIter2, class Pred, class Comp>
FwdIter1 removeIfIntersectOrMatch (FwdIter1 first1, FwdIter1 last1, InputIter2 first2, InputIter2 last2, Pred pred, Comp comp)
void extractTarLz4 (boost::filesystem::path const &src, boost::filesystem::path const &dst)
 Extract a tar archive compressed with lz4.
std::string base64Encode (std::uint8_t const *data, std::size_t len)
std::string base64Encode (std::string_view s)
std::string base64Decode (std::string_view data)
template<std::size_t Bits, class Tag>
constexpr std::strong_ordering operator<=> (BaseUInt< Bits, Tag > const &lhs, BaseUInt< Bits, Tag > const &rhs)
template<std::size_t Bits, typename Tag>
constexpr bool operator== (BaseUInt< Bits, Tag > const &lhs, BaseUInt< Bits, Tag > const &rhs)
template<std::size_t Bits, class Tag>
constexpr bool operator== (BaseUInt< Bits, Tag > const &a, std::uint64_t b)
template<std::size_t Bits, class Tag>
constexpr BaseUInt< Bits, Tag > operator^ (BaseUInt< Bits, Tag > const &a, BaseUInt< Bits, Tag > const &b)
template<std::size_t Bits, class Tag>
constexpr BaseUInt< Bits, Tag > operator& (BaseUInt< Bits, Tag > const &a, BaseUInt< Bits, Tag > const &b)
template<std::size_t Bits, class Tag>
constexpr BaseUInt< Bits, Tag > operator| (BaseUInt< Bits, Tag > const &a, BaseUInt< Bits, Tag > const &b)
template<std::size_t Bits, class Tag>
constexpr BaseUInt< Bits, Tag > operator+ (BaseUInt< Bits, Tag > const &a, BaseUInt< Bits, Tag > const &b)
template<std::size_t Bits, class Tag>
std::string to_string (BaseUInt< Bits, Tag > const &a)
template<std::size_t Bits, class Tag>
std::string toShortString (BaseUInt< Bits, Tag > const &a)
template<std::size_t Bits, class Tag>
std::ostreamoperator<< (std::ostream &out, BaseUInt< Bits, Tag > const &u)
template<>
std::size_t extract (uint256 const &key)
bool operator== (Buffer const &lhs, Buffer const &rhs) noexcept
bool operator!= (Buffer const &lhs, Buffer const &rhs) noexcept
template<class T>
constexpr auto kilobytes (T value) noexcept
template<class T>
constexpr auto megabytes (T value) noexcept
template<class Duration>
std::string to_string (date::sys_time< Duration > tp)
std::string to_string (NetClock::time_point tp)
template<class Duration>
std::string toStringIso (date::sys_time< Duration > tp)
std::string toStringIso (NetClock::time_point tp)
Stopwatchstopwatch ()
 Returns an instance of a wall clock.
void logThrow (std::string const &title)
 Generates and logs a call stack.
XRPL_NO_SANITIZE_ADDRESS void rethrow ()
 Rethrow the exception currently being handled.
template<class E, class... Args>
XRPL_NO_SANITIZE_ADDRESS void Throw (Args &&... args)
void logicError (std::string const &how) noexcept
 Called when faulty logic causes a broken invariant.
std::string getFileContents (boost::system::error_code &ec, boost::filesystem::path const &sourcePath, std::optional< std::size_t > maxSize=std::nullopt)
void writeFileContents (boost::system::error_code &ec, boost::filesystem::path const &destPath, std::string const &contents)
template<class TT, class... Args>
SharedIntrusive< TT > makeSharedIntrusive (Args &&... args)
 Create a shared intrusive pointer.
template<class T>
void partialDestructorFinished (T **o)
template<class Stream, class Iter>
Stream & join (Stream &s, Iter iter, Iter end, std::string_view delimiter)
std::unique_ptr< beast::Journal::SinksetDebugLogSink (std::unique_ptr< beast::Journal::Sink > sink)
 Set the sink for the debug journal.
beast::Journal debugLog ()
 Returns a debug journal.
std::shared_ptr< boost::asio::ssl::context > makeSslContext (std::string const &cipherList)
 Create a self-signed SSL context that allows anonymous Diffie Hellman.
std::shared_ptr< boost::asio::ssl::context > makeSslContextAuthed (std::string const &keyFile, std::string const &certFile, std::string const &chainFile, std::string const &cipherList)
 Create an authenticated SSL context using the specified files.
MallocTrimReport mallocTrim (std::string_view tag, beast::Journal journal)
 Attempt to return freed memory to the operating system.
constexpr std::size_t calculatePercent (std::size_t count, std::size_t total)
 Calculate one number divided by another number in percentage.
std::optional< std::uint64_tmulDiv (std::uint64_t value, std::uint64_t mul, std::uint64_t div)
 Return value*mul/div accurately.
std::string to_string (Number const &amount)
template<typename T>
constexpr std::optional< int > logTen (T value)
template<typename T>
constexpr bool isPowerOfTen (T value)
Number operator+ (Number const &x, Number const &y)
Number operator- (Number const &x, Number const &y)
Number operator* (Number const &x, Number const &y)
Number operator/ (Number const &x, Number const &y)
constexpr Number abs (Number x) noexcept
Number power (Number const &f, unsigned n)
Number root (Number f, unsigned d)
Number root2 (Number f)
Number power (Number const &f, unsigned n, unsigned d)
constexpr Number squelch (Number const &x, Number const &limit) noexcept
std::string to_string (MantissaRange::MantissaScale const &scale)
template<typename Key>
static std::size_t extract (Key const &key)
template<>
std::size_t extract (std::string const &key)
beast::xor_shift_enginedefaultPrng ()
 Return the default random engine.
template<class T>
ClosedInterval< T > range (T low, T high)
 Create a closed range interval.
template<class T>
std::string to_string (ClosedInterval< T > const &ci)
 Convert a ClosedInterval to a styled string.
template<class T>
std::string to_string (RangeSet< T > const &rs)
 Convert the given RangeSet to a styled string.
template<class T>
bool fromString (RangeSet< T > &rs, std::string const &s)
 Convert the given styled string to a RangeSet.
template<class T>
std::optional< T > prevMissing (RangeSet< T > const &rs, T t, T minVal=0)
 Find the largest value not in the set that is less than a given value.
template<class Dest, class Src>
constexpr std::enable_if_t< std::is_integral_v< Dest > &&std::is_integral_v< Src >, Dest > safeCast (Src s) noexcept
template<class Dest, class Src>
constexpr std::enable_if_t< std::is_enum_v< Dest > &&std::is_integral_v< Src >, Dest > safeCast (Src s) noexcept
template<class Dest, class Src>
constexpr std::enable_if_t< std::is_integral_v< Dest > &&std::is_enum_v< Src >, Dest > safeCast (Src s) noexcept
template<class Dest, class Src>
constexpr std::enable_if_t< std::is_integral_v< Dest > &&std::is_integral_v< Src >, Dest > unsafeCast (Src s) noexcept
template<class Dest, class Src>
constexpr std::enable_if_t< std::is_enum_v< Dest > &&std::is_integral_v< Src >, Dest > unsafeCast (Src s) noexcept
template<class Dest, class Src>
constexpr std::enable_if_t< std::is_integral_v< Dest > &&std::is_enum_v< Src >, Dest > unsafeCast (Src s) noexcept
template<class Dest, class Src>
Dest safeDowncast (Src *s) noexcept
template<class Dest, class Src>
Dest safeDowncast (Src &s) noexcept
template<class EF>
 ScopeExit (EF) -> ScopeExit< EF >
template<class EF>
 ScopeFail (EF) -> ScopeFail< EF >
template<class EF>
 ScopeSuccess (EF) -> ScopeSuccess< EF >
template<class Mutex>
 ScopeUnlock (std::unique_lock< Mutex > &) -> ScopeUnlock< Mutex >
bool operator!= (SHAMapHash const &x, SHAMapHash const &y)
template<>
std::size_t extract (SHAMapHash const &key)
template<class Hasher>
void hash_append (Hasher &h, Slice const &v)
bool operator== (Slice const &lhs, Slice const &rhs) noexcept
bool operator!= (Slice const &lhs, Slice const &rhs) noexcept
bool operator< (Slice const &lhs, Slice const &rhs) noexcept
template<class Stream>
Stream & operator<< (Stream &s, Slice const &v)
template<class T, std::size_t N>
std::enable_if_t< std::is_same_v< T, char >||std::is_same_v< T, unsigned char >, SlicemakeSlice (std::array< T, N > const &a)
template<class T, class Alloc>
std::enable_if_t< std::is_same_v< T, char >||std::is_same_v< T, unsigned char >, SlicemakeSlice (std::vector< T, Alloc > const &v)
template<class Traits, class Alloc>
Slice makeSlice (std::basic_string< char, Traits, Alloc > const &s)
template<class FwdIt>
std::string strHex (FwdIt begin, FwdIt end)
template<class T, class = decltype(std::declval<T>().begin())>
std::string strHex (T const &from)
std::string sqlBlobLiteral (Blob const &blob)
 Format arbitrary binary data as an SQLite "blob literal".
template<class Iterator>
std::optional< BlobstrUnHex (std::size_t strSize, Iterator begin, Iterator end)
std::optional< BlobstrUnHex (std::string_view strSrc)
bool parseUrl (ParsedUrl &pUrl, std::string const &strUrl)
std::string trimWhitespace (std::string str)
std::optional< std::uint64_ttoUInt64 (std::string const &s)
bool isProperlyFormedTomlDomain (std::string_view domain)
 Determines if the given string looks like a TOML-file hosting domain.
template<class T>
std::enable_if_t< std::is_arithmetic_v< T >, std::stringto_string (T t)
 to_string() generalizes std::to_string to handle bools, chars, and strings.
std::string to_string (bool b)
std::string to_string (char c)
std::string to_string (std::string s)
std::string to_string (char const *s)
template<class T>
bool set (T &target, std::string const &name, Section const &section)
 Set a value from a configuration Section If the named value is not found or doesn't parse as a T, the variable is unchanged.
template<class T>
bool set (T &target, T const &defaultValue, std::string const &name, Section const &section)
 Set a value from a configuration Section If the named value is not found or doesn't cast to T, the variable is assigned the default.
template<class T = std::string>
get (Section const &section, std::string const &name, T const &defaultValue=T{})
 Retrieve a key/value pair from a section.
std::string get (Section const &section, std::string const &name, char const *defaultValue)
template<class T>
bool getIfExists (Section const &section, std::string const &name, T &v)
template<>
bool getIfExists< bool > (Section const &section, std::string const &name, bool &v)
constexpr HashRouterFlags operator| (HashRouterFlags lhs, HashRouterFlags rhs)
constexpr HashRouterFlagsoperator|= (HashRouterFlags &lhs, HashRouterFlags rhs)
constexpr HashRouterFlags operator& (HashRouterFlags lhs, HashRouterFlags rhs)
constexpr HashRouterFlagsoperator&= (HashRouterFlags &lhs, HashRouterFlags rhs)
constexpr bool any (HashRouterFlags flags)
std::ostreamoperator<< (std::ostream &os, StartUpType const &type)
CsprngEnginecryptoPrng ()
 The default cryptographically secure PRNG.
void secureErase (void *dest, std::size_t bytes)
 Attempts to clear the given blob of memory.
std::unique_ptr< AmendmentTablemakeAmendmentTable (ServiceRegistry &registry, std::chrono::seconds majorityTime, std::vector< AmendmentTable::FeatureInfo > const &supported, Section const &enabled, Section const &vetoed, beast::Journal journal)
constexpr ApplyFlags operator| (ApplyFlags const &lhs, ApplyFlags const &rhs)
constexpr ApplyFlags operator& (ApplyFlags const &lhs, ApplyFlags const &rhs)
constexpr ApplyFlags operator~ (ApplyFlags const &flags)
ApplyFlags operator|= (ApplyFlags &lhs, ApplyFlags const &rhs)
ApplyFlags operator&= (ApplyFlags &lhs, ApplyFlags const &rhs)
bool isGlobalFrozen (ReadView const &view, AccountID const &issuer)
 Check if the issuer has the global freeze flag set.
XRPAmount xrpLiquid (ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
void adjustOwnerCount (ApplyView &view, SLE::ref sle, std::int32_t amount, beast::Journal j)
 Adjust the owner count up or down.
Rate transferRate (ReadView const &view, AccountID const &issuer)
 Returns IOU issuer transfer fee as Rate.
AccountID pseudoAccountAddress (ReadView const &view, uint256 const &pseudoOwnerKey)
 Generate a pseudo-account address from a pseudo owner key.
std::vector< SField const * > const & getPseudoAccountFields ()
 Returns the list of fields that define an ACCOUNT_ROOT as a pseudo-account if set.
bool isPseudoAccount (SLE::const_pointer sleAcct, std::set< SField const * > const &pseudoFieldFilter={})
 Returns true if and only if sleAcct is a pseudo-account or specific pseudo-accounts in pseudoFieldFilter.
bool isPseudoAccount (ReadView const &view, AccountID const &accountId, std::set< SField const * > const &pseudoFieldFilter={})
 Convenience overload that reads the account from the view.
std::expected< SLE::pointer, TERcreatePseudoAccount (ApplyView &view, uint256 const &pseudoOwnerKey, SField const &ownerField)
 Create pseudo-account, storing pseudoOwnerKey into ownerField.
TER checkDestinationAndTag (SLE::const_ref toSle, bool hasDestinationTag)
 Checks the destination and tag.
STAmount ammLPTokens (STAmount const &asset1, STAmount const &asset2, Asset const &lptIssue)
 Calculate LP Tokens given AMM pool reserves.
STAmount lpTokensOut (STAmount const &asset1Balance, STAmount const &asset1Deposit, STAmount const &lptAMMBalance, std::uint16_t tfee)
 Calculate LP Tokens given asset's deposit amount.
STAmount ammAssetIn (STAmount const &asset1Balance, STAmount const &lptAMMBalance, STAmount const &lpTokens, std::uint16_t tfee)
 Calculate asset deposit given LP Tokens.
STAmount lpTokensIn (STAmount const &asset1Balance, STAmount const &asset1Withdraw, STAmount const &lptAMMBalance, std::uint16_t tfee)
 Calculate LP Tokens given asset's withdraw amount.
STAmount ammAssetOut (STAmount const &assetBalance, STAmount const &lptAMMBalance, STAmount const &lpTokens, std::uint16_t tfee)
 Calculate asset withdrawal by tokens.
bool withinRelativeDistance (Quality const &calcQuality, Quality const &reqQuality, Number const &dist)
 Check if the relative distance between the qualities is within the requested distance.
template<typename Amt>
bool withinRelativeDistance (Amt const &calc, Amt const &req, Number const &dist)
 Check if the relative distance between the amounts is within the requested distance.
std::optional< NumbersolveQuadraticEqSmallest (Number const &a, Number const &b, Number const &c)
 Solve quadratic equation to find takerGets or takerPays.
template<typename TIn, typename TOut>
std::optional< TAmounts< TIn, TOut > > getAMMOfferStartWithTakerGets (TAmounts< TIn, TOut > const &pool, Quality const &targetQuality, std::uint16_t const &tfee)
 Generate AMM offer starting with takerGets when AMM pool from the payment perspective is IOU(in)/XRP(out) Equations: Spot Price Quality after the offer is consumed: Qsp = (O - o) / (I + i) – equation (1) where O is poolPays, I is poolGets, o is takerGets, i is takerPays Swap out: i = (I * o) / (O - o) * f – equation (2) where f is (1 - tfee/100000), tfee is in basis points Effective price targetQuality: Qep = o / i – equation (3) There are two scenarios to consider A) Qsp = Qep.
template<typename TIn, typename TOut>
std::optional< TAmounts< TIn, TOut > > getAMMOfferStartWithTakerPays (TAmounts< TIn, TOut > const &pool, Quality const &targetQuality, std::uint16_t tfee)
 Generate AMM offer starting with takerPays when AMM pool from the payment perspective is XRP(in)/IOU(out) or IOU(in)/IOU(out).
template<typename TIn, typename TOut>
std::optional< TAmounts< TIn, TOut > > changeSpotPriceQuality (TAmounts< TIn, TOut > const &pool, Quality const &quality, std::uint16_t tfee, Rules const &rules, beast::Journal j)
 Generate AMM offer so that either updated Spot Price Quality (SPQ) is equal to LOB quality (in this case AMM offer quality is better than LOB quality) or AMM offer is equal to LOB quality (in this case SPQ is better than LOB quality).
template<typename TIn, typename TOut>
TOut swapAssetIn (TAmounts< TIn, TOut > const &pool, TIn const &assetIn, std::uint16_t tfee)
 AMM pool invariant - the product (A * B) after swap in/out has to remain at least the same: (A + in) * (B - out) >= A * B XRP round-off may result in a smaller product after swap in/out.
template<typename TIn, typename TOut>
TIn swapAssetOut (TAmounts< TIn, TOut > const &pool, TOut const &assetOut, std::uint16_t tfee)
 Swap assetOut out of the pool and swap in a proportional amount of the other asset.
Number square (Number const &n)
 Return square of n.
STAmount adjustLPTokens (STAmount const &lptAMMBalance, STAmount const &lpTokens, IsDeposit isDeposit)
 Adjust LP tokens to deposit/withdraw.
std::tuple< STAmount, std::optional< STAmount >, STAmountadjustAmountsByLPTokens (STAmount const &amountBalance, STAmount const &amount, std::optional< STAmount > const &amount2, STAmount const &lptAMMBalance, STAmount const &lpTokens, std::uint16_t tfee, IsDeposit isDeposit)
 Calls adjustLPTokens() and adjusts deposit or withdraw amounts if the adjusted LP tokens are less than the provided LP tokens.
Number solveQuadraticEq (Number const &a, Number const &b, Number const &c)
 Positive solution for quadratic equation: x = (-b + sqrt(b**2 + 4*a*c))/(2*a).
STAmount multiply (STAmount const &amount, Number const &frac, Number::RoundingMode rm)
template<typename A>
STAmount getRoundedAsset (Rules const &rules, STAmount const &balance, A const &frac, IsDeposit isDeposit)
 Round AMM equal deposit/withdrawal amount.
STAmount getRoundedAsset (Rules const &rules, std::function< Number()> const &noRoundCb, STAmount const &balance, std::function< Number()> const &productCb, IsDeposit isDeposit)
 Round AMM single deposit/withdrawal amount.
STAmount getRoundedLPTokens (Rules const &rules, STAmount const &balance, Number const &frac, IsDeposit isDeposit)
 Round AMM deposit/withdrawal LPToken amount.
STAmount getRoundedLPTokens (Rules const &rules, std::function< Number()> const &noRoundCb, STAmount const &lptAMMBalance, std::function< Number()> const &productCb, IsDeposit isDeposit)
 Round AMM single deposit/withdrawal LPToken amount.
std::pair< STAmount, STAmountadjustAssetInByTokens (Rules const &rules, STAmount const &balance, STAmount const &amount, STAmount const &lptAMMBalance, STAmount const &tokens, std::uint16_t tfee)
std::pair< STAmount, STAmountadjustAssetOutByTokens (Rules const &rules, STAmount const &balance, STAmount const &amount, STAmount const &lptAMMBalance, STAmount const &tokens, std::uint16_t tfee)
Number adjustFracByTokens (Rules const &rules, STAmount const &lptAMMBalance, STAmount const &tokens, Number const &frac)
 Find a fraction of tokens after the tokens are adjusted.
std::pair< STAmount, STAmountammPoolHolds (ReadView const &view, AccountID const &ammAccountID, Asset const &asset1, Asset const &asset2, FreezeHandling freezeHandling, AuthHandling authHandling, beast::Journal const j)
 Get AMM pool balances.
TER checkAMMPrecisionLoss (Number const &poolProductMean, STAmount const &newLPTokenBalance)
 Check AMM pool product invariant after an AMM operation that changes LP tokens (deposit/withdraw/clawback) from an already calculated pool product mean.
TER checkAMMPrecisionLoss (ReadView const &view, AccountID const &ammAccountID, Asset const &asset1, Asset const &asset2, STAmount const &newLPTokenBalance, beast::Journal const j)
 Check AMM pool product invariant after an AMM operation that changes LP tokens (deposit/withdraw/clawback).
std::expected< std::tuple< STAmount, STAmount, STAmount >, TERammHolds (ReadView const &view, SLE const &ammSle, std::optional< Asset > const &optAsset1, std::optional< Asset > const &optAsset2, FreezeHandling freezeHandling, AuthHandling authHandling, beast::Journal const j)
 Get AMM pool and LP token balances.
STAmount ammLPHolds (ReadView const &view, Asset const &asset1, Asset const &asset2, AccountID const &ammAccount, AccountID const &lpAccount, beast::Journal const j)
 Get the balance of LP tokens.
STAmount ammLPHolds (ReadView const &view, SLE const &ammSle, AccountID const &lpAccount, beast::Journal const j)
std::uint16_t getTradingFee (ReadView const &view, SLE const &ammSle, AccountID const &account)
 Get AMM trading fee for the given account.
STAmount ammAccountHolds (ReadView const &view, AccountID const &ammAccountID, Asset const &asset)
 Returns total amount held by AMM for the given token.
TER deleteAMMAccount (Sandbox &view, Asset const &asset, Asset const &asset2, beast::Journal j)
 Delete trustlines to AMM.
void initializeFeeAuctionVote (ApplyView &view, SLE::pointer &ammSle, AccountID const &account, Asset const &lptAsset, std::uint16_t tfee)
 Initialize Auction and Voting slots and set the trading/discounted fee.
std::expected< bool, TERisOnlyLiquidityProvider (ReadView const &view, Issue const &ammIssue, AccountID const &lpAccount)
 Return true if the Liquidity Provider is the only AMM provider, false otherwise.
std::expected< bool, TERverifyAndAdjustLPTokenBalance (Sandbox &sb, STAmount const &lpTokens, SLE::pointer &ammSle, AccountID const &account)
 Due to rounding, the LPTokenBalance of the last LP might not match the LP's trustline balance.
TER verifyValidDomain (ApplyView &view, AccountID const &account, uint256 domainID, beast::Journal j)
TER checkDepositPreauth (STTx const &tx, ReadView const &view, AccountID const &src, AccountID const &dst, std::shared_ptr< SLE const > const &sleDst, beast::Journal j)
 Check whether src is authorized to deposit to dst.
TER cleanupExpiredCredentials (STTx const &tx, ApplyView &view, beast::Journal j)
 Remove expired credentials referenced by the transaction.
TER verifyDepositPreauth (STTx const &tx, ApplyView &view, AccountID const &src, AccountID const &dst, SLE::const_ref sleDst, beast::Journal j)
NotTEC checkTxPermission (SLE::const_ref delegate, STTx const &tx)
 Check if the delegate account has permission to execute the transaction.
std::unordered_set< GranularPermissionTypegetGranularPermission (SLE::const_ref delegate, TxType const &type)
 Load the granular permissions granted to the delegate account for the specified transaction type.
void forEachItem (ReadView const &view, Keylet const &root, std::function< void(SLE::const_ref)> const &f)
 Iterate all items in the given directory.
bool forEachItemAfter (ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(SLE::const_ref)> const &f)
 Iterate all items after an item in the given directory.
void forEachItem (ReadView const &view, AccountID const &id, std::function< void(SLE::const_ref)> const &f)
 Iterate all items in an account's owner directory.
bool forEachItemAfter (ReadView const &view, AccountID const &id, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(SLE::const_ref)> const &f)
 Iterate all items after an item in an owner directory.
bool dirIsEmpty (ReadView const &view, Keylet const &k)
 Returns true if the directory is empty.
std::function< void(SLE::ref)> describeOwnerDir (AccountID const &account)
 Returns a function that sets the owner on a directory SLE.
template<ValidIssueType T>
TER escrowUnlockApplyHelper (ApplyView &view, Rate lockedRate, SLE::ref sleDest, STAmount const &xrpBalance, STAmount const &amount, AccountID const &issuer, AccountID const &sender, AccountID const &receiver, bool createAsset, beast::Journal journal)
template<>
TER escrowUnlockApplyHelper< Issue > (ApplyView &view, Rate lockedRate, SLE::ref sleDest, STAmount const &xrpBalance, STAmount const &amount, AccountID const &issuer, AccountID const &sender, AccountID const &receiver, bool createAsset, beast::Journal journal)
template<>
TER escrowUnlockApplyHelper< MPTIssue > (ApplyView &view, Rate lockedRate, SLE::ref sleDest, STAmount const &xrpBalance, STAmount const &amount, AccountID const &issuer, AccountID const &sender, AccountID const &receiver, bool createAsset, beast::Journal journal)
TER canApplyToBrokerCover (ReadView const &view, SLE::const_ref sleBroker, Asset const &vaultAsset, STAmount const &amount, beast::Journal j, std::string_view logPrefix)
 Broker cover preclaim precision guard (fixCleanup3_2_0).
bool checkLendingProtocolDependencies (Rules const &rules, STTx const &tx)
Number loanPeriodicRate (TenthBips32 interestRate, std::uint32_t paymentInterval)
Number roundPeriodicPayment (Asset const &asset, Number const &periodicPayment, std::int32_t scale)
 Ensure the periodic payment is always rounded consistently.
template<class NumberProxy>
void adjustImpreciseNumber (NumberProxy value, Number const &adjustment, Asset const &asset, int vaultScale)
int getAssetsTotalScale (SLE::const_ref vaultSle)
Number minimumBrokerCover (Number const &debtTotal, TenthBips32 coverRateMinimum, SLE::const_ref vaultSle)
TER checkLoanGuards (Asset const &vaultAsset, Number const &principalRequested, bool expectInterest, std::uint32_t paymentTotal, LoanProperties const &properties, beast::Journal j)
LoanState computeTheoreticalLoanState (Rules const &rules, Number const &periodicPayment, Number const &periodicRate, std::uint32_t const paymentRemaining, TenthBips32 const managementFeeRate)
LoanState constructLoanState (Number const &totalValueOutstanding, Number const &principalOutstanding, Number const &managementFeeOutstanding)
LoanState constructRoundedLoanState (SLE::const_ref loan)
Number computeManagementFee (Asset const &asset, Number const &interest, TenthBips32 managementFeeRate, std::int32_t scale)
Number computeFullPaymentInterest (Number const &theoreticalPrincipalOutstanding, Number const &periodicRate, NetClock::time_point parentCloseTime, std::uint32_t paymentInterval, std::uint32_t prevPaymentDate, std::uint32_t startDate, TenthBips32 closeInterestRate)
detail::LoanStateDeltas operator- (LoanState const &lhs, LoanState const &rhs)
LoanState operator- (LoanState const &lhs, detail::LoanStateDeltas const &rhs)
LoanState operator+ (LoanState const &lhs, detail::LoanStateDeltas const &rhs)
LoanProperties computeLoanProperties (Rules const &rules, Asset const &asset, Number const &principalOutstanding, TenthBips32 interestRate, std::uint32_t paymentInterval, std::uint32_t paymentsRemaining, TenthBips32 managementFeeRate, std::int32_t minimumScale)
LoanProperties computeLoanProperties (Rules const &rules, Asset const &asset, Number const &principalOutstanding, Number const &periodicRate, std::uint32_t paymentsRemaining, TenthBips32 managementFeeRate, std::int32_t minimumScale)
bool isRounded (Asset const &asset, Number const &value, std::int32_t scale)
std::expected< LoanPaymentParts, TERloanMakePayment (Asset const &asset, ApplyView &view, SLE::ref loan, SLE::const_ref brokerSle, STAmount const &amount, LoanPaymentType const paymentType, beast::Journal j)
bool isGlobalFrozen (ReadView const &view, MPTIssue const &mptIssue)
bool isIndividualFrozen (ReadView const &view, AccountID const &account, MPTIssue const &mptIssue)
bool isFrozen (ReadView const &view, AccountID const &account, MPTIssue const &mptIssue, std::uint8_t depth=0)
bool isAnyFrozen (ReadView const &view, std::initializer_list< AccountID > const &accounts, MPTIssue const &mptIssue, std::uint8_t depth=0)
Rate transferRate (ReadView const &view, MPTID const &issuanceID)
 Returns MPT transfer fee as Rate.
TER canAddHolding (ReadView const &view, MPTIssue const &mptIssue)
TER authorizeMPToken (ApplyView &view, XRPAmount const &priorBalance, MPTID const &mptIssuanceID, AccountID const &account, beast::Journal journal, std::uint32_t flags=0, std::optional< AccountID > holderID=std::nullopt)
TER requireAuth (ReadView const &view, MPTIssue const &mptIssue, AccountID const &account, AuthType authType=AuthType::Legacy, std::uint8_t depth=0)
 Check if the account lacks required authorization for MPT.
TER enforceMPTokenAuthorization (ApplyView &view, MPTID const &mptIssuanceID, AccountID const &account, XRPAmount const &priorBalance, beast::Journal j)
 Enforce account has MPToken to match its authorization.
Asset assetOfHolding (SLE const &sleShareIssuance, SLE const &sleHolding)
 Resolve the underlying asset of a vault share.
TER canTransfer (ReadView const &view, MPTIssue const &mptIssue, AccountID const &from, AccountID const &to, WaiveMPTCanTransfer waive=WaiveMPTCanTransfer::No, std::uint8_t depth=0)
 Check whether to may receive the given MPT from from.
TER canTrade (ReadView const &view, Asset const &asset, std::uint8_t depth=0)
 Check whether asset may be traded on the DEX.
TER canMPTTradeAndTransfer (ReadView const &v, Asset const &asset, AccountID const &from, AccountID const &to)
 Convenience to combine canTrade/Transfer.
TER addEmptyHolding (ApplyView &view, AccountID const &accountID, XRPAmount priorBalance, MPTIssue const &mptIssue, beast::Journal journal)
TER removeEmptyHolding (ApplyView &view, AccountID const &accountID, MPTIssue const &mptIssue, beast::Journal journal)
TER lockEscrowMPT (ApplyView &view, AccountID const &uGrantorID, STAmount const &saAmount, beast::Journal j)
TER unlockEscrowMPT (ApplyView &view, AccountID const &uGrantorID, AccountID const &uGranteeID, STAmount const &netAmount, STAmount const &grossAmount, beast::Journal j)
TER createMPToken (ApplyView &view, MPTID const &mptIssuanceID, AccountID const &account, std::uint32_t const flags)
TER checkCreateMPT (xrpl::ApplyView &view, xrpl::MPTIssue const &mptIssue, xrpl::AccountID const &holder, beast::Journal j)
std::int64_t maxMPTAmount (SLE const &sleIssuance)
std::int64_t availableMPTAmount (SLE const &sleIssuance)
std::int64_t availableMPTAmount (ReadView const &view, MPTID const &mptID)
bool isMPTOverflow (std::int64_t sendAmount, std::uint64_t outstandingAmount, std::int64_t maximumAmount, AllowMPTOverflow allowOverflow)
 Checks for two types of OutstandingAmount overflow during a send operation.
STAmount issuerFundsToSelfIssue (ReadView const &view, MPTIssue const &issue)
 Determine funds available for an issuer to sell in an issuer owned offer.
void issuerSelfDebitHookMPT (ApplyView &view, MPTIssue const &issue, std::uint64_t amount)
 Facilitate tracking of MPT sold by an issuer owning MPT sell offer.
TER offerDelete (ApplyView &view, SLE::ref sle, beast::Journal j)
 Delete an offer.
TER closeChannel (SLE::ref slep, ApplyView &view, uint256 const &key, beast::Journal j)
 Close a payment channel and return its remaining funds to the channel owner.
uint32_t saturatingAdd (Rules const &rules, uint32_t const lhs, uint32_t const rhs)
 Add two uint32_t values with saturation at UINT32_MAX.
bool isChannelExpired (ApplyView const &view, std::optional< std::uint32_t > timeField)
 Determine whether a payment channel time field represents an expired time.
bool isIndividualFrozen (ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
bool isIndividualFrozen (ReadView const &view, AccountID const &account, Issue const &issue)
bool isFrozen (ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
bool isFrozen (ReadView const &view, AccountID const &account, Issue const &issue)
bool isFrozen (ReadView const &view, AccountID const &account, Issue const &issue, std::uint8_t)
bool isDeepFrozen (ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
bool isDeepFrozen (ReadView const &view, AccountID const &account, Issue const &issue, std::uint8_t=0)
TER checkDeepFrozen (ReadView const &view, AccountID const &account, Issue const &issue)
TER trustCreate (ApplyView &view, bool const bSrcHigh, AccountID const &uSrcAccountID, AccountID const &uDstAccountID, uint256 const &uIndex, SLE::ref sleAccount, bool const bAuth, bool const bNoRipple, bool const bFreeze, bool bDeepFreeze, STAmount const &saBalance, STAmount const &saLimit, std::uint32_t uQualityIn, std::uint32_t uQualityOut, beast::Journal j)
 Create a trust line.
TER trustDelete (ApplyView &view, SLE::ref sleRippleState, AccountID const &uLowAccountID, AccountID const &uHighAccountID, beast::Journal j)
TER issueIOU (ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
TER redeemIOU (ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
TER requireAuth (ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType=AuthType::Legacy)
 Check if the account lacks required authorization.
TER canTransfer (ReadView const &view, Issue const &issue, AccountID const &from, AccountID const &to)
 Check if the destination account is allowed to receive IOU.
TER addEmptyHolding (ApplyView &view, AccountID const &accountID, XRPAmount priorBalance, Issue const &issue, beast::Journal journal)
 Any transactors that call addEmptyHolding() in doApply must call canAddHolding() in preflight with the same View and Asset.
TER removeEmptyHolding (ApplyView &view, AccountID const &accountID, Issue const &issue, beast::Journal journal)
TER deleteAMMTrustLine (ApplyView &view, SLE::pointer sleState, std::optional< AccountID > const &ammAccountID, beast::Journal j)
 Delete trustline to AMM.
TER deleteAMMMPToken (ApplyView &view, SLE::pointer sleMPT, AccountID const &ammAccountID, beast::Journal j)
 Delete AMMs MPToken.
bool isGlobalFrozen (ReadView const &view, Asset const &asset)
TER checkGlobalFrozen (ReadView const &view, Asset const &asset)
bool isIndividualFrozen (ReadView const &view, AccountID const &account, Asset const &asset)
TER checkIndividualFrozen (ReadView const &view, AccountID const &account, Asset const &asset)
bool isFrozen (ReadView const &view, AccountID const &account, Asset const &asset, std::uint8_t depth=0)
 isFrozen check is recursive for MPT shares in a vault, descending to assets in the vault, up to maxAssetCheckDepth recursion depth.
TER checkFrozen (ReadView const &view, AccountID const &account, Issue const &issue)
TER checkFrozen (ReadView const &view, AccountID const &account, MPTIssue const &mptIssue)
TER checkFrozen (ReadView const &view, AccountID const &account, Asset const &asset)
bool isAnyFrozen (ReadView const &view, std::initializer_list< AccountID > const &accounts, Issue const &issue)
bool isAnyFrozen (ReadView const &view, std::initializer_list< AccountID > const &accounts, Asset const &asset, std::uint8_t depth=0)
bool isDeepFrozen (ReadView const &view, AccountID const &account, MPTIssue const &mptIssue, std::uint8_t depth=0)
bool isDeepFrozen (ReadView const &view, AccountID const &account, Asset const &asset, std::uint8_t depth=0)
 isFrozen check is recursive for MPT shares in a vault, descending to assets in the vault, up to maxAssetCheckDepth recursion depth.
TER checkDeepFrozen (ReadView const &view, AccountID const &account, MPTIssue const &mptIssue)
TER checkDeepFrozen (ReadView const &view, AccountID const &account, Asset const &asset)
TER checkWithdrawFreeze (ReadView const &view, AccountID const &srcAcct, AccountID const &submitterAcct, AccountID const &dstAcct, Asset const &asset)
 Checks freeze compliance for withdrawing an asset from a pseudo-account (e.g.
TER checkDepositFreeze (ReadView const &view, AccountID const &srcAcct, AccountID const &dstAcct, Asset const &asset)
 Checks freeze compliance for depositing an asset into a pseudo-account (e.g.
STAmount accountHolds (ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j, SpendableHandling includeFullBalance=SpendableHandling::SimpleBalance)
STAmount accountHolds (ReadView const &view, AccountID const &account, Issue const &issue, FreezeHandling zeroIfFrozen, beast::Journal j, SpendableHandling includeFullBalance=SpendableHandling::SimpleBalance)
STAmount accountHolds (ReadView const &view, AccountID const &account, MPTIssue const &mptIssue, FreezeHandling zeroIfFrozen, AuthHandling zeroIfUnauthorized, beast::Journal j, SpendableHandling includeFullBalance=SpendableHandling::SimpleBalance)
STAmount accountHolds (ReadView const &view, AccountID const &account, Asset const &asset, FreezeHandling zeroIfFrozen, AuthHandling zeroIfUnauthorized, beast::Journal j, SpendableHandling includeFullBalance=SpendableHandling::SimpleBalance)
STAmount accountFunds (ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
STAmount accountFunds (ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, AuthHandling authHandling, beast::Journal j)
Rate transferRate (ReadView const &view, STAmount const &amount)
 Returns the transfer fee as Rate based on the type of token.
TER canAddHolding (ReadView const &view, Asset const &asset)
TER addEmptyHolding (ApplyView &view, AccountID const &accountID, XRPAmount priorBalance, Asset const &asset, beast::Journal journal)
TER removeEmptyHolding (ApplyView &view, AccountID const &accountID, Asset const &asset, beast::Journal journal)
TER requireAuth (ReadView const &view, Asset const &asset, AccountID const &account, AuthType authType=AuthType::Legacy)
TER canTransfer (ReadView const &view, Asset const &asset, AccountID const &from, AccountID const &to, WaiveMPTCanTransfer waive=WaiveMPTCanTransfer::No, std::uint8_t depth=0)
TER directSendNoFee (ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
 Calls static directSendNoFeeIOU if saAmount represents Issue.
TER accountSend (ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee=WaiveTransferFee::No, AllowMPTOverflow allowOverflow=AllowMPTOverflow::No)
 Calls static accountSendIOU if saAmount represents Issue.
TER accountSendMulti (ApplyView &view, AccountID const &senderID, Asset const &asset, MultiplePaymentDestinations const &receivers, beast::Journal j, WaiveTransferFee waiveFee=WaiveTransferFee::No)
 Like accountSend, except one account is sending multiple payments (with the same asset!) simultaneously.
TER transferXRP (ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &amount, beast::Journal j)
std::optional< STAmountassetsToSharesDeposit (SLE::const_ref vault, SLE::const_ref issuance, STAmount const &assets)
 From the perspective of a vault, return the number of shares to give depositor when they offer a fixed amount of assets.
std::optional< STAmountsharesToAssetsDeposit (SLE::const_ref vault, SLE::const_ref issuance, STAmount const &shares)
 From the perspective of a vault, return the number of assets to take from depositor when they receive a fixed amount of shares.
std::optional< STAmountassetsToSharesWithdraw (SLE::const_ref vault, SLE::const_ref issuance, STAmount const &assets, TruncateShares truncate=TruncateShares::No, WaiveUnrealizedLoss waive=WaiveUnrealizedLoss::No)
 From the perspective of a vault, return the number of shares to demand from the depositor when they ask to withdraw a fixed amount of assets.
std::optional< STAmountsharesToAssetsWithdraw (SLE::const_ref vault, SLE::const_ref issuance, STAmount const &shares, WaiveUnrealizedLoss waive=WaiveUnrealizedLoss::No)
 From the perspective of a vault, return the number of assets to give the depositor when they redeem a fixed amount of shares.
bool isSoleShareholder (ReadView const &view, AccountID const &account, SLE::const_ref issuance)
 Returns true iff account holds all of the vault's outstanding shares — i.e.
template<class Rep, class Period, class Seq>
std::chrono::duration< Rep, Period > getNextLedgerTimeResolution (std::chrono::duration< Rep, Period > previousResolution, bool previousAgree, Seq ledgerSeq)
 Calculates the close time resolution for the specified ledger.
template<class Clock, class Duration, class Rep, class Period>
std::chrono::time_point< Clock, Duration > roundCloseTime (std::chrono::time_point< Clock, Duration > closeTime, std::chrono::duration< Rep, Period > closeResolution)
 Calculates the close time for a ledger, given a close time resolution.
template<class Clock, class Duration, class Rep, class Period>
std::chrono::time_point< Clock, Duration > effCloseTime (std::chrono::time_point< Clock, Duration > closeTime, std::chrono::duration< Rep, Period > resolution, std::chrono::time_point< Clock, Duration > priorCloseTime)
 Calculate the effective ledger close time.
hash_set< BookaffectedBooks (AcceptedLedgerTx const &alTx, beast::Journal const &j)
 Extract the set of books affected by a transaction.
Rules makeRulesGivenLedger (DigestAwareReadView const &ledger, Rules const &current)
Rules makeRulesGivenLedger (DigestAwareReadView const &ledger, std::unordered_set< uint256, beast::Uhash<> > const &presets)
bool hasExpired (ReadView const &view, std::optional< std::uint32_t > const &exp)
 Determines whether the given expiration time has passed.
bool isVaultPseudoAccountFrozen (ReadView const &view, AccountID const &account, MPTIssue const &mptShare, std::uint8_t depth)
bool isLPTokenFrozen (ReadView const &view, AccountID const &account, Asset const &asset, Asset const &asset2)
std::set< uint256getEnabledAmendments (ReadView const &view)
majorityAmendments_t getMajorityAmendments (ReadView const &view)
std::optional< uint256hashOfSeq (ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
 Return the hash of a ledger by sequence.
LedgerIndex getCandidateLedger (LedgerIndex requested)
 Find a ledger index from which we could easily get the requested ledger.
bool areCompatible (ReadView const &validLedger, ReadView const &testLedger, beast::Journal::Stream &s, char const *reason)
 Return false if the test ledger is provably incompatible with the valid ledger, that is, they could not possibly both be valid.
bool areCompatible (uint256 const &validHash, LedgerIndex validIndex, ReadView const &testLedger, beast::Journal::Stream &s, char const *reason)
TER dirLink (ApplyView &view, AccountID const &owner, SLE::pointer &object, SF_UINT64 const &node=sfOwnerNode)
TER canWithdraw (ReadView const &view, AccountID const &from, AccountID const &to, SLE::const_ref toSle, STAmount const &amount, bool hasDestinationTag)
 Checks that can withdraw funds from an object to itself or a destination.
TER canWithdraw (ReadView const &view, AccountID const &from, AccountID const &to, STAmount const &amount, bool hasDestinationTag)
 Checks that can withdraw funds from an object to itself or a destination.
TER canWithdraw (ReadView const &view, STTx const &tx)
 Checks that can withdraw funds from an object to itself or a destination.
TER doWithdraw (ApplyView &view, STTx const &tx, AccountID const &senderAcct, AccountID const &dstAcct, AccountID const &sourceAcct, XRPAmount priorBalance, STAmount const &amount, beast::Journal j)
TER cleanupOnAccountDelete (ApplyView &view, Keylet const &ownerDirKeylet, EntryDeleter const &deleter, beast::Journal j, std::optional< std::uint16_t > maxNodesToDelete=std::nullopt)
 Cleanup owner directory entries on account delete.
bool after (NetClock::time_point now, std::uint32_t mark)
 Has the specified time passed?
void registerSSLCerts (boost::asio::ssl::context &, boost::system::error_code &, beast::Journal j)
 Register default SSL certificates.
std::string toBase58 (AccountID const &v)
 Convert AccountID to base58 checked string.
template<>
std::optional< AccountIDparseBase58 (std::string const &s)
 Parse AccountID from checked, base58 string.
AccountID const & xrpAccount ()
 Compute AccountID from public key.
AccountID const & noAccount ()
 A placeholder for empty accounts.
bool toIssuer (AccountID &, std::string const &)
 Convert hex or base58 string to AccountID.
bool isXRP (AccountID const &c)
std::string to_string (AccountID const &account)
std::ostreamoperator<< (std::ostream &os, AccountID const &x)
void initAccountIdCache (std::size_t count)
 Initialize the global cache used to map AccountID to base58 conversions.
Currency ammLPTCurrency (Asset const &asset1, Asset const &asset2)
 Calculate Liquidity Provider Token (LPT) Currency.
Issue ammLPTIssue (Asset const &asset1, Asset const &asset2, AccountID const &ammAccountID)
 Calculate LPT Issue from AMM asset pair.
NotTEC invalidAMMAmount (STAmount const &amount, std::optional< std::pair< Asset, Asset > > const &pair=std::nullopt, bool validZero=false)
 Validate the amount.
NotTEC invalidAMMAsset (Asset const &asset, std::optional< std::pair< Asset, Asset > > const &pair=std::nullopt)
NotTEC invalidAMMAssetPair (Asset const &asset1, Asset const &asset2, std::optional< std::pair< Asset, Asset > > const &pair=std::nullopt)
std::optional< std::uint8_tammAuctionTimeSlot (std::uint64_t current, STObject const &auctionSlot)
 Get time slot of the auction slot.
bool ammEnabled (Rules const &)
 Return true if required AMM amendment is enabled.
Number getFee (std::uint16_t tfee)
 Convert to the fee from the basis points.
Number feeMult (std::uint16_t tfee)
 Get fee multiplier (1 - tfee) @tfee trading fee in basis points.
Number feeMultHalf (std::uint16_t tfee)
 Get fee multiplier (1 - tfee / 2) @tfee trading fee in basis points.
STAmount toSTAmount (IOUAmount const &iou, Asset const &asset)
STAmount toSTAmount (IOUAmount const &iou)
STAmount toSTAmount (XRPAmount const &xrp)
STAmount toSTAmount (XRPAmount const &xrp, Asset const &asset)
STAmount toSTAmount (MPTAmount const &mpt)
STAmount toSTAmount (MPTAmount const &mpt, Asset const &asset)
template<class T>
toAmount (STAmount const &amt)=delete
template<>
STAmount toAmount< STAmount > (STAmount const &amt)
template<>
IOUAmount toAmount< IOUAmount > (STAmount const &amt)
template<>
XRPAmount toAmount< XRPAmount > (STAmount const &amt)
template<>
MPTAmount toAmount< MPTAmount > (STAmount const &amt)
template<class T>
toAmount (IOUAmount const &amt)=delete
template<>
IOUAmount toAmount< IOUAmount > (IOUAmount const &amt)
template<class T>
toAmount (XRPAmount const &amt)=delete
template<>
XRPAmount toAmount< XRPAmount > (XRPAmount const &amt)
template<class T>
toAmount (MPTAmount const &amt)=delete
template<>
MPTAmount toAmount< MPTAmount > (MPTAmount const &amt)
template<typename T>
toAmount (Asset const &asset, Number const &n, Number::RoundingMode mode=Number::getround())
template<typename T>
toMaxAmount (Asset const &asset)
STAmount toSTAmount (Asset const &asset, Number const &n, Number::RoundingMode mode=Number::getround())
template<typename T>
Asset getAsset (T const &amt)
template<typename T>
constexpr T get (STAmount const &a)
template<unsigned MinVer, unsigned MaxVer, typename Fn, typename... Args>
requires (MaxVer >= MinVer) && (MinVer >= RPC::kApiMinimumSupportedVersion) && (RPC::kApiMaximumValidVersion >= MaxVer) && requires { fn(std::integral_constant<unsigned int, MinVer>{}, std::forward<Args>(args)...); fn(std::integral_constant<unsigned int, MaxVer>{}, std::forward<Args>(args)...); }
void forApiVersions (Fn const &fn, Args &&... args)
template<typename Fn, typename... Args>
requires requires { forApiVersions<RPC::kApiMinimumSupportedVersion, RPC::kApiMaximumValidVersion>( fn, std::forward<Args>(args)...); }
void forAllApiVersions (Fn const &fn, Args &&... args)
BadAsset const & badAsset ()
json::Value toJson (Asset const &asset)
constexpr bool operator== (Asset const &lhs, Asset const &rhs)
constexpr std::weak_ordering operator<=> (Asset const &lhs, Asset const &rhs)
constexpr bool operator== (Currency const &lhs, Asset const &rhs)
constexpr bool operator== (BadAsset const &lhs, Asset const &rhs)
constexpr bool equalTokens (Asset const &lhs, Asset const &rhs)
bool isXRP (Asset const &asset)
std::string to_string (Asset const &asset)
bool validJSONAsset (json::Value const &jv)
Asset assetFromJson (json::Value const &jv)
bool isConsistent (Asset const &asset)
bool validAsset (Asset const &asset)
template<class Hasher>
void hash_append (Hasher &h, Asset const &r)
std::ostreamoperator<< (std::ostream &os, Asset const &x)
void serializeBatch (Serializer &msg, std::uint32_t const &flags, std::vector< uint256 > const &txids)
bool isConsistent (Book const &book)
std::string to_string (Book const &book)
std::ostreamoperator<< (std::ostream &os, Book const &x)
template<class Hasher>
void hash_append (Hasher &h, Book const &b)
Book reversed (Book const &book)
void incrementConfidentialVersion (STObject &mptoken)
 Increments the confidential balance version counter on an MPToken.
uint256 getSendContextHash (AccountID const &account, uint192 const &issuanceID, std::uint32_t sequence, AccountID const &destination, std::uint32_t version)
 Generates the context hash for ConfidentialMPTSend transactions.
uint256 getClawbackContextHash (AccountID const &account, uint192 const &issuanceID, std::uint32_t sequence, AccountID const &holder)
 Generates the context hash for ConfidentialMPTClawback transactions.
uint256 getConvertContextHash (AccountID const &account, uint192 const &issuanceID, std::uint32_t sequence)
 Generates the context hash for ConfidentialMPTConvert transactions.
uint256 getConvertBackContextHash (AccountID const &account, uint192 const &issuanceID, std::uint32_t sequence, std::uint32_t version)
 Generates the context hash for ConfidentialMPTConvertBack transactions.
std::optional< EcPairmakeEcPair (Slice const &buffer)
 Parses an ElGamal ciphertext into two secp256k1 public key components.
std::optional< BufferserializeEcPair (EcPair const &pair)
 Serializes an EcPair into compressed form.
bool isValidCiphertext (Slice const &buffer)
 Verifies that a buffer contains two valid, parsable EC public keys.
bool isValidCompressedECPoint (Slice const &buffer)
 Verifies that a buffer contains a valid, parsable compressed EC point.
std::optional< BufferhomomorphicAdd (Slice const &a, Slice const &b)
 Homomorphically adds two ElGamal ciphertexts.
std::optional< BufferhomomorphicSubtract (Slice const &a, Slice const &b)
 Homomorphically subtracts two ElGamal ciphertexts.
std::optional< BufferrerandomizeCiphertext (Slice const &ciphertext, Slice const &pubKeySlice, Slice const &randomness)
 Re-randomizes an ElGamal ciphertext without changing its plaintext.
std::optional< BufferencryptAmount (uint64_t const amt, Slice const &pubKeySlice, Slice const &blindingFactor)
 Encrypts an amount using ElGamal encryption.
std::optional< BufferencryptCanonicalZeroAmount (Slice const &pubKeySlice, AccountID const &account, MPTID const &mptId)
 Generates the canonical zero encryption for a specific MPToken.
TER verifySchnorrProof (Slice const &pubKeySlice, Slice const &proofSlice, uint256 const &contextHash)
 Verifies a Schnorr proof of knowledge of an ElGamal private key.
NotTEC checkEncryptedAmountFormat (STObject const &object)
 Validates the format of encrypted amount fields in a transaction.
TER verifyRevealedAmount (uint64_t const amount, Slice const &blindingFactor, ConfidentialRecipient const &holder, ConfidentialRecipient const &issuer, std::optional< ConfidentialRecipient > const &auditor)
 Verifies revealed amount encryptions for all recipients.
constexpr uint8_t getConfidentialRecipientCount (bool hasAuditor)
 Returns the number of recipients in a confidential transfer.
TER verifyClawbackProof (uint64_t const amount, Slice const &proof, Slice const &pubKeySlice, Slice const &ciphertext, uint256 const &contextHash)
 Verifies a compact sigma clawback proof.
Buffer generateBlindingFactor ()
 Generates a cryptographically secure blinding factor (size=xrpl::kEcBlindingFactorLength).
TER verifySendProof (Slice const &proof, ConfidentialRecipient const &sender, ConfidentialRecipient const &destination, ConfidentialRecipient const &issuer, std::optional< ConfidentialRecipient > const &auditor, Slice const &spendingBalance, Slice const &amountCommitment, Slice const &balanceCommitment, uint256 const &contextHash)
 Verifies all zero-knowledge proofs for a ConfidentialMPTSend transaction.
TER verifyConvertBackProof (Slice const &proof, Slice const &pubKeySlice, Slice const &spendingBalance, Slice const &balanceCommitment, uint64_t amount, uint256 const &contextHash)
 Verifies all zero-knowledge proofs for a ConfidentialMPTConvertBack transaction.
template<class = void>
secp256k1_context const * secp256k1Context ()
xrpl::detail::TokenCodecErrcCategory const & tokenCodecErrcCategory ()
std::error_code make_error_code (xrpl::TokenCodecErrc e)
template<class... Args>
sha512_half_hasher::result_type sha512Half (Args const &... args)
 Returns the SHA512-Half of a series of objects.
template<class... Args>
sha512_half_hasher_s::result_type sha512HalfS (Args const &... args)
 Returns the SHA512-Half of a series of objects.
std::string rpcErrorString (json::Value const &jv)
 Returns a single string with the contents of an RPC error.
consteval auto validFeatureNameSize (auto fn) -> bool
consteval auto validFeatureName (auto fn) -> bool
std::map< std::string, AmendmentSupport > const & allAmendments ()
 All amendments libxrpl knows about.
std::optional< uint256getRegisteredFeature (std::string const &name)
size_t featureToBitsetIndex (uint256 const &f)
uint256 bitsetIndexToFeature (size_t i)
std::string featureToName (uint256 const &f)
template<class F>
void foreachFeature (FeatureBitset bs, F &&f)
template<class Hasher>
void hash_append (Hasher &h, HashPrefix const &hp) noexcept
uint256 getBookBase (Book const &book)
uint256 getQualityNext (uint256 const &uBase)
std::uint64_t getQuality (uint256 const &uBase)
uint256 getTicketIndex (AccountID const &account, std::uint32_t uSequence)
uint256 getTicketIndex (AccountID const &account, SeqProxy ticketSeq)
MPTID makeMptID (std::uint32_t sequence, AccountID const &account)
std::string to_string (IOUAmount const &amount)
IOUAmount mulRatio (IOUAmount const &amt, std::uint32_t num, std::uint32_t den, bool roundUp)
bool isConsistent (Issue const &ac)
std::string to_string (Issue const &ac)
json::Value toJson (Issue const &is)
Issue issueFromJson (json::Value const &v)
std::ostreamoperator<< (std::ostream &os, Issue const &x)
template<class Hasher>
void hash_append (Hasher &h, Issue const &r)
Issue const & xrpIssue ()
 Returns an asset specifier that represents XRP.
Issue const & noIssue ()
 Returns an asset specifier that represents no account and currency.
bool isXRP (Issue const &issue)
std::optional< KeyTypekeyTypeFromString (std::string const &s)
char const * to_string (KeyType type)
template<class Stream>
Stream & operator<< (Stream &s, KeyType type)
std::vector< std::pair< std::string, LedgerFlagMap > > const & getAllLedgerFlags ()
bool getCloseAgree (LedgerHeader const &info)
void addRaw (LedgerHeader const &, Serializer &, bool includeHash=false)
LedgerHeader deserializeHeader (Slice data, bool hasHash=false)
 Deserialize a ledger header from a byte array.
LedgerHeader deserializePrefixedHeader (Slice data, bool hasHash=false)
 Deserialize a ledger header (prefixed with 4 bytes) from a byte array.
uint256 calculateLedgerHash (LedgerHeader const &info)
 Calculate the hash of a ledger header.
template<class Char, class Traits>
std::basic_ostream< Char, Traits > & operator<< (std::basic_ostream< Char, Traits > &os, MPTAmount const &q)
std::string to_string (MPTAmount const &amount)
MPTAmount mulRatio (MPTAmount const &amt, std::uint32_t num, std::uint32_t den, bool roundUp)
constexpr bool operator== (MPTIssue const &lhs, MPTIssue const &rhs)
constexpr std::weak_ordering operator<=> (MPTIssue const &lhs, MPTIssue const &rhs)
bool isXRP (MPTID const &)
 MPT is a non-native token.
AccountID getMPTIssuer (MPTID const &mptid)
AccountID const & getMPTIssuer (MPTID const &&)=delete
AccountID const & getMPTIssuer (MPTID &&)=delete
MPTID noMPT ()
MPTID badMPT ()
template<class Hasher>
void hash_append (Hasher &h, MPTIssue const &r)
json::Value toJson (MPTIssue const &mptIssue)
std::string to_string (MPTIssue const &mptIssue)
MPTIssue mptIssueFromJson (json::Value const &jv)
std::ostreamoperator<< (std::ostream &os, MPTIssue const &x)
constexpr bool operator== (PathAsset const &lhs, PathAsset const &rhs)
template<typename Hasher>
void hash_append (Hasher &h, PathAsset const &pathAsset)
bool isXRP (PathAsset const &asset)
std::string to_string (PathAsset const &asset)
std::ostreamoperator<< (std::ostream &os, PathAsset const &x)
void serializePayChanAuthorization (Serializer &msg, uint256 const &key, XRPAmount const &amt)
constexpr Bips32 kBipsPerUnity (100 *100)
 There are 10,000 basis points (bips) in 100%.
constexpr TenthBips32 kTenthBipsPerUnity (kBipsPerUnity.value() *10)
constexpr Bips32 percentageToBips (std::uint32_t percentage)
constexpr TenthBips32 percentageToTenthBips (std::uint32_t percentage)
template<typename T, class TBips>
constexpr T bipsOfValue (T value, Bips< TBips > bips)
template<typename T, class TBips>
constexpr T tenthBipsOfValue (T value, TenthBips< TBips > bips)
bool isVotingLedger (LedgerIndex seq)
 Returns true if the given ledgerIndex is a voting ledgerIndex.
bool isFlagLedger (LedgerIndex seq)
 Returns true if the given ledgerIndex is a flag ledgerIndex.
std::ostreamoperator<< (std::ostream &os, PublicKey const &pk)
 Print the public key to a stream.
bool operator== (PublicKey const &lhs, PublicKey const &rhs)
bool operator< (PublicKey const &lhs, PublicKey const &rhs)
template<class Hasher>
void hash_append (Hasher &h, PublicKey const &pk)
std::string toBase58 (TokenType type, PublicKey const &pk)
template<>
std::optional< PublicKeyparseBase58 (TokenType type, std::string const &s)
std::optional< ECDSACanonicalityecdsaCanonicality (Slice const &sig)
 Determines the canonicality of a signature.
bool verifyDigest (PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
 Verify a secp256k1 signature on the digest of a message.
bool verify (PublicKey const &publicKey, Slice const &m, Slice const &sig) noexcept
 Verify a signature on a message.
NodeID calcNodeID (PublicKey const &)
 Calculate the 160-bit node ID from a node public key.
AccountID calcAccountID (PublicKey const &pk)
std::string getFingerprint (beast::IP::Endpoint const &address, std::optional< PublicKey > const &publicKey=std::nullopt, std::optional< std::string > const &id=std::nullopt)
template<class In, class Out>
bool operator== (TAmounts< In, Out > const &lhs, TAmounts< In, Out > const &rhs) noexcept
template<class In, class Out>
bool operator!= (TAmounts< In, Out > const &lhs, TAmounts< In, Out > const &rhs) noexcept
Quality composedQuality (Quality const &lhs, Quality const &rhs)
 Calculate the quality of a two-hop path given the two hops.
bool operator== (Rate const &lhs, Rate const &rhs) noexcept
bool operator< (Rate const &lhs, Rate const &rhs) noexcept
std::ostreamoperator<< (std::ostream &os, Rate const &rate)
STAmount multiply (STAmount const &amount, Rate const &rate)
STAmount multiplyRound (STAmount const &amount, Rate const &rate, bool roundUp)
STAmount multiplyRound (STAmount const &amount, Rate const &rate, Asset const &asset, bool roundUp)
STAmount divide (STAmount const &amount, Rate const &rate)
STAmount divideRound (STAmount const &amount, Rate const &rate, bool roundUp)
STAmount divideRound (STAmount const &amount, Rate const &rate, Asset const &asset, bool roundUp)
bool isRpcError (json::Value jvResult)
json::Value rpcError (ErrorCodeI iError)
bool isFeatureEnabled (uint256 const &feature, bool resultIfNoRules)
 Check whether a feature is enabled in the current ledger rules.
bool isFeatureEnabled (uint256 const &feature)
 Check whether a feature is enabled in the current ledger rules.
std::optional< Rules > const & getCurrentTransactionRules ()
void setCurrentTransactionRules (std::optional< Rules > r)
bool useRulesGuards (Rules const &rules)
void createGuards (Rules const &rules, std::optional< CurrentTransactionRulesGuard > &rulesGuard, std::optional< NumberMantissaScaleGuard > &mantissaScaleGuard)
bool operator== (SecretKey const &lhs, SecretKey const &rhs)=delete
bool operator!= (SecretKey const &lhs, SecretKey const &rhs)=delete
template<>
std::optional< SecretKeyparseBase58 (TokenType type, std::string const &s)
 Parse a secret key.
std::string toBase58 (TokenType type, SecretKey const &sk)
SecretKey randomSecretKey ()
 Create a secret key using secure random numbers.
SecretKey generateSecretKey (KeyType type, Seed const &seed)
 Generate a new secret key deterministically.
PublicKey derivePublicKey (KeyType type, SecretKey const &sk)
 Derive the public key from a secret key.
std::pair< PublicKey, SecretKeygenerateKeyPair (KeyType type, Seed const &seed)
 Generate a key pair deterministically.
std::pair< PublicKey, SecretKeyrandomKeyPair (KeyType type)
 Create a key pair using secure random numbers.
Seed randomSeed ()
 Create a seed using secure random numbers.
Seed generateSeed (std::string const &passPhrase)
 Generate a seed deterministically.
template<>
std::optional< SeedparseBase58 (std::string const &s)
 Parse a Base58 encoded string into a seed.
std::optional< SeedparseGenericSeed (std::string const &str, bool rfc1751=true)
 Attempt to parse a string as a seed.
std::string seedAs1751 (Seed const &seed)
 Encode a Seed in RFC1751 format.
std::string toBase58 (Seed const &seed)
 Format a seed as a Base58 string.
template<class Object>
Blob serializeBlob (Object const &o)
 Serialize an object to a blob.
std::string serializeHex (STObject const &o)
 Serialize an object to a hex string.
int fieldCode (SerializedTypeID id, int index)
int fieldCode (int id, int index)
template<class T>
OptionaledField< T > operator~ (TypedField< T > const &f)
void sign (STObject &st, HashPrefix const &prefix, KeyType type, SecretKey const &sk, SF_VL const &sigField=sfSignature)
 Sign an STObject.
bool verify (STObject const &st, HashPrefix const &prefix, PublicKey const &pk, SF_VL const &sigField=sfSignature)
 Returns true if STObject contains valid signature.
Serializer buildMultiSigningData (STObject const &obj, AccountID const &signingID)
 Return a Serializer suitable for computing a multisigning TxnSignature.
Serializer startMultiSigningData (STObject const &obj)
 Break the multi-signing hash computation into 2 parts for optimization.
void finishMultiSigningData (AccountID const &signingID, Serializer &s)
bool operator== (STAccount const &lhs, STAccount const &rhs)
auto operator< (STAccount const &lhs, STAccount const &rhs)
bool operator== (STAccount const &lhs, AccountID const &rhs)
auto operator< (STAccount const &lhs, AccountID const &rhs)
auto operator< (AccountID const &lhs, STAccount const &rhs)
STAmount amountFromQuality (std::uint64_t rate)
STAmount amountFromString (Asset const &asset, std::string const &amount)
STAmount amountFromJson (SField const &name, json::Value const &v)
bool amountFromJsonNoThrow (STAmount &result, json::Value const &jvSource)
STAmount const & toSTAmount (STAmount const &a)
bool isLegalNet (STAmount const &value)
bool isLegalMPT (STAmount const &value)
bool hasInvalidAmount (STBase const &field, beast::Journal j)
bool operator== (STAmount const &lhs, STAmount const &rhs)
bool operator< (STAmount const &lhs, STAmount const &rhs)
bool operator!= (STAmount const &lhs, STAmount const &rhs)
bool operator> (STAmount const &lhs, STAmount const &rhs)
bool operator<= (STAmount const &lhs, STAmount const &rhs)
bool operator>= (STAmount const &lhs, STAmount const &rhs)
STAmount operator- (STAmount const &value)
STAmount operator+ (STAmount const &v1, STAmount const &v2)
STAmount operator- (STAmount const &v1, STAmount const &v2)
STAmount divide (STAmount const &v1, STAmount const &v2, Asset const &asset)
STAmount multiply (STAmount const &v1, STAmount const &v2, Asset const &asset)
STAmount mulRound (STAmount const &v1, STAmount const &v2, Asset const &asset, bool roundUp)
STAmount mulRoundStrict (STAmount const &v1, STAmount const &v2, Asset const &asset, bool roundUp)
STAmount divRound (STAmount const &v1, STAmount const &v2, Asset const &asset, bool roundUp)
STAmount divRoundStrict (STAmount const &v1, STAmount const &v2, Asset const &asset, bool roundUp)
std::uint64_t getRate (STAmount const &offerOut, STAmount const &offerIn)
STAmount roundToScale (STAmount const &value, std::int32_t scale, Number::RoundingMode rounding=Number::getround())
 Round an arbitrary precision Amount to the precision of an STAmount that has a given exponent.
template<AssetType A>
void roundToAsset (A const &asset, Number &value)
 Round an arbitrary precision Number IN PLACE to the precision of a given Asset.
template<AssetType A>
Number roundToAsset (A const &asset, Number const &value, std::int32_t scale, Number::RoundingMode rounding=Number::getround())
 Round an arbitrary precision Number to the precision of a given Asset.
bool isXRP (STAmount const &amount)
bool canAdd (STAmount const &a, STAmount const &b)
 Safely checks if two STAmount values can be added without overflow, underflow, or precision loss.
bool canSubtract (STAmount const &a, STAmount const &b)
 Determines if it is safe to subtract one STAmount from another.
int scale (Number const &number, Asset const &asset)
 Get the scale of a Number for a given asset.
template<typename T>
json::Value toJson (T const &t)
std::ostreamoperator<< (std::ostream &out, STBase const &t)
STCurrency currencyFromJson (SField const &name, json::Value const &v)
bool operator== (STCurrency const &lhs, STCurrency const &rhs)
bool operator!= (STCurrency const &lhs, STCurrency const &rhs)
bool operator< (STCurrency const &lhs, STCurrency const &rhs)
bool operator== (STCurrency const &lhs, Currency const &rhs)
bool operator< (STCurrency const &lhs, Currency const &rhs)
template<class U, class T>
void set (STObject &st, TypedField< U > const &f, T &&t)
 Set a field value in an STObject.
template<class Init>
void set (STObject &st, TypedField< STBlob > const &f, std::size_t size, Init &&init)
 Set a blob field using an init function.
template<class = void>
void set (STObject &st, TypedField< STBlob > const &f, void const *data, std::size_t size)
 Set a blob field from data.
template<class U>
void erase (STObject &st, TypedField< U > const &f)
 Remove a field in an STObject.
STIssue issueFromJson (SField const &name, json::Value const &v)
constexpr bool operator== (STIssue const &lhs, STIssue const &rhs)
constexpr std::weak_ordering operator<=> (STIssue const &lhs, STIssue const &rhs)
constexpr bool operator== (STIssue const &lhs, Asset const &rhs)
constexpr std::weak_ordering operator<=> (STIssue const &lhs, Asset const &rhs)
std::ostreamoperator<< (std::ostream &out, STNumber const &rhs)
NumberParts partsFromString (std::string const &number)
STNumber numberFromJson (SField const &field, json::Value const &value)
void throwFieldNotFound (SField const &field)
void associateAsset (STLedgerEntry &sle, Asset const &asset)
 Associate an Asset with all sMD_NeedsAsset fields in a ledger entry.
bool passesLocalChecks (STObject const &st, std::string &)
std::shared_ptr< STTx const > sterilize (STTx const &stx)
 Sterilize a transaction.
bool isPseudoTx (STObject const &tx)
 Check whether a transaction is a pseudo-transaction.
bool operator== (STXChainBridge const &lhs, STXChainBridge const &rhs)
bool operator< (STXChainBridge const &lhs, STXChainBridge const &rhs)
static std::string const & systemName ()
bool isLegalAmount (XRPAmount const &amount)
 Returns true if the amount does not exceed the initial XRP in existence.
bool isLegalAmountSigned (XRPAmount const &amount)
 Returns true if the absolute value of the amount does not exceed the initial XRP in existence.
static std::string const & systemCurrencyCode ()
constexpr TERUnderlyingType TERtoInt (TELcodes v)
constexpr TERUnderlyingType TERtoInt (TEMcodes v)
constexpr TERUnderlyingType TERtoInt (TEFcodes v)
constexpr TERUnderlyingType TERtoInt (TERcodes v)
constexpr TERUnderlyingType TERtoInt (TEScodes v)
constexpr TERUnderlyingType TERtoInt (TECcodes v)
template<typename L, typename R>
constexpr auto operator== (L const &lhs, R const &rhs) -> std::enable_if_t< std::is_same_v< decltype(TERtoInt(lhs)), int > &&std::is_same_v< decltype(TERtoInt(rhs)), int >, bool >
template<typename L, typename R>
constexpr auto operator!= (L const &lhs, R const &rhs) -> std::enable_if_t< std::is_same_v< decltype(TERtoInt(lhs)), int > &&std::is_same_v< decltype(TERtoInt(rhs)), int >, bool >
template<typename L, typename R>
constexpr auto operator< (L const &lhs, R const &rhs) -> std::enable_if_t< std::is_same_v< decltype(TERtoInt(lhs)), int > &&std::is_same_v< decltype(TERtoInt(rhs)), int >, bool >
template<typename L, typename R>
constexpr auto operator<= (L const &lhs, R const &rhs) -> std::enable_if_t< std::is_same_v< decltype(TERtoInt(lhs)), int > &&std::is_same_v< decltype(TERtoInt(rhs)), int >, bool >
template<typename L, typename R>
constexpr auto operator> (L const &lhs, R const &rhs) -> std::enable_if_t< std::is_same_v< decltype(TERtoInt(lhs)), int > &&std::is_same_v< decltype(TERtoInt(rhs)), int >, bool >
template<typename L, typename R>
constexpr auto operator>= (L const &lhs, R const &rhs) -> std::enable_if_t< std::is_same_v< decltype(TERtoInt(lhs)), int > &&std::is_same_v< decltype(TERtoInt(rhs)), int >, bool >
bool isTelLocal (TER x) noexcept
bool isTemMalformed (TER x) noexcept
bool isTefFailure (TER x) noexcept
bool isTerRetry (TER x) noexcept
bool isTesSuccess (TER x) noexcept
bool isTecClaim (TER x) noexcept
std::unordered_map< TERUnderlyingType, std::pair< char const *const, char const *const > > const & transResults ()
bool transResultInfo (TER code, std::string &token, std::string &text)
std::string transToken (TER code)
std::string transHuman (TER code)
std::optional< TERtransCode (std::string const &token)
template<class T>
std::optional< T > parseBase58 (std::string const &s)
template<class T>
std::optional< T > parseBase58 (TokenType type, std::string const &s)
std::string encodeBase58Token (TokenType type, void const *token, std::size_t size)
 Encode data in Base58Check format using XRPL alphabet.
std::string decodeBase58Token (std::string const &s, TokenType type)
FlagMap const & getUniversalFlags ()
FlagMapPairList const & getAllTxFlags ()
std::map< std::string, FlagValue > const & getAsfFlagMap ()
Currency const & xrpCurrency ()
 XRP currency.
Currency const & noCurrency ()
 A placeholder for empty currencies.
Currency const & badCurrency ()
 We deliberately disallow the currency that looks like "XRP" because too many people were using it instead of the correct XRP currency.
bool isXRP (Currency const &c)
std::string to_string (Currency const &c)
 Returns "", "XRP", or three letter ISO code.
bool toCurrency (Currency &, std::string const &)
 Tries to convert a string to a Currency, returns true on success.
Currency toCurrency (std::string const &)
 Tries to convert a string to a Currency, returns noCurrency() on failure.
std::ostreamoperator<< (std::ostream &os, Currency const &x)
template<class Source1, class Source2, unit::muldivable< Source1, Source2 > Dest>
std::optional< Dest > mulDiv (Source1 value, Dest mul, Source2 div)
template<class Source1, class Source2, unit::muldivCommutable< Source1, Source2 > Dest>
std::optional< Dest > mulDiv (Dest value, Source1 mul, Source2 div)
template<unit::muldivDest Dest>
std::optional< Dest > mulDiv (std::uint64_t value, Dest mul, std::uint64_t div)
template<unit::muldivDest Dest>
std::optional< Dest > mulDiv (Dest value, std::uint64_t mul, std::uint64_t div)
template<unit::muldivSource Source1, unit::muldivSources< Source1 > Source2>
std::optional< std::uint64_tmulDiv (Source1 value, std::uint64_t mul, Source2 div)
template<unit::muldivSource Source1, unit::muldivSources< Source1 > Source2>
std::optional< std::uint64_tmulDiv (std::uint64_t value, Source1 mul, Source2 div)
template<unit::IntegralValue Dest, unit::CastableValue< Dest > Src>
constexpr Dest safeCast (Src s) noexcept
template<unit::IntegralValue Dest, unit::Integral Src>
constexpr Dest safeCast (Src s) noexcept
template<unit::IntegralValue Dest, unit::CastableValue< Dest > Src>
constexpr Dest unsafeCast (Src s) noexcept
template<unit::IntegralValue Dest, unit::Integral Src>
constexpr Dest unsafeCast (Src s) noexcept
template<class TAttestation>
bool operator== (XChainAttestationsBase< TAttestation > const &lhs, XChainAttestationsBase< TAttestation > const &rhs)
template<class Char, class Traits>
std::basic_ostream< Char, Traits > & operator<< (std::basic_ostream< Char, Traits > &os, XRPAmount const &q)
std::string to_string (XRPAmount const &amount)
XRPAmount mulRatio (XRPAmount const &amt, std::uint32_t num, std::uint32_t den, bool roundUp)
std::shared_ptr< CheckpointercheckpointerFromId (std::uintptr_t id)
template<typename T, typename C>
requires (std::is_arithmetic_v<T> && std::is_arithmetic_v<C> && std::convertible_to<C, T>)
rangeCheckedCast (C c)
void open (soci::session &s, BasicConfig const &config, std::string const &dbName)
 Open a soci session.
void open (soci::session &s, std::string const &beName, std::string const &connectionString)
 Open a soci session.
std::uint32_t getKBUsedAll (soci::session &s)
std::uint32_t getKBUsedDB (soci::session &s)
void convert (soci::blob &from, std::vector< std::uint8_t > &to)
void convert (soci::blob &from, std::string &to)
void convert (std::vector< std::uint8_t > const &from, soci::blob &to)
void convert (std::string const &from, soci::blob &to)
std::shared_ptr< CheckpointermakeCheckpointer (std::uintptr_t id, std::weak_ptr< soci::session >, JobQueue &, ServiceRegistry &)
 Returns a new checkpointer which makes checkpoints of a soci database every checkpointPageCount pages, using a job on the job queue.
void httpReply (int nStatus, std::string const &strMsg, json::Output const &, beast::Journal j)
template<class T>
decltype(auto) getLowestLayer (T &t) noexcept
XRPAmount scaleFeeLoad (XRPAmount fee, LoadFeeTrack const &feeTrack, Fees const &fees, bool bUnlimited)
std::string to_string (Manifest const &m)
 Format the specified manifest to a string for debugging purposes.
bool operator== (Manifest const &lhs, Manifest const &rhs)
bool operator!= (Manifest const &lhs, Manifest const &rhs)
std::optional< ValidatorTokenloadValidatorToken (std::vector< std::string > const &blob, beast::Journal journal=beast::Journal(beast::Journal::getNullSink()))
std::string to_string (ManifestDisposition m)
std::ostreamoperator<< (std::ostream &os, Port const &p)
void parsePort (ParsedPort &port, Section const &section, std::ostream &log)
template<class Handler>
std::unique_ptr< ServermakeServer (Handler &handler, boost::asio::io_context &ioContext, beast::Journal journal)
 Create the HTTP server using the specified handler.
void initStateDB (soci::session &session, BasicConfig const &config, std::string const &dbName)
 initStateDB Opens a session with the State database.
LedgerIndex getCanDelete (soci::session &session)
 getCanDelete Returns the ledger sequence which can be deleted.
LedgerIndex setCanDelete (soci::session &session, LedgerIndex canDelete)
 setCanDelete Updates the ledger sequence which can be deleted.
SavedState getSavedState (soci::session &session)
 getSavedState Returns the saved state.
void setSavedState (soci::session &session, SavedState const &state)
 setSavedState Saves the given state.
void setLastRotated (soci::session &session, LedgerIndex seq)
 setLastRotated Updates the last rotated ledger sequence.
bool doVacuumDB (DatabaseCon::Setup const &setup, beast::Journal j)
 doVacuumDB Creates, initialises, and performs cleanup on a database.
std::unique_ptr< DatabaseConmakeWalletDB (DatabaseCon::Setup const &setup, beast::Journal j)
 makeWalletDB Opens the wallet database and returns it.
std::unique_ptr< DatabaseConmakeTestWalletDB (DatabaseCon::Setup const &setup, std::string const &dbname, beast::Journal j)
 makeTestWalletDB Opens a test wallet database with an arbitrary name.
void getManifests (soci::session &session, std::string const &dbTable, ManifestCache &cache, beast::Journal j)
 getManifests Loads a manifest from the wallet database and stores it in the cache.
void saveManifests (soci::session &session, std::string const &dbTable, std::function< bool(PublicKey const &)> const &isTrusted, hash_map< PublicKey, Manifest > const &map, beast::Journal j)
 saveManifests Saves all given manifests to the database.
void addValidatorManifest (soci::session &session, std::string const &serialized)
 addValidatorManifest Saves the manifest of a validator to the database.
void clearNodeIdentity (soci::session &session)
 Delete any saved public/private key associated with this node.
std::pair< PublicKey, SecretKeygetNodeIdentity (soci::session &session)
 Returns a stable public and private key for this node.
std::unordered_set< PeerReservation, beast::Uhash<>, KeyEqual > getPeerReservationTable (soci::session &session, beast::Journal j)
 getPeerReservationTable Returns the peer reservation table.
void insertPeerReservation (soci::session &session, PublicKey const &nodeId, std::string const &description)
 insertPeerReservation Adds an entry to the peer reservation table.
void deletePeerReservation (soci::session &session, PublicKey const &nodeId)
 deletePeerReservation Deletes an entry from the peer reservation table.
bool createFeatureVotes (soci::session &session)
 createFeatureVotes Creates the FeatureVote table if it does not exist.
void readAmendments (soci::session &session, std::function< void(boost::optional< std::string > amendmentHash, boost::optional< std::string > amendmentName, boost::optional< AmendmentVote > vote)> const &callback)
 readAmendments Reads all amendments from the FeatureVotes table.
void voteAmendment (soci::session &session, uint256 const &amendment, std::string const &name, AmendmentVote vote)
 voteAmendment Set the veto value for a particular amendment.
int popcnt16 (std::uint16_t a)
bool operator== (SHAMap::ConstIterator const &x, SHAMap::ConstIterator const &y)
bool operator!= (SHAMap::ConstIterator const &x, SHAMap::ConstIterator const &y)
void intrusive_ptr_add_ref (SHAMapItem const *x)
void intrusive_ptr_release (SHAMapItem const *x)
boost::intrusive_ptr< SHAMapItemmakeShamapitem (uint256 const &tag, Slice data)
boost::intrusive_ptr< SHAMapItemmakeShamapitem (SHAMapItem const &other)
std::string to_string (SHAMapType t)
std::string to_string (SHAMapNodeID const &node)
std::ostreamoperator<< (std::ostream &out, SHAMapNodeID const &node)
unsigned int selectBranch (SHAMapNodeID const &id, uint256 const &hash)
 Returns the branch that would contain the given hash.
std::pair< Validity, std::stringcheckValidity (HashRouter &router, STTx const &tx, Rules const &rules)
 Checks transaction signature and local checks.
void forceValidity (HashRouter &router, uint256 const &txid, Validity validity)
 Sets the validity of a given transaction in the cache.
ApplyResult apply (ServiceRegistry &registry, OpenView &view, STTx const &tx, ApplyFlags flags, beast::Journal journal)
 Apply a transaction to an OpenView.
ApplyTransactionResult applyTransaction (ServiceRegistry &registry, OpenView &view, STTx const &tx, bool retryAssured, ApplyFlags flags, beast::Journal journal)
 Transaction application helper.
bool isTecClaimHardFail (TER ter, ApplyFlags flags)
 Return true if the transaction can claim a fee (tec), and the ApplyFlags do not allow soft failures.
PreclaimResult preclaim (PreflightResult const &preflightResult, ServiceRegistry &registry, OpenView const &view)
 Gate a transaction based on static ledger information.
XRPAmount calculateBaseFee (ReadView const &view, STTx const &tx)
 Compute only the expected base fee for a transaction.
XRPAmount calculateDefaultBaseFee (ReadView const &view, STTx const &tx)
 Return the minimum fee that an "ordinary" transaction would pay.
ApplyResult doApply (PreclaimResult const &preclaimResult, ServiceRegistry &registry, OpenView &view)
 Apply a prechecked transaction to an OpenView.
InvariantChecks getInvariantChecks ()
 get a tuple of all invariant checks
constexpr Privilege operator| (Privilege lhs, Privilege rhs)
bool hasPrivilege (STTx const &tx, Privilege priv)
template<StepAmount T>
T const & get (EitherAmount const &amt)
template<class T>
void setUnion (boost::container::flat_set< T > &dst, boost::container::flat_set< T > const &src)
 Given two flat sets dst and src, compute dst = dst union src.
TER checkFreeze (ReadView const &view, AccountID const &src, AccountID const &dst, Currency const &currency)
TER checkNoRipple (ReadView const &view, AccountID const &prev, AccountID const &cur, AccountID const &next, Currency const &currency, beast::Journal j)
bool redeems (DebtDirection dir)
bool issues (DebtDirection dir)
std::pair< TER, STPathnormalizePath (AccountID const &src, AccountID const &dst, Asset const &deliver, std::optional< Asset > const &sendMaxAsset, STPath const &path)
std::pair< TER, Strand > toStrand (ReadView const &sb, AccountID const &src, AccountID const &dst, Asset const &deliver, std::optional< Quality > const &limitQuality, std::optional< Asset > const &sendMaxAsset, STPath const &path, bool ownerPaysTransferFee, OfferCrossing offerCrossing, AMMContext &ammContext, std::optional< uint256 > const &domainID, beast::Journal j)
 Create a Strand for the specified path.
std::pair< TER, std::vector< Strand > > toStrands (ReadView const &sb, AccountID const &src, AccountID const &dst, Asset const &deliver, std::optional< Quality > const &limitQuality, std::optional< Asset > const &sendMax, STPathSet const &paths, bool addDefaultPath, bool ownerPaysTransferFee, OfferCrossing offerCrossing, AMMContext &ammContext, std::optional< uint256 > const &domainID, beast::Journal j)
 Create a Strand for each specified path (including the default path, if indicated).
template<class TInAmt, class TOutAmt>
StrandResult< TInAmt, TOutAmt > flow (PaymentSandbox const &baseView, Strand const &strand, std::optional< TInAmt > const &maxIn, TOutAmt const &out, beast::Journal j)
 Request out amount from a strand.
template<StepAmount TInAmt, StepAmount TOutAmt>
FlowResult< TInAmt, TOutAmt > flow (PaymentSandbox const &baseView, std::vector< Strand > const &strands, TOutAmt const &outReq, bool partialPayment, OfferCrossing offerCrossing, std::optional< Quality > const &limitQuality, std::optional< STAmount > const &sendMaxST, beast::Journal j, AMMContext &ammContext, path::detail::FlowDebugInfo *flowDebugInfo=nullptr)
 Request out amount from a collection of strands.
path::RippleCalc::Output flow (PaymentSandbox &view, STAmount const &deliver, AccountID const &src, AccountID const &dst, STPathSet const &paths, bool defaultPaths, bool partialPayment, bool ownerPaysTransferFee, OfferCrossing offerCrossing, std::optional< Quality > const &limitQuality, std::optional< STAmount > const &sendMax, std::optional< uint256 > const &domainID, beast::Journal j, path::detail::FlowDebugInfo *flowDebugInfo=nullptr)
 Make a payment from the src account to the dst account.
template<StepAmount TIn, StepAmount TOut>
std::ostreamoperator<< (std::ostream &os, TOffer< TIn, TOut > const &offer)
NotTEC preflight0 (PreflightContext const &ctx, std::uint32_t flagMask)
 Performs early sanity checks on the txid and flags.
static DebugSinkdebugSink ()
static unsigned divu10 (uint128_t &u)
template<class T>
void doNormalize (bool &negative, T &mantissa, int &exponent, MantissaRange::rep const &minMantissa, MantissaRange::rep const &maxMantissa, MantissaRange::CuspRoundingFix cuspRoundingFixEnabled, bool dropped)
std::ostreamoperator<< (std::ostream &os, Section const &section)
std::ostreamoperator<< (std::ostream &ss, BasicConfig const &c)
bool operator< (CanonicalTXSet::Key const &lhs, CanonicalTXSet::Key const &rhs)
static std::uint32_t confineOwnerCount (std::uint32_t current, std::int32_t adjustment, std::optional< AccountID > const &id=std::nullopt, beast::Journal j=beast::Journal{beast::Journal::getNullSink()})
static TER deleteAMMTrustLines (Sandbox &sb, AccountID const &ammAccountID, std::uint16_t maxTrustlinesToDelete, beast::Journal j)
static TER deleteAMMMPTokens (Sandbox &sb, AccountID const &ammAccountID, beast::Journal j)
TER checkDepositPreauth (STTx const &tx, ReadView const &view, AccountID const &src, AccountID const &dst, SLE::const_ref sleDst, beast::Journal j)
bool isChannelExpired (ApplyView const &view, std::optional< uint32_t > timeField)
static bool updateTrustLine (ApplyView &view, SLE::pointer state, bool bSenderHigh, AccountID const &sender, STAmount const &before, STAmount const &after, beast::Journal j)
static SLE::const_pointer getLineIfUsable (ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
static STAmount getTrustLineBalance (ReadView const &view, SLE::const_ref sle, AccountID const &account, Currency const &currency, AccountID const &issuer, bool includeOppositeLimit, beast::Journal j)
TER canAddHolding (ReadView const &view, Issue const &issue)
static TER directSendNoFeeIOU (ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
static TER directSendNoLimitIOU (ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, STAmount &saActual, beast::Journal j, WaiveTransferFee waiveFee)
static TER directSendNoLimitMultiIOU (ApplyView &view, AccountID const &senderID, Issue const &issue, MultiplePaymentDestinations const &receivers, STAmount &actual, beast::Journal j, WaiveTransferFee waiveFee)
static TER accountSendIOU (ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
static TER accountSendMultiIOU (ApplyView &view, AccountID const &senderID, Issue const &issue, MultiplePaymentDestinations const &receivers, beast::Journal j, WaiveTransferFee waiveFee)
static TER directSendNoFeeMPT (ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j)
static TER directSendNoLimitMPT (ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, STAmount &saActual, beast::Journal j, WaiveTransferFee waiveFee, AllowMPTOverflow allowOverflow)
static TER directSendNoLimitMultiMPT (ApplyView &view, AccountID const &senderID, MPTIssue const &mptIssue, MultiplePaymentDestinations const &receivers, STAmount &actual, beast::Journal j, WaiveTransferFee waiveFee)
static TER accountSendMPT (ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee, AllowMPTOverflow allowOverflow)
static TER accountSendMultiMPT (ApplyView &view, AccountID const &senderID, MPTIssue const &mptIssue, MultiplePaymentDestinations const &receivers, beast::Journal j, WaiveTransferFee waiveFee)
static TER withdrawToDestExceedsLimit (ReadView const &view, AccountID const &from, AccountID const &to, STAmount const &amount)
TER cleanupOnAccountDelete (ApplyView &view, Keylet const &ownerDirKeylet, EntryDeleter const &deleter, beast::Journal j, std::optional< uint16_t > maxNodesToDelete)
template<>
std::optional< AccountIDparseBase58 (std::string const &s)
 Parse AccountID from checked, base58 string.
std::size_t hash_value (xrpl::uint256 const &feature)
uint256 registerFeature (std::string const &name, Supported support, VoteBehavior vote)
uint256 retireFeature (std::string const &name)
bool registrationIsDone ()
 Tell FeatureCollections when registration is complete.
consteval auto enforceValidFeatureName (auto fn) -> char const *
template<class... Args>
static uint256 indexHash (LedgerNameSpace space, Args const &... args)
template<>
std::optional< PublicKeyparseBase58 (TokenType type, std::string const &s)
 Parse a secret key.
static std::optional< SlicesigPart (Slice &buf)
static std::string sliceToHex (Slice const &slice)
static bool ed25519Canonical (Slice const &sig)
template<STAmount(*)(STAmount const &, STAmount const &, Asset const &, bool) DivRoundFunc>
static Amounts ceilInImpl (Amounts const &amount, STAmount const &limit, bool roundUp, Quality const &quality)
template<STAmount(*)(STAmount const &, STAmount const &, Asset const &, bool) MulRoundFunc>
static Amounts ceilOutImpl (Amounts const &amount, STAmount const &limit, bool roundUp, Quality const &quality)
Rate const kParityRate (QUALITY_ONE)
template<>
std::optional< SecretKeyparseBase58 (TokenType type, std::string const &s)
 Parse a secret key.
template<>
std::optional< SeedparseBase58 (std::string const &s)
 Parse AccountID from checked, base58 string.
SField const sfInvalid (access, -1, "")
SField const sfGeneric (access, 0, "Generic")
static std::int64_t getInt64Value (STAmount const &amount, bool valid, char const *error)
static std::int64_t getSNValue (STAmount const &amount)
static std::int64_t getMPTValue (STAmount const &amount)
static bool areComparable (STAmount const &v1, STAmount const &v2)
static bool hasInvalidAmount (STBase const &field, int depth, beast::Journal j)
static bool hasInvalidAmount (STObject const &object, int depth, beast::Journal j)
static bool hasInvalidAmount (STArray const &array, int depth, beast::Journal j)
static std::uint64_t muldiv (std::uint64_t multiplier, std::uint64_t multiplicand, std::uint64_t divisor)
static std::uint64_t muldivRound (std::uint64_t multiplier, std::uint64_t multiplicand, std::uint64_t divisor, std::uint64_t rounding)
static void canonicalizeRound (bool integral, std::uint64_t &value, int &offset, bool)
static void canonicalizeRoundStrict (bool integral, std::uint64_t &value, int &offset, bool roundUp)
template<void(*)(bool, std::uint64_t &, int &, bool) CanonicalizeFunc, typename MightSaveRound>
static STAmount mulRoundImpl (STAmount const &v1, STAmount const &v2, Asset const &asset, bool roundUp)
template<typename MightSaveRound>
static STAmount divRoundImpl (STAmount const &num, STAmount const &den, Asset const &asset, bool roundUp)
void associateAsset (SLE &sle, Asset const &asset)
static auto getTxFormat (TxType type)
static Blob getSigningData (STTx const &that)
static std::expected< void, std::stringsingleSignHelper (STObject const &sigObject, Slice const &data)
std::expected< void, std::stringmultiSignHelper (STObject const &sigObject, std::optional< AccountID > txnAccountID, std::function< Serializer(AccountID const &)> makeMsg, Rules const &rules)
static bool isMemoOkay (STObject const &st, std::string &reason)
static bool isAccountFieldOkay (STObject const &st)
static bool invalidMPTAmountInTx (STObject const &tx)
static bool isRawTransactionOkay (STObject const &st, std::string &reason)
template<class Hasher>
static Hasher::result_type digest (void const *data, std::size_t size) noexcept
template<class Hasher, class T, std::size_t N, class = std::enable_if_t<sizeof(T) == 1>>
static Hasher::result_type digest (std::array< T, N > const &v)
template<class Hasher, class... Args>
static Hasher::result_type digest2 (Args const &... args)
static void checksum (void *out, void const *message, std::size_t size)
 Calculate a 4-byte checksum of the data.
bool operator== (XChainClaimAttestation const &lhs, XChainClaimAttestation const &rhs)
bool operator== (XChainCreateAccountAttestation const &lhs, XChainCreateAccountAttestation const &rhs)
static sqlite_api::sqlite3 * getConnection (soci::session &s)
std::string getHTTPHeaderTimestamp ()
template<class Stream>
Stream & logMftAct (Stream &s, std::string const &action, PublicKey const &pk, std::uint32_t seq)
template<class Stream>
Stream & logMftAct (Stream &s, std::string const &action, PublicKey const &pk, std::uint32_t seq, std::uint32_t oldSeq)
static void populate (Section const &section, std::string const &field, std::ostream &log, std::vector< boost::asio::ip::network_v4 > &nets4, std::vector< boost::asio::ip::network_v6 > &nets6)
static void saveManifest (soci::session &session, std::string const &dbTable, std::string const &serialized)
intr_ptr::SharedPtr< SHAMapLeafNodemakeTypedLeaf (SHAMapNodeType type, boost::intrusive_ptr< SHAMapItem const > item, std::uint32_t owner)
static uint256 const & depthMask (unsigned int depth)
template<typename PreflightChecks>
ApplyResult apply (ServiceRegistry &registry, OpenView &view, PreflightChecks &&preflightChecks)
ApplyResult apply (ServiceRegistry &registry, OpenView &view, uint256 const &parentBatchId, STTx const &tx, ApplyFlags flags, beast::Journal j)
static bool applyBatchTransactions (ServiceRegistry &registry, OpenView &batchView, STTx const &batchTxn, beast::Journal j)
template<class T>
TxConsequences consequencesHelper (PreflightContext const &ctx)
static std::pair< NotTEC, TxConsequencesinvokePreflight (PreflightContext const &ctx)
static TER invokePreclaim (PreclaimContext const &ctx)
static XRPAmount invokeCalculateBaseFee (ReadView const &view, STTx const &tx)
 Calculates the base fee for a given transaction.
static ApplyResult invokeApply (ApplyContext &ctx)
std::unique_ptr< TransactormakeTransactor (ApplyContext &ctx)
static bool validBalances (STAmount const &amount, STAmount const &amount2, STAmount const &lptAMMBalance, ValidAMM::ZeroAllowed zeroAllowed)
template<class TIn, class TOut, class Offer>
static void limitStepIn (Offer const &offer, TAmounts< TIn, TOut > &ofrAmt, TAmounts< TIn, TOut > &stpAmt, TOut &ownerGives, std::uint32_t transferRateIn, std::uint32_t transferRateOut, TIn const &limit)
template<class TIn, class TOut, class Offer>
static void limitStepOut (Offer const &offer, TAmounts< TIn, TOut > &ofrAmt, TAmounts< TIn, TOut > &stpAmt, TOut &ownerGives, std::uint32_t transferRateIn, std::uint32_t transferRateOut, TOut const &limit)
template<class TCollection>
static auto sum (TCollection const &col)
template<class TIn, class TOut>
static std::pair< TER, std::unique_ptr< Step > > makeBookStepHelper (StrandContext const &ctx, Asset const &in, Asset const &out)
std::pair< TER, std::unique_ptr< Step > > makeBookStepIi (StrandContext const &ctx, Issue const &in, Issue const &out)
std::pair< TER, std::unique_ptr< Step > > makeBookStepIx (StrandContext const &ctx, Issue const &in)
std::pair< TER, std::unique_ptr< Step > > makeBookStepXi (StrandContext const &ctx, Issue const &out)
std::pair< TER, std::unique_ptr< Step > > makeBookStepMm (StrandContext const &ctx, MPTIssue const &in, MPTIssue const &out)
std::pair< TER, std::unique_ptr< Step > > makeBookStepMi (StrandContext const &ctx, MPTIssue const &in, Issue const &out)
std::pair< TER, std::unique_ptr< Step > > makeBookStepIm (StrandContext const &ctx, Issue const &in, MPTIssue const &out)
std::pair< TER, std::unique_ptr< Step > > makeBookStepMx (StrandContext const &ctx, MPTIssue const &in)
std::pair< TER, std::unique_ptr< Step > > makeBookStepXm (StrandContext const &ctx, MPTIssue const &out)
std::pair< TER, std::unique_ptr< Step > > makeDirectStepI (StrandContext const &ctx, AccountID const &src, AccountID const &dst, Currency const &c)
template<class FlowResult>
static auto finishFlow (PaymentSandbox &sb, Asset const &srcAsset, Asset const &dstAsset, FlowResult &&f)
std::pair< TER, std::unique_ptr< Step > > makeMptEndpointStep (StrandContext const &ctx, AccountID const &src, AccountID const &dst, MPTID const &mpt)
template<StepAmount T>
static T accountFundsHelper (ReadView const &view, AccountID const &id, T const &amtDefault, Asset const &asset, FreezeHandling freezeHandling, AuthHandling authHandling, beast::Journal j)
bool checkNear (IOUAmount const &expected, IOUAmount const &actual)
static bool isXRPAccount (STPathElement const &pe)
static std::pair< TER, std::unique_ptr< Step > > toStep (StrandContext const &ctx, STPathElement const *e1, STPathElement const *e2, Asset const &curAsset)
template<class TDerived>
bool operator== (XRPEndpointStep< TDerived > const &lhs, XRPEndpointStep< TDerived > const &rhs)
std::pair< TER, std::unique_ptr< Step > > makeXrpEndpointStep (StrandContext const &ctx, AccountID const &acc)
static void removeUnfundedOffers (ApplyView &view, std::vector< uint256 > const &offers, beast::Journal viewJ)
static void removeExpiredNFTokenOffers (ApplyView &view, std::vector< uint256 > const &offers, beast::Journal viewJ)
static void removeExpiredCredentials (ApplyView &view, std::vector< uint256 > const &creds, beast::Journal viewJ)
static void removeDeletedTrustLines (ApplyView &view, std::vector< uint256 > const &trustLines, beast::Journal viewJ)
static int signerCountBasedOwnerCountDelta (std::size_t entryCount, Rules const &rules)
static TER removeSignersFromLedger (ServiceRegistry &registry, ApplyView &view, Keylet const &accountKeylet, Keylet const &ownerDirKeylet, Keylet const &signerListKeylet, beast::Journal j)
static std::pair< TER, bool > applyBid (ApplyContext &ctx, Sandbox &sb, AccountID const &account, beast::Journal j)
static std::pair< TER, bool > applyCreate (ApplyContext &ctx, Sandbox &sb, AccountID const &account, beast::Journal j)
static STAmount adjustLPTokensOut (Rules const &rules, STAmount const &lptAMMBalance, STAmount const &lpTokensDeposit)
static std::pair< TER, bool > applyVote (ApplyContext &ctx, Sandbox &sb, AccountID const &accountID, beast::Journal j)
static std::optional< STAmounttokensWithdraw (STAmount const &lpTokens, std::optional< STAmount > const &tokensIn, std::uint32_t flags)
static STAmount adjustLPTokensIn (Rules const &rules, STAmount const &lptAMMBalance, STAmount const &lpTokensWithdraw, WithdrawAll withdrawAll)
static TER addSLE (ApplyContext &ctx, SLE::ref sle, AccountID const &owner)
template<ValidIssueType T>
static TER escrowCancelPreclaimHelper (PreclaimContext const &ctx, AccountID const &account, STAmount const &amount)
template<>
TER escrowCancelPreclaimHelper< Issue > (PreclaimContext const &ctx, AccountID const &account, STAmount const &amount)
template<>
TER escrowCancelPreclaimHelper< MPTIssue > (PreclaimContext const &ctx, AccountID const &account, STAmount const &amount)
template<ValidIssueType T>
static NotTEC escrowCreatePreflightHelper (PreflightContext const &ctx)
template<>
NotTEC escrowCreatePreflightHelper< Issue > (PreflightContext const &ctx)
template<>
NotTEC escrowCreatePreflightHelper< MPTIssue > (PreflightContext const &ctx)
template<ValidIssueType T>
static TER escrowCreatePreclaimHelper (PreclaimContext const &ctx, AccountID const &account, AccountID const &dest, STAmount const &amount)
template<>
TER escrowCreatePreclaimHelper< Issue > (PreclaimContext const &ctx, AccountID const &account, AccountID const &dest, STAmount const &amount)
template<>
TER escrowCreatePreclaimHelper< MPTIssue > (PreclaimContext const &ctx, AccountID const &account, AccountID const &dest, STAmount const &amount)
template<ValidIssueType T>
static TER escrowLockApplyHelper (ApplyView &view, AccountID const &issuer, AccountID const &sender, STAmount const &amount, beast::Journal journal)
template<>
TER escrowLockApplyHelper< Issue > (ApplyView &view, AccountID const &issuer, AccountID const &sender, STAmount const &amount, beast::Journal journal)
template<>
TER escrowLockApplyHelper< MPTIssue > (ApplyView &view, AccountID const &issuer, AccountID const &sender, STAmount const &amount, beast::Journal journal)
static bool checkCondition (Slice f, Slice c)
template<ValidIssueType T>
static TER escrowFinishPreclaimHelper (PreclaimContext const &ctx, AccountID const &dest, STAmount const &amount)
template<>
TER escrowFinishPreclaimHelper< Issue > (PreclaimContext const &ctx, AccountID const &dest, STAmount const &amount)
template<>
TER escrowFinishPreclaimHelper< MPTIssue > (PreclaimContext const &ctx, AccountID const &dest, STAmount const &amount)
std::expected< uint256, TERdetermineBrokerID (ReadView const &view, STTx const &tx)
std::expected< Asset, TERdetermineAsset (ReadView const &view, AccountID const &account, AccountID const &brokerPseudoAccountID, STAmount const &amount)
std::expected< STAmount, TERdetermineClawAmount (SLE const &sleBroker, Asset const &vaultAsset, std::optional< STAmount > const &amount, SLE::const_ref vaultSle, Rules const &rules)
template<ValidIssueType T>
static TER preclaimHelper (PreclaimContext const &ctx, SLE const &sleIssuer, STAmount const &clawAmount)
template<>
TER preclaimHelper< Issue > (PreclaimContext const &ctx, SLE const &sleIssuer, STAmount const &clawAmount)
template<>
TER preclaimHelper< MPTIssue > (PreclaimContext const &ctx, SLE const &sleIssuer, STAmount const &clawAmount)
static Number owedToVault (SLE::ref loanSle)
static std::uint32_t getStartDate (ReadView const &view)
static std::uint16_t extractNFTokenFlagsFromTxFlags (std::uint32_t txFlags)
static bool hasOfferFields (PreflightContext const &ctx)
static std::pair< Currency, CurrencytokenPairKey (STObject const &pair)
static bool adjustOwnerCount (ApplyContext &ctx, int count)
static void setPriceDataInnerObjTemplate (STObject &obj)
STAmount getMaxSourceAmount (AccountID const &account, STAmount const &dstAmount, std::optional< STAmount > const &sendMax)
template<ValidIssueType T>
static NotTEC preflightHelper (PreflightContext const &ctx)
template<>
NotTEC preflightHelper< Issue > (PreflightContext const &ctx)
template<>
NotTEC preflightHelper< MPTIssue > (PreflightContext const &ctx)
template<ValidIssueType T>
static TER preclaimHelper (PreclaimContext const &ctx, SLE const &sleIssuer, AccountID const &issuer, AccountID const &holder, STAmount const &clawAmount)
template<>
TER preclaimHelper< Issue > (PreclaimContext const &ctx, SLE const &sleIssuer, AccountID const &issuer, AccountID const &holder, STAmount const &clawAmount)
template<>
TER preclaimHelper< MPTIssue > (PreclaimContext const &ctx, SLE const &sleIssuer, AccountID const &issuer, AccountID const &holder, STAmount const &clawAmount)
template<ValidIssueType T>
static TER applyHelper (ApplyContext &ctx)
template<>
TER applyHelper< Issue > (ApplyContext &ctx)
template<>
TER applyHelper< MPTIssue > (ApplyContext &ctx)
static TER verifyProofs (STTx const &tx, std::shared_ptr< SLE const > const &issuance, std::shared_ptr< SLE const > const &mptoken)
 Verifies the cryptographic proofs for a ConvertBack transaction.
STAmount clawbackAmount (SLE::const_ref vault, std::optional< STAmount > const &maybeAmount, AccountID const &account)
static STAmount roundToVaultScale (STAmount const &amount, SLE::const_ref vault)
static WaiveUnrealizedLoss shouldWaiveWithdrawal (ReadView const &view, AccountID const &account, SLE::const_ref issuance)
 BEAST_DEFINE_TESTSUITE_PRIO (AccountSet, app, xrpl, 1)
 BEAST_DEFINE_TESTSUITE (AccountTxPaging, app, xrpl)
 BEAST_DEFINE_TESTSUITE (AmendmentTable, app, xrpl)
 BEAST_DEFINE_TESTSUITE (Check, app, xrpl)
 BEAST_DEFINE_TESTSUITE (CheckMPT, tx, xrpl)
 BEAST_DEFINE_TESTSUITE (Clawback, app, xrpl)
 BEAST_DEFINE_TESTSUITE (ClawbackMPT, app, xrpl)
 BEAST_DEFINE_TESTSUITE (ConfidentialTransfer, app, xrpl)
 BEAST_DEFINE_TESTSUITE (ConfidentialTransferExtended, app, xrpl)
 BEAST_DEFINE_TESTSUITE (Discrepancy, app, xrpl)
 BEAST_DEFINE_TESTSUITE (FixNFTokenPageLinks, app, xrpl)
 BEAST_DEFINE_TESTSUITE (Freeze, app, xrpl)
 BEAST_DEFINE_TESTSUITE (LedgerLoad, app, xrpl)
 BEAST_DEFINE_TESTSUITE (LoadFeeTrack, app, xrpl)
 BEAST_DEFINE_TESTSUITE_PRIO (NFTokenBaseUtil, app, xrpl, 2)
 BEAST_DEFINE_TESTSUITE_PRIO (NFTokenDisallowIncoming, app, xrpl, 2)
 BEAST_DEFINE_TESTSUITE_PRIO (NFTokenWOMintOffer, app, xrpl, 2)
 BEAST_DEFINE_TESTSUITE_PRIO (NFTokenWOModify, app, xrpl, 2)
 BEAST_DEFINE_TESTSUITE_PRIO (NFTokenAllFeatures, app, xrpl, 2)
 BEAST_DEFINE_TESTSUITE_PRIO (NFTokenAuth, app, xrpl, 2)
 BEAST_DEFINE_TESTSUITE_PRIO (NFTokenBurn, app, xrpl, 3)
 BEAST_DEFINE_TESTSUITE_PRIO (NFTokenDir, app, xrpl, 1)
 BEAST_DEFINE_TESTSUITE (OfferStream, app, xrpl)
 BEAST_DEFINE_TESTSUITE (SetRegularKey, app, xrpl)
 BEAST_DEFINE_TESTSUITE (Ticket, app, xrpl)
 BEAST_DEFINE_TESTSUITE (TrustAndBalance, app, xrpl)
 BEAST_DEFINE_TESTSUITE (Apply, tx, xrpl)
 BEAST_DEFINE_TESTSUITE_PRIO (Vault, app, xrpl, 1)
 BEAST_DEFINE_TESTSUITE (FileUtilities, basics, xrpl)
 BEAST_DEFINE_TESTSUITE (hardened_hash, basics, xrpl)
 BEAST_DEFINE_TESTSUITE (IOUAmount, basics, xrpl)
 BEAST_DEFINE_TESTSUITE (KeyCache, basics, xrpl)
 BEAST_DEFINE_TESTSUITE (Number, basics, xrpl)
 BEAST_DEFINE_TESTSUITE (PerfLog, basics, xrpl)
 BEAST_DEFINE_TESTSUITE (StringUtilities, basics, xrpl)
 BEAST_DEFINE_TESTSUITE (TaggedCache, basics, xrpl)
 BEAST_DEFINE_TESTSUITE (XRPAmount, basics, xrpl)
 BEAST_DEFINE_TESTSUITE (Config, core, xrpl)
 BEAST_DEFINE_TESTSUITE (SociDB, core, xrpl)
 BEAST_DEFINE_TESTSUITE (Workers, core, xrpl)
 BEAST_DEFINE_TESTSUITE (ProtocolVersion, overlay, xrpl)
 BEAST_DEFINE_TESTSUITE (short_read, overlay, xrpl)
 BEAST_DEFINE_TESTSUITE (BuildInfo, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (Hooks, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (InnerObjectFormatsParsedJSON, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (Issue, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (Memo, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (PublicKey, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (Quality, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (SecretKey, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (Seed, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (SeqProxy, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (Serializer, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (STAccount, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (STAmount, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (STInteger, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (STNumber, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (STObject, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (STParsedJSON, protocol, xrpl)
bool matches (char const *string, char const *regex)
 Return true if the string loosely matches the regex.
 BEAST_DEFINE_TESTSUITE (STTx, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (InnerObjectFormatsSerializer, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (STValidation, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (TER, protocol, xrpl)
 BEAST_DEFINE_TESTSUITE (AccountCurrencies, rpc, xrpl)
 BEAST_DEFINE_TESTSUITE (AmendmentBlocked, rpc, xrpl)
 BEAST_DEFINE_TESTSUITE (Connect, rpc, xrpl)
 BEAST_DEFINE_TESTSUITE (Feature, rpc, xrpl)
 BEAST_DEFINE_TESTSUITE (GetCounts, rpc, xrpl)
 BEAST_DEFINE_TESTSUITE (LedgerClosed, rpc, xrpl)
 BEAST_DEFINE_TESTSUITE_PRIO (LedgerData, rpc, xrpl, 1)
 BEAST_DEFINE_TESTSUITE (LedgerHeader, rpc, xrpl)
 BEAST_DEFINE_TESTSUITE (NoRippleCheck, rpc, xrpl)
 BEAST_DEFINE_TESTSUITE_MANUAL_PRIO (NoRippleCheckLimits, rpc, xrpl, 1)
 BEAST_DEFINE_TESTSUITE (OwnerInfo, rpc, xrpl)
 BEAST_DEFINE_TESTSUITE (Peers, rpc, xrpl)
 BEAST_DEFINE_TESTSUITE (Transaction, rpc, xrpl)
 BEAST_DEFINE_TESTSUITE (TransactionEntry, rpc, xrpl)
 BEAST_DEFINE_TESTSUITE (TransactionHistory, rpc, xrpl)
 BEAST_DEFINE_TESTSUITE (Version, rpc, xrpl)
 TEST (json_value, limits)
 TEST (json_value, construct_and_compare_Json_StaticString)
 TEST (json_value, different_types)
 TEST (json_value, compare_strings)
 TEST (json_value, bool)
 TEST (json_value, bad_json)
 TEST (json_value, edge_cases)
 TEST (json_value, copy)
 TEST (json_value, move)
 TEST (json_value, comparisons)
 TEST (json_value, compact)
 TEST (json_value, conversions)
 TEST (json_value, access_members)
 TEST (json_value, remove_members)
 TEST (json_value, iterator)
 TEST (json_value, nest_limits)
 TEST (json_value, memory_leak)
UInt8Value canonical_UINT8 ()
UInt16Value canonical_UINT16 ()
UInt32Value canonical_UINT32 ()
UInt64Value canonical_UINT64 ()
UInt128Value canonical_UINT128 ()
UInt160Value canonical_UINT160 ()
UInt192Value canonical_UINT192 ()
UInt256Value canonical_UINT256 ()
Int32Value canonical_INT32 ()
NumberValue canonical_NUMBER ()
AmountValue canonical_AMOUNT ()
AccountValue canonical_ACCOUNT ()
CurrencyValue canonical_CURRENCY ()
IssueValue canonical_ISSUE ()
Vector256Value canonical_VECTOR256 ()
BlobValue canonical_VL ()
XChainBridgeValue canonical_XCHAIN_BRIDGE ()
STArray canonical_ARRAY ()
STObject canonical_OBJECT ()
STPathSet canonical_PATHSET ()
template<class T>
void expectEqualField (T const &expected, T const &actual, char const *fieldName)
template<>
void expectEqualField< STObject > (STObject const &expected, STObject const &actual, char const *fieldName)
template<>
void expectEqualField< STPathSet > (STPathSet const &expected, STPathSet const &actual, char const *fieldName)
template<class T>
void expectEqualField (T const &expected, std::reference_wrapper< T const > actual, char const *fieldName)
uint256 proposalUniqueId (uint256 const &proposeHash, uint256 const &previousLedger, std::uint32_t proposeSeq, NetClock::time_point closeTime, Slice const &publicKey, Slice const &signature)
 Calculate a unique identifier for a signed proposal.
RCLValidatedLedger::Seq mismatch (RCLValidatedLedger const &a, RCLValidatedLedger const &b)
void handleNewValidation (Application &app, std::shared_ptr< STValidation > const &val, std::string const &source, BypassAccept const bypassAccept=BypassAccept::No, std::optional< beast::Journal > j=std::nullopt)
 Handle a new validation.
std::shared_ptr< LedgerbuildLedger (std::shared_ptr< Ledger const > const &parent, NetClock::time_point closeTime, bool const closeTimeCorrect, NetClock::duration closeResolution, Application &app, CanonicalTXSet &txns, std::set< TxID > &failedTxs, beast::Journal j)
 Build a new ledger by applying consensus transactions.
std::shared_ptr< LedgerbuildLedger (LedgerReplay const &replayData, ApplyFlags applyFlags, Application &app, beast::Journal j)
 Build a new ledger by replaying transactions.
template<class ApplyTxs>
std::shared_ptr< LedgerbuildLedgerImpl (std::shared_ptr< Ledger const > const &parent, NetClock::time_point closeTime, bool const closeTimeCorrect, NetClock::duration closeResolution, Application &app, beast::Journal j, ApplyTxs &&applyTxs)
std::size_t applyTransactions (Application &app, std::shared_ptr< Ledger const > const &built, CanonicalTXSet &txns, std::set< TxID > &failed, OpenView &view, beast::Journal j)
 Apply a set of consensus transactions to a ledger.
static std::vector< uint256neededHashes (uint256 const &root, SHAMap &map, int max, SHAMapSyncFilter const *filter)
std::unique_ptr< InboundLedgersmakeInboundLedgers (Application &app, InboundLedgers::clock_type &clock, beast::insight::Collector::ptr const &collector)
std::unique_ptr< InboundTransactionsmakeInboundTransactions (Application &app, beast::insight::Collector::ptr const &collector, std::function< void(std::shared_ptr< SHAMap > const &, bool)> gotSet)
std::unique_ptr< LedgerCleanermakeLedgerCleaner (Application &app, beast::Journal journal)
static bool shouldAcquire (std::uint32_t const currentLedger, std::uint32_t const ledgerHistory, std::optional< LedgerIndex > const minimumOnline, std::uint32_t const candidateLedger, beast::Journal j)
static void populateFetchPack (SHAMap const &want, SHAMap const *have, std::uint32_t cnt, protocol::TMGetObjectByHash *into, std::uint32_t seq, bool withLeaves=true)
 Populate a fetch pack with data from the map the recipient wants.
static bool saveValidatedLedger (ServiceRegistry &registry, std::shared_ptr< Ledger const > const &ledger, bool current)
bool pendSaveValidated (ServiceRegistry &registry, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
 Save, or arrange to save, a fully-validated ledger.
std::shared_ptr< LedgerloadLedgerHelper (LedgerHeader const &info, Rules const &rules, Fees const &fees, ServiceRegistry &registry, bool acquire)
 Make ledger using info loaded from database.
static void finishLoadByIndexOrHash (std::shared_ptr< Ledger > const &ledger, beast::Journal j)
std::tuple< std::shared_ptr< Ledger >, std::uint32_t, uint256getLatestLedger (Rules const &rules, Fees const &fees, ServiceRegistry &registry)
 Fetch the ledger with the highest sequence contained in the database.
std::shared_ptr< LedgerloadByIndex (std::uint32_t ledgerIndex, Rules const &rules, Fees const &fees, ServiceRegistry &registry, bool acquire=true)
 Load a ledger by its sequence number.
std::shared_ptr< LedgerloadByHash (uint256 const &ledgerHash, Rules const &rules, Fees const &fees, ServiceRegistry &registry, bool acquire=true)
 Load a ledger by its hash.
void addJson (json::Value &, LedgerFill const &)
 Given a Ledger and options, fill a json::Value with a description of the ledger.
json::Value getJson (LedgerFill const &)
 Return a new json::Value representing the ledger with given options.
void copyFrom (json::Value &to, json::Value const &from)
 Copy all the keys and values from one object into another.
std::unique_ptr< LocalTxsmakeLocalTxs ()
std::string debugTxstr (std::shared_ptr< STTx const > const &tx)
std::string debugTostr (OrderedTxs const &set)
std::string debugTostr (SHAMap const &set)
std::string debugTostr (std::shared_ptr< ReadView const > const &view)
static void logOne (ReadView const &ledger, uint256 const &tx, char const *msg, beast::Journal &j)
static void logMetadataDifference (ReadView const &builtLedger, ReadView const &validLedger, uint256 const &tx, beast::Journal j)
static std::vector< SHAMapItem const * > leaves (SHAMap const &sm)
std::unique_ptr< OrderBookDBmakeOrderBookDb (ServiceRegistry &registry, OrderBookDBConfig const &config)
 Create an OrderBookDB instance.
static void fixConfigPorts (Config &config, Endpoints const &endpoints)
std::unique_ptr< ApplicationmakeApplication (std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
std::unique_ptr< CollectorManagermakeCollectorManager (Section const &params, beast::Journal journal)
std::unique_ptr< LoadManagermakeLoadManager (Application &app, beast::Journal journal)
bool adjustDescriptorLimit (int needed, beast::Journal j)
void printHelp (po::options_description const &desc)
int run (int argc, char **argv)
std::pair< PublicKey, SecretKeygetNodeIdentity (Application &app, boost::program_options::variables_map const &cmdline)
 The cryptographic credentials identifying this server instance.
std::unique_ptr< AmendmentTablemake_AmendmentTable (ServiceRegistry &registry, std::chrono::seconds majorityTime, std::vector< AmendmentTable::FeatureInfo > const &supported, Section const &enabled, Section const &vetoed, beast::Journal journal)
void convertBlobsToTxResult (RelationalDatabase::AccountTxs &to, std::uint32_t ledgerIndex, std::string const &status, Blob const &rawTxn, Blob const &rawMeta, Application &app)
void saveLedgerAsync (Application &app, std::uint32_t seq)
static std::vector< std::pair< uint256, std::string > > parseSection (Section const &section)
HashRouter::Setup setupHashRouter (Config const &config)
 Create HashRouter setup from configuration.
static FeeLevel64 getFeeLevelPaid (ReadView const &view, STTx const &tx)
static std::optional< LedgerIndexgetLastLedgerSequence (STTx const &tx)
static FeeLevel64 increase (FeeLevel64 level, std::uint32_t increasePercent)
TxQ::Setup setupTxQ (Config const &)
 Build a TxQ::Setup object from application configuration.
std::string to_string (ListDisposition disposition)
std::size_t splitMessageParts (std::vector< ValidatorList::MessageWithHash > &messages, protocol::TMValidatorListCollection const &largeMsg, std::size_t maxSize, std::size_t begin, std::size_t end)
std::size_t splitMessage (std::vector< ValidatorList::MessageWithHash > &messages, protocol::TMValidatorListCollection const &largeMsg, std::size_t maxSize, std::size_t begin=0, std::size_t end=0)
std::size_t buildValidatorListMessage (std::vector< ValidatorList::MessageWithHash > &messages, std::uint32_t rawVersion, std::string const &rawManifest, ValidatorBlobInfo const &currentBlob, std::size_t maxSize)
std::size_t buildValidatorListMessage (std::vector< ValidatorList::MessageWithHash > &messages, std::uint64_t peerSequence, std::uint32_t rawVersion, std::string const &rawManifest, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, std::size_t maxSize)
std::unique_ptr< FeeVotemakeFeeVote (FeeSetup const &setup, beast::Journal journal)
 Create an instance of the FeeVote logic.
std::unique_ptr< NetworkOPsmakeNetworkOPs (ServiceRegistry &registry, NetworkOPs::clock_type &clock, bool standalone, std::size_t minPeerCount, bool startValid, JobQueue &jobQueue, LedgerMaster &ledgerMaster, ValidatorKeys const &validatorKeys, boost::asio::io_context &ioSvc, beast::Journal journal, beast::insight::Collector::ptr const &collector)
static std::uint32_t trunc32 (std::uint64_t v)
std::unique_ptr< SHAMapStoremakeSHAMapStore (Application &app, NodeStore::Scheduler &scheduler, beast::Journal journal)
template<class T>
XRPAmount toDrops (FeeLevel< T > const &level, XRPAmount baseFee)
FeeLevel64 toFeeLevel (XRPAmount const &drops, XRPAmount const &baseFee)
template<class Hasher>
void hash_append (Hasher &h, ValidatorBlobInfo const &blobInfo)
template<class Hasher>
void hash_append (Hasher &h, std::vector< ValidatorBlobInfo > const &blobs)
template<class Hasher>
void hash_append (Hasher &h, std::map< std::size_t, ValidatorBlobInfo > const &blobs)
SQLiteDatabase setupRelationalDatabase (ServiceRegistry &registry, Config const &config, JobQueue &jobQueue)
 setupRelationalDatabase Creates and returns a SQLiteDatabase instance based on configuration.
void initPeerFinderDB (soci::session &session, BasicConfig const &config, beast::Journal j)
 initPeerFinderDB Opens a session with the peer finder database.
void updatePeerFinderDB (soci::session &session, int currentSchemaVersion, beast::Journal j)
 updatePeerFinderDB Updates the peer finder database to a new version.
void readPeerFinderDB (soci::session &session, std::function< void(std::string const &, int)> const &func)
 readPeerFinderDB Reads all entries from the peer finder database and invokes the given callback for each entry.
void savePeerFinderDB (soci::session &session, std::vector< PeerFinder::Store::Entry > const &v)
 savePeerFinderDB Saves a new entry to the peer finder database.
bool shouldCloseLedger (bool anyTransactions, std::size_t prevProposers, std::size_t proposersClosed, std::size_t proposersValidated, std::chrono::milliseconds prevRoundTime, std::chrono::milliseconds timeSincePrevClose, std::chrono::milliseconds openTime, std::chrono::milliseconds idleInterval, ConsensusParms const &parms, beast::Journal j, std::unique_ptr< std::stringstream > const &clog={})
 Determines whether the current ledger should close at this time.
bool checkConsensusReached (std::size_t agreeing, std::size_t total, bool countSelf, std::size_t minConsensusPct, bool reachedMax, bool stalled, std::unique_ptr< std::stringstream > const &clog)
ConsensusState checkConsensus (std::size_t prevProposers, std::size_t currentProposers, std::size_t currentAgree, std::size_t currentFinished, std::chrono::milliseconds previousAgreeTime, std::chrono::milliseconds currentAgreeTime, bool stalled, ConsensusParms const &parms, bool proposing, beast::Journal j, std::unique_ptr< std::stringstream > const &clog={})
 Determine whether the network reached consensus and whether we joined.
int participantsNeeded (int participants, int percent)
 How many of the participants must agree to reach a given threshold?
std::pair< std::size_t, std::optional< ConsensusParms::AvalancheState > > getNeededWeight (ConsensusParms const &p, ConsensusParms::AvalancheState currentState, int percentTime, std::size_t currentRounds, std::size_t minimumRounds)
template<class NodeId, class LedgerId, class Position>
bool operator== (ConsensusProposal< NodeId, LedgerId, Position > const &a, ConsensusProposal< NodeId, LedgerId, Position > const &b)
std::string to_string (ConsensusMode m)
std::string to_string (ConsensusPhase p)
bool isCurrent (ValidationParms const &p, NetClock::time_point now, NetClock::time_point signTime, NetClock::time_point seenTime)
 Whether a validation is still current.
std::string to_string (ValStatus m)
FeeSetup setupFeeVote (Section const &section)
DatabaseCon::Setup setupDatabaseCon (Config const &c, std::optional< beast::Journal > j=std::nullopt)
IniFileSections parseIniFile (std::string const &strInput, bool const bTrim)
IniFileSections::mapped_type * getIniFileSection (IniFileSections &secSource, std::string const &strSection)
bool getSingleSection (IniFileSections &secSource, std::string const &strSection, std::string &strValue, beast::Journal j)
static std::string getEnvVar (char const *name)
static void checkZeroPorts (Config const &config)
std::optional< std::stringgetFeatureValue (boost::beast::http::fields const &headers, std::string const &feature)
 Get feature's header value.
bool isFeatureValue (boost::beast::http::fields const &headers, std::string const &feature, std::string const &value)
 Check if a feature's value is equal to the specified value.
bool featureEnabled (boost::beast::http::fields const &headers, std::string const &feature)
 Check if a feature is enabled.
std::string makeFeaturesRequestHeader (bool comprEnabled, bool ledgerReplayEnabled, bool txReduceRelayEnabled, bool vpReduceRelayEnabled)
 Make request header X-Protocol-Ctl value with supported features.
std::string makeFeaturesResponseHeader (http_request_type const &headers, bool comprEnabled, bool ledgerReplayEnabled, bool txReduceRelayEnabled, bool vpReduceRelayEnabled)
 Make response header X-Protocol-Ctl value with supported features.
static std::optional< BaseUInt< 512 > > hashLastMessage (SSL const *ssl, size_t(*get)(const SSL *, void *, size_t))
 Hashes the latest finished message from an SSL stream.
std::optional< uint256makeSharedValue (stream_type &ssl, beast::Journal journal)
 Computes a shared value based on the SSL connection state.
void buildHandshake (boost::beast::http::fields &h, uint256 const &sharedValue, std::optional< std::uint32_t > networkID, beast::IP::Address publicIp, beast::IP::Address remoteIp, Application &app)
 Insert fields headers necessary for upgrading the link to the peer protocol.
PublicKey verifyHandshake (boost::beast::http::fields const &headers, uint256 const &sharedValue, std::optional< std::uint32_t > networkID, beast::IP::Address publicIp, beast::IP::Address remote, Application &app)
 Validate header fields necessary for upgrading the link to the peer protocol.
auto makeRequest (bool crawlPublic, bool comprEnabled, bool ledgerReplayEnabled, bool txReduceRelayEnabled, bool vpReduceRelayEnabled)
 Make outbound http request.
http_response_type makeResponse (bool crawlPublic, http_request_type const &req, beast::IP::Address publicIp, beast::IP::Address remoteIp, uint256 const &sharedValue, std::optional< std::uint32_t > networkID, ProtocolVersion version, Application &app)
 Make http response.
template<typename Headers>
bool peerFeatureEnabled (Headers const &request, std::string const &feature, std::string value, bool config)
 Check if a feature should be enabled for a peer.
template<typename Headers>
bool peerFeatureEnabled (Headers const &request, std::string const &feature, bool config)
 Wrapper for enable(1)/disable type(0) of feature.
std::shared_ptr< MessagemakeSquelchMessage (PublicKey const &validator, bool squelch, uint32_t squelchDuration)
Overlay::Setup setupOverlay (BasicConfig const &config, beast::Journal j)
std::unique_ptr< OverlaymakeOverlay (Application &app, Overlay::Setup const &setup, ServerHandler &serverHandler, Resource::Manager &resourceManager, Resolver &resolver, boost::asio::io_context &ioContext, BasicConfig const &config, beast::insight::Collector::ptr const &collector)
 Creates the implementation of Overlay.
static bool stringIsUInt256Sized (std::string const &pBuffStr)
static std::shared_ptr< PeerImpgetPeerWithTree (OverlayImpl &ov, uint256 const &rootHash, PeerImp const *skip)
static std::shared_ptr< PeerImpgetPeerWithLedger (OverlayImpl &ov, uint256 const &ledgerHash, LedgerIndex ledger, PeerImp const *skip)
std::unique_ptr< PeerSetBuildermakePeerSetBuilder (Application &app)
std::unique_ptr< PeerSetmakeDummyPeerSet (Application &app)
 Make a dummy PeerSet that does not do anything.
protocol::MessageType protocolMessageType (protocol::TMGetLedger const &)
protocol::MessageType protocolMessageType (protocol::TMReplayDeltaRequest const &)
protocol::MessageType protocolMessageType (protocol::TMProofPathRequest const &)
template<class = void>
std::string protocolMessageName (int type)
 Returns the name of a protocol message given its type.
template<class Buffers, class Handler>
std::pair< std::size_t, boost::system::error_code > invokeProtocolMessage (Buffers const &buffers, Handler &handler, std::size_t &hint)
 Calls the handler for up to one protocol message in the passed buffers.
std::string to_string (ProtocolVersion const &p)
 Print a protocol version a human-readable string.
std::vector< ProtocolVersionparseProtocolVersions (boost::beast::string_view const &s)
 Parse a set of protocol versions.
std::optional< ProtocolVersionnegotiateProtocolVersion (std::vector< ProtocolVersion > const &versions)
 Given a list of supported protocol versions, choose the one we prefer.
std::optional< ProtocolVersionnegotiateProtocolVersion (boost::beast::string_view const &versions)
 Given a list of supported protocol versions, choose the one we prefer.
std::string const & supportedProtocolVersions ()
 The list of all the protocol versions we support.
bool isProtocolSupported (ProtocolVersion const &v)
 Determine whether we support a specific protocol version.
constexpr ProtocolVersion makeProtocol (std::uint16_t major, std::uint16_t minor)
template<typename Predicate>
SendIfPred< Predicate > sendIf (std::shared_ptr< Message > const &m, Predicate const &f)
 Helper function to aid in type deduction.
template<typename Predicate>
SendIfNotPred< Predicate > sendIfNot (std::shared_ptr< Message > const &m, Predicate const &f)
 Helper function to aid in type deduction.
hash_set< PathAssetaccountSourceAssets (AccountID const &account, std::shared_ptr< AssetCache > const &lrCache, bool includeXRP)
hash_set< PathAssetaccountDestAssets (AccountID const &account, std::shared_ptr< AssetCache > const &lrCache, bool includeXRP)
static std::ostreamoperator<< (std::ostream &os, Pathfinder::NodeType t)
static std::ostreamoperator<< (std::ostream &os, Pathfinder::PaymentType t)
static bool isDefaultPath (STPath const &path)
static STPath removeIssuer (STPath const &path)
void addUniquePath (STPathSet &pathSet, STPath const &path)
STAmount largestAmount (STAmount const &amt)
STAmount convertAmount (STAmount const &amt, bool all)
bool convertAllCheck (STAmount const &a)
bool passwordUnrequiredOrSentCorrect (Port const &port, json::Value const &params)
bool ipAllowed (beast::IP::Address const &remoteIp, std::vector< boost::asio::ip::network_v4 > const &nets4, std::vector< boost::asio::ip::network_v6 > const &nets6)
 True if remoteIp is in any of adminIp.
bool isAdmin (Port const &port, json::Value const &params, beast::IP::Address const &remoteIp)
Role requestRole (Role const &required, Port const &port, json::Value const &params, beast::IP::Endpoint const &remoteIp, std::string_view user)
 Return the allowed privilege role.
bool isUnlimited (Role const &role)
 ADMIN and IDENTIFIED roles shall have unlimited resources.
bool isUnlimited (Role const &required, Port const &port, json::Value const &params, beast::IP::Endpoint const &remoteIp, std::string const &user)
Resource::Consumer requestInboundEndpoint (Resource::Manager &manager, beast::IP::Endpoint const &remoteAddress, Role const &role, std::string_view user, std::string_view forwardedFor)
static std::string_view extractIpAddrFromField (std::string_view field)
std::string_view forwardedFor (http_request_type const &request)
std::string createHTTPPost (std::string const &strHost, std::string const &strPath, std::string const &strMsg, std::unordered_map< std::string, std::string > const &mapRequestHeaders)
std::string jsonrpcRequest (std::string const &strMethod, json::Value const &params, json::Value const &id)
json::Value rpcCmdToJson (std::vector< std::string > const &args, json::Value &retParams, unsigned int apiVersion, beast::Journal j)
std::pair< int, json::ValuerpcClient (std::vector< std::string > const &args, Config const &config, Logs &logs, unsigned int apiVersion, std::unordered_map< std::string, std::string > const &headers={})
 Internal invocation of RPC client.
std::shared_ptr< RPCSubmakeRPCSub (InfoSub::Source &source, boost::asio::io_context &ioContext, JobQueue &jobQueue, std::string const &strUrl, std::string const &strUsername, std::string const &strPassword, ServiceRegistry &registry)
static bool isStatusRequest (http_request_type const &request)
static Handoff statusRequestResponse (http_request_type const &request, boost::beast::http::status status)
static bool authorized (Port const &port, std::map< std::string, std::string > const &h)
static json::Output makeOutput (Session &session)
static std::map< std::string, std::stringbuildMap (boost::beast::http::fields const &h)
template<class ConstBufferSequence>
static std::string buffersToString (ConstBufferSequence const &bs)
template<class T>
void logDuration (json::Value const &request, T const &duration, beast::Journal &journal)
static json::Value makeJsonError (json::Int code, json::Value &&message)
static Port toPort (ParsedPort const &parsed, std::ostream &log)
static std::vector< PortparsePorts (Config const &config, std::ostream &log)
static void setupClient (ServerHandler::Setup &setup)
static void setupOverlay (ServerHandler::Setup &setup)
ServerHandler::Setup setupServerHandler (Config const &config, std::ostream &log)
std::unique_ptr< ServerHandlermakeServerHandler (Application &app, boost::asio::io_context &ioContext, JobQueue &jobQueue, NetworkOPs &networkOPs, Resource::Manager &resourceManager, CollectorManager &cm)
std::pair< org::xrpl::rpc::v1::GetLedgerResponse, grpc::Status > doLedgerGrpc (RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerRequest > &context)
std::pair< org::xrpl::rpc::v1::GetLedgerEntryResponse, grpc::Status > doLedgerEntryGrpc (RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerEntryRequest > &context)
std::pair< org::xrpl::rpc::v1::GetLedgerDataResponse, grpc::Status > doLedgerDataGrpc (RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerDataRequest > &context)
std::pair< org::xrpl::rpc::v1::GetLedgerDiffResponse, grpc::Status > doLedgerDiffGrpc (RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerDiffRequest > &context)
void addChannel (json::Value &jsonLines, SLE const &line)
json::Value doAccountChannels (RPC::JsonContext &context)
json::Value doAccountCurrencies (RPC::JsonContext &context)
void injectSLE (json::Value &jv, SLE const &sle)
 Injects JSON describing a ledger entry.
json::Value doAccountInfo (RPC::JsonContext &context)
void addLine (json::Value &jsonLines, RPCTrustLine const &line)
json::Value doAccountLines (RPC::JsonContext &context)
json::Value doAccountNFTs (RPC::JsonContext &context)
 General RPC command that can retrieve objects in the account root.
bool getAccountObjects (ReadView const &ledger, AccountID const &account, std::optional< std::vector< LedgerEntryType > > const &typeFilter, uint256 dirIndex, uint256 entryIndex, std::uint32_t const limit, json::Value &jvResult)
 Gathers all objects for an account in a ledger.
json::Value doAccountObjects (RPC::JsonContext &context)
void appendOfferJson (SLE::const_ref offer, json::Value &offers)
json::Value doAccountOffers (RPC::JsonContext &context)
std::variant< std::optional< LedgerSpecifier >, json::ValueparseLedgerArgs (RPC::Context &context, json::Value const &params)
std::variant< LedgerRange, RPC::StatusgetLedgerRange (RPC::Context &context, std::optional< LedgerSpecifier > const &ledgerSpecifier)
std::pair< AccountTxResult, RPC::StatusdoAccountTxHelp (RPC::Context &context, AccountTxArgs const &args)
json::Value populateJsonResponse (std::pair< AccountTxResult, RPC::Status > const &res, AccountTxArgs const &args, RPC::JsonContext const &context)
json::Value doAccountTx (RPC::JsonContext &context)
json::Value doGatewayBalances (RPC::JsonContext &context)
static void fillTransaction (RPC::JsonContext &context, json::Value &txArray, AccountID const &accountID, std::uint32_t &sequence, ReadView const &ledger)
json::Value doNoRippleCheck (RPC::JsonContext &context)
json::Value doOwnerInfo (RPC::JsonContext &context)
json::Value doBlackList (RPC::JsonContext &context)
json::Value doCanDelete (RPC::JsonContext &context)
json::Value doLedgerCleaner (RPC::JsonContext &context)
json::Value doLedgerRequest (RPC::JsonContext &context)
static std::optional< SeedvalidationSeed (json::Value const &params)
json::Value doValidationCreate (RPC::JsonContext &context)
double estimateEntropy (std::string const &input)
json::Value doWalletPropose (RPC::JsonContext &context)
json::Value walletPropose (json::Value const &params)
json::Value doLogLevel (RPC::JsonContext &context)
json::Value doLogRotate (RPC::JsonContext &context)
json::Value doConnect (RPC::JsonContext &context)
json::Value doPeerReservationsAdd (RPC::JsonContext &context)
json::Value doPeerReservationsDel (RPC::JsonContext &context)
json::Value doPeerReservationsList (RPC::JsonContext &context)
json::Value doPeers (RPC::JsonContext &context)
json::Value doLedgerAccept (RPC::JsonContext &context)
json::Value doStop (RPC::JsonContext &context)
json::Value doChannelAuthorize (RPC::JsonContext &context)
json::Value doSign (RPC::JsonContext &context)
json::Value doSignFor (RPC::JsonContext &context)
json::Value doConsensusInfo (RPC::JsonContext &context)
json::Value doFetchInfo (RPC::JsonContext &context)
static void textTime (std::string &text, UptimeClock::time_point &seconds, char const *unitName, std::chrono::seconds unitVal)
json::Value getCountsJson (Application &app, int minObjectCount)
json::Value doGetCounts (RPC::JsonContext &context)
json::Value doPrint (RPC::JsonContext &context)
json::Value doValidatorInfo (RPC::JsonContext &context)
json::Value doValidatorListSites (RPC::JsonContext &context)
json::Value doValidators (RPC::JsonContext &context)
json::Value doUnlList (RPC::JsonContext &context)
json::Value doChannelVerify (RPC::JsonContext &context)
json::Value doAMMInfo (RPC::JsonContext &)
json::Value doBookOffers (RPC::JsonContext &)
json::Value doBookChanges (RPC::JsonContext &)
json::Value doDepositAuthorized (RPC::JsonContext &)
json::Value doFeature (RPC::JsonContext &)
json::Value doFee (RPC::JsonContext &)
json::Value doGetAggregatePrice (RPC::JsonContext &context)
 oracles: array of {account, oracle_document_id} base_asset: is the asset to be priced quote_asset: is the denomination in which the prices are expressed trim : percentage of outliers to trim [optional] time_threshold : defines a range of prices to include based on the timestamp range - {most recent, most recent - time_threshold} [optional]
json::Value doLedgerClosed (RPC::JsonContext &)
json::Value doLedgerCurrent (RPC::JsonContext &)
json::Value doLedgerData (RPC::JsonContext &)
json::Value doLedgerEntry (RPC::JsonContext &)
json::Value doLedgerHeader (RPC::JsonContext &)
json::Value doManifest (RPC::JsonContext &)
json::Value doNFTBuyOffers (RPC::JsonContext &)
json::Value doNFTSellOffers (RPC::JsonContext &)
json::Value doPathFind (RPC::JsonContext &)
json::Value doPause (RPC::JsonContext &)
json::Value doPing (RPC::JsonContext &)
json::Value doRandom (RPC::JsonContext &)
json::Value doResume (RPC::JsonContext &)
json::Value doRipplePathFind (RPC::JsonContext &)
json::Value doServerDefinitions (RPC::JsonContext &)
json::Value doServerInfo (RPC::JsonContext &)
json::Value doServerState (RPC::JsonContext &)
json::Value doSimulate (RPC::JsonContext &)
json::Value doSubmit (RPC::JsonContext &)
json::Value doSubmitMultiSigned (RPC::JsonContext &)
json::Value doSubscribe (RPC::JsonContext &)
json::Value doTransactionEntry (RPC::JsonContext &)
json::Value doTxJson (RPC::JsonContext &)
json::Value doTxHistory (RPC::JsonContext &)
json::Value doTxReduceRelay (RPC::JsonContext &)
json::Value doUnsubscribe (RPC::JsonContext &)
json::Value doVaultInfo (RPC::JsonContext &)
static std::expected< uint256, json::ValueparseFixed (Keylet const &keylet, json::Value const &params, json::StaticString const &fieldName, unsigned const apiVersion)
static FunctionType fixed (Keylet const &keylet)
static std::expected< uint256, json::ValueparseObjectID (json::Value const &params, json::StaticString const fieldName, std::string const &expectedType="hex string or object")
static std::expected< uint256, json::ValueparseIndex (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseAccountRoot (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseAMM (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseBridge (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseCheck (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseCredential (json::Value const &cred, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseDelegate (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< STArray, json::ValueparseAuthorizeCredentials (json::Value const &jv)
static std::expected< uint256, json::ValueparseDepositPreauth (json::Value const &dp, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseDID (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseDirectoryNode (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseEscrow (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseLedgerHashes (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseLoanBroker (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseLoan (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseMPToken (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseMPTokenIssuance (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseNFTokenOffer (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseNFTokenPage (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseOffer (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseOracle (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparsePayChannel (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparsePermissionedDomain (json::Value const &pd, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseRippleState (json::Value const &jvRippleState, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseSignerList (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseTicket (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseVault (json::Value const &params, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseXChainOwnedClaimID (json::Value const &claimId, json::StaticString const fieldName, unsigned const apiVersion)
static std::expected< uint256, json::ValueparseXChainOwnedCreateAccountClaimID (json::Value const &claimId, json::StaticString const fieldName, unsigned const apiVersion)
std::expected< Asset, ErrorCodeIgetAsset (json::Value const &v, beast::Journal j)
std::string toIso8601 (NetClock::time_point tp)
std::optional< json::ValuevalidateTakerJSON (json::Value const &taker, json::StaticString const &name)
std::optional< json::ValueparseTakerAssetJSON (Asset &asset, json::Value const &taker, json::StaticString const &name, beast::Journal j)
std::optional< json::ValueparseTakerIssuerJSON (Asset &asset, json::Value const &taker, json::StaticString const &name, beast::Journal j)
static void iteratePriceData (RPC::JsonContext &context, SLE::const_ref sle, std::function< bool(STObject const &)> const &f)
 Calls callback "f" on the ledger-object sle and up to three previous metadata objects.
static std::tuple< STAmount, Number, std::uint16_tgetStats (Prices::right_const_iterator const &begin, Prices::right_const_iterator const &end)
void appendNftOfferJson (Application const &app, SLE::const_ref offer, json::Value &offers)
json::Value enumerateNFTOffers (RPC::JsonContext &context, uint256 const &nftId, Keylet const &directory)
json::Value const & getServerDefinitionsJson ()
static std::expected< std::uint32_t, json::ValuegetAutofillSequence (json::Value const &txJson, RPC::JsonContext &context)
static std::optional< json::ValueautofillSignature (json::Value &sigObject)
static std::optional< json::ValueautofillTx (json::Value &txJson, RPC::JsonContext &context)
static json::Value getTxJsonFromParams (json::Value const &params)
static json::Value simulateTxn (RPC::JsonContext &context, std::shared_ptr< Transaction > transaction)
static std::expected< NetworkOPs::FailHard, json::ValuegetFailHard (RPC::JsonContext const &context)
static bool isValidated (LedgerMaster &ledgerMaster, std::uint32_t seq, uint256 const &hash)
std::pair< TxResult, RPC::StatusdoTxHelp (RPC::Context &context, TxArgs args)
json::Value populateJsonResponse (std::pair< TxResult, RPC::Status > const &res, TxArgs const &args, RPC::JsonContext const &context)
static std::optional< uint256parseVault (json::Value const &params, json::Value &jvResult)
bool operator< (Port const &lhs, Port const &rhs)
template<class Engine, class Integral>
std::enable_if_t< std::is_integral_v< Integral > &&detail::is_engine< Engine >::value, Integral > randInt (Engine &engine, Integral min, Integral max)
 Return a uniformly distributed random integer.
template<class Integral>
std::enable_if_t< std::is_integral_v< Integral >, Integral > randInt (Integral min, Integral max)
template<class Engine, class Integral>
std::enable_if_t< std::is_integral_v< Integral > &&detail::is_engine< Engine >::value, Integral > randInt (Engine &engine, Integral max)
template<class Integral>
std::enable_if_t< std::is_integral_v< Integral >, Integral > randInt (Integral max)
template<class Integral, class Engine>
std::enable_if_t< std::is_integral_v< Integral > &&detail::is_engine< Engine >::value, Integral > randInt (Engine &engine)
template<class Integral = int>
std::enable_if_t< std::is_integral_v< Integral >, Integral > randInt ()
template<class Byte, class Engine>
std::enable_if_t<(std::is_same_v< Byte, unsigned char >||std::is_same_v< Byte, std::uint8_t >) &&detail::is_engine< Engine >::value, Byte > randByte (Engine &engine)
 Return a random byte.
template<class Byte = std::uint8_t>
std::enable_if_t<(std::is_same_v< Byte, unsigned char >||std::is_same_v< Byte, std::uint8_t >), Byte > randByte ()
template<class Engine>
bool randBool (Engine &engine)
 Return a random boolean value.
bool randBool ()
bool cdirFirst (ReadView const &view, uint256 const &root, SLE::const_pointer &page, unsigned int &index, uint256 &entry)
 Returns the first entry in the directory, advancing the index.
bool dirFirst (ApplyView &view, uint256 const &root, SLE::pointer &page, unsigned int &index, uint256 &entry)
bool cdirNext (ReadView const &view, uint256 const &root, SLE::const_pointer &page, unsigned int &index, uint256 &entry)
 Returns the next entry in the directory, advancing the index.
bool dirNext (ApplyView &view, uint256 const &root, SLE::pointer &page, unsigned int &index, uint256 &entry)
STAmount creditLimit (ReadView const &view, AccountID const &account, AccountID const &issuer, Currency const &currency)
 Calculate the maximum amount of IOUs that an account can hold.
IOUAmount creditLimit2 (ReadView const &v, AccountID const &acc, AccountID const &iss, Currency const &cur)
STAmount creditBalance (ReadView const &view, AccountID const &account, AccountID const &issuer, Currency const &currency)
 Returns the amount of IOUs issued by issuer that are held by an account.
constexpr bool operator== (Book const &lhs, Book const &rhs)
 Equality comparison.
constexpr std::weak_ordering operator<=> (Book const &lhs, Book const &rhs)
 Strict weak ordering.
constexpr bool operator== (Issue const &lhs, Issue const &rhs)
 Equality comparison.
constexpr std::weak_ordering operator<=> (Issue const &lhs, Issue const &rhs)
 Strict weak ordering.
bool canHaveNFTokenID (std::shared_ptr< STTx const > const &serializedTx, TxMeta const &transactionMeta)
 Add a nftoken_ids field to the meta output parameter.
std::optional< uint256getNFTokenIDFromPage (TxMeta const &transactionMeta)
std::vector< uint256getNFTokenIDFromDeletedOffer (TxMeta const &transactionMeta)
void insertNFTokenID (json::Value &response, std::shared_ptr< STTx const > const &transaction, TxMeta const &transactionMeta)
bool canHaveNFTokenOfferID (std::shared_ptr< STTx const > const &serializedTx, TxMeta const &transactionMeta)
 Add an offer_id field to the meta output parameter.
std::optional< uint256getOfferIDFromCreatedOffer (TxMeta const &transactionMeta)
void insertNFTokenOfferID (json::Value &response, std::shared_ptr< STTx const > const &transaction, TxMeta const &transactionMeta)
std::optional< KeyTypepublicKeyType (Slice const &slice)
 Returns the type of public key.
std::optional< KeyTypepublicKeyType (PublicKey const &publicKey)
Buffer signDigest (PublicKey const &pk, SecretKey const &sk, uint256 const &digest)
 Generate a signature for a message digest.
Buffer signDigest (KeyType type, SecretKey const &sk, uint256 const &digest)
Buffer sign (PublicKey const &pk, SecretKey const &sk, Slice const &message)
 Generate a signature for a message.
Buffer sign (KeyType type, SecretKey const &sk, Slice const &message)
template<class T, class U>
std::optional< T > get (STObject const &st, TypedField< U > const &f)
 Return the value of a field in an STObject as a given type.
template<class U>
std::optional< typename STExchange< U, typename U::value_type >::value_type > get (STObject const &st, TypedField< U > const &f)
std::optional< ManifestdeserializeManifest (Slice s, beast::Journal journal)
 Constructs Manifest from serialized string.
std::optional< ManifestdeserializeManifest (std::string const &s, beast::Journal journal=beast::Journal(beast::Journal::getNullSink()))
template<class T, class = std::enable_if_t<std::is_same_v<T, char> || std::is_same_v<T, unsigned char>>>
std::optional< ManifestdeserializeManifest (std::vector< T > const &v, beast::Journal journal=beast::Journal(beast::Journal::getNullSink()))
std::optional< SHAMapNodeIDdeserializeSHAMapNodeID (void const *data, std::size_t size)
 Return an object representing a serialized SHAMap Node ID.
std::optional< SHAMapNodeIDdeserializeSHAMapNodeID (std::string_view s)
PreflightResult preflight (ServiceRegistry &registry, Rules const &rules, STTx const &tx, ApplyFlags flags, beast::Journal j)
 Gate a transaction based on static information.
PreflightResult preflight (ServiceRegistry &registry, Rules const &rules, uint256 const &parentBatchId, STTx const &tx, ApplyFlags flags, beast::Journal j)

Variables

static constexpr std::chrono::seconds kEpochOffset
 Clock for measuring the network time.
constexpr auto kMuldivMax = std::numeric_limits<std::uint64_t>::max()
constexpr std::array< std::uint64_t, detail::kInt64DigitskPowerOfTen = detail::buildPowersOfTen()
static constexpr Number kNumZero {}
Number const kAMMInvariantRelativeTolerance {1, -11}
static constexpr std::uint32_t kSecondsInYear = 365 * 24 * 60 * 60
CreateGenesisT const kCreateGenesis {}
constexpr std::chrono::seconds kLedgerPossibleTimeResolutions []
 Possible ledger close time resolutions.
constexpr auto kLedgerDefaultTimeResolution = kLedgerPossibleTimeResolutions[2]
 Initial resolution of ledger close time.
constexpr auto kLedgerGenesisTimeResolution = kLedgerPossibleTimeResolutions[0]
 Close time resolution in genesis ledger.
constexpr auto kIncreaseLedgerTimeResolutionEvery = 8
 How often we increase the close time resolution (in numbers of ledgers).
constexpr auto kDecreaseLedgerTimeResolutionEvery = 1
 How often we decrease the close time resolution (in numbers of ledgers).
constexpr struct xrpl::OpenLedgerT kOpenLedger
constexpr struct xrpl::BatchViewT kBatchView
constexpr std::uint16_t kTradingFeeThreshold = 1000
constexpr std::uint32_t kTotalTimeSlotSecs = 24 * 3600
constexpr std::uint16_t kAuctionSlotTimeIntervals = 20
constexpr std::uint16_t kAuctionSlotMaxAuthAccounts = 4
constexpr std::uint32_t kAuctionSlotFeeScaleFactor = 100000
constexpr std::uint32_t kAuctionSlotDiscountedFeeFraction = 10
constexpr std::uint32_t kAuctionSlotMinFeeFraction = 25
constexpr std::uint32_t kAuctionSlotIntervalDuration
constexpr std::uint16_t kVoteMaxSlots = 8
constexpr std::uint32_t kVoteWeightScaleFactor = 100000
template<ValidIssueType TIss>
constexpr bool kIsIssueV = std::is_same_v<TIss, Issue>
template<ValidIssueType TIss>
constexpr bool kIsMptissueV = std::is_same_v<TIss, MPTIssue>
static constexpr std::size_t kMaxFeatureNameSize = 63
static constexpr std::size_t kReservedFeatureNameSize = 32
constexpr std::uint32_t kFeeUnitsDeprecated = 10
std::array< KeyletDesc< AccountID const & >, 6 > const kDirectAccountKeylets
static std::uint32_t const kSLcfNoConsensusTime = 0x01
template<ValidPathAsset PA>
constexpr bool kIsCurrencyV = std::is_same_v<PA, Currency>
template<ValidPathAsset PA>
constexpr bool kIsMptidV = std::is_same_v<PA, MPTID>
constexpr std::size_t kTxMinSizeBytes = 32
 Protocol specific constants.
constexpr std::size_t kTxMaxSizeBytes = megabytes(1)
 Largest legal byte size of a transaction.
constexpr std::size_t kUnfundedOfferRemoveLimit = 1000
 The maximum number of unfunded offers to delete at once.
constexpr std::size_t kExpiredOfferRemoveLimit = 256
 The maximum number of expired offers to delete at once.
constexpr std::size_t kOversizeMetaDataCap = 5200
 The maximum number of metadata entries allowed in one transaction.
constexpr std::size_t kDirNodeMaxEntries = 32
 The maximum number of entries per directory page.
constexpr std::uint64_t kDirNodeMaxPages = 262144
 The maximum number of pages allowed in a directory.
constexpr std::size_t kDirMaxTokensPerPage = 32
 The maximum number of items in an NFT page.
constexpr std::size_t kMaxDeletableDirEntries = 1000
 The maximum number of owner directory entries for account to be deletable.
constexpr std::size_t kMaxTokenOfferCancelCount = 500
 The maximum number of token offers that can be canceled at once.
constexpr std::size_t kMaxDeletableTokenOfferEntries = 500
 The maximum number of offers in an offer directory for NFT to be burnable.
constexpr std::uint16_t kMaxTransferFee = 50000
 The maximum token transfer fee allowed.
constexpr std::size_t kMaxTokenUriLength = 256
 The maximum length of a URI inside an NFT.
constexpr std::size_t kMaxDidDocumentLength = 256
 The maximum length of a Data element inside a DID.
constexpr std::size_t kMaxDidUriLength = 256
 The maximum length of a URI inside a DID.
constexpr std::size_t kMaxDidDataLength = 256
 The maximum length of an Attestation inside a DID.
constexpr std::size_t kMaxDomainLength = 256
 The maximum length of a domain.
constexpr std::size_t kMaxCredentialUriLength = 256
 The maximum length of a URI inside a Credential.
constexpr std::size_t kMaxCredentialTypeLength = 64
 The maximum length of a CredentialType inside a Credential.
constexpr std::size_t kMaxCredentialsArraySize = 8
 The maximum number of credentials can be passed in array.
constexpr std::size_t kMaxPermissionedDomainCredentialsArraySize = 10
 The maximum number of credentials can be passed in array for permissioned domain.
constexpr std::size_t kMaxMpTokenMetadataLength = 1024
 The maximum length of MPTokenMetadata.
constexpr std::uint64_t kMaxMpTokenAmount = 0x7FFF'FFFF'FFFF'FFFFull
 The maximum amount of MPTokenIssuance.
constexpr std::size_t kMaxDataPayloadLength = 256
 The maximum length of Data payload.
constexpr std::uint8_t kVaultStrategyFirstComeFirstServe = 1
 Vault withdrawal policies.
constexpr std::uint8_t kVaultDefaultIouScale = 6
 Default IOU scale factor for a Vault.
constexpr std::uint8_t kVaultMaximumIouScale = 18
 Maximum scale factor for a Vault.
constexpr std::uint8_t kMaxAssetCheckDepth = 5
 Maximum recursion depth for vault shares being put as an asset inside another vault; counted from 0.
constexpr std::uint32_t kFlagLedgerInterval = 256
constexpr std::uint16_t kMaxDeletableAmmTrustLines = 512
 The maximum number of trustlines to delete as part of AMM account deletion cleanup.
constexpr std::size_t kMaxOracleUri = 256
 The maximum length of a URI inside an Oracle.
constexpr std::size_t kMaxOracleProvider = 256
 The maximum length of a Provider inside an Oracle.
constexpr std::size_t kMaxOracleDataSeries = 10
 The maximum size of a data series array inside an Oracle.
constexpr std::size_t kMaxOracleSymbolClass = 16
 The maximum length of a SymbolClass inside an Oracle.
constexpr std::size_t kMaxLastUpdateTimeDelta = 300
 The maximum allowed time difference between lastUpdateTime and the time of the last closed ledger.
constexpr std::size_t kMaxPriceScale = 20
 The maximum price scaling factor.
constexpr std::size_t kMaxTrim = 25
 The maximum percentage of outliers to trim.
constexpr std::size_t kPermissionMaxSize = 10
 The maximum number of delegate permissions an account can grant.
constexpr std::size_t kMaxBatchTxCount = 8
 The maximum number of transactions that can be in a batch.
constexpr std::size_t kEcScalarLength = kMPT_SCALAR_SIZE
 Length of a secp256k1 scalar in bytes.
constexpr std::size_t kCompressedEcPointLength = 33
 Length of EC point (compressed).
constexpr std::size_t kEcCiphertextComponentLength = kMPT_ELGAMAL_CIPHER_SIZE
 Length of one compressed EC point component in an EC ElGamal ciphertext.
constexpr std::size_t kEcGamalEncryptedTotalLength = kMPT_ELGAMAL_TOTAL_SIZE
 EC ElGamal ciphertext length: two compressed EC points concatenated.
constexpr std::size_t kEcPubKeyLength = kMPT_PUBKEY_SIZE
 Length of EC public key (compressed).
constexpr std::size_t kEcPrivKeyLength = kMPT_PRIVKEY_SIZE
 Length of EC private key in bytes.
constexpr std::size_t kEcBlindingFactorLength = kMPT_BLINDING_FACTOR_SIZE
 Length of the EC blinding factor in bytes.
constexpr std::size_t kEcSchnorrProofLength = kMPT_SCHNORR_PROOF_SIZE
 Length of Schnorr ZKProof for public key registration (compact form) in bytes.
constexpr std::size_t kEcPedersenCommitmentLength = kMPT_PEDERSEN_COMMIT_SIZE
 Length of Pedersen Commitment (compressed).
constexpr std::size_t kEcSingleBulletproofLength = kMPT_SINGLE_BULLETPROOF_SIZE
 Length of single bulletproof (range proof for 1 commitment) in bytes.
constexpr std::size_t kEcDoubleBulletproofLength = kMPT_DOUBLE_BULLETPROOF_SIZE
 Length of double bulletproof (range proof for 2 commitments) in bytes.
constexpr std::size_t kEcSendSigmaProofLength = SECP256K1_COMPACT_STANDARD_PROOF_SIZE
 Length of the compact sigma proof component for ConfidentialMPTSend.
constexpr std::size_t kEcSendProofLength = kEcSendSigmaProofLength + kEcDoubleBulletproofLength
 192 bytes compact sigma proof + 754 bytes double bulletproof.
constexpr std::size_t kEcConvertBackSigmaProofLength = SECP256K1_COMPACT_CONVERTBACK_PROOF_SIZE
 Length of the compact sigma proof component for ConfidentialMPTConvertBack.
constexpr std::size_t kEcConvertBackProofLength
 128 bytes compact sigma proof + 688 bytes single bulletproof.
constexpr std::size_t kEcClawbackProofLength = SECP256K1_COMPACT_CLAWBACK_PROOF_SIZE
 Length of the ZKProof for ConfidentialMPTClawback.
constexpr std::uint32_t kConfidentialFeeMultiplier = 9
 Extra base fee multiplier charged to confidential MPT transactions.
constexpr std::uint8_t kEcCompressedPrefixEvenY = 0x02
 Compressed EC point prefix for even y-coordinate.
constexpr std::uint8_t kEcCompressedPrefixOddY = 0x03
 Compressed EC point prefix for odd y-coordinate.
Rate const kParityRate
 A transfer rate signifying a 1:1 exchange.
static std::map< std::string, int > const kSTypeMap = {XMACRO(TO_MAP)}
SField const sfInvalid
SField const sfGeneric
constexpr std::size_t kMaxParsedJsonDepth = 64
 Maximum JSON object nesting depth permitted during parsing.
constexpr std::size_t kMaxParsedJsonArraySize = 512
 Maximum number of elements permitted in any JSON array field during parsing.
constexpr std::uint32_t kVfFullValidation = 0x00000001
constexpr std::uint32_t kVfFullyCanonicalSig = 0x80000000
constexpr XRPAmount kInitialXrp {100'000'000'000 * kDropsPerXrp}
 Configure the native currency.
static constexpr std::uint32_t kXrpLedgerEarliestSeq {32570u}
 The XRP ledger network's earliest allowed sequence.
static constexpr std::uint32_t kXrpLedgerEarliestFees {562177u}
 The XRP Ledger mainnet's earliest ledger with a FeeSettings object.
constexpr std::ratio< 80, 100 > kAmendmentMajorityCalcThreshold
 The minimum amount of support an amendment should have.
constexpr std::chrono::seconds const kDefaultAmendmentMajorityTime = weeks{2}
 The minimum amount of time an amendment must hold a majority.
constexpr FlagValue tfFullyCanonicalSig = 0x80000000
constexpr FlagValue tfInnerBatchTxn = 0x40000000
constexpr FlagValue tfUniversal = tfFullyCanonicalSig | tfInnerBatchTxn
constexpr FlagValue tfUniversalMask = ~tfUniversal
constexpr FlagValue tfMPTPaymentMask = ~(tfUniversal | tfPartialPayment)
constexpr FlagValue tfTrustSetPermissionMask
constexpr FlagValue tmfMPTCanEnableCanLock = lsmfMPTCanEnableCanLock
constexpr FlagValue tmfMPTCanEnableRequireAuth = lsmfMPTCanEnableRequireAuth
constexpr FlagValue tmfMPTCanEnableCanEscrow = lsmfMPTCanEnableCanEscrow
constexpr FlagValue tmfMPTCanEnableCanTrade = lsmfMPTCanEnableCanTrade
constexpr FlagValue tmfMPTCanEnableCanTransfer = lsmfMPTCanEnableCanTransfer
constexpr FlagValue tmfMPTCanEnableCanClawback = lsmfMPTCanEnableCanClawback
constexpr FlagValue tmfMPTCanMutateMetadata = lsmfMPTCanMutateMetadata
constexpr FlagValue tmfMPTCanMutateTransferFee = lsmfMPTCanMutateTransferFee
constexpr FlagValue tmfMPTCannotEnableCanHoldConfidentialBalance
constexpr FlagValue tmfMPTokenIssuanceCreateMutableMask
constexpr FlagValue tmfMPTSetCanLock = 0x00000001
constexpr FlagValue tmfMPTSetRequireAuth = 0x00000002
constexpr FlagValue tmfMPTSetCanEscrow = 0x00000004
constexpr FlagValue tmfMPTSetCanTrade = 0x00000008
constexpr FlagValue tmfMPTSetCanTransfer = 0x00000010
constexpr FlagValue tmfMPTSetCanClawback = 0x00000020
constexpr FlagValue tmfMPTSetCanHoldConfidentialBalance = 0x00000040
constexpr FlagValue tmfMPTokenIssuanceSetMutableMask
constexpr FlagValue tfTrustLine = 0x00000004
constexpr FlagValue tfNFTokenMintMaskWithoutMutable
constexpr FlagValue tfNFTokenMintOldMask = ~(~tfNFTokenMintMaskWithoutMutable | tfTrustLine)
constexpr FlagValue tfNFTokenMintOldMaskWithMutable = ~(~tfNFTokenMintOldMask | tfMutable)
constexpr FlagValue tfWithdrawSubTx
constexpr FlagValue tfDepositSubTx
constexpr XRPAmount kDropsPerXrp {1'000'000}
 Number of drops per 1 XRP.
constexpr char const * kCommonDbPragmaJournal {"PRAGMA journal_mode=%s;"}
constexpr char const * kCommonDbPragmaSync {"PRAGMA synchronous=%s;"}
constexpr char const * kCommonDbPragmaTemp {"PRAGMA temp_store=%s;"}
constexpr std::uint32_t kSqliteTuningCutoff = 10'000'000
constexpr auto kLgrDbName {"ledger.db"}
constexpr std::array< char const *, 5 > kLgrDbInit
constexpr auto kTxDbName {"transaction.db"}
constexpr std::array< char const *, 8 > kTxDbInit
constexpr auto kWalletDbName {"wallet.db"}
constexpr std::array< char const *, 6 > kWalletDbInit
static constexpr unsigned char const kWireTypeTransaction = 0
static constexpr unsigned char const kWireTypeAccountState = 1
static constexpr unsigned char const kWireTypeInner = 2
static constexpr unsigned char const kWireTypeCompressedInner = 3
static constexpr unsigned char const kWireTypeTransactionWithMeta = 4
constexpr std::size_t kMinShaMapItemBytes = 12
constexpr size_t kXbridgeMaxAccountCreateClaims = 128
static std::optional< HTTPClientSSLContextgHttpClientSslContext
static std::unique_ptr< detail::AccountIdCachegAccountIdCache
static bool const kReadOnlySet = gFeatureCollections.registrationIsDone()
static constexpr std::int64_t kMinMantissa = STAmount::kMinValue
static constexpr std::int64_t kMaxMantissa = STAmount::kMaxValue
static constexpr int kMinExponent = STAmount::kMinOffset
static constexpr int kMaxExponent = STAmount::kMaxOffset
static SField::PrivateAccessTagT access
SField const kSfHash (access, STI_UINT256, 257, "hash")
SField const kSfIndex (access, STI_UINT256, 258, "index")
static std::uint64_t const kTenTO14 = 100000000000000ull
static std::uint64_t const kTenTO14M1 = kTenTO14 - 1
static std::uint64_t const kTenTO17 = kTenTO14 * 1000
static constexpr char const * kAlphabetForward
static constexpr std::array< int, 256 > const kAlphabetReverse
CheckpointersCollection gCheckpointers
static auto gCheckpointPageCount = 1000
static boost::intrusive_ptr< SHAMapItem const > const kNoItem
constexpr HashRouterFlags kSfSigbad = HashRouterFlags::PRIVATE1
constexpr HashRouterFlags kSfSiggood = HashRouterFlags::PRIVATE2
constexpr HashRouterFlags kSfLocalbad = HashRouterFlags::PRIVATE3
constexpr HashRouterFlags kSfLocalgood = HashRouterFlags::PRIVATE4
static std::uint32_t const kDefaultSignerListId = 0
constexpr HashRouterFlags kSfCfInvalid = HashRouterFlags::PRIVATE5
constexpr HashRouterFlags kSfCfValid = HashRouterFlags::PRIVATE6
static constexpr std::array< MPTMutabilityFlags, 6 > kMptMutabilityFlags
static constexpr auto kPeerCountStart = 5
static constexpr auto kPeerCountAdd = 3
static constexpr auto kLedgerTimeoutRetriesMax = 6
static constexpr auto kLedgerBecomeAggressiveThreshold
static constexpr auto kMissingNodesFind = 256
static constexpr auto kReqNodesReply = 128
static constexpr auto kReqNodes = 12
constexpr auto kLedgerAcquireTimeout = 3000ms
static constexpr auto kStartPeers = 2
static constexpr auto kSetKeepRounds = 3
static constexpr int kMaxLedgerGap {100}
static constexpr std::chrono::minutes kMaxLedgerAgeAcquire {1}
static constexpr int kMaxWriteLoadAcquire {8192}
constexpr auto kTxAcquireTimeout = 250ms
static constexpr auto kNormTimeouts = 4
static constexpr auto kMaxTimeouts = 20
constexpr std::size_t kFullBelowTargetSize = 524288
constexpr std::chrono::seconds kFullBelowExpiration = std::chrono::minutes{10}
constexpr std::size_t kMaxPoppedTransactions = 10
constexpr auto kDefaultRefreshInterval = std::chrono::minutes{5}
constexpr auto kErrorRetryInterval = std::chrono::seconds{30}
unsigned constexpr short kMaxRedirects = 3
static std::array< char const *, 5 > const kStateNames
static auto const kGenesisAccountId
constexpr std::array< std::pair< SizedItem, std::array< int, 5 > >, 13 > kSizedItems
static constexpr char kFeatureCompr [] = "compr"
static constexpr char kFeatureVprr [] = "vprr"
static constexpr char kFeatureTxrr [] = "txrr"
static constexpr char kFeatureLedgerReplay [] = "ledgerreplay"
static constexpr char kDelimFeature [] = ";"
static constexpr char kDelimValue [] = ","
constexpr ProtocolVersion const kSupportedProtocolList []
 The list of protocol versions we speak and we prefer to use.
std::unordered_map< protocol::MessageType, TrafficCount::Category > const kTypeLookup
constexpr std::size_t kMaximumMessageSize = megabytes(64)
constexpr json::Int kMethodNotFound = -32601
constexpr json::Int kServerOverloaded = -32604
constexpr json::Int kForbidden = -32605
constexpr json::Int kWrongVersion = -32606
auto const parseAmendments = fixed(keylet::amendments())
auto const parseFeeSettings = fixed(keylet::feeSettings())
auto const parseNegativeUNL = fixed(keylet::negativeUNL())

Detailed Description

Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.

Callback for filtering SHAMap during sync.

TODO: Remove xrpl::basic_semaphore (and this file) and use std::counting_semaphore.

Use hardened_hash_* containers for keys that do need a secure hashing algorithm.

The cryptographic security of containers where a hash function is used as a template parameter depends entirely on that hash function and not at all on what container it is.

Background:

GCC: According to GCC Bugzilla PR104928 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104928#c15), the fix is scheduled for inclusion in GCC 16.0 (see comment #15, Target Milestone: 16.0). It is not included in GCC 14.x or earlier, and there is no indication that it will be backported to GCC 13.x or 14.x branches.

Clang: The fix for is included in Clang 19.1.0+

Once the minimum compiler version is updated to > GCC 16.0 or Clang 19.1.0, we can remove this file.

WARNING: Avoid using std::counting_semaphore until the minimum compiler version is updated.

Typedef Documentation

◆ uint128

using xrpl::uint128 = BaseUInt<128>

Definition at line 560 of file base_uint.h.

◆ uint160

using xrpl::uint160 = BaseUInt<160>

Definition at line 561 of file base_uint.h.

◆ uint256

using xrpl::uint256 = BaseUInt<256>

Definition at line 562 of file base_uint.h.

◆ uint192

using xrpl::uint192 = BaseUInt<192>

Definition at line 563 of file base_uint.h.

◆ Blob

using xrpl::Blob = std::vector<unsigned char>

Storage for linear binary data.

Blocks of binary data appear often in various idioms and structures.

Definition at line 10 of file Blob.h.

◆ days

◆ weeks

Definition at line 21 of file chrono.h.

◆ Stopwatch

A clock for measuring elapsed time.

The epoch is unspecified.

Definition at line 87 of file chrono.h.

◆ TestStopwatch

A manual Stopwatch for unit tests.

Definition at line 90 of file chrono.h.

◆ KeyCache

using xrpl::KeyCache = TaggedCache<uint256, int, true>

Definition at line 8 of file KeyCache.h.

◆ ClosedInterval

template<class T>
using xrpl::ClosedInterval = boost::icl::closed_interval<T>

A closed interval over the domain T.

For an instance ClosedInterval c, this represents the closed interval (c.first(), c.last()). A single element interval has c.first() == c.last().

This is simply a type-alias for boost interval container library interval set, so users should consult that documentation for available supporting member and free functions.

Definition at line 25 of file RangeSet.h.

◆ RangeSet

template<class T>
using xrpl::RangeSet = boost::icl::interval_set<T, std::less, ClosedInterval<T>>

A set of closed intervals over the domain T.

Represents a set of values of the domain T using the minimum number of disjoint ClosedInterval<T>. This is useful to represent ranges of T where a few instances are missing, e.g. the set 1-5,8-9,11-14.

This is simply a type-alias for boost interval container library interval set, so users should consult that documentation for available supporting member and free functions.

Definition at line 50 of file RangeSet.h.

◆ hash_map

template<class Key, class Value, class Hash = beast::Uhash<>, class Pred = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key const, Value>>>
using xrpl::hash_map = std::unordered_map<Key, Value, Hash, Pred, Allocator>

Definition at line 34 of file UnorderedContainers.h.

◆ hash_multimap

template<class Key, class Value, class Hash = beast::Uhash<>, class Pred = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key const, Value>>>
using xrpl::hash_multimap = std::unordered_multimap<Key, Value, Hash, Pred, Allocator>

Definition at line 42 of file UnorderedContainers.h.

◆ hash_set

template<class Value, class Hash = beast::Uhash<>, class Pred = std::equal_to<Value>, class Allocator = std::allocator<Value>>
using xrpl::hash_set = std::unordered_set<Value, Hash, Pred, Allocator>

Definition at line 49 of file UnorderedContainers.h.

◆ hash_multiset

template<class Value, class Hash = beast::Uhash<>, class Pred = std::equal_to<Value>, class Allocator = std::allocator<Value>>
using xrpl::hash_multiset = std::unordered_multiset<Value, Hash, Pred, Allocator>

Definition at line 56 of file UnorderedContainers.h.

◆ strong_hash

Definition at line 60 of file UnorderedContainers.h.

◆ hardened_hash_map

template<class Key, class Value, class Hash = HardenedHash<strong_hash>, class Pred = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key const, Value>>>
using xrpl::hardened_hash_map = std::unordered_map<Key, Value, Hash, Pred, Allocator>

Definition at line 68 of file UnorderedContainers.h.

◆ hardened_partitioned_hash_map

template<class Key, class Value, class Hash = HardenedHash<strong_hash>, class Pred = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key const, Value>>>
using xrpl::hardened_partitioned_hash_map = PartitionedUnorderedMap<Key, Value, Hash, Pred, Allocator>

Definition at line 76 of file UnorderedContainers.h.

◆ hardened_hash_multimap

template<class Key, class Value, class Hash = HardenedHash<strong_hash>, class Pred = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key const, Value>>>
using xrpl::hardened_hash_multimap = std::unordered_multimap<Key, Value, Hash, Pred, Allocator>

Definition at line 84 of file UnorderedContainers.h.

◆ hardened_hash_set

template<class Value, class Hash = HardenedHash<strong_hash>, class Pred = std::equal_to<Value>, class Allocator = std::allocator<Value>>
using xrpl::hardened_hash_set = std::unordered_set<Value, Hash, Pred, Allocator>

Definition at line 91 of file UnorderedContainers.h.

◆ hardened_hash_multiset

template<class Value, class Hash = HardenedHash<strong_hash>, class Pred = std::equal_to<Value>, class Allocator = std::allocator<Value>>
using xrpl::hardened_hash_multiset = std::unordered_multiset<Value, Hash, Pred, Allocator>

Definition at line 98 of file UnorderedContainers.h.

◆ IniFileSections

◆ semaphore

◆ JobCounter

Definition at line 133 of file Job.h.

◆ SLE

Definition at line 36 of file ServiceRegistry.h.

◆ CachedSLEs

Definition at line 37 of file ServiceRegistry.h.

◆ RCLValidations

Alias for RCL-specific instantiation of generic Validations.

Definition at line 76 of file ServiceRegistry.h.

◆ NodeCache

◆ MultiplePaymentDestinations

◆ CachedLedger

A ledger wrapped in a CachedView.

Definition at line 413 of file include/xrpl/ledger/Ledger.h.

◆ majorityAmendments_t

◆ EntryDeleter

Initial value:
std::shared_ptr< STLedgerEntry > pointer
LedgerEntryType
Identifiers for on-ledger objects.
BaseUInt< 256 > uint256
Definition base_uint.h:562

Deleter function prototype.

Returns the status of the entry deletion (if should not be skipped) and if the entry should be skipped. The status is always tesSUCCESS if the entry should be skipped.

Definition at line 217 of file View.h.

◆ AccountID

A 160-bit unsigned that uniquely identifies an account.

Definition at line 28 of file AccountID.h.

◆ Result

template<class T>
using xrpl::Result = boost::outcome_v2::result<T, std::error_code>

Definition at line 17 of file b58_utils.h.

◆ ripemd160_hasher

Definition at line 94 of file digest.h.

◆ sha256_hasher

Definition at line 95 of file digest.h.

◆ sha512_hasher

Definition at line 96 of file digest.h.

◆ sha512_half_hasher

Definition at line 194 of file digest.h.

◆ sha512_half_hasher_s

Definition at line 197 of file digest.h.

◆ LedgerFlagMap

◆ MultiApiJson

◆ LedgerIndex

A ledger index.

Definition at line 259 of file Protocol.h.

◆ TxID

A transaction identifier.

The value is computed as the hash of the canonicalized, serialized transaction object.

Definition at line 275 of file Protocol.h.

◆ Amounts

Definition at line 64 of file Quality.h.

◆ LedgerHash

Definition at line 7 of file RippleLedgerHash.h.

◆ SF_UINT8

Definition at line 333 of file SField.h.

◆ SF_UINT16

Definition at line 334 of file SField.h.

◆ SF_UINT32

Definition at line 335 of file SField.h.

◆ SF_UINT64

Definition at line 336 of file SField.h.

◆ SF_UINT96

Definition at line 337 of file SField.h.

◆ SF_UINT128

Definition at line 338 of file SField.h.

◆ SF_UINT160

Definition at line 339 of file SField.h.

◆ SF_UINT192

Definition at line 340 of file SField.h.

◆ SF_UINT256

Definition at line 341 of file SField.h.

◆ SF_UINT384

Definition at line 342 of file SField.h.

◆ SF_UINT512

Definition at line 343 of file SField.h.

◆ SF_INT32

Definition at line 345 of file SField.h.

◆ SF_INT64

Definition at line 346 of file SField.h.

◆ SF_ACCOUNT

Definition at line 348 of file SField.h.

◆ SF_AMOUNT

Definition at line 349 of file SField.h.

◆ SF_ISSUE

Definition at line 350 of file SField.h.

◆ SF_CURRENCY

Definition at line 351 of file SField.h.

◆ SF_NUMBER

Definition at line 352 of file SField.h.

◆ SF_VL

Definition at line 353 of file SField.h.

◆ SF_VECTOR256

Definition at line 354 of file SField.h.

◆ SF_XCHAIN_BRIDGE

Definition at line 355 of file SField.h.

◆ STUInt128

Definition at line 65 of file STBitString.h.

◆ STUInt160

Definition at line 66 of file STBitString.h.

◆ STUInt192

Definition at line 67 of file STBitString.h.

◆ STUInt256

Definition at line 68 of file STBitString.h.

◆ STUInt8

using xrpl::STUInt8 = STInteger<unsigned char>

Definition at line 59 of file STInteger.h.

◆ STUInt16

Definition at line 60 of file STInteger.h.

◆ STUInt32

Definition at line 61 of file STInteger.h.

◆ STUInt64

Definition at line 62 of file STInteger.h.

◆ STInt32

Definition at line 64 of file STInteger.h.

◆ TERUnderlyingType

Definition at line 20 of file TER.h.

◆ NotTEC

Definition at line 594 of file TER.h.

◆ TER

Definition at line 634 of file TER.h.

◆ B58Result

template<class T>
using xrpl::B58Result = std::expected<T, std::error_code>

Definition at line 16 of file tokens.h.

◆ FlagValue

Transaction flags.

These flags are specified in a transaction's 'Flags' field and modify the behavior of that transaction.

There are two types of flags:

(1) Universal flags: these are flags which apply to, and are interpreted the same way by,
    all transactions, except, perhaps, to special pseudo-transactions.

(2) Tx-Specific flags: these are flags which are interpreted according to the type of the
    transaction being executed. That is, the same numerical flag value may have different
    effects, depending on the transaction being executed.
Note
The universal transaction flags occupy the high-order 8 bits. The tx-specific flags occupy the remaining 24 bits.
Warning
Transaction flags form part of the protocol. Changing them should be avoided because without special handling, this will result in a hard fork.**

Definition at line 39 of file TxFlags.h.

◆ FlagMap

Definition at line 275 of file TxFlags.h.

◆ FlagMapPairList

◆ Directory

Directory is an index into the directory of offer books.

The last 64 bits of this are the quality.

Definition at line 33 of file UintTypes.h.

◆ Currency

Currency is a hash representing a specific currency.

Definition at line 36 of file UintTypes.h.

◆ NodeID

NodeID is a 160-bit hash representing one node.

Definition at line 39 of file UintTypes.h.

◆ MPTID

using xrpl::MPTID = BaseUInt<192>

MPTID is a 192-bit value representing MPT Issuance ID, which is a concatenation of a 32-bit sequence (big endian) and a 160-bit account.

Definition at line 44 of file UintTypes.h.

◆ Domain

using xrpl::Domain = BaseUInt<256>

Domain is a 256-bit hash representing a specific domain.

Definition at line 47 of file UintTypes.h.

◆ FeeLevel

template<class T>
using xrpl::FeeLevel = unit::ValueUnit<unit::feelevelTag, T>

Definition at line 427 of file Units.h.

◆ FeeLevel64

Definition at line 428 of file Units.h.

◆ FeeLevelDouble

using xrpl::FeeLevelDouble = FeeLevel<double>

Definition at line 429 of file Units.h.

◆ Bips

template<class T>
using xrpl::Bips = unit::ValueUnit<unit::BipsTag, T>

Definition at line 433 of file Units.h.

◆ Bips16

Definition at line 434 of file Units.h.

◆ Bips32

Definition at line 435 of file Units.h.

◆ TenthBips

template<class T>
using xrpl::TenthBips = unit::ValueUnit<unit::TenthBipsTag, T>

Definition at line 437 of file Units.h.

◆ TenthBips16

Definition at line 438 of file Units.h.

◆ TenthBips32

Definition at line 439 of file Units.h.

◆ Endpoints

using xrpl::Endpoints = std::unordered_map<std::string, boost::asio::ip::tcp::endpoint>

Definition at line 20 of file ServerImpl.h.

◆ http_request_type

typedef boost::beast::http::request< boost::beast::http::dynamic_body > xrpl::http_request_type = boost::beast::http::request<boost::beast::http::dynamic_body>

Definition at line 12 of file Handoff.h.

◆ http_response_type

typedef boost::beast::http::response< boost::beast::http::dynamic_body > xrpl::http_response_type = boost::beast::http::response<boost::beast::http::dynamic_body>

Definition at line 14 of file Handoff.h.

◆ FullBelowCache

◆ SHAMapTreeNodePtr

◆ TreeNodeCache

Initial value:
false,
Map/cache combination.
Definition TaggedCache.h:59
SharedWeakUnion< T > SharedWeakUnionPtr
intr_ptr::SharedPtr< SHAMapTreeNode > SHAMapTreeNodePtr

Definition at line 9 of file TreeNodeCache.h.

◆ InvariantChecks

Initial value:
Invariant: a deleted account must not have any objects left.
Invariant: we cannot remove an account ledger entry.
Invariant: corresponding modified ledger entries should match in type and added entries should be a v...
Invariant: Validates counts of NFTokens after all transaction types.
Invariant: offers should be for non-negative amounts and must not be XRP to XRP.
Invariant: Trust lines with deep freeze flag are not allowed if normal freeze flag is not set.
Invariants: Some fields are unmodifiable.
Invariant: Trust lines using XRP are not allowed.
Invariant: an escrow entry must take a value between 0 and INITIAL_XRP drops exclusive.
Invariant: We should never charge a transaction a negative fee or a fee that is larger than what the ...
Invariant: frozen trust line balance change is not allowed.
Verify that MPT/XRP STAmounts are canonical in any ledger entries left after the transaction applies.
Invariant: Token holder's trustline balance cannot be negative after Clawback.
Invariants: Confidential MPToken consistency.
Invariants: Loan brokers are internally consistent.
Invariants: Loans are internally consistent.
Verify public MPT amount and outstanding amount accounting.
Invariant: Validates several invariants for NFToken pages.
Invariant: a new account root must be the consequence of a payment, must have the right starting sequ...
Invariants: Permissioned Domains must have some rules and AcceptedCredentials must have length betwee...
Invariants: Pseudo-accounts have valid and consistent properties.
Invariant: An account XRP balance must be in XRP and take a value between 0 and INITIAL_XRP drops,...
Invariant: A transaction must not create XRP and should only destroy the XRP fee.

Definition at line 390 of file InvariantCheck.h.

◆ XChainModifyBridge

Definition at line 75 of file XChainBridge.h.

◆ XChainAccountCreateCommit

◆ EnableAmendment

Definition at line 52 of file Change.h.

◆ SetFee

Definition at line 53 of file Change.h.

◆ UNLModify

Definition at line 54 of file Change.h.

◆ const_iterator

Definition at line 16 of file Dir.cpp.

◆ sha256_t

Definition at line 143 of file hardened_hash_test.cpp.

◆ UInt8Value

using xrpl::UInt8Value = std::decay_t<typename SF_UINT8::type::value_type>

Definition at line 31 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ UInt16Value

using xrpl::UInt16Value = std::decay_t<typename SF_UINT16::type::value_type>

Definition at line 38 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ UInt32Value

using xrpl::UInt32Value = std::decay_t<typename SF_UINT32::type::value_type>

Definition at line 45 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ UInt64Value

using xrpl::UInt64Value = std::decay_t<typename SF_UINT64::type::value_type>

Definition at line 52 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ UInt128Value

using xrpl::UInt128Value = std::decay_t<typename SF_UINT128::type::value_type>

Definition at line 59 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ UInt160Value

using xrpl::UInt160Value = std::decay_t<typename SF_UINT160::type::value_type>

Definition at line 66 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ UInt192Value

using xrpl::UInt192Value = std::decay_t<typename SF_UINT192::type::value_type>

Definition at line 73 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ UInt256Value

using xrpl::UInt256Value = std::decay_t<typename SF_UINT256::type::value_type>

Definition at line 80 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ Int32Value

using xrpl::Int32Value = std::decay_t<typename SF_INT32::type::value_type>

Definition at line 87 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ NumberValue

using xrpl::NumberValue = std::decay_t<typename SF_NUMBER::type::value_type>

Definition at line 94 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ AmountValue

using xrpl::AmountValue = std::decay_t<typename SF_AMOUNT::type::value_type>

Definition at line 101 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ AccountValue

using xrpl::AccountValue = std::decay_t<typename SF_ACCOUNT::type::value_type>

Definition at line 108 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ CurrencyValue

using xrpl::CurrencyValue = std::decay_t<typename SF_CURRENCY::type::value_type>

Definition at line 115 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ IssueValue

using xrpl::IssueValue = std::decay_t<typename SF_ISSUE::type::value_type>

Definition at line 122 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ Vector256Value

using xrpl::Vector256Value = std::decay_t<typename SF_VECTOR256::type::value_type>

Definition at line 129 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ BlobValue

using xrpl::BlobValue = std::decay_t<typename SF_VL::type::value_type>

Definition at line 136 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ XChainBridgeValue

using xrpl::XChainBridgeValue = std::decay_t<typename SF_XCHAIN_BRIDGE::type::value_type>

Definition at line 144 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ OrderedTxs

Definition at line 27 of file OpenLedger.h.

◆ socket_type

using xrpl::socket_type = boost::beast::tcp_stream

Definition at line 21 of file Handshake.h.

◆ stream_type

using xrpl::stream_type = boost::beast::ssl_stream<socket_type>

Definition at line 22 of file Handshake.h.

◆ request_type

using xrpl::request_type = boost::beast::http::request<boost::beast::http::empty_body>

Definition at line 23 of file Handshake.h.

◆ ProtocolVersion

Represents a particular version of the peer-to-peer protocol.

The protocol is represented as two pairs of 16-bit integers; a major and a minor.

Definition at line 18 of file ProtocolVersion.h.

◆ TxnsData

Definition at line 41 of file AccountTx.cpp.

◆ TxnsDataBinary

◆ TxnDataBinary

◆ AccountTxArgs

◆ AccountTxResult

◆ LedgerSpecifier

◆ FunctionType

Initial value:
json::Value const&,
unsigned const apiVersion)>
Lightweight wrapper to tag static string.
Definition json_value.h:44
Represents a JSON value.
Definition json_value.h:130

Definition at line 37 of file LedgerEntry.cpp.

◆ Prices

using xrpl::Prices
Initial value:
bimap<multiset_of<std::uint32_t, std::greater<std::uint32_t>>, multiset_of<STAmount>>

Definition at line 42 of file GetAggregatePrice.cpp.

Enumeration Type Documentation

◆ ReleaseStrongRefAction

enum class xrpl::ReleaseStrongRefAction
strong

Action to perform when releasing a strong pointer.

noop: Do nothing. For example, a noop action will occur when a count is decremented to a non-zero value.

partialDestroy: Run the partialDestructor. This action will happen when a strong count is decremented to zero and the weak count is non-zero.

destroy: Run the destructor. This action will occur when either the strong count or weak count is decremented and the other count is also zero.

Enumerator
NoOp 
PartialDestroy 
Destroy 

Definition at line 21 of file IntrusiveRefCounts.h.

◆ ReleaseWeakRefAction

enum class xrpl::ReleaseWeakRefAction
strong

Action to perform when releasing a weak pointer.

noop: Do nothing. For example, a noop action will occur when a count is decremented to a non-zero value.

destroy: Run the destructor. This action will occur when either the strong count or weak count is decremented and the other count is also zero.

Enumerator
NoOp 
Destroy 

Definition at line 31 of file IntrusiveRefCounts.h.

◆ HashRouterFlags

enum class xrpl::HashRouterFlags : std::uint16_t
strong
Enumerator
UNDEFINED 
BAD 
SAVED 
HELD 
TRUSTED 
PRIVATE1 
PRIVATE2 
PRIVATE3 
PRIVATE4 
PRIVATE5 
PRIVATE6 

Definition at line 14 of file HashRouter.h.

◆ JobType

Enumerator
JtInvalid 
JtPack 
JtPuboldledger 
JtClient 
JtClientSubscribe 
JtClientFeeChange 
JtClientConsensus 
JtClientAcctHist 
JtClientRpc 
JtClientWebsocket 
JtRpc 
JtSweep 
JtValidationUt 
JtManifest 
JtUpdatePf 
JtTransactionL 
JtReplayReq 
JtLedgerReq 
JtProposalUt 
JtReplayTask 
JtTransaction 
JtMissingTxn 
JtRequestedTxn 
JtBatch 
JtLedgerData 
JtAdvance 
JtPubledger 
JtTxnData 
JtWal 
JtValidationT 
JtWrite 
JtAccept 
JtProposalT 
JtNetopCluster 
JtNetopTimer 
JtAdmin 
JtPeer 
JtDisk 
JtTxnProc 
JtObSetup 
JtPathFind 
JtHoRead 
JtHoWrite 
JtGeneric 
JtNsSyncRead 
JtNsAsyncRead 
JtNsWrite 

Definition at line 16 of file Job.h.

◆ StartUpType

enum class xrpl::StartUpType
strong
Enumerator
Fresh 
Normal 
Load 
LoadFile 
Replay 
Network 

Definition at line 8 of file StartUpType.h.

◆ ApplyFlags

Enumerator
TapNone 
TapFailHard 
TapRetry 
TapUnlimited 
TapBatch 
TapDryRun 

Definition at line 12 of file ApplyView.h.

◆ IsDeposit

enum class xrpl::IsDeposit : bool
strong
Enumerator
No 
Yes 

Definition at line 38 of file AMMHelpers.h.

◆ LoanPaymentType

enum class xrpl::LoanPaymentType
strong
Enumerator
Regular 
Late 
Full 
Overpayment 

Definition at line 525 of file LendingHelpers.h.

◆ FreezeHandling

enum class xrpl::FreezeHandling
strong

Controls the treatment of frozen account balances.

Enumerator
IgnoreFreeze 
ZeroIfFrozen 

Definition at line 24 of file TokenHelpers.h.

◆ AuthHandling

enum class xrpl::AuthHandling
strong

Controls the treatment of unauthorized MPT balances.

Enumerator
IgnoreAuth 
ZeroIfUnauthorized 

Definition at line 27 of file TokenHelpers.h.

◆ SpendableHandling

enum class xrpl::SpendableHandling
strong

Controls whether to include the account's full spendable balance.

Enumerator
SimpleBalance 
FullBalance 

Definition at line 30 of file TokenHelpers.h.

◆ WaiveTransferFee

enum class xrpl::WaiveTransferFee : bool
strong
Enumerator
No 
Yes 

Definition at line 32 of file TokenHelpers.h.

◆ AllowMPTOverflow

enum class xrpl::AllowMPTOverflow : bool
strong

Controls whether accountSend is allowed to overflow OutstandingAmount.

Enumerator
No 
Yes 

Definition at line 35 of file TokenHelpers.h.

◆ WaiveMPTCanTransfer

enum class xrpl::WaiveMPTCanTransfer : bool
strong

Controls whether canTransfer enforces lsfMPTCanTransfer on MPTs.

Default is No (enforce). Use Yes at call sites that must remain available even when an MPT issuer has cleared lsfMPTCanTransfer - for example, unwinding existing positions in SAV or the Lending Protocol. Has no effect on the IOU branch of canTransfer.

Enumerator
No 
Yes 

Definition at line 44 of file TokenHelpers.h.

◆ AuthType

enum class xrpl::AuthType
strong
Enumerator
StrongAuth 
WeakAuth 
Legacy 

Definition at line 55 of file TokenHelpers.h.

◆ TruncateShares

enum class xrpl::TruncateShares : bool
strong

Controls whether to truncate shares instead of rounding.

Enumerator
No 
Yes 

Definition at line 39 of file VaultHelpers.h.

◆ WaiveUnrealizedLoss

enum class xrpl::WaiveUnrealizedLoss : bool
strong

Controls whether the withdraw conversion helpers (assetsToSharesWithdraw and sharesToAssetsWithdraw) subtract sfLossUnrealized from sfAssetsTotal before computing the exchange rate.

The default (No) applies the standard discounted rate; Yes is used when the redeemer is the sole remaining shareholder.

Enumerator
No 
Yes 

Definition at line 47 of file VaultHelpers.h.

◆ SkipEntry

enum class xrpl::SkipEntry : bool
strong
Enumerator
No 
Yes 

Definition at line 21 of file View.h.

◆ NodeObjectType

enum class xrpl::NodeObjectType : std::uint32_t
strong

The types of node objects.

Enumerator
Unknown 
Ledger 
AccountNode 
TransactionNode 
Dummy 

Definition at line 12 of file NodeObject.h.

◆ TokenCodecErrc

enum class xrpl::TokenCodecErrc
strong
Enumerator
Success 
InputTooLarge 
InputTooSmall 
BadB58Character 
OutputTooSmall 
MismatchedTokenType 
MismatchedChecksum 
InvalidEncodingChar 
OverflowAdd 
Unknown 

Definition at line 6 of file token_errors.h.

◆ ErrorCodeI

Enumerator
RpcUnknown 
RpcSuccess 
RpcBadSyntax 
RpcJsonRpc 
RpcForbidden 
RpcWrongNetwork 
RpcNoPermission 
RpcNoEvents 
RpcTooBusy 
RpcSlowDown 
RpcHighFee 
RpcNotEnabled 
RpcNotReady 
RpcAmendmentBlocked 
RpcNoClosed 
RpcNoCurrent 
RpcNoNetwork 
RpcNotSynced 
RpcActNotFound 
RpcLgrNotFound 
RpcLgrNotValidated 
RpcMasterDisabled 
RpcTxnNotFound 
RpcInvalidHotwallet 
RpcInvalidParams 
RpcUnknownCommand 
RpcNoPfRequest 
RpcActMalformed 
RpcAlreadyMultisig 
RpcAlreadySingleSig 
RpcBadFeature 
RpcBadIssuer 
RpcBadMarket 
RpcBadSecret 
RpcBadSeed 
RpcChannelMalformed 
RpcChannelAmtMalformed 
RpcCommandMissing 
RpcDstActMalformed 
RpcDstActMissing 
RpcDstActNotFound 
RpcDstAmtMalformed 
RpcDstAmtMissing 
RpcDstIsrMalformed 
RpcLgrIdxsInvalid 
RpcLgrIdxMalformed 
RpcPublicMalformed 
RpcSigningMalformed 
RpcSendmaxMalformed 
RpcSrcActMalformed 
RpcSrcActMissing 
RpcSrcActNotFound 
RpcDelegateActNotFound 
RpcSrcCurMalformed 
RpcSrcIsrMalformed 
RpcStreamMalformed 
RpcAtxDeprecated 
RpcInternal 
RpcNotImpl 
RpcNotSupported 
RpcBadKeyType 
RpcDbDeserialization 
RpcExcessiveLgrRange 
RpcInvalidLgrRange 
RpcExpiredValidatorList 
RpcReportingUnsupported 
RpcObjectNotFound 
RpcIssueMalformed 
RpcOracleMalformed 
RpcBadCredentials 
RpcTxSigned 
RpcDomainMalformed 
RpcEntryNotFound 
RpcUnexpectedLedgerType 
RpcLast 

Definition at line 22 of file ErrorCodes.h.

◆ WarningCodeI

Codes returned in the warnings array of certain RPC commands.

These values need to remain stable.

Enumerator
WarnRpcUnsupportedMajority 
WarnRpcAmendmentBlocked 
WarnRpcExpiredValidatorList 
WarnRpcFieldsDeprecated 

Definition at line 155 of file ErrorCodes.h.

◆ VoteBehavior

enum class xrpl::VoteBehavior : int
strong
Enumerator
Obsolete 
DefaultNo 
DefaultYes 

Definition at line 110 of file Feature.h.

◆ AmendmentSupport

enum class xrpl::AmendmentSupport : int
strong
Enumerator
Retired 
Supported 
Unsupported 

Definition at line 111 of file Feature.h.

◆ HashPrefix

enum class xrpl::HashPrefix : std::uint32_t
strong

Prefix for hashing functions.

These prefixes are inserted before the source material used to generate various hashes. This is done to put each hash in its own "space." This way, two different types of objects with the same binary data will produce different hashes.

Each prefix is a 4-byte value with the last byte set to zero and the first three bytes formed from the ASCII equivalent of some arbitrary string. For example "TXN".

Note
Hash prefixes are part of the protocol; you cannot, arbitrarily, change the type or the value of any of these without causing breakage.
Enumerator
TransactionId 

transaction plus signature to give transaction ID

TxNode 

transaction plus metadata

LeafNode 

account state

InnerNode 

inner node in V1 tree

LedgerMaster 

ledger master data for signing

TxSign 

inner transaction to sign

TxMultiSign 

inner transaction to multi-sign

Validation 

validation for signing

Proposal 

proposal for signing

Manifest 

Manifest.

PaymentChannelClaim 

Payment Channel Claim.

Batch 

Batch.

Definition at line 34 of file HashPrefix.h.

◆ KeyType

enum class xrpl::KeyType
strong
Enumerator
Secp256k1 
Ed25519 

Definition at line 8 of file KeyType.h.

◆ LedgerEntryType

Identifiers for on-ledger objects.

Each ledger object requires a unique type identifier, which is stored within the object itself; this makes it possible to iterate the entire ledger and determine each object's type and verify that the object you retrieved from a given hash matches the expected type.

Warning
Since these values are stored inside objects stored on the ledger they are part of the protocol. Changing them should be avoided because without special handling, this will result in a hard fork.**
Note
Values outside this range may be used internally by the code for various purposes, but attempting to use such values to identify on-ledger objects will result in an invariant failure.
When retiring types, the specific values should not be removed but should be marked as [[deprecated]]. This is to avoid accidental reuse of identifiers.
Enumerator
ltANY 

A special type, matching any ledger entry type.

The value does not represent a concrete type, but rather is used in contexts where the specific type of a ledger object is unimportant, unknown or unavailable.

Objects with this special type cannot be created or stored on the ledger.

See also
keylet::unchecked
ltCHILD 

A special type, matching any ledger type except directory nodes.

The value does not represent a concrete type, but rather is used in contexts where the ledger object must not be a directory node but its specific type is otherwise unimportant, unknown or unavailable.

Objects with this special type cannot be created or stored on the ledger.

See also
keylet::child
ltNICKNAME 

A legacy, deprecated type.

ltCONTRACT 

A legacy, deprecated type.

ltGENERATOR_MAP 

A legacy, deprecated type.

Definition at line 36 of file LedgerFormats.h.

◆ LedgerSpecificFlags

Enumerator
XMACRO 

Definition at line 225 of file LedgerFormats.h.

◆ LedgerShortcut

enum class xrpl::LedgerShortcut
strong

Enumeration of ledger shortcuts for specifying which ledger to use.

These shortcuts provide a convenient way to reference commonly used ledgers without needing to specify their exact hash or sequence number.

Enumerator
Current 

The current working ledger (open, not yet closed).

Closed 

The most recently closed ledger (may not be validated).

Validated 

The most recently validated ledger.

Definition at line 11 of file LedgerShortcut.h.

◆ GranularPermissionType

We have both transaction type permissions and granular type permissions.

Since we will reuse the TransactionFormats to parse the Transaction Permissions, only the GranularPermissionType is defined here. To prevent conflicts with TxType, the GranularPermissionType is always set to a value greater than the maximum value of uint16.

Definition at line 26 of file Permissions.h.

◆ Delegation

Enumerator
Delegable 
NotDelegable 

Definition at line 41 of file Permissions.h.

◆ ECDSACanonicality

enum class xrpl::ECDSACanonicality
strong
Enumerator
Canonical 
FullyCanonical 

Definition at line 171 of file PublicKey.h.

◆ SerializedTypeID

Enumerator
XMACRO 

Definition at line 93 of file SField.h.

◆ SOEStyle

Kind of element in each entry of an SOTemplate.

Enumerator
SoeInvalid 
SoeRequired 
SoeOptional 
SoeDefault 

Definition at line 16 of file SOTemplate.h.

◆ SOETxMPTIssue

Amount fields that can support MPT.

Enumerator
SoeMptNone 
SoeMptSupported 
SoeMptNotSupported 

Definition at line 28 of file SOTemplate.h.

◆ TxnSql

enum class xrpl::TxnSql : char
strong
Enumerator
New 
Conflict 
Held 
Validated 
Included 
Unknown 

Definition at line 18 of file STTx.h.

◆ TELcodes

Enumerator
telLOCAL_ERROR 
telBAD_DOMAIN 
telBAD_PATH_COUNT 
telBAD_PUBLIC_KEY 
telFAILED_PROCESSING 
telINSUF_FEE_P 
telNO_DST_PARTIAL 
telCAN_NOT_QUEUE 
telCAN_NOT_QUEUE_BALANCE 
telCAN_NOT_QUEUE_BLOCKS 
telCAN_NOT_QUEUE_BLOCKED 
telCAN_NOT_QUEUE_FEE 
telCAN_NOT_QUEUE_FULL 
telWRONG_NETWORK 
telREQUIRES_NETWORK_ID 
telNETWORK_ID_MAKES_TX_NON_CANONICAL 
telENV_RPC_FAILED 

Definition at line 26 of file TER.h.

◆ TEMcodes

Enumerator
temMALFORMED 
temBAD_AMOUNT 
temBAD_CURRENCY 
temBAD_EXPIRATION 
temBAD_FEE 
temBAD_ISSUER 
temBAD_LIMIT 
temBAD_OFFER 
temBAD_PATH 
temBAD_PATH_LOOP 
temBAD_REGKEY 
temBAD_SEND_XRP_LIMIT 
temBAD_SEND_XRP_MAX 
temBAD_SEND_XRP_NO_DIRECT 
temBAD_SEND_XRP_PARTIAL 
temBAD_SEND_XRP_PATHS 
temBAD_SEQUENCE 
temBAD_SIGNATURE 
temBAD_SRC_ACCOUNT 
temBAD_TRANSFER_RATE 
temDST_IS_SRC 
temDST_NEEDED 
temINVALID 
temINVALID_FLAG 
temREDUNDANT 
temRIPPLE_EMPTY 
temDISABLED 
temBAD_SIGNER 
temBAD_QUORUM 
temBAD_WEIGHT 
temBAD_TICK_SIZE 
temINVALID_ACCOUNT_ID 
temCANNOT_PREAUTH_SELF 
temINVALID_COUNT 
temUNCERTAIN 
temUNKNOWN 
temSEQ_AND_TICKET 
temBAD_NFTOKEN_TRANSFER_FEE 
temBAD_AMM_TOKENS 
temXCHAIN_EQUAL_DOOR_ACCOUNTS 
temXCHAIN_BAD_PROOF 
temXCHAIN_BRIDGE_BAD_ISSUES 
temXCHAIN_BRIDGE_NONDOOR_OWNER 
temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT 
temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT 
temEMPTY_DID 
temARRAY_EMPTY 
temARRAY_TOO_LARGE 
temBAD_TRANSFER_FEE 
temINVALID_INNER_BATCH 
temBAD_MPT 
temBAD_CIPHERTEXT 

Definition at line 59 of file TER.h.

◆ TEFcodes

Enumerator
tefFAILURE 
tefALREADY 
tefBAD_ADD_AUTH 
tefBAD_AUTH 
tefBAD_LEDGER 
tefCREATED 
tefEXCEPTION 
tefINTERNAL 
tefNO_AUTH_REQUIRED 
tefPAST_SEQ 
tefWRONG_PRIOR 
tefMASTER_DISABLED 
tefMAX_LEDGER 
tefBAD_SIGNATURE 
tefBAD_QUORUM 
tefNOT_MULTI_SIGNING 
tefBAD_AUTH_MASTER 
tefINVARIANT_FAILED 
tefTOO_BIG 
tefNO_TICKET 
tefNFTOKEN_IS_NOT_TRANSFERABLE 
tefINVALID_LEDGER_FIX_TYPE 

Definition at line 138 of file TER.h.

◆ TERcodes

Enumerator
terRETRY 
terFUNDS_SPENT 
terINSUF_FEE_B 
terNO_ACCOUNT 
terNO_AUTH 
terNO_LINE 
terOWNERS 
terPRE_SEQ 
terLAST 
terNO_RIPPLE 
terQUEUED 
terPRE_TICKET 
terNO_AMM 
terADDRESS_COLLISION 
terNO_DELEGATE_PERMISSION 
terLOCKED 

Definition at line 184 of file TER.h.

◆ TEScodes

Enumerator
tesSUCCESS 

Definition at line 230 of file TER.h.

◆ TECcodes

Enumerator
tecCLAIM 
tecPATH_PARTIAL 
tecUNFUNDED_ADD 
tecUNFUNDED_OFFER 
tecUNFUNDED_PAYMENT 
tecFAILED_PROCESSING 
tecDIR_FULL 
tecINSUF_RESERVE_LINE 
tecINSUF_RESERVE_OFFER 
tecNO_DST 
tecNO_DST_INSUF_XRP 
tecNO_LINE_INSUF_RESERVE 
tecNO_LINE_REDUNDANT 
tecPATH_DRY 
tecUNFUNDED 
tecNO_ALTERNATIVE_KEY 
tecNO_REGULAR_KEY 
tecOWNERS 
tecNO_ISSUER 
tecNO_AUTH 
tecNO_LINE 
tecINSUFF_FEE 
tecFROZEN 
tecNO_TARGET 
tecNO_PERMISSION 
tecNO_ENTRY 
tecINSUFFICIENT_RESERVE 
tecNEED_MASTER_KEY 
tecDST_TAG_NEEDED 
tecINTERNAL 
tecOVERSIZE 
tecCRYPTOCONDITION_ERROR 
tecINVARIANT_FAILED 
tecEXPIRED 
tecDUPLICATE 
tecKILLED 
tecHAS_OBLIGATIONS 
tecTOO_SOON 
tecHOOK_REJECTED 
tecMAX_SEQUENCE_REACHED 
tecNO_SUITABLE_NFTOKEN_PAGE 
tecNFTOKEN_BUY_SELL_MISMATCH 
tecNFTOKEN_OFFER_TYPE_MISMATCH 
tecCANT_ACCEPT_OWN_NFTOKEN_OFFER 
tecINSUFFICIENT_FUNDS 
tecOBJECT_NOT_FOUND 
tecINSUFFICIENT_PAYMENT 
tecUNFUNDED_AMM 
tecAMM_BALANCE 
tecAMM_FAILED 
tecAMM_INVALID_TOKENS 
tecAMM_EMPTY 
tecAMM_NOT_EMPTY 
tecAMM_ACCOUNT 
tecINCOMPLETE 
tecXCHAIN_BAD_TRANSFER_ISSUE 
tecXCHAIN_NO_CLAIM_ID 
tecXCHAIN_BAD_CLAIM_ID 
tecXCHAIN_CLAIM_NO_QUORUM 
tecXCHAIN_PROOF_UNKNOWN_KEY 
tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE 
tecXCHAIN_WRONG_CHAIN 
tecXCHAIN_REWARD_MISMATCH 
tecXCHAIN_NO_SIGNERS_LIST 
tecXCHAIN_SENDING_ACCOUNT_MISMATCH 
tecXCHAIN_INSUFF_CREATE_AMOUNT 
tecXCHAIN_ACCOUNT_CREATE_PAST 
tecXCHAIN_ACCOUNT_CREATE_TOO_MANY 
tecXCHAIN_PAYMENT_FAILED 
tecXCHAIN_SELF_COMMIT 
tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR 
tecXCHAIN_CREATE_ACCOUNT_DISABLED 
tecEMPTY_DID 
tecINVALID_UPDATE_TIME 
tecTOKEN_PAIR_NOT_FOUND 
tecARRAY_EMPTY 
tecARRAY_TOO_LARGE 
tecLOCKED 
tecBAD_CREDENTIALS 
tecWRONG_ASSET 
tecLIMIT_EXCEEDED 
tecPSEUDO_ACCOUNT 
tecPRECISION_LOSS 
tecNO_DELEGATE_PERMISSION 
tecBAD_PROOF 

Definition at line 247 of file TER.h.

◆ TokenType

enum class xrpl::TokenType : std::uint8_t
strong
Enumerator
None 
NodePublic 
NodePrivate 
AccountID 
AccountPublic 
AccountSecret 
FamilyGenerator 
FamilySeed 

Definition at line 18 of file tokens.h.

◆ TxType

Transaction type identifiers.

These are part of the binary message format. Transaction type identifiers

Each ledger object requires a unique type identifier, which is stored within the object itself; this makes it possible to iterate the entire ledger and determine each object's type and verify that the object you retrieved from a given hash matches the expected type.

Warning
Since these values are included in transactions, which are signed objects, and used by the code to determine the type of transaction being invoked, they are part of the protocol. Changing them should be avoided because without special handling, this will result in a hard fork.
Note
When retiring types, the specific values should not be removed but should be marked as [[deprecated]]. This is to avoid accidental reuse of identifiers.
Enumerator
TtNicknameSet 

This transaction type is deprecated; it is retained for historical purposes.

TtContract 

This transaction type is deprecated; it is retained for historical purposes.

TtSpinalTap 

This identifier was never used, but the slot is reserved for historical purposes.

TtHookSet 

This transaction type installs a hook.

Definition at line 40 of file TxFormats.h.

◆ TxSearched

enum class xrpl::TxSearched
strong
Enumerator
All 
Some 
Unknown 

Definition at line 5 of file TxSearched.h.

◆ AttestationMatch

enum class xrpl::AttestationMatch
strong
Enumerator
NonDstMismatch 
MatchExceptDst 
Match 

Definition at line 233 of file XChainAttestations.h.

◆ ManifestDisposition

enum class xrpl::ManifestDisposition
strong
Enumerator
Accepted 

Manifest is valid.

Stale 

Sequence is too old.

BadMasterKey 

The master key is not acceptable to us.

BadEphemeralKey 

The ephemeral key is not acceptable to us.

Invalid 

Timely, but invalid signature.

Definition at line 195 of file Manifest.h.

◆ OperatingMode

enum class xrpl::OperatingMode
strong

Specifies the mode under which the server believes it's operating.

This has implications about how the server processes transactions and how it responds to requests (e.g. account balance request).

Note
Other code relies on the numerical values of these constants; do not change them without verifying each use and ensuring that it is not a breaking change.
Enumerator
DISCONNECTED 

not ready to process requests

CONNECTED 

convinced we are talking to the network

SYNCING 

fallen slightly behind

TRACKING 

convinced we agree with the network

FULL 

we have the ledger and can even validate

Definition at line 50 of file NetworkOPs.h.

◆ AmendmentVote

enum class xrpl::AmendmentVote : int
strong
Enumerator
Obsolete 
Up 
Down 

Definition at line 126 of file Wallet.h.

◆ SHAMapState

enum class xrpl::SHAMapState
strong

Describes the current state of a given SHAMap.

Enumerator
Modifying 

The map is in flux and objects can be added and removed.

Example: map underlying the open ledger.

Immutable 

The map is set in stone and cannot be changed.

Example: a map underlying a given closed ledger.

Synching 

The map's hash is fixed but valid nodes may be missing and can be added.

Example: a map that's syncing a given peer's closing ledger.

Invalid 

The map is known to not be valid.

Example: usually synching a corrupt ledger.

Definition at line 27 of file SHAMap.h.

◆ SHAMapType

enum class xrpl::SHAMapType
strong
Enumerator
TRANSACTION 
STATE 
FREE 

Definition at line 13 of file SHAMapMissingNode.h.

◆ SHAMapNodeType

enum class xrpl::SHAMapNodeType
strong
Enumerator
TnInner 
TnTransactionNm 
TnTransactionMd 
TnAccountState 

Definition at line 30 of file SHAMapTreeNode.h.

◆ Validity

enum class xrpl::Validity
strong

Describes the pre-processing validity of a transaction.

See also
checkValidity, forceValidity
Enumerator
SigBad 

Signature is bad. Didn't do local checks.

SigGoodOnly 

Signature is good, but local checks fail.

Valid 

Signature and local checks are good / passed.

Definition at line 19 of file apply.h.

◆ ApplyTransactionResult

enum class xrpl::ApplyTransactionResult
strong

Enum class for return value from applyTransaction.

See also
applyTransaction
Enumerator
Success 

Applied to this ledger.

Fail 

Should not be retried in this ledger.

Retry 

Should be retried in this ledger.

Definition at line 109 of file apply.h.

◆ Privilege

Enumerator
NoPriv 
CreateAcct 
CreatePseudoAcct 
MustDeleteAcct 
MayDeleteAcct 
OverrideFreeze 
ChangeNftCounts 
CreateMptIssuance 
DestroyMptIssuance 
MustAuthorizeMpt 
MayAuthorizeMpt 
MayDeleteMpt 
MustModifyVault 
MayModifyVault 
MayCreateMpt 

Definition at line 30 of file InvariantCheckPrivilege.h.

◆ DebtDirection

enum class xrpl::DebtDirection
strong
Enumerator
Issues 
Redeems 

Definition at line 21 of file Steps.h.

◆ QualityDirection

enum class xrpl::QualityDirection
strong
Enumerator
In 
Out 

Definition at line 22 of file Steps.h.

◆ StrandDirection

enum class xrpl::StrandDirection
strong
Enumerator
Forward 
Reverse 

Definition at line 23 of file Steps.h.

◆ OfferCrossing

enum class xrpl::OfferCrossing
strong
Enumerator
No 
Yes 
Sell 

Definition at line 24 of file Steps.h.

◆ WithdrawAll

enum class xrpl::WithdrawAll : bool
strong

AMMWithdraw implements AMM withdraw Transactor.

The withdraw transaction is used to remove liquidity from the AMM instance pool, thus redeeming some share of the pools that one owns in the form of LPTokens. If the trader withdraws proportional values of both assets without changing their relative pricing, no trading fee is charged on the transaction. The trader can specify different combination of the fields in the withdrawal. LPTokens - transaction assumes proportional withdrawal of pool assets for the amount of LPTokens. Asset1Out - transaction assumes withdrawal of single asset equivalent to the amount specified in Asset1Out. Asset1Out and Asset2Out - transaction assumes all assets withdrawal with the constraints on the maximum amount of each asset that the trader is willing to withdraw. Asset1Out and LPTokens - transaction assumes withdrawal of single asset specified in Asset1Out proportional to the share represented by the amount of LPTokens. Asset1Out and EPrice - transaction assumes withdrawal of single asset with the following constraints: a. Amount of asset1 if specified (not 0) in Asset1Out specifies the minimum amount of asset1 that the trader is willing to withdraw. b. The effective price of asset traded out does not exceed the amount specified in EPrice. Following updates after a successful transaction: The withdrawn asset, if XRP, is transferred from AMM instance account to the account that initiated the transaction, thus changing the Balance field of each account. The withdrawn asset, if token, is balanced between the AMM instance account and the issuer account. The LPTokens ~ are balanced between the AMM instance account and the account that initiated the transaction. The pool composition is updated.

See also
XLS30d:AMMWithdraw transaction
Enumerator
No 
Yes 

Definition at line 48 of file tx/transactors/dex/AMMWithdraw.h.

◆ LedgerNameSpace

enum class xrpl::LedgerNameSpace : std::uint16_t
strong

Type-specific prefix for calculating ledger indices.

The identifier for a given object within the ledger is calculated based on some object-specific parameters. To ensure that different types of objects have different indices, even if they happen to use the same set of parameters, we use "tagged hashing" by adding a type-specific prefix.

Note
These values are part of the protocol and CANNOT be arbitrarily changed. If they were, on-ledger objects may no longer be able to be located or addressed.

Additions to this list are OK, but changing existing entries to assign them a different values should never be needed.

Entries that are removed should be moved to the bottom of the enum and marked as [[deprecated]] to prevent accidental reuse.

Enumerator
Account 
DirNode 
TrustLine 
Offer 
OwnerDir 
BookDir 
SkipList 
Escrow 
Amendments 
FeeSettings 
Ticket 
SignerList 
XRPPaymentChannel 
Check 
DepositPreauth 
DepositPreauthCredentials 
NegativeUnl 
NftokenOffer 
NftokenBuyOffers 
NftokenSellOffers 
Amm 
Bridge 
XchainClaimId 
XchainCreateAccountClaimId 
Did 
Oracle 
MPTokenIssuance 
MPToken 
Credential 
PermissionedDomain 
Delegate 
Vault 
LoanBroker 
Loan 
Contract 
Generator 
Nickname 

Definition at line 52 of file Indexes.cpp.

◆ BypassAccept

enum class xrpl::BypassAccept : bool
strong
Enumerator
No 
Yes 

Definition at line 17 of file RCLValidations.h.

◆ TransStatus

enum class xrpl::TransStatus
strong
Enumerator
NEW 
INVALID 
INCLUDED 
CONFLICTED 
COMMITTED 
HELD 
REMOVED 
OBSOLETE 
INCOMPLETE 

Definition at line 26 of file Transaction.h.

◆ ListDisposition

enum class xrpl::ListDisposition
strong
Enumerator
Accepted 

List is valid.

Expired 

List is expired, but has the largest non-pending sequence seen so far.

Pending 

List will be valid in the future.

SameSequence 

Same sequence as current list.

KnownSequence 

Future sequence already seen.

Stale 

Trusted publisher key, but seq is too old.

Untrusted 

List signed by untrusted publisher key.

UnsupportedVersion 

List version is not supported.

Invalid 

Invalid format or signature.

Definition at line 35 of file ValidatorList.h.

◆ PublisherStatus

enum class xrpl::PublisherStatus
strong
Enumerator
Available 
Expired 
Unavailable 
Revoked 

Definition at line 67 of file ValidatorList.h.

◆ ConsensusMode

enum class xrpl::ConsensusMode
strong

Represents how a node currently participates in Consensus.

A node participates in consensus in varying modes, depending on how the node was configured by its operator and how well it stays in sync with the network during consensus.

proposing observing
\ /
\---> wrongLedger <---/
^
|
|
v
switchedLedger

We enter the round proposing or observing. If we detect we are working on the wrong prior ledger, we go to wrongLedger and attempt to acquire the right one. Once we acquire the right one, we go to the switchedLedger mode. It is possible we fall behind again and find there is a new better ledger, moving back and forth between wrongLedger and switchLedger as we attempt to catch up.

Enumerator
Proposing 

We are normal participant in consensus and propose our position.

Observing 

We are observing peer positions, but not proposing our position.

WrongLedger 

We have the wrong ledger and are attempting to acquire it.

SwitchedLedger 

We switched ledgers since we started this consensus round but are now running on what we believe is the correct ledger. This mode is as if we entered the round observing, but is used to indicate we did have the wrongLedger at some point.

Definition at line 37 of file ConsensusTypes.h.

◆ ConsensusPhase

enum class xrpl::ConsensusPhase
strong

Phases of consensus for a single ledger round.

"close" "accept"
open ------- > establish ---------> accepted
^ | |
|---------------| |
^ "startRound" |
|------------------------------------|
void open(soci::session &s, BasicConfig const &config, std::string const &dbName)
Open a soci session.
Definition SociDB.cpp:92

The typical transition goes from open to establish to accepted and then a call to startRound begins the process anew. However, if a wrong prior ledger is detected and recovered during the establish or accept phase, consensus will internally go back to open (see Consensus::handleWrongLedger).

Enumerator
Open 

We haven't closed our ledger yet, but others might have.

Establish 

Establishing consensus by exchanging proposals with our peers.

Accepted 

We have accepted a new last closed ledger and are waiting on a call to startRound to begin the next consensus round. No changes to consensus phase occur while in this phase.

Definition at line 85 of file ConsensusTypes.h.

◆ ConsensusState

enum class xrpl::ConsensusState
strong

Whether we have or don't have a consensus.

Enumerator
No 

We do not have consensus.

MovedOn 

The network has consensus without us.

Expired 

Consensus time limit has hard-expired.

Yes 

We have consensus along with the network.

Definition at line 168 of file ConsensusTypes.h.

◆ ValStatus

enum class xrpl::ValStatus
strong

Status of validation we received.

Enumerator
Current 

This was a new validation and was added.

Stale 

Not current or was older than current from this node.

BadSeq 

A validation violates the increasing seq requirement.

Multiple 

Multiple validations by a validator for the same ledger.

Conflicting 

Multiple validations by a validator for different ledgers.

Definition at line 148 of file Validations.h.

◆ SizedItem

enum class xrpl::SizedItem : std::size_t
strong
Enumerator
SweepInterval 
TreeCacheSize 
TreeCacheAge 
LedgerSize 
LedgerAge 
LedgerFetch 
HashNodeDbCache 
TxnDbCache 
LgrDbCache 
OpenFinalLimit 
BurstSize 
RamSizeGb 
AccountIdCacheSize 

Definition at line 27 of file Config.h.

◆ ProtocolFeature

enum class xrpl::ProtocolFeature
strong
Enumerator
ValidatorListPropagation 
ValidatorList2Propagation 
LedgerReplay 

Definition at line 16 of file xrpld/overlay/Peer.h.

◆ LineDirection

enum class xrpl::LineDirection : bool
strong

Describes how an account was found in a path, and how to find the next set of paths.

"Outgoing" is defined as the source account, or an account found via a trustline that has rippling enabled on the account's side. "Incoming" is defined as an account found via a trustline that has rippling disabled on the account's side. Any trust lines for an incoming account that have rippling disabled are unusable in paths.

Enumerator
Incoming 
Outgoing 

Definition at line 21 of file TrustLine.h.

◆ Role

enum class xrpl::Role
strong

Indicates the level of administrative permission to grant.

IDENTIFIED role has unlimited resources but cannot perform some RPC commands. ADMIN role has unlimited resources and is able to perform all RPC commands.

Enumerator
GUEST 
USER 
IDENTIFIED 
ADMIN 
PROXY 
FORBID 

Definition at line 24 of file Role.h.

Function Documentation

◆ generalizedSetIntersection()

template<class InputIter1, class InputIter2, class Action, class Comp>
void xrpl::generalizedSetIntersection ( InputIter1 first1,
InputIter1 last1,
InputIter2 first2,
InputIter2 last2,
Action action,
Comp comp )

Definition at line 16 of file algorithm.h.

◆ removeIfIntersectOrMatch()

template<class FwdIter1, class InputIter2, class Pred, class Comp>
FwdIter1 xrpl::removeIfIntersectOrMatch ( FwdIter1 first1,
FwdIter1 last1,
InputIter2 first2,
InputIter2 last2,
Pred pred,
Comp comp )

Definition at line 56 of file algorithm.h.

◆ extractTarLz4()

void xrpl::extractTarLz4 ( boost::filesystem::path const & src,
boost::filesystem::path const & dst )

Extract a tar archive compressed with lz4.

Parameters
srcthe path of the archive to be extracted
dstthe directory to extract to
Exceptions
runtime_error

Definition at line 18 of file Archive.cpp.

◆ base64Encode() [1/2]

std::string xrpl::base64Encode ( std::uint8_t const * data,
std::size_t len )

Definition at line 202 of file libxrpl/basics/base64.cpp.

◆ base64Encode() [2/2]

std::string xrpl::base64Encode ( std::string_view s)

Definition at line 47 of file base64.h.

◆ base64Decode()

std::string xrpl::base64Decode ( std::string_view data)

Definition at line 211 of file libxrpl/basics/base64.cpp.

◆ operator<=>() [1/7]

template<std::size_t Bits, class Tag>
std::strong_ordering xrpl::operator<=> ( BaseUInt< Bits, Tag > const & lhs,
BaseUInt< Bits, Tag > const & rhs )
nodiscardconstexpr

Definition at line 566 of file base_uint.h.

◆ operator==() [1/31]

template<std::size_t Bits, typename Tag>
bool xrpl::operator== ( BaseUInt< Bits, Tag > const & lhs,
BaseUInt< Bits, Tag > const & rhs )
nodiscardconstexpr

Definition at line 588 of file base_uint.h.

◆ operator==() [2/31]

template<std::size_t Bits, class Tag>
bool xrpl::operator== ( BaseUInt< Bits, Tag > const & a,
std::uint64_t b )
constexpr

Definition at line 596 of file base_uint.h.

◆ operator^()

template<std::size_t Bits, class Tag>
BaseUInt< Bits, Tag > xrpl::operator^ ( BaseUInt< Bits, Tag > const & a,
BaseUInt< Bits, Tag > const & b )
constexpr

Definition at line 604 of file base_uint.h.

◆ operator&() [1/3]

template<std::size_t Bits, class Tag>
BaseUInt< Bits, Tag > xrpl::operator& ( BaseUInt< Bits, Tag > const & a,
BaseUInt< Bits, Tag > const & b )
constexpr

Definition at line 611 of file base_uint.h.

◆ operator|() [1/4]

template<std::size_t Bits, class Tag>
BaseUInt< Bits, Tag > xrpl::operator| ( BaseUInt< Bits, Tag > const & a,
BaseUInt< Bits, Tag > const & b )
constexpr

Definition at line 618 of file base_uint.h.

◆ operator+() [1/4]

template<std::size_t Bits, class Tag>
BaseUInt< Bits, Tag > xrpl::operator+ ( BaseUInt< Bits, Tag > const & a,
BaseUInt< Bits, Tag > const & b )
constexpr

Definition at line 625 of file base_uint.h.

◆ to_string() [1/32]

template<std::size_t Bits, class Tag>
std::string xrpl::to_string ( BaseUInt< Bits, Tag > const & a)

Definition at line 633 of file base_uint.h.

◆ toShortString()

template<std::size_t Bits, class Tag>
std::string xrpl::toShortString ( BaseUInt< Bits, Tag > const & a)

Definition at line 640 of file base_uint.h.

◆ operator<<() [1/24]

template<std::size_t Bits, class Tag>
std::ostream & xrpl::operator<< ( std::ostream & out,
BaseUInt< Bits, Tag > const & u )

Definition at line 647 of file base_uint.h.

◆ extract() [1/4]

template<>
std::size_t xrpl::extract ( uint256 const & key)

Definition at line 655 of file base_uint.h.

◆ operator==() [3/31]

bool xrpl::operator== ( Buffer const & lhs,
Buffer const & rhs )
noexcept

Definition at line 198 of file Buffer.h.

◆ operator!=() [1/10]

bool xrpl::operator!= ( Buffer const & lhs,
Buffer const & rhs )
noexcept

Definition at line 210 of file Buffer.h.

◆ kilobytes()

template<class T>
auto xrpl::kilobytes ( T value)
constexprnoexcept

Definition at line 7 of file ByteUtilities.h.

◆ megabytes()

template<class T>
auto xrpl::megabytes ( T value)
constexprnoexcept

Definition at line 14 of file ByteUtilities.h.

◆ to_string() [2/32]

template<class Duration>
std::string xrpl::to_string ( date::sys_time< Duration > tp)

Definition at line 53 of file chrono.h.

◆ to_string() [3/32]

std::string xrpl::to_string ( NetClock::time_point tp)

Definition at line 59 of file chrono.h.

◆ toStringIso() [1/2]

template<class Duration>
std::string xrpl::toStringIso ( date::sys_time< Duration > tp)

Definition at line 68 of file chrono.h.

◆ toStringIso() [2/2]

std::string xrpl::toStringIso ( NetClock::time_point tp)

Definition at line 75 of file chrono.h.

◆ stopwatch()

Stopwatch & xrpl::stopwatch ( )

Returns an instance of a wall clock.

Definition at line 94 of file chrono.h.

◆ logThrow()

void xrpl::logThrow ( std::string const & title)

Generates and logs a call stack.

Definition at line 13 of file libxrpl/basics/contract.cpp.

◆ rethrow()

XRPL_NO_SANITIZE_ADDRESS void xrpl::rethrow ( )

Rethrow the exception currently being handled.

When called from within a catch block, it will pass control to the next matching exception handler, if any. Otherwise, std::terminate will be called.

ASAN can't handle sudden jumps in control flow very well. This function is marked as XRPL_NO_SANITIZE_ADDRESS to prevent it from triggering false positives, since it throws.

Definition at line 33 of file contract.h.

◆ Throw()

template<class E, class... Args>
XRPL_NO_SANITIZE_ADDRESS void xrpl::Throw ( Args &&... args)

Definition at line 49 of file contract.h.

◆ logicError()

void xrpl::logicError ( std::string const & how)
noexcept

Called when faulty logic causes a broken invariant.

Definition at line 19 of file libxrpl/basics/contract.cpp.

◆ getFileContents()

std::string xrpl::getFileContents ( boost::system::error_code & ec,
boost::filesystem::path const & sourcePath,
std::optional< std::size_t > maxSize = std::nullopt )

Definition at line 20 of file FileUtilities.cpp.

◆ writeFileContents()

void xrpl::writeFileContents ( boost::system::error_code & ec,
boost::filesystem::path const & destPath,
std::string const & contents )

Definition at line 60 of file FileUtilities.cpp.

◆ makeSharedIntrusive()

template<class TT, class... Args>
SharedIntrusive< TT > xrpl::makeSharedIntrusive ( Args &&... args)

Create a shared intrusive pointer.

Note: unlike std::shared_ptr, where there is an advantage of allocating the pointer and control block together, there is no benefit for intrusive pointers.

Definition at line 445 of file IntrusivePointer.h.

◆ partialDestructorFinished()

template<class T>
void xrpl::partialDestructorFinished ( T ** o)

Definition at line 448 of file IntrusiveRefCounts.h.

◆ join()

template<class Stream, class Iter>
Stream & xrpl::join ( Stream & s,
Iter iter,
Iter end,
std::string_view delimiter )

Definition at line 10 of file join.h.

◆ setDebugLogSink()

Set the sink for the debug journal.

Parameters
sinkunique_ptr to new debug Sink.
Returns
unique_ptr to the previous Sink. nullptr if there was no Sink.

Definition at line 393 of file Log.cpp.

◆ debugLog()

beast::Journal xrpl::debugLog ( )

Returns a debug journal.

The journal may drain to a null sink, so its output may never be seen. Never use it for critical information.

Definition at line 399 of file Log.cpp.

◆ makeSslContext()

std::shared_ptr< boost::asio::ssl::context > xrpl::makeSslContext ( std::string const & cipherList)

Create a self-signed SSL context that allows anonymous Diffie Hellman.

Definition at line 353 of file make_SSLContext.cpp.

◆ makeSslContextAuthed()

std::shared_ptr< boost::asio::ssl::context > xrpl::makeSslContextAuthed ( std::string const & keyFile,
std::string const & certFile,
std::string const & chainFile,
std::string const & cipherList )

Create an authenticated SSL context using the specified files.

Definition at line 364 of file make_SSLContext.cpp.

◆ mallocTrim()

MallocTrimReport xrpl::mallocTrim ( std::string_view tag,
beast::Journal journal )

Attempt to return freed memory to the operating system.

On Linux with glibc malloc, this issues ::malloc_trim(0), which may release free space from ptmalloc arenas back to the kernel. On other platforms, or if a different allocator is in use, this function is a no-op and the report will indicate that trimming is unsupported or had no effect.

Parameters
tagIdentifier for logging/debugging purposes.
journalJournal for diagnostic logging.
Returns
Report containing before/after metrics and the trim result.
Note
If an alternative allocator (jemalloc/tcmalloc) is linked or preloaded, calling glibc's malloc_trim may have no effect on the active heap. The call is harmless but typically does not reclaim memory under those allocators.
Only memory served from glibc's sbrk/arena heaps is eligible for trim. Large allocations satisfied via mmap are usually returned on free independently of trimming.
Intended for use after operations that free significant memory (e.g., cache sweeps, ledger cleanup, online delete). Consider rate limiting.

Definition at line 77 of file libxrpl/basics/MallocTrim.cpp.

◆ calculatePercent()

std::size_t xrpl::calculatePercent ( std::size_t count,
std::size_t total )
constexpr

Calculate one number divided by another number in percentage.

The result is rounded up to the next integer, and capped in the range [0,100] E.g. calculatePercent(1, 100) = 1 because 1/100 = 0.010000 calculatePercent(1, 99) = 2 because 1/99 = 0.010101 calculatePercent(0, 100) = 0 calculatePercent(100, 100) = 100 calculatePercent(200, 100) = 100 because the result is capped to 100

Parameters
countdividend
totaldivisor
Returns
the percentage, in [0, 100]
Note
total cannot be zero.

Definition at line 24 of file MathUtilities.h.

◆ mulDiv() [1/7]

Return value*mul/div accurately.

Computes the result of the multiplication and division in a single step, avoiding overflow and retaining precision. Throws: None Returns: std::optional: std::nullopt if the calculation overflows. Otherwise, value * mul / div.

Definition at line 11 of file libxrpl/basics/mulDiv.cpp.

◆ to_string() [4/32]

std::string xrpl::to_string ( Number const & amount)

Definition at line 1080 of file Number.cpp.

◆ logTen()

template<typename T>
std::optional< int > xrpl::logTen ( T value)
constexpr

Definition at line 25 of file Number.h.

◆ isPowerOfTen()

template<typename T>
bool xrpl::isPowerOfTen ( T value)
constexpr

Definition at line 40 of file Number.h.

◆ operator+() [2/4]

Number xrpl::operator+ ( Number const & x,
Number const & y )

Definition at line 728 of file Number.h.

◆ operator-() [1/5]

Number xrpl::operator- ( Number const & x,
Number const & y )

Definition at line 736 of file Number.h.

◆ operator*()

Number xrpl::operator* ( Number const & x,
Number const & y )

Definition at line 744 of file Number.h.

◆ operator/()

Number xrpl::operator/ ( Number const & x,
Number const & y )

Definition at line 752 of file Number.h.

◆ abs()

Number xrpl::abs ( Number x)
constexprnoexcept

Definition at line 823 of file Number.h.

◆ power() [1/2]

Number xrpl::power ( Number const & f,
unsigned n )

Definition at line 1178 of file Number.cpp.

◆ root()

Number xrpl::root ( Number f,
unsigned d )

Definition at line 1201 of file Number.cpp.

◆ root2()

Number xrpl::root2 ( Number f)

Definition at line 1275 of file Number.cpp.

◆ power() [2/2]

Number xrpl::power ( Number const & f,
unsigned n,
unsigned d )

Definition at line 1322 of file Number.cpp.

◆ squelch()

Number xrpl::squelch ( Number const & x,
Number const & limit )
constexprnoexcept

Definition at line 854 of file Number.h.

◆ to_string() [5/32]

std::string xrpl::to_string ( MantissaRange::MantissaScale const & scale)

Definition at line 862 of file Number.h.

◆ extract() [2/4]

template<typename Key>
std::size_t xrpl::extract ( Key const & key)
static

Definition at line 18 of file partitioned_unordered_map.h.

◆ extract() [3/4]

template<>
std::size_t xrpl::extract ( std::string const & key)

Definition at line 25 of file partitioned_unordered_map.h.

◆ defaultPrng()

beast::xor_shift_engine & xrpl::defaultPrng ( )

Return the default random engine.

This engine is guaranteed to be deterministic, but by default will be randomly seeded. It is NOT cryptographically secure and MUST NOT be used to generate randomness that will be used for keys, secure cookies, IVs, padding, etc.

Each thread gets its own instance of the engine which will be randomly seeded.

Definition at line 48 of file include/xrpl/basics/random.h.

◆ randInt() [1/6]

template<class Engine, class Integral>
std::enable_if_t< std::is_integral_v< Integral > &&detail::is_engine< Engine >::value, Integral > xrpl::randInt ( Engine & engine,
Integral min,
Integral max )

Return a uniformly distributed random integer.

Parameters
minThe smallest value to return. If not specified the value defaults to 0.
maxThe largest value to return. If not specified the value defaults to the largest value that can be represented.

The randomness is generated by the specified engine (or the default engine if one is not specified). The result is cryptographically secure only when the engine passed into the function is cryptographically secure.

Note
The range is always a closed interval, so calling rand_int(-5, 15) can return any integer in the closed interval [-5, 15]; similarly, calling rand_int(7) can return any integer in the closed interval [0, 7].

Definition at line 96 of file include/xrpl/basics/random.h.

◆ randInt() [2/6]

template<class Integral>
std::enable_if_t< std::is_integral_v< Integral >, Integral > xrpl::randInt ( Integral min,
Integral max )

Definition at line 108 of file include/xrpl/basics/random.h.

◆ randInt() [3/6]

template<class Engine, class Integral>
std::enable_if_t< std::is_integral_v< Integral > &&detail::is_engine< Engine >::value, Integral > xrpl::randInt ( Engine & engine,
Integral max )

Definition at line 115 of file include/xrpl/basics/random.h.

◆ randInt() [4/6]

template<class Integral>
std::enable_if_t< std::is_integral_v< Integral >, Integral > xrpl::randInt ( Integral max)

Definition at line 122 of file include/xrpl/basics/random.h.

◆ randInt() [5/6]

template<class Integral, class Engine>
std::enable_if_t< std::is_integral_v< Integral > &&detail::is_engine< Engine >::value, Integral > xrpl::randInt ( Engine & engine)

Definition at line 129 of file include/xrpl/basics/random.h.

◆ randInt() [6/6]

template<class Integral = int>
std::enable_if_t< std::is_integral_v< Integral >, Integral > xrpl::randInt ( )

Definition at line 136 of file include/xrpl/basics/random.h.

◆ randByte() [1/2]

template<class Byte, class Engine>
std::enable_if_t<(std::is_same_v< Byte, unsigned char >||std::is_same_v< Byte, std::uint8_t >) &&detail::is_engine< Engine >::value, Byte > xrpl::randByte ( Engine & engine)

Return a random byte.

Definition at line 149 of file include/xrpl/basics/random.h.

◆ randByte() [2/2]

template<class Byte = std::uint8_t>
std::enable_if_t<(std::is_same_v< Byte, unsigned char >||std::is_same_v< Byte, std::uint8_t >), Byte > xrpl::randByte ( )

Definition at line 157 of file include/xrpl/basics/random.h.

◆ randBool() [1/2]

template<class Engine>
bool xrpl::randBool ( Engine & engine)

Return a random boolean value.

Definition at line 167 of file include/xrpl/basics/random.h.

◆ randBool() [2/2]

bool xrpl::randBool ( )

Definition at line 173 of file include/xrpl/basics/random.h.

◆ range()

template<class T>
ClosedInterval< T > xrpl::range ( T low,
T high )

Create a closed range interval.

Helper function to create a closed range interval without having to qualify the template argument.

Definition at line 34 of file RangeSet.h.

◆ to_string() [6/32]

template<class T>
std::string xrpl::to_string ( ClosedInterval< T > const & ci)

Convert a ClosedInterval to a styled string.

The styled string is "c.first()-c.last()" if c.first() != c.last() "c.first()" if c.first() == c.last()

Parameters
ciThe closed interval to convert
Returns
The style string

Definition at line 63 of file RangeSet.h.

◆ to_string() [7/32]

template<class T>
std::string xrpl::to_string ( RangeSet< T > const & rs)

Convert the given RangeSet to a styled string.

The styled string representation is the set of disjoint intervals joined by commas. The string "empty" is returned if the set is empty.

Parameters
rsThe rangeset to convert
Returns
The styled string

Definition at line 80 of file RangeSet.h.

◆ fromString()

template<class T>
bool xrpl::fromString ( RangeSet< T > & rs,
std::string const & s )
nodiscard

Convert the given styled string to a RangeSet.

The styled string representation is the set of disjoint intervals joined by commas.

Parameters
rsThe set to be populated
sThe styled string to convert
Returns
True on successfully converting styled string

Definition at line 104 of file RangeSet.h.

◆ prevMissing()

template<class T>
std::optional< T > xrpl::prevMissing ( RangeSet< T > const & rs,
T t,
T minVal = 0 )

Find the largest value not in the set that is less than a given value.

Parameters
rsThe set of interest
tThe value that must be larger than the result
minVal(Default is 0) The smallest allowed value
Returns
The largest v such that minV <= v < t and !contains(rs, v) or std::nullopt if no such v exists.

Definition at line 173 of file RangeSet.h.

◆ safeCast() [1/5]

template<class Dest, class Src>
std::enable_if_t< std::is_integral_v< Dest > &&std::is_integral_v< Src >, Dest > xrpl::safeCast ( Src s)
constexprnoexcept

Definition at line 21 of file safe_cast.h.

◆ safeCast() [2/5]

template<class Dest, class Src>
std::enable_if_t< std::is_enum_v< Dest > &&std::is_integral_v< Src >, Dest > xrpl::safeCast ( Src s)
constexprnoexcept

Definition at line 34 of file safe_cast.h.

◆ safeCast() [3/5]

template<class Dest, class Src>
std::enable_if_t< std::is_integral_v< Dest > &&std::is_enum_v< Src >, Dest > xrpl::safeCast ( Src s)
constexprnoexcept

Definition at line 41 of file safe_cast.h.

◆ unsafeCast() [1/5]

template<class Dest, class Src>
std::enable_if_t< std::is_integral_v< Dest > &&std::is_integral_v< Src >, Dest > xrpl::unsafeCast ( Src s)
constexprnoexcept

Definition at line 52 of file safe_cast.h.

◆ unsafeCast() [2/5]

template<class Dest, class Src>
std::enable_if_t< std::is_enum_v< Dest > &&std::is_integral_v< Src >, Dest > xrpl::unsafeCast ( Src s)
constexprnoexcept

Definition at line 63 of file safe_cast.h.

◆ unsafeCast() [3/5]

template<class Dest, class Src>
std::enable_if_t< std::is_integral_v< Dest > &&std::is_enum_v< Src >, Dest > xrpl::unsafeCast ( Src s)
constexprnoexcept

Definition at line 70 of file safe_cast.h.

◆ safeDowncast() [1/2]

template<class Dest, class Src>
Dest xrpl::safeDowncast ( Src * s)
noexcept

Definition at line 78 of file safe_cast.h.

◆ safeDowncast() [2/2]

template<class Dest, class Src>
Dest xrpl::safeDowncast ( Src & s)
noexcept

Definition at line 92 of file safe_cast.h.

◆ ScopeExit()

template<class EF>
xrpl::ScopeExit ( EF ) -> ScopeExit< EF >

◆ ScopeFail()

template<class EF>
xrpl::ScopeFail ( EF ) -> ScopeFail< EF >

◆ ScopeSuccess()

template<class EF>
xrpl::ScopeSuccess ( EF ) -> ScopeSuccess< EF >

◆ ScopeUnlock()

template<class Mutex>
xrpl::ScopeUnlock ( std::unique_lock< Mutex > & ) -> ScopeUnlock< Mutex >

◆ operator!=() [2/10]

bool xrpl::operator!= ( SHAMapHash const & x,
SHAMapHash const & y )

Definition at line 87 of file SHAMapHash.h.

◆ extract() [4/4]

template<>
std::size_t xrpl::extract ( SHAMapHash const & key)

Definition at line 94 of file SHAMapHash.h.

◆ hash_append() [1/11]

template<class Hasher>
void xrpl::hash_append ( Hasher & h,
Slice const & v )

Definition at line 175 of file Slice.h.

◆ operator==() [4/31]

bool xrpl::operator== ( Slice const & lhs,
Slice const & rhs )
noexcept

Definition at line 181 of file Slice.h.

◆ operator!=() [3/10]

bool xrpl::operator!= ( Slice const & lhs,
Slice const & rhs )
noexcept

Definition at line 193 of file Slice.h.

◆ operator<() [1/13]

bool xrpl::operator< ( Slice const & lhs,
Slice const & rhs )
noexcept

Definition at line 198 of file Slice.h.

◆ operator<<() [2/24]

template<class Stream>
Stream & xrpl::operator<< ( Stream & s,
Slice const & v )

Definition at line 206 of file Slice.h.

◆ makeSlice() [1/3]

template<class T, std::size_t N>
std::enable_if_t< std::is_same_v< T, char >||std::is_same_v< T, unsigned char >, Slice > xrpl::makeSlice ( std::array< T, N > const & a)

Definition at line 215 of file Slice.h.

◆ makeSlice() [2/3]

template<class T, class Alloc>
std::enable_if_t< std::is_same_v< T, char >||std::is_same_v< T, unsigned char >, Slice > xrpl::makeSlice ( std::vector< T, Alloc > const & v)

Definition at line 222 of file Slice.h.

◆ makeSlice() [3/3]

template<class Traits, class Alloc>
Slice xrpl::makeSlice ( std::basic_string< char, Traits, Alloc > const & s)

Definition at line 229 of file Slice.h.

◆ strHex() [1/2]

template<class FwdIt>
std::string xrpl::strHex ( FwdIt begin,
FwdIt end )

Definition at line 10 of file strHex.h.

◆ strHex() [2/2]

template<class T, class = decltype(std::declval<T>().begin())>
std::string xrpl::strHex ( T const & from)

Definition at line 25 of file strHex.h.

◆ sqlBlobLiteral()

std::string xrpl::sqlBlobLiteral ( Blob const & blob)

Format arbitrary binary data as an SQLite "blob literal".

In SQLite, blob literals must be encoded when used in a query. Per https://sqlite.org/lang_expr.html#literal_values_constants_ they are encoded as string literals containing hexadecimal data and preceded by a single 'X' character.

Parameters
blobAn arbitrary blob of binary data
Returns
The input, encoded as a blob literal.

Definition at line 23 of file StringUtilities.cpp.

◆ strUnHex() [1/2]

template<class Iterator>
std::optional< Blob > xrpl::strUnHex ( std::size_t strSize,
Iterator begin,
Iterator end )

Definition at line 63 of file StringUtilities.h.

◆ strUnHex() [2/2]

std::optional< Blob > xrpl::strUnHex ( std::string_view strSrc)

Definition at line 99 of file StringUtilities.h.

◆ parseUrl()

bool xrpl::parseUrl ( ParsedUrl & pUrl,
std::string const & strUrl )

Definition at line 37 of file StringUtilities.cpp.

◆ trimWhitespace()

std::string xrpl::trimWhitespace ( std::string str)

Definition at line 97 of file StringUtilities.cpp.

◆ toUInt64()

std::optional< std::uint64_t > xrpl::toUInt64 ( std::string const & s)

Definition at line 104 of file StringUtilities.cpp.

◆ isProperlyFormedTomlDomain()

bool xrpl::isProperlyFormedTomlDomain ( std::string_view domain)

Determines if the given string looks like a TOML-file hosting domain.

Do not use this function to determine if a particular string is a valid domain, as this function may reject domains that are otherwise valid and doesn't check whether the TLD is valid.

Definition at line 113 of file StringUtilities.cpp.

◆ to_string() [8/32]

template<class T>
std::enable_if_t< std::is_arithmetic_v< T >, std::string > xrpl::to_string ( T t)

to_string() generalizes std::to_string to handle bools, chars, and strings.

It's also possible to provide implementation of to_string for a class which needs a string implementation.

Definition at line 16 of file ToString.h.

◆ to_string() [9/32]

std::string xrpl::to_string ( bool b)

Definition at line 22 of file ToString.h.

◆ to_string() [10/32]

std::string xrpl::to_string ( char c)

Definition at line 28 of file ToString.h.

◆ to_string() [11/32]

std::string xrpl::to_string ( std::string s)

Definition at line 34 of file ToString.h.

◆ to_string() [12/32]

std::string xrpl::to_string ( char const * s)

Definition at line 40 of file ToString.h.

◆ set() [1/5]

template<class T>
bool xrpl::set ( T & target,
std::string const & name,
Section const & section )

Set a value from a configuration Section If the named value is not found or doesn't parse as a T, the variable is unchanged.

Returns
true if value was set.

Definition at line 295 of file BasicConfig.h.

◆ set() [2/5]

template<class T>
bool xrpl::set ( T & target,
T const & defaultValue,
std::string const & name,
Section const & section )

Set a value from a configuration Section If the named value is not found or doesn't cast to T, the variable is assigned the default.

Returns
true if the named value was found and is valid.

Definition at line 318 of file BasicConfig.h.

◆ get() [1/6]

template<class T = std::string>
T xrpl::get ( Section const & section,
std::string const & name,
T const & defaultValue = T{} )

Retrieve a key/value pair from a section.

Returns
The value string converted to T if it exists and can be parsed, or else defaultValue.

Definition at line 333 of file BasicConfig.h.

◆ get() [2/6]

std::string xrpl::get ( Section const & section,
std::string const & name,
char const * defaultValue )

Definition at line 346 of file BasicConfig.h.

◆ getIfExists()

template<class T>
bool xrpl::getIfExists ( Section const & section,
std::string const & name,
T & v )

Definition at line 362 of file BasicConfig.h.

◆ getIfExists< bool >()

template<>
bool xrpl::getIfExists< bool > ( Section const & section,
std::string const & name,
bool & v )

Definition at line 368 of file BasicConfig.h.

◆ operator|() [2/4]

HashRouterFlags xrpl::operator| ( HashRouterFlags lhs,
HashRouterFlags rhs )
constexpr

Definition at line 33 of file HashRouter.h.

◆ operator|=() [1/2]

HashRouterFlags & xrpl::operator|= ( HashRouterFlags & lhs,
HashRouterFlags rhs )
constexpr

Definition at line 41 of file HashRouter.h.

◆ operator&() [2/3]

HashRouterFlags xrpl::operator& ( HashRouterFlags lhs,
HashRouterFlags rhs )
constexpr

Definition at line 48 of file HashRouter.h.

◆ operator&=() [1/2]

HashRouterFlags & xrpl::operator&= ( HashRouterFlags & lhs,
HashRouterFlags rhs )
constexpr

Definition at line 56 of file HashRouter.h.

◆ any()

bool xrpl::any ( HashRouterFlags flags)
constexpr

Definition at line 63 of file HashRouter.h.

◆ operator<<() [3/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
StartUpType const & type )

Definition at line 10 of file StartUpType.h.

◆ cryptoPrng()

CsprngEngine & xrpl::cryptoPrng ( )

The default cryptographically secure PRNG.

Use this when you need to generate random numbers or data that will be used for encryption or passed into cryptographic routines.

This meets the requirements of UniformRandomNumberEngine

Definition at line 81 of file libxrpl/crypto/csprng.cpp.

◆ secureErase()

void xrpl::secureErase ( void * dest,
std::size_t bytes )

Attempts to clear the given blob of memory.

The underlying implementation of this function takes pains to attempt to outsmart the compiler from optimizing the clearing away. Please note that, despite that, remnants of content may remain floating around in memory as well as registers, caches and more.

For a more in-depth discussion of the subject please see the below posts by Colin Percival:

http://www.daemonology.net/blog/2014-09-04-how-to-zero-a-buffer.html http://www.daemonology.net/blog/2014-09-06-zeroing-buffers-is-insufficient.html

Definition at line 10 of file secure_erase.cpp.

◆ makeAmendmentTable()

std::unique_ptr< AmendmentTable > xrpl::makeAmendmentTable ( ServiceRegistry & registry,
std::chrono::seconds majorityTime,
std::vector< AmendmentTable::FeatureInfo > const & supported,
Section const & enabled,
Section const & vetoed,
beast::Journal journal )

Definition at line 1021 of file AmendmentTable.cpp.

◆ operator|() [3/4]

ApplyFlags xrpl::operator| ( ApplyFlags const & lhs,
ApplyFlags const & rhs )
constexpr

Definition at line 35 of file ApplyView.h.

◆ operator&() [3/3]

ApplyFlags xrpl::operator& ( ApplyFlags const & lhs,
ApplyFlags const & rhs )
constexpr

Definition at line 46 of file ApplyView.h.

◆ operator~() [1/2]

ApplyFlags xrpl::operator~ ( ApplyFlags const & flags)
constexpr

Definition at line 57 of file ApplyView.h.

◆ operator|=() [2/2]

ApplyFlags xrpl::operator|= ( ApplyFlags & lhs,
ApplyFlags const & rhs )

Definition at line 65 of file ApplyView.h.

◆ operator&=() [2/2]

ApplyFlags xrpl::operator&= ( ApplyFlags & lhs,
ApplyFlags const & rhs )

Definition at line 72 of file ApplyView.h.

◆ isGlobalFrozen() [1/3]

bool xrpl::isGlobalFrozen ( ReadView const & view,
AccountID const & issuer )
nodiscard

Check if the issuer has the global freeze flag set.

Parameters
issuerThe account to check
Returns
true if the account has global freeze set

Definition at line 35 of file AccountRootHelpers.cpp.

◆ xrpLiquid()

XRPAmount xrpl::xrpLiquid ( ReadView const & view,
AccountID const & id,
std::int32_t ownerCountAdj,
beast::Journal j )
nodiscard

Definition at line 87 of file AccountRootHelpers.cpp.

◆ adjustOwnerCount() [1/2]

void xrpl::adjustOwnerCount ( ApplyView & view,
SLE::ref sle,
std::int32_t amount,
beast::Journal j )

Adjust the owner count up or down.

Definition at line 128 of file AccountRootHelpers.cpp.

◆ transferRate() [1/3]

Rate xrpl::transferRate ( ReadView const & view,
AccountID const & issuer )
nodiscard

Returns IOU issuer transfer fee as Rate.

Rate specifies the fee as fractions of 1 billion. For example, 1% transfer rate is represented as 1,010,000,000.

Parameters
issuerThe IOU issuer

Definition at line 117 of file AccountRootHelpers.cpp.

◆ pseudoAccountAddress()

AccountID xrpl::pseudoAccountAddress ( ReadView const & view,
uint256 const & pseudoOwnerKey )

Generate a pseudo-account address from a pseudo owner key.

Parameters
pseudoOwnerKeyThe key to generate the address from
Returns
The generated account ID

Definition at line 142 of file AccountRootHelpers.cpp.

◆ getPseudoAccountFields()

std::vector< SField const * > const & xrpl::getPseudoAccountFields ( )
nodiscard

Returns the list of fields that define an ACCOUNT_ROOT as a pseudo-account if set.

The list is constructed during initialization and is const after that. Pseudo-account designator fields MUST be maintained by including the SField::sMD_PseudoAccount flag in the SField definition.

Definition at line 165 of file AccountRootHelpers.cpp.

◆ isPseudoAccount() [1/2]

bool xrpl::isPseudoAccount ( SLE::const_pointer sleAcct,
std::set< SField const * > const & pseudoFieldFilter = {} )
nodiscard

Returns true if and only if sleAcct is a pseudo-account or specific pseudo-accounts in pseudoFieldFilter.

Returns false if sleAcct is:

  • NOT a pseudo-account OR
  • NOT a ltACCOUNT_ROOT OR
  • null pointer

Definition at line 191 of file AccountRootHelpers.cpp.

◆ isPseudoAccount() [2/2]

bool xrpl::isPseudoAccount ( ReadView const & view,
AccountID const & accountId,
std::set< SField const * > const & pseudoFieldFilter = {} )
nodiscard

Convenience overload that reads the account from the view.

Definition at line 78 of file AccountRootHelpers.h.

◆ createPseudoAccount()

std::expected< SLE::pointer, TER > xrpl::createPseudoAccount ( ApplyView & view,
uint256 const & pseudoOwnerKey,
SField const & ownerField )
nodiscard

Create pseudo-account, storing pseudoOwnerKey into ownerField.

The list of valid ownerField is maintained in AccountRootHelpers.cpp and the caller to this function must perform necessary amendment check(s) before using a field. The amendment check is not performed in createPseudoAccount.

Definition at line 206 of file AccountRootHelpers.cpp.

◆ checkDestinationAndTag()

TER xrpl::checkDestinationAndTag ( SLE::const_ref toSle,
bool hasDestinationTag )
nodiscard

Checks the destination and tag.

  • Checks that the SLE is not null.
  • If the SLE requires a destination tag, checks that there is a tag.

Definition at line 248 of file AccountRootHelpers.cpp.

◆ ammLPTokens()

STAmount xrpl::ammLPTokens ( STAmount const & asset1,
STAmount const & asset2,
Asset const & lptIssue )

Calculate LP Tokens given AMM pool reserves.

Parameters
asset1AMM one side of the pool reserve
asset2AMM another side of the pool reserve
Returns
LP Tokens as IOU

Definition at line 45 of file AMMHelpers.cpp.

◆ lpTokensOut()

STAmount xrpl::lpTokensOut ( STAmount const & asset1Balance,
STAmount const & asset1Deposit,
STAmount const & lptAMMBalance,
std::uint16_t tfee )

Calculate LP Tokens given asset's deposit amount.

Parameters
asset1Balancecurrent AMM asset1 balance
asset1Depositrequested asset1 deposit amount
lptAMMBalanceAMM LPT balance
tfeetrading fee in basis points
Returns
tokens

Definition at line 62 of file AMMHelpers.cpp.

◆ ammAssetIn()

STAmount xrpl::ammAssetIn ( STAmount const & asset1Balance,
STAmount const & lptAMMBalance,
STAmount const & lpTokens,
std::uint16_t tfee )

Calculate asset deposit given LP Tokens.

Parameters
asset1Balancecurrent AMM asset1 balance
lpTokensLP Tokens
lptAMMBalanceAMM LPT balance
tfeetrading fee in basis points
Returns

Definition at line 95 of file AMMHelpers.cpp.

◆ lpTokensIn()

STAmount xrpl::lpTokensIn ( STAmount const & asset1Balance,
STAmount const & asset1Withdraw,
STAmount const & lptAMMBalance,
std::uint16_t tfee )

Calculate LP Tokens given asset's withdraw amount.

Return 0 if can't calculate.

Parameters
asset1Balancecurrent AMM asset1 balance
asset1Withdrawrequested asset1 withdraw amount
lptAMMBalanceAMM LPT balance
tfeetrading fee in basis points
Returns
tokens out amount

Definition at line 124 of file AMMHelpers.cpp.

◆ ammAssetOut()

STAmount xrpl::ammAssetOut ( STAmount const & assetBalance,
STAmount const & lptAMMBalance,
STAmount const & lpTokens,
std::uint16_t tfee )

Calculate asset withdrawal by tokens.

Parameters
assetBalancebalance of the asset being withdrawn
lptAMMBalancetotal AMM Tokens balance
lpTokensLP Tokens balance
tfeetrading fee in basis points
Returns
calculated asset amount

Definition at line 155 of file AMMHelpers.cpp.

◆ withinRelativeDistance() [1/2]

bool xrpl::withinRelativeDistance ( Quality const & calcQuality,
Quality const & reqQuality,
Number const & dist )

Check if the relative distance between the qualities is within the requested distance.

Parameters
calcQualitycalculated quality
reqQualityrequested quality
distrequested relative distance
Returns
true if within dist, false otherwise

Definition at line 115 of file AMMHelpers.h.

◆ withinRelativeDistance() [2/2]

template<typename Amt>
bool xrpl::withinRelativeDistance ( Amt const & calc,
Amt const & req,
Number const & dist )

Check if the relative distance between the amounts is within the requested distance.

Parameters
calccalculated amount
reqrequested amount
distrequested relative distance
Returns
true if within dist, false otherwise

Definition at line 139 of file AMMHelpers.h.

◆ solveQuadraticEqSmallest()

std::optional< Number > xrpl::solveQuadraticEqSmallest ( Number const & a,
Number const & b,
Number const & c )

Solve quadratic equation to find takerGets or takerPays.

Round to minimize the amount in order to maximize the quality.

Definition at line 276 of file AMMHelpers.cpp.

◆ getAMMOfferStartWithTakerGets()

template<typename TIn, typename TOut>
std::optional< TAmounts< TIn, TOut > > xrpl::getAMMOfferStartWithTakerGets ( TAmounts< TIn, TOut > const & pool,
Quality const & targetQuality,
std::uint16_t const & tfee )

Generate AMM offer starting with takerGets when AMM pool from the payment perspective is IOU(in)/XRP(out) Equations: Spot Price Quality after the offer is consumed: Qsp = (O - o) / (I + i) – equation (1) where O is poolPays, I is poolGets, o is takerGets, i is takerPays Swap out: i = (I * o) / (O - o) * f – equation (2) where f is (1 - tfee/100000), tfee is in basis points Effective price targetQuality: Qep = o / i – equation (3) There are two scenarios to consider A) Qsp = Qep.

Substitute i in (1) with (2) and solve for o and Qsp = targetQuality(Qt): o**2 + o * (I * Qt * (1 - 1 / f) - 2 * O) + O**2 - Qt * I * O = 0 B) Qep = Qsp. Substitute i in (3) with (2) and solve for o and Qep = targetQuality(Qt): o = O - I * Qt / f Since the scenario is not known a priori, both A and B are solved and the lowest value of o is takerGets. takerPays is calculated with swap out eq (2). If o is less or equal to 0 then the offer can't be generated.

Definition at line 178 of file AMMHelpers.h.

◆ getAMMOfferStartWithTakerPays()

template<typename TIn, typename TOut>
std::optional< TAmounts< TIn, TOut > > xrpl::getAMMOfferStartWithTakerPays ( TAmounts< TIn, TOut > const & pool,
Quality const & targetQuality,
std::uint16_t tfee )

Generate AMM offer starting with takerPays when AMM pool from the payment perspective is XRP(in)/IOU(out) or IOU(in)/IOU(out).

Equations: Spot Price Quality after the offer is consumed: Qsp = (O - o) / (I + i) – equation (1) where O is poolPays, I is poolGets, o is takerGets, i is takerPays Swap in: o = (O * i * f) / (I + i * f) – equation (2) where f is (1 - tfee/100000), tfee is in basis points Effective price quality: Qep = o / i – equation (3) There are two scenarios to consider A) Qsp = Qep. Substitute o in (1) with (2) and solve for i and Qsp = targetQuality(Qt): i**2 * f + i * I * (1 + f) + I**2 - I * O / Qt = 0 B) Qep = Qsp. Substitute i in (3) with (2) and solve for i and Qep = targetQuality(Qt): i = O / Qt - I / f Since the scenario is not known a priori, both A and B are solved and the lowest value of i is takerPays. takerGets is calculated with swap in eq (2). If i is less or equal to 0 then the offer can't be generated.

Definition at line 245 of file AMMHelpers.h.

◆ changeSpotPriceQuality()

template<typename TIn, typename TOut>
std::optional< TAmounts< TIn, TOut > > xrpl::changeSpotPriceQuality ( TAmounts< TIn, TOut > const & pool,
Quality const & quality,
std::uint16_t tfee,
Rules const & rules,
beast::Journal j )

Generate AMM offer so that either updated Spot Price Quality (SPQ) is equal to LOB quality (in this case AMM offer quality is better than LOB quality) or AMM offer is equal to LOB quality (in this case SPQ is better than LOB quality).

Pre-amendment code calculates takerPays first. If takerGets is XRP, it is rounded down, which results in worse offer quality than LOB quality, and the offer might fail to generate. Post-amendment code calculates the XRP offer side first. The result is rounded down, which makes the offer quality better. It might not be possible to match either SPQ or AMM offer to LOB quality. This generally happens at higher fees.

Parameters
poolAMM pool balances
qualityrequested quality
tfeetrading fee in basis points
Returns
seated in/out amounts if the quality can be changed

Definition at line 305 of file AMMHelpers.h.

◆ swapAssetIn()

template<typename TIn, typename TOut>
TOut xrpl::swapAssetIn ( TAmounts< TIn, TOut > const & pool,
TIn const & assetIn,
std::uint16_t tfee )

AMM pool invariant - the product (A * B) after swap in/out has to remain at least the same: (A + in) * (B - out) >= A * B XRP round-off may result in a smaller product after swap in/out.

To address this:

  • if on swapIn the out is XRP then the amount is round-off downward, making the product slightly larger since out value is reduced.
  • if on swapOut the in is XRP then the amount is round-off upward, making the product slightly larger since in value is increased. Swap assetIn into the pool and swap out a proportional amount of the other asset. Implements AMM Swap in.
    See also
    XLS30d:AMM Swap
    Parameters
    poolcurrent AMM pool balances
    assetInamount to swap in
    tfeetrading fee in basis points
    Returns

Definition at line 427 of file AMMHelpers.h.

◆ swapAssetOut()

template<typename TIn, typename TOut>
TIn xrpl::swapAssetOut ( TAmounts< TIn, TOut > const & pool,
TOut const & assetOut,
std::uint16_t tfee )

Swap assetOut out of the pool and swap in a proportional amount of the other asset.

Implements AMM Swap out.

See also
XLS30d:AMM Swap
Parameters
poolcurrent AMM pool balances
assetOutamount to swap out
tfeetrading fee in basis points
Returns

Definition at line 493 of file AMMHelpers.h.

◆ square()

Number xrpl::square ( Number const & n)

Return square of n.

Definition at line 175 of file AMMHelpers.cpp.

◆ adjustLPTokens()

STAmount xrpl::adjustLPTokens ( STAmount const & lptAMMBalance,
STAmount const & lpTokens,
IsDeposit isDeposit )

Adjust LP tokens to deposit/withdraw.

Amount type keeps 16 digits. Maintaining the LP balance by adding deposited tokens or subtracting withdrawn LP tokens from LP balance results in losing precision in LP balance. I.e. the resulting LP balance is less than the actual sum of LP tokens. To adjust for this, subtract old tokens balance from the new one for deposit or vice versa for withdraw to cancel out the precision loss.

Parameters
lptAMMBalanceLPT AMM Balance
lpTokensLP tokens to deposit or withdraw
isDepositYes if deposit, No if withdraw

Definition at line 181 of file AMMHelpers.cpp.

◆ adjustAmountsByLPTokens()

std::tuple< STAmount, std::optional< STAmount >, STAmount > xrpl::adjustAmountsByLPTokens ( STAmount const & amountBalance,
STAmount const & amount,
std::optional< STAmount > const & amount2,
STAmount const & lptAMMBalance,
STAmount const & lpTokens,
std::uint16_t tfee,
IsDeposit isDeposit )

Calls adjustLPTokens() and adjusts deposit or withdraw amounts if the adjusted LP tokens are less than the provided LP tokens.

Parameters
amountBalanceasset1 pool balance
amountasset1 to deposit or withdraw
amount2asset2 to deposit or withdraw
lptAMMBalanceLPT AMM Balance
lpTokensLP tokens to deposit or withdraw
tfeetrading fee in basis points
isDepositYes if deposit, No if withdraw
Returns

Definition at line 192 of file AMMHelpers.cpp.

◆ solveQuadraticEq()

Number xrpl::solveQuadraticEq ( Number const & a,
Number const & b,
Number const & c )

Positive solution for quadratic equation: x = (-b + sqrt(b**2 + 4*a*c))/(2*a).

Definition at line 269 of file AMMHelpers.cpp.

◆ multiply() [1/3]

STAmount xrpl::multiply ( STAmount const & amount,
Number const & frac,
Number::RoundingMode rm )

Definition at line 292 of file AMMHelpers.cpp.

◆ getRoundedAsset() [1/2]

template<typename A>
STAmount xrpl::getRoundedAsset ( Rules const & rules,
STAmount const & balance,
A const & frac,
IsDeposit isDeposit )

Round AMM equal deposit/withdrawal amount.

Deposit/withdrawal formulas calculate the amount as a fractional value of the pool balance. The rounding takes place on the last step of multiplying the balance by the fraction if AMMv1_3 is enabled.

Definition at line 626 of file AMMHelpers.h.

◆ getRoundedAsset() [2/2]

STAmount xrpl::getRoundedAsset ( Rules const & rules,
std::function< Number()> const & noRoundCb,
STAmount const & balance,
std::function< Number()> const & productCb,
IsDeposit isDeposit )

Round AMM single deposit/withdrawal amount.

The lambda's are used to delay evaluation until the function is executed so that the calculation is not done twice. noRoundCb() is called if AMMv1_3 is disabled. Otherwise, the rounding is set and the amount is: isDeposit is Yes - the balance multiplied by productCb() isDeposit is No - the result of productCb(). The rounding is the same for all calculations in productCb()

Definition at line 300 of file AMMHelpers.cpp.

◆ getRoundedLPTokens() [1/2]

STAmount xrpl::getRoundedLPTokens ( Rules const & rules,
STAmount const & balance,
Number const & frac,
IsDeposit isDeposit )

Round AMM deposit/withdrawal LPToken amount.

Deposit/withdrawal formulas calculate the lptokens as a fractional value of the AMM total lptokens. The rounding takes place on the last step of multiplying the balance by the fraction if AMMv1_3 is enabled. The tokens are then adjusted to factor in the loss in precision (we only keep 16 significant digits) when adding the lptokens to the balance.

Definition at line 318 of file AMMHelpers.cpp.

◆ getRoundedLPTokens() [2/2]

STAmount xrpl::getRoundedLPTokens ( Rules const & rules,
std::function< Number()> const & noRoundCb,
STAmount const & lptAMMBalance,
std::function< Number()> const & productCb,
IsDeposit isDeposit )

Round AMM single deposit/withdrawal LPToken amount.

The lambda's are used to delay evaluation until the function is executed so that the calculations are not done twice. noRoundCb() is called if AMMv1_3 is disabled. Otherwise, the rounding is set and the lptokens are: if isDeposit is Yes - the result of productCb(). The rounding is the same for all calculations in productCb() if isDeposit is No - the balance multiplied by productCb() The lptokens are then adjusted to factor in the loss in precision (we only keep 16 significant digits) when adding the lptokens to the balance.

Definition at line 333 of file AMMHelpers.cpp.

◆ adjustAssetInByTokens()

std::pair< STAmount, STAmount > xrpl::adjustAssetInByTokens ( Rules const & rules,
STAmount const & balance,
STAmount const & amount,
STAmount const & lptAMMBalance,
STAmount const & tokens,
std::uint16_t tfee )

Definition at line 356 of file AMMHelpers.cpp.

◆ adjustAssetOutByTokens()

std::pair< STAmount, STAmount > xrpl::adjustAssetOutByTokens ( Rules const & rules,
STAmount const & balance,
STAmount const & amount,
STAmount const & lptAMMBalance,
STAmount const & tokens,
std::uint16_t tfee )

Definition at line 382 of file AMMHelpers.cpp.

◆ adjustFracByTokens()

Number xrpl::adjustFracByTokens ( Rules const & rules,
STAmount const & lptAMMBalance,
STAmount const & tokens,
Number const & frac )

Find a fraction of tokens after the tokens are adjusted.

The fraction is used to adjust equal deposit/withdraw amount.

Definition at line 408 of file AMMHelpers.cpp.

◆ ammPoolHolds()

std::pair< STAmount, STAmount > xrpl::ammPoolHolds ( ReadView const & view,
AccountID const & ammAccountID,
Asset const & asset1,
Asset const & asset2,
FreezeHandling freezeHandling,
AuthHandling authHandling,
beast::Journal const j )

Get AMM pool balances.

Definition at line 420 of file AMMHelpers.cpp.

◆ checkAMMPrecisionLoss() [1/2]

TER xrpl::checkAMMPrecisionLoss ( Number const & poolProductMean,
STAmount const & newLPTokenBalance )

Check AMM pool product invariant after an AMM operation that changes LP tokens (deposit/withdraw/clawback) from an already calculated pool product mean.

Returns tecPRECISION_LOSS if poolProductMean < newLPTokenBalance beyond the invariant tolerance, tesSUCCESS otherwise. Skips check when newLPTokenBalance is zero (last withdrawal).

Definition at line 437 of file AMMHelpers.cpp.

◆ checkAMMPrecisionLoss() [2/2]

TER xrpl::checkAMMPrecisionLoss ( ReadView const & view,
AccountID const & ammAccountID,
Asset const & asset1,
Asset const & asset2,
STAmount const & newLPTokenBalance,
beast::Journal const j )

Check AMM pool product invariant after an AMM operation that changes LP tokens (deposit/withdraw/clawback).

Returns tecPRECISION_LOSS if sqrt(asset1 * asset2) < newLPTokenBalance beyond the invariant tolerance, tesSUCCESS otherwise. Skips check when newLPTokenBalance is zero (last withdrawal).

Definition at line 452 of file AMMHelpers.cpp.

◆ ammHolds()

std::expected< std::tuple< STAmount, STAmount, STAmount >, TER > xrpl::ammHolds ( ReadView const & view,
SLE const & ammSle,
std::optional< Asset > const & optAsset1,
std::optional< Asset > const & optAsset2,
FreezeHandling freezeHandling,
AuthHandling authHandling,
beast::Journal const j )

Get AMM pool and LP token balances.

If both optIssue are provided then they are used as the AMM token pair issues. Otherwise the missing issues are fetched from ammSle.

Definition at line 474 of file AMMHelpers.cpp.

◆ ammLPHolds() [1/2]

STAmount xrpl::ammLPHolds ( ReadView const & view,
Asset const & asset1,
Asset const & asset2,
AccountID const & ammAccount,
AccountID const & lpAccount,
beast::Journal const j )

Get the balance of LP tokens.

Definition at line 542 of file AMMHelpers.cpp.

◆ ammLPHolds() [2/2]

STAmount xrpl::ammLPHolds ( ReadView const & view,
SLE const & ammSle,
AccountID const & lpAccount,
beast::Journal const j )

Definition at line 592 of file AMMHelpers.cpp.

◆ getTradingFee()

std::uint16_t xrpl::getTradingFee ( ReadView const & view,
SLE const & ammSle,
AccountID const & account )

Get AMM trading fee for the given account.

The fee is discounted if the account is the auction slot owner or one of the slot's authorized accounts.

Definition at line 602 of file AMMHelpers.cpp.

◆ ammAccountHolds()

STAmount xrpl::ammAccountHolds ( ReadView const & view,
AccountID const & ammAccountID,
Asset const & asset )

Returns total amount held by AMM for the given token.

Definition at line 632 of file AMMHelpers.cpp.

◆ deleteAMMAccount()

TER xrpl::deleteAMMAccount ( Sandbox & view,
Asset const & asset,
Asset const & asset2,
beast::Journal j )

Delete trustlines to AMM.

If all trustlines are deleted then AMM object and account are deleted. Otherwise tecINCOMPLETE is returned.

Definition at line 749 of file AMMHelpers.cpp.

◆ initializeFeeAuctionVote()

void xrpl::initializeFeeAuctionVote ( ApplyView & view,
SLE::pointer & ammSle,
AccountID const & account,
Asset const & lptAsset,
std::uint16_t tfee )

Initialize Auction and Voting slots and set the trading/discounted fee.

Definition at line 805 of file AMMHelpers.cpp.

◆ isOnlyLiquidityProvider()

std::expected< bool, TER > xrpl::isOnlyLiquidityProvider ( ReadView const & view,
Issue const & ammIssue,
AccountID const & lpAccount )

Return true if the Liquidity Provider is the only AMM provider, false otherwise.

Return tecINTERNAL if encountered an unexpected condition, for instance Liquidity Provider has more than one LPToken trustline.

Definition at line 862 of file AMMHelpers.cpp.

◆ verifyAndAdjustLPTokenBalance()

std::expected< bool, TER > xrpl::verifyAndAdjustLPTokenBalance ( Sandbox & sb,
STAmount const & lpTokens,
SLE::pointer & ammSle,
AccountID const & account )

Due to rounding, the LPTokenBalance of the last LP might not match the LP's trustline balance.

If it's within the tolerance, update LPTokenBalance to match the LP's trustline balance.

Definition at line 962 of file AMMHelpers.cpp.

◆ verifyValidDomain()

TER xrpl::verifyValidDomain ( ApplyView & view,
AccountID const & account,
uint256 domainID,
beast::Journal j )

Definition at line 313 of file CredentialHelpers.cpp.

◆ checkDepositPreauth() [1/2]

TER xrpl::checkDepositPreauth ( STTx const & tx,
ReadView const & view,
AccountID const & src,
AccountID const & dst,
std::shared_ptr< SLE const > const & sleDst,
beast::Journal j )

Check whether src is authorized to deposit to dst.

Parameters
txTransaction containing optional credential IDs.
viewRead-only ledger view.
srcSource account.
dstDestination account.
sleDstDestination AccountRoot, if it exists.
jJournal for diagnostics.
Returns
tesSUCCESS if the deposit is allowed, otherwise an authorization error.

◆ cleanupExpiredCredentials()

TER xrpl::cleanupExpiredCredentials ( STTx const & tx,
ApplyView & view,
beast::Journal j )

Remove expired credentials referenced by the transaction.

Parameters
txTransaction containing optional sfCredentialIDs.
viewMutable ledger view.
jJournal for diagnostics.
Returns
tesSUCCESS if no referenced credentials expired, tecEXPIRED if any were removed, or an error from credential deletion.

Definition at line 381 of file CredentialHelpers.cpp.

◆ verifyDepositPreauth()

TER xrpl::verifyDepositPreauth ( STTx const & tx,
ApplyView & view,
AccountID const & src,
AccountID const & dst,
SLE::const_ref sleDst,
beast::Journal j )

Definition at line 397 of file CredentialHelpers.cpp.

◆ checkTxPermission()

NotTEC xrpl::checkTxPermission ( SLE::const_ref delegate,
STTx const & tx )

Check if the delegate account has permission to execute the transaction.

Parameters
delegateThe delegate account.
txThe transaction that the delegate account intends to execute.
Returns
tesSUCCESS if the transaction is allowed, terNO_DELEGATE_PERMISSION if not.

Definition at line 14 of file DelegateUtils.cpp.

◆ getGranularPermission()

std::unordered_set< GranularPermissionType > xrpl::getGranularPermission ( SLE::const_ref delegate,
TxType const & type )

Load the granular permissions granted to the delegate account for the specified transaction type.

Parameters
delegateThe delegate account.
typeUsed to determine which granted granular permissions to load, based on the transaction type.
Returns
the granted granular permissions tied to the transaction type.

Definition at line 33 of file DelegateUtils.cpp.

◆ cdirFirst()

bool xrpl::cdirFirst ( ReadView const & view,
uint256 const & root,
SLE::const_pointer & page,
unsigned int & index,
uint256 & entry )

Returns the first entry in the directory, advancing the index.

Parameters
viewThe view against which to operate
rootThe root (i.e. first page) of the directory to iterate
pageThe current page
indexThe index inside the current page
entryThe entry at the current index
Returns
true if the directory isn't empty; false otherwise

Definition at line 41 of file DirectoryHelpers.cpp.

◆ dirFirst()

bool xrpl::dirFirst ( ApplyView & view,
uint256 const & root,
SLE::pointer & page,
unsigned int & index,
uint256 & entry )

Definition at line 19 of file DirectoryHelpers.cpp.

◆ cdirNext()

bool xrpl::cdirNext ( ReadView const & view,
uint256 const & root,
SLE::const_pointer & page,
unsigned int & index,
uint256 & entry )

Returns the next entry in the directory, advancing the index.

Parameters
viewThe view against which to operate
rootThe root (i.e. first page) of the directory to iterate
pageThe current page
indexThe index inside the current page
entryThe entry at the current index
Returns
true if the directory isn't empty; false otherwise

Definition at line 52 of file DirectoryHelpers.cpp.

◆ dirNext()

bool xrpl::dirNext ( ApplyView & view,
uint256 const & root,
SLE::pointer & page,
unsigned int & index,
uint256 & entry )

Definition at line 30 of file DirectoryHelpers.cpp.

◆ forEachItem() [1/2]

void xrpl::forEachItem ( ReadView const & view,
Keylet const & root,
std::function< void(SLE::const_ref)> const & f )

Iterate all items in the given directory.

Definition at line 63 of file DirectoryHelpers.cpp.

◆ forEachItemAfter() [1/2]

bool xrpl::forEachItemAfter ( ReadView const & view,
Keylet const & root,
uint256 const & after,
std::uint64_t const hint,
unsigned int limit,
std::function< bool(SLE::const_ref)> const & f )

Iterate all items after an item in the given directory.

Parameters
afterThe key of the item to start after
hintThe directory page containing after
limitThe maximum number of items to return
Returns
false if the iteration failed

Definition at line 87 of file DirectoryHelpers.cpp.

◆ forEachItem() [2/2]

void xrpl::forEachItem ( ReadView const & view,
AccountID const & id,
std::function< void(SLE::const_ref)> const & f )

Iterate all items in an account's owner directory.

Definition at line 184 of file DirectoryHelpers.h.

◆ forEachItemAfter() [2/2]

bool xrpl::forEachItemAfter ( ReadView const & view,
AccountID const & id,
uint256 const & after,
std::uint64_t const hint,
unsigned int limit,
std::function< bool(SLE::const_ref)> const & f )

Iterate all items after an item in an owner directory.

Parameters
afterThe key of the item to start after
hintThe directory page containing after
limitThe maximum number of items to return
Returns
false if the iteration failed

Definition at line 196 of file DirectoryHelpers.h.

◆ dirIsEmpty()

bool xrpl::dirIsEmpty ( ReadView const & view,
Keylet const & k )
nodiscard

Returns true if the directory is empty.

Parameters
keyThe key of the directory

Definition at line 166 of file DirectoryHelpers.cpp.

◆ describeOwnerDir()

std::function< void(SLE::ref)> xrpl::describeOwnerDir ( AccountID const & account)
nodiscard

Returns a function that sets the owner on a directory SLE.

Definition at line 180 of file DirectoryHelpers.cpp.

◆ escrowUnlockApplyHelper()

template<ValidIssueType T>
TER xrpl::escrowUnlockApplyHelper ( ApplyView & view,
Rate lockedRate,
SLE::ref sleDest,
STAmount const & xrpBalance,
STAmount const & amount,
AccountID const & issuer,
AccountID const & sender,
AccountID const & receiver,
bool createAsset,
beast::Journal journal )

◆ escrowUnlockApplyHelper< Issue >()

template<>
TER xrpl::escrowUnlockApplyHelper< Issue > ( ApplyView & view,
Rate lockedRate,
SLE::ref sleDest,
STAmount const & xrpBalance,
STAmount const & amount,
AccountID const & issuer,
AccountID const & sender,
AccountID const & receiver,
bool createAsset,
beast::Journal journal )

Definition at line 31 of file EscrowHelpers.h.

◆ escrowUnlockApplyHelper< MPTIssue >()

template<>
TER xrpl::escrowUnlockApplyHelper< MPTIssue > ( ApplyView & view,
Rate lockedRate,
SLE::ref sleDest,
STAmount const & xrpBalance,
STAmount const & amount,
AccountID const & issuer,
AccountID const & sender,
AccountID const & receiver,
bool createAsset,
beast::Journal journal )

Definition at line 161 of file EscrowHelpers.h.

◆ canApplyToBrokerCover()

TER xrpl::canApplyToBrokerCover ( ReadView const & view,
SLE::const_ref sleBroker,
Asset const & vaultAsset,
STAmount const & amount,
beast::Journal j,
std::string_view logPrefix )
nodiscard

Broker cover preclaim precision guard (fixCleanup3_2_0).

Prevents a "silent sub-ULP no-op" where a deposit, withdrawal, or clawback amount is so small that it rounds to zero at sfCoverAvailable's scale. Without this guard, both the pseudo trust-line and sfCoverAvailable would identically absorb the rounded zero, resulting in a successful transaction (tesSUCCESS) where no funds actually moved.

Parameters
viewRead view (rules used for amendment gating).
sleBrokerThe loan broker SLE (read-only).
vaultAssetThe underlying vault asset (the broker's cover asset).
amountThe effective subtraction/addition amount.
jJournal for logging.
logPrefixTransactor name for log diagnostics.
Returns
tecPRECISION_LOSS if the request rounds to zero at cover scale. tesSUCCESS if the amendment is disabled or the request is safely supra-ULP.

Definition at line 34 of file LendingHelpers.cpp.

◆ checkLendingProtocolDependencies()

bool xrpl::checkLendingProtocolDependencies ( Rules const & rules,
STTx const & tx )

Definition at line 65 of file LendingHelpers.cpp.

◆ loanPeriodicRate()

Number xrpl::loanPeriodicRate ( TenthBips32 interestRate,
std::uint32_t paymentInterval )

Definition at line 116 of file LendingHelpers.cpp.

◆ roundPeriodicPayment()

Number xrpl::roundPeriodicPayment ( Asset const & asset,
Number const & periodicPayment,
std::int32_t scale )

Ensure the periodic payment is always rounded consistently.

Definition at line 51 of file LendingHelpers.h.

◆ adjustImpreciseNumber()

template<class NumberProxy>
void xrpl::adjustImpreciseNumber ( NumberProxy value,
Number const & adjustment,
Asset const & asset,
int vaultScale )

Definition at line 187 of file LendingHelpers.h.

◆ getAssetsTotalScale()

int xrpl::getAssetsTotalScale ( SLE::const_ref vaultSle)

Definition at line 200 of file LendingHelpers.h.

◆ minimumBrokerCover()

Number xrpl::minimumBrokerCover ( Number const & debtTotal,
TenthBips32 coverRateMinimum,
SLE::const_ref vaultSle )

Definition at line 211 of file LendingHelpers.h.

◆ checkLoanGuards()

TER xrpl::checkLoanGuards ( Asset const & vaultAsset,
Number const & principalRequested,
bool expectInterest,
std::uint32_t paymentTotal,
LoanProperties const & properties,
beast::Journal j )

Definition at line 1417 of file LendingHelpers.cpp.

◆ computeTheoreticalLoanState()

LoanState xrpl::computeTheoreticalLoanState ( Rules const & rules,
Number const & periodicPayment,
Number const & periodicRate,
std::uint32_t const paymentRemaining,
TenthBips32 const managementFeeRate )

Definition at line 1559 of file LendingHelpers.cpp.

◆ constructLoanState()

LoanState xrpl::constructLoanState ( Number const & totalValueOutstanding,
Number const & principalOutstanding,
Number const & managementFeeOutstanding )

Definition at line 1620 of file LendingHelpers.cpp.

◆ constructRoundedLoanState()

LoanState xrpl::constructRoundedLoanState ( SLE::const_ref loan)

Definition at line 1635 of file LendingHelpers.cpp.

◆ computeManagementFee()

Number xrpl::computeManagementFee ( Asset const & asset,
Number const & interest,
TenthBips32 managementFeeRate,
std::int32_t scale )

Definition at line 1650 of file LendingHelpers.cpp.

◆ computeFullPaymentInterest()

Number xrpl::computeFullPaymentInterest ( Number const & theoreticalPrincipalOutstanding,
Number const & periodicRate,
NetClock::time_point parentCloseTime,
std::uint32_t paymentInterval,
std::uint32_t prevPaymentDate,
std::uint32_t startDate,
TenthBips32 closeInterestRate )

Definition at line 1501 of file LendingHelpers.cpp.

◆ operator-() [2/5]

detail::LoanStateDeltas xrpl::operator- ( LoanState const & lhs,
LoanState const & rhs )

Definition at line 1379 of file LendingHelpers.cpp.

◆ operator-() [3/5]

LoanState xrpl::operator- ( LoanState const & lhs,
detail::LoanStateDeltas const & rhs )

Definition at line 1391 of file LendingHelpers.cpp.

◆ operator+() [3/4]

LoanState xrpl::operator+ ( LoanState const & lhs,
detail::LoanStateDeltas const & rhs )

Definition at line 1404 of file LendingHelpers.cpp.

◆ computeLoanProperties() [1/2]

LoanProperties xrpl::computeLoanProperties ( Rules const & rules,
Asset const & asset,
Number const & principalOutstanding,
TenthBips32 interestRate,
std::uint32_t paymentInterval,
std::uint32_t paymentsRemaining,
TenthBips32 managementFeeRate,
std::int32_t minimumScale )

Definition at line 1669 of file LendingHelpers.cpp.

◆ computeLoanProperties() [2/2]

LoanProperties xrpl::computeLoanProperties ( Rules const & rules,
Asset const & asset,
Number const & principalOutstanding,
Number const & periodicRate,
std::uint32_t paymentsRemaining,
TenthBips32 managementFeeRate,
std::int32_t minimumScale )

Definition at line 1700 of file LendingHelpers.cpp.

◆ isRounded()

bool xrpl::isRounded ( Asset const & asset,
Number const & value,
std::int32_t scale )

Definition at line 127 of file LendingHelpers.cpp.

◆ loanMakePayment()

std::expected< LoanPaymentParts, TER > xrpl::loanMakePayment ( Asset const & asset,
ApplyView & view,
SLE::ref loan,
SLE::const_ref brokerSle,
STAmount const & amount,
LoanPaymentType const paymentType,
beast::Journal j )

Definition at line 1784 of file LendingHelpers.cpp.

◆ isGlobalFrozen() [2/3]

bool xrpl::isGlobalFrozen ( ReadView const & view,
MPTIssue const & mptIssue )
nodiscard

Definition at line 41 of file MPTokenHelpers.cpp.

◆ isIndividualFrozen() [1/4]

bool xrpl::isIndividualFrozen ( ReadView const & view,
AccountID const & account,
MPTIssue const & mptIssue )
nodiscard

Definition at line 49 of file MPTokenHelpers.cpp.

◆ isFrozen() [1/5]

bool xrpl::isFrozen ( ReadView const & view,
AccountID const & account,
MPTIssue const & mptIssue,
std::uint8_t depth = 0 )
nodiscard

Definition at line 57 of file MPTokenHelpers.cpp.

◆ isAnyFrozen() [1/3]

bool xrpl::isAnyFrozen ( ReadView const & view,
std::initializer_list< AccountID > const & accounts,
MPTIssue const & mptIssue,
std::uint8_t depth = 0 )
nodiscard

Definition at line 68 of file MPTokenHelpers.cpp.

◆ transferRate() [2/3]

Rate xrpl::transferRate ( ReadView const & view,
MPTID const & issuanceID )
nodiscard

Returns MPT transfer fee as Rate.

Rate specifies the fee as fractions of 1 billion. For example, 1% transfer rate is represented as 1,010,000,000.

Parameters
issuanceIDMPTokenIssuanceID of MPTTokenIssuance object

Definition at line 93 of file MPTokenHelpers.cpp.

◆ canAddHolding() [1/3]

TER xrpl::canAddHolding ( ReadView const & view,
MPTIssue const & mptIssue )
nodiscard

Definition at line 110 of file MPTokenHelpers.cpp.

◆ authorizeMPToken()

TER xrpl::authorizeMPToken ( ApplyView & view,
XRPAmount const & priorBalance,
MPTID const & mptIssuanceID,
AccountID const & account,
beast::Journal journal,
std::uint32_t flags = 0,
std::optional< AccountID > holderID = std::nullopt )
nodiscard

Definition at line 149 of file MPTokenHelpers.cpp.

◆ requireAuth() [1/3]

TER xrpl::requireAuth ( ReadView const & view,
MPTIssue const & mptIssue,
AccountID const & account,
AuthType authType = AuthType::Legacy,
std::uint8_t depth = 0 )
nodiscard

Check if the account lacks required authorization for MPT.

requireAuth check is recursive for MPT shares in a vault, descending to assets in the vault, up to maxAssetCheckDepth recursion depth. This is purely defensive, as we currently do not allow such vaults to be created. WeakAuth intentionally allows missing MPTokens under MPToken V2.

Definition at line 313 of file MPTokenHelpers.cpp.

◆ enforceMPTokenAuthorization()

TER xrpl::enforceMPTokenAuthorization ( ApplyView & view,
MPTID const & mptIssuanceID,
AccountID const & account,
XRPAmount const & priorBalance,
beast::Journal j )
nodiscard

Enforce account has MPToken to match its authorization.

Called from doApply - it will check for expired (and delete if found any) credentials matching DomainID set in MPTokenIssuance. Must be called if requireAuth(...MPTIssue...) returned tesSUCCESS or tecEXPIRED in preclaim.

Definition at line 421 of file MPTokenHelpers.cpp.

◆ assetOfHolding()

Asset xrpl::assetOfHolding ( SLE const & sleShareIssuance,
SLE const & sleHolding )
nodiscard

Resolve the underlying asset of a vault share.

Reads sfReferenceHolding from sleShareIssuance to determine which asset the vault wraps. sleHolding must be the SLE that sfReferenceHolding points to — either an ltMPTOKEN (returns its MPTIssue) or an ltRIPPLE_STATE (returns its low/high Issue).

Precondition
Both SLEs must exist and sleHolding must be of type ltMPTOKEN or ltRIPPLE_STATE. Passing any other type is undefined behaviour.
Parameters
sleShareIssuanceMPTokenIssuance SLE for the vault share token.
sleHoldingSLE referenced by sfReferenceHolding.
Returns
The underlying Asset (MPTIssue or Issue).

Definition at line 521 of file MPTokenHelpers.cpp.

◆ canTransfer() [1/3]

TER xrpl::canTransfer ( ReadView const & view,
MPTIssue const & mptIssue,
AccountID const & from,
AccountID const & to,
WaiveMPTCanTransfer waive = WaiveMPTCanTransfer::No,
std::uint8_t depth = 0 )
nodiscard

Check whether to may receive the given MPT from from.

The check passes when any of the following is true:

  • waive is WaiveMPTCanTransfer::Yes (recovery-path exemption), or
  • from or to is the issuer, or
  • lsfMPTCanTransfer is set on the MPTokenIssuance.

For vault shares (MPTokenIssuances that carry sfReferenceHolding) the check recurses into the underlying asset's transferability. This recursion is defensive; vault-of-vault-shares is rejected at vault creation, so in practice depth never exceeds 1.

Parameters
viewLedger state to read from.
mptIssueThe MPT issuance being transferred.
fromSending account.
toReceiving account.
waiveWaiveMPTCanTransfer::Yes skips the lsfMPTCanTransfer check. Use for recovery paths (e.g. unwinding SAV or Lending Protocol positions after an issuer revokes transferability).
depthRecursion depth; bounded at kMaxAssetCheckDepth.
Returns
tesSUCCESS if the transfer is allowed, tecNO_AUTH otherwise.

Definition at line 544 of file MPTokenHelpers.cpp.

◆ canTrade()

TER xrpl::canTrade ( ReadView const & view,
Asset const & asset,
std::uint8_t depth = 0 )
nodiscard

Check whether asset may be traded on the DEX.

For IOU assets the check delegates to the existing offer/AMM freeze logic. For MPT assets it checks lsfMPTCanTrade on the MPTokenIssuance. Vault shares recurse into the underlying asset's tradability via sfReferenceHolding; depth is bounded at kMaxAssetCheckDepth.

Parameters
viewLedger state to read from.
assetThe asset to check.
depthRecursion depth; bounded at kMaxAssetCheckDepth.
Returns
tesSUCCESS if trading is allowed, tecNO_PERMISSION otherwise.

Definition at line 601 of file MPTokenHelpers.cpp.

◆ canMPTTradeAndTransfer()

TER xrpl::canMPTTradeAndTransfer ( ReadView const & v,
Asset const & asset,
AccountID const & from,
AccountID const & to )
nodiscard

Convenience to combine canTrade/Transfer.

Returns tesSUCCESS if Asset is Issue.

Definition at line 641 of file MPTokenHelpers.cpp.

◆ addEmptyHolding() [1/3]

TER xrpl::addEmptyHolding ( ApplyView & view,
AccountID const & accountID,
XRPAmount priorBalance,
MPTIssue const & mptIssue,
beast::Journal journal )
nodiscard

Definition at line 127 of file MPTokenHelpers.cpp.

◆ removeEmptyHolding() [1/3]

TER xrpl::removeEmptyHolding ( ApplyView & view,
AccountID const & accountID,
MPTIssue const & mptIssue,
beast::Journal journal )
nodiscard

Definition at line 271 of file MPTokenHelpers.cpp.

◆ lockEscrowMPT()

TER xrpl::lockEscrowMPT ( ApplyView & view,
AccountID const & uGrantorID,
STAmount const & saAmount,
beast::Journal j )

Definition at line 657 of file MPTokenHelpers.cpp.

◆ unlockEscrowMPT()

TER xrpl::unlockEscrowMPT ( ApplyView & view,
AccountID const & uGrantorID,
AccountID const & uGranteeID,
STAmount const & netAmount,
STAmount const & grossAmount,
beast::Journal j )

Definition at line 750 of file MPTokenHelpers.cpp.

◆ createMPToken()

TER xrpl::createMPToken ( ApplyView & view,
MPTID const & mptIssuanceID,
AccountID const & account,
std::uint32_t const flags )

Definition at line 914 of file MPTokenHelpers.cpp.

◆ checkCreateMPT()

TER xrpl::checkCreateMPT ( xrpl::ApplyView & view,
xrpl::MPTIssue const & mptIssue,
xrpl::AccountID const & holder,
beast::Journal j )

Definition at line 940 of file MPTokenHelpers.cpp.

◆ maxMPTAmount()

std::int64_t xrpl::maxMPTAmount ( SLE const & sleIssuance)

Definition at line 969 of file MPTokenHelpers.cpp.

◆ availableMPTAmount() [1/2]

std::int64_t xrpl::availableMPTAmount ( SLE const & sleIssuance)

Definition at line 975 of file MPTokenHelpers.cpp.

◆ availableMPTAmount() [2/2]

std::int64_t xrpl::availableMPTAmount ( ReadView const & view,
MPTID const & mptID )

Definition at line 983 of file MPTokenHelpers.cpp.

◆ isMPTOverflow()

bool xrpl::isMPTOverflow ( std::int64_t sendAmount,
std::uint64_t outstandingAmount,
std::int64_t maximumAmount,
AllowMPTOverflow allowOverflow )

Checks for two types of OutstandingAmount overflow during a send operation.

  1. Direct directSendNoFee (Overflow: No): A true overflow check when OutstandingAmount > MaximumAmount. This threshold is used for direct directSendNoFee transactions that bypass the payment engine.
  2. accountSend & Payment Engine (Overflow: Yes): A temporary overflow check when OutstandingAmount > UINT64_MAX. This higher threshold is used for accountSend and payments processed via the payment engine.

Definition at line 992 of file MPTokenHelpers.cpp.

◆ issuerFundsToSelfIssue()

STAmount xrpl::issuerFundsToSelfIssue ( ReadView const & view,
MPTIssue const & issue )
nodiscard

Determine funds available for an issuer to sell in an issuer owned offer.

Issuing step, which could be either MPTEndPointStep last step or BookStep's TakerPays may overflow OutstandingAmount. Redeeming step, in BookStep's TakerGets redeems the offer's owner funds, essentially balancing out the overflow, unless the offer's owner is the issuer.

Definition at line 1005 of file MPTokenHelpers.cpp.

◆ issuerSelfDebitHookMPT()

void xrpl::issuerSelfDebitHookMPT ( ApplyView & view,
MPTIssue const & issue,
std::uint64_t amount )

Facilitate tracking of MPT sold by an issuer owning MPT sell offer.

See ApplyView::issuerSelfDebitHookMPT().

Definition at line 1017 of file MPTokenHelpers.cpp.

◆ offerDelete()

TER xrpl::offerDelete ( ApplyView & view,
SLE::ref sle,
beast::Journal j )

Delete an offer.

Requirements: The offer must exist. The caller must have already checked permissions.

Parameters
viewThe ApplyView to modify.
sleThe offer to delete.
jJournal for logging.
Returns
tesSUCCESS on success, otherwise an error code.

Definition at line 18 of file OfferHelpers.cpp.

◆ closeChannel()

TER xrpl::closeChannel ( SLE::ref slep,
ApplyView & view,
uint256 const & key,
beast::Journal j )

Close a payment channel and return its remaining funds to the channel owner.

Parameters
slepThe SLE for the PayChannel object to close.
viewThe apply view in which ledger state modifications are made.
keyThe ledger key identifying the PayChannel entry.
jJournal used for fatal-level diagnostic messages.
Returns
tesSUCCESS on success; tefBAD_LEDGER if a directory removal fails; tefINTERNAL if the source account SLE cannot be found.

Definition at line 25 of file PaymentChannelHelpers.cpp.

◆ saturatingAdd()

uint32_t xrpl::saturatingAdd ( Rules const & rules,
uint32_t const lhs,
uint32_t const rhs )

Add two uint32_t values with saturation at UINT32_MAX.

Parameters
rulesThe current ledger rules used to check amendment status.
lhsLeft-hand operand.
rhsRight-hand operand.
Returns
lhs + rhs, saturated at UINT32_MAX when the amendment is active.

Definition at line 70 of file PaymentChannelHelpers.cpp.

◆ isChannelExpired() [1/2]

bool xrpl::isChannelExpired ( ApplyView const & view,
std::optional< std::uint32_t > timeField )

Determine whether a payment channel time field represents an expired time.

Parameters
viewThe apply view providing the parent close time and rules.
timeFieldThe optional expiry timestamp (seconds since the XRP Ledger epoch). If empty, the function returns false.
Returns
true if timeField is set and the indicated time is in the past relative to the view's parent close time; false otherwise.

◆ creditLimit()

STAmount xrpl::creditLimit ( ReadView const & view,
AccountID const & account,
AccountID const & issuer,
Currency const & currency )

Calculate the maximum amount of IOUs that an account can hold.

Parameters
viewthe ledger to check against.
accountthe account of interest.
issuerthe issuer of the IOU.
currencythe IOU to check.
Returns
The maximum amount that can be held.

Definition at line 42 of file RippleStateHelpers.cpp.

◆ creditLimit2()

IOUAmount xrpl::creditLimit2 ( ReadView const & v,
AccountID const & acc,
AccountID const & iss,
Currency const & cur )

Definition at line 67 of file RippleStateHelpers.cpp.

◆ creditBalance()

STAmount xrpl::creditBalance ( ReadView const & view,
AccountID const & account,
AccountID const & issuer,
Currency const & currency )

Returns the amount of IOUs issued by issuer that are held by an account.

Parameters
viewthe ledger to check against.
accountthe account of interest.
issuerthe issuer of the IOU.
currencythe IOU to check.

Definition at line 73 of file RippleStateHelpers.cpp.

◆ isIndividualFrozen() [2/4]

bool xrpl::isIndividualFrozen ( ReadView const & view,
AccountID const & account,
Currency const & currency,
AccountID const & issuer )
nodiscard

Definition at line 106 of file RippleStateHelpers.cpp.

◆ isIndividualFrozen() [3/4]

bool xrpl::isIndividualFrozen ( ReadView const & view,
AccountID const & account,
Issue const & issue )
nodiscard

Definition at line 75 of file RippleStateHelpers.h.

◆ isFrozen() [2/5]

bool xrpl::isFrozen ( ReadView const & view,
AccountID const & account,
Currency const & currency,
AccountID const & issuer )
nodiscard

Definition at line 127 of file RippleStateHelpers.cpp.

◆ isFrozen() [3/5]

bool xrpl::isFrozen ( ReadView const & view,
AccountID const & account,
Issue const & issue )
nodiscard

Definition at line 88 of file RippleStateHelpers.h.

◆ isFrozen() [4/5]

bool xrpl::isFrozen ( ReadView const & view,
AccountID const & account,
Issue const & issue,
std::uint8_t  )
nodiscard

Definition at line 96 of file RippleStateHelpers.h.

◆ isDeepFrozen() [1/4]

bool xrpl::isDeepFrozen ( ReadView const & view,
AccountID const & account,
Currency const & currency,
AccountID const & issuer )
nodiscard

Definition at line 149 of file RippleStateHelpers.cpp.

◆ isDeepFrozen() [2/4]

bool xrpl::isDeepFrozen ( ReadView const & view,
AccountID const & account,
Issue const & issue,
std::uint8_t = 0 )
nodiscard

Definition at line 109 of file RippleStateHelpers.h.

◆ checkDeepFrozen() [1/3]

TER xrpl::checkDeepFrozen ( ReadView const & view,
AccountID const & account,
Issue const & issue )
nodiscard

Definition at line 119 of file RippleStateHelpers.h.

◆ trustCreate()

TER xrpl::trustCreate ( ApplyView & view,
bool const bSrcHigh,
AccountID const & uSrcAccountID,
AccountID const & uDstAccountID,
uint256 const & uIndex,
SLE::ref sleAccount,
bool const bAuth,
bool const bNoRipple,
bool const bFreeze,
bool bDeepFreeze,
STAmount const & saBalance,
STAmount const & saLimit,
std::uint32_t uQualityIn,
std::uint32_t uQualityOut,
beast::Journal j )
nodiscard

Create a trust line.

This can set an initial balance.

Definition at line 181 of file RippleStateHelpers.cpp.

◆ trustDelete()

TER xrpl::trustDelete ( ApplyView & view,
SLE::ref sleRippleState,
AccountID const & uLowAccountID,
AccountID const & uHighAccountID,
beast::Journal j )
nodiscard

Definition at line 295 of file RippleStateHelpers.cpp.

◆ issueIOU()

TER xrpl::issueIOU ( ApplyView & view,
AccountID const & account,
STAmount const & amount,
Issue const & issue,
beast::Journal j )
nodiscard

Definition at line 385 of file RippleStateHelpers.cpp.

◆ redeemIOU()

TER xrpl::redeemIOU ( ApplyView & view,
AccountID const & account,
STAmount const & amount,
Issue const & issue,
beast::Journal j )
nodiscard

Definition at line 479 of file RippleStateHelpers.cpp.

◆ requireAuth() [2/3]

TER xrpl::requireAuth ( ReadView const & view,
Issue const & issue,
AccountID const & account,
AuthType authType = AuthType::Legacy )
nodiscard

Check if the account lacks required authorization.

Return tecNO_AUTH or tecNO_LINE if it does and tesSUCCESS otherwise.

If StrongAuth then return tecNO_LINE if the RippleState doesn't exist. Return tecNO_AUTH if lsfRequireAuth is set on the issuer's AccountRoot, and the RippleState does exist, and the RippleState is not authorized.

If WeakAuth then return tecNO_AUTH if lsfRequireAuth is set, and the RippleState exists, and is not authorized. Return tecNO_LINE if lsfRequireAuth is set and the RippleState doesn't exist. Consequently, if WeakAuth and lsfRequireAuth is not set, this function will return tesSUCCESS even if RippleState does not exist.

The default "Legacy" auth type is equivalent to WeakAuth.

Definition at line 556 of file RippleStateHelpers.cpp.

◆ canTransfer() [2/3]

TER xrpl::canTransfer ( ReadView const & view,
Issue const & issue,
AccountID const & from,
AccountID const & to )
nodiscard

Check if the destination account is allowed to receive IOU.

Return terNO_RIPPLE if rippling is disabled on both sides and tesSUCCESS otherwise.

Definition at line 584 of file RippleStateHelpers.cpp.

◆ addEmptyHolding() [2/3]

TER xrpl::addEmptyHolding ( ApplyView & view,
AccountID const & accountID,
XRPAmount priorBalance,
Issue const & issue,
beast::Journal journal )
nodiscard

Any transactors that call addEmptyHolding() in doApply must call canAddHolding() in preflight with the same View and Asset.

Definition at line 622 of file RippleStateHelpers.cpp.

◆ removeEmptyHolding() [2/3]

TER xrpl::removeEmptyHolding ( ApplyView & view,
AccountID const & accountID,
Issue const & issue,
beast::Journal journal )
nodiscard

Definition at line 676 of file RippleStateHelpers.cpp.

◆ deleteAMMTrustLine()

TER xrpl::deleteAMMTrustLine ( ApplyView & view,
SLE::pointer sleState,
std::optional< AccountID > const & ammAccountID,
beast::Journal j )
nodiscard

Delete trustline to AMM.

The passed sle must be obtained from a prior call to view.peek(). Fail if neither side of the trustline is AMM or if ammAccountID is seated and is not one of the trustline's side.

Definition at line 739 of file RippleStateHelpers.cpp.

◆ deleteAMMMPToken()

TER xrpl::deleteAMMMPToken ( ApplyView & view,
SLE::pointer sleMPT,
AccountID const & ammAccountID,
beast::Journal j )
nodiscard

Delete AMMs MPToken.

The passed sle must be obtained from a prior call to view.peek().

Definition at line 787 of file RippleStateHelpers.cpp.

◆ isGlobalFrozen() [3/3]

bool xrpl::isGlobalFrozen ( ReadView const & view,
Asset const & asset )
nodiscard

Definition at line 45 of file TokenHelpers.cpp.

◆ checkGlobalFrozen()

TER xrpl::checkGlobalFrozen ( ReadView const & view,
Asset const & asset )
nodiscard

Definition at line 53 of file TokenHelpers.cpp.

◆ isIndividualFrozen() [4/4]

bool xrpl::isIndividualFrozen ( ReadView const & view,
AccountID const & account,
Asset const & asset )
nodiscard

Definition at line 61 of file TokenHelpers.cpp.

◆ checkIndividualFrozen()

TER xrpl::checkIndividualFrozen ( ReadView const & view,
AccountID const & account,
Asset const & asset )
nodiscard

Definition at line 68 of file TokenHelpers.cpp.

◆ isFrozen() [5/5]

bool xrpl::isFrozen ( ReadView const & view,
AccountID const & account,
Asset const & asset,
std::uint8_t depth = 0 )
nodiscard

isFrozen check is recursive for MPT shares in a vault, descending to assets in the vault, up to maxAssetCheckDepth recursion depth.

This is purely defensive, as we currently do not allow such vaults to be created.

Definition at line 76 of file TokenHelpers.cpp.

◆ checkFrozen() [1/3]

TER xrpl::checkFrozen ( ReadView const & view,
AccountID const & account,
Issue const & issue )
nodiscard

Definition at line 83 of file TokenHelpers.cpp.

◆ checkFrozen() [2/3]

TER xrpl::checkFrozen ( ReadView const & view,
AccountID const & account,
MPTIssue const & mptIssue )
nodiscard

Definition at line 89 of file TokenHelpers.cpp.

◆ checkFrozen() [3/3]

TER xrpl::checkFrozen ( ReadView const & view,
AccountID const & account,
Asset const & asset )
nodiscard

Definition at line 95 of file TokenHelpers.cpp.

◆ isAnyFrozen() [2/3]

bool xrpl::isAnyFrozen ( ReadView const & view,
std::initializer_list< AccountID > const & accounts,
Issue const & issue )
nodiscard

Definition at line 102 of file TokenHelpers.cpp.

◆ isAnyFrozen() [3/3]

bool xrpl::isAnyFrozen ( ReadView const & view,
std::initializer_list< AccountID > const & accounts,
Asset const & asset,
std::uint8_t depth = 0 )
nodiscard

Definition at line 116 of file TokenHelpers.cpp.

◆ isDeepFrozen() [3/4]

bool xrpl::isDeepFrozen ( ReadView const & view,
AccountID const & account,
MPTIssue const & mptIssue,
std::uint8_t depth = 0 )
nodiscard

Definition at line 128 of file TokenHelpers.cpp.

◆ isDeepFrozen() [4/4]

bool xrpl::isDeepFrozen ( ReadView const & view,
AccountID const & account,
Asset const & asset,
std::uint8_t depth = 0 )
nodiscard

isFrozen check is recursive for MPT shares in a vault, descending to assets in the vault, up to maxAssetCheckDepth recursion depth.

This is purely defensive, as we currently do not allow such vaults to be created.

Definition at line 140 of file TokenHelpers.cpp.

◆ checkDeepFrozen() [2/3]

TER xrpl::checkDeepFrozen ( ReadView const & view,
AccountID const & account,
MPTIssue const & mptIssue )
nodiscard

Definition at line 148 of file TokenHelpers.cpp.

◆ checkDeepFrozen() [3/3]

TER xrpl::checkDeepFrozen ( ReadView const & view,
AccountID const & account,
Asset const & asset )
nodiscard

Definition at line 154 of file TokenHelpers.cpp.

◆ checkWithdrawFreeze()

TER xrpl::checkWithdrawFreeze ( ReadView const & view,
AccountID const & srcAcct,
AccountID const & submitterAcct,
AccountID const & dstAcct,
Asset const & asset )
nodiscard

Checks freeze compliance for withdrawing an asset from a pseudo-account (e.g.

Vault, AMM, LoanBroker) to a destination account.

Asserts that sourceAcct is a pseudo-account and that submitterAcct and dstAcct are not.

Issuer exemption: returns tesSUCCESS immediately when dstAcct is the asset issuer — the issuer can always receive their own token, even when the pool is frozen. Callers that need to block withdrawals from a frozen pool even for the issuer (e.g. because the pool math cannot handle it) must check checkFrozen(sourceAcct, asset) separately before calling this function.

Otherwise checks, in order:

  1. If the asset is globally frozen the remaining checks are redundant.
  2. For MPT shares: The pseudo-account's vault share must not be transitively frozen via its underlying asset.
  3. The pseudo-account's trustline / MPToken must not be frozen for sending.
  4. Skipped when submitter == dst (self-withdrawal); a regular freeze should not prevent recovering one's own funds.
  5. The destination must not be deep-frozen (cannot receive under any circumstance).

For IOUs a regular individual freeze on the withdrawer does NOT block self-withdrawal; only deep freeze does. For MPTs "locked" is equivalent to deep-frozen, so locked MPT holders are always blocked.

Parameters
viewLedger view to read freeze state from.
srcAcctPseudo-account the funds are withdrawn from (sender).
submitterAcctAccount that submitted the withdrawal transaction.
dstAcctAccount receiving the withdrawn funds.
assetAsset being withdrawn.
Returns
tesSUCCESS if the withdrawal is permitted, otherwise a freeze result (tecFROZEN for IOUs, tecLOCKED for MPTs).

Definition at line 161 of file TokenHelpers.cpp.

◆ checkDepositFreeze()

TER xrpl::checkDepositFreeze ( ReadView const & view,
AccountID const & srcAcct,
AccountID const & dstAcct,
Asset const & asset )
nodiscard

Checks freeze compliance for depositing an asset into a pseudo-account (e.g.

Vault, AMM, LoanBroker).

Checks, in order:

  1. If the asset is globally frozen the remaining checks are redundant.
  2. For MPT shares: the pseudo-account's vault share must not be transitively frozen via its underlying asset (returns tecLOCKED).
  3. The depositor must not be individually frozen. Skipped when srcAcct is the asset issuer, since the issuer can always send its own asset.
  4. The pseudo-account must not be individually frozen for the asset. Unlike regular accounts, pseudo-accounts cannot receive deposits under a regular freeze because the deposited funds could not later be withdrawn.
Parameters
viewLedger view to read freeze state from.
srcAcctDepositor sending the funds.
dstAcctPseudo-account receiving the deposit.
assetAsset being deposited.
Returns
tesSUCCESS if the deposit is permitted, otherwise a freeze result (tecFROZEN for IOUs, tecLOCKED for MPTs).

Definition at line 210 of file TokenHelpers.cpp.

◆ accountHolds() [1/4]

STAmount xrpl::accountHolds ( ReadView const & view,
AccountID const & account,
Currency const & currency,
AccountID const & issuer,
FreezeHandling zeroIfFrozen,
beast::Journal j,
SpendableHandling includeFullBalance = SpendableHandling::SimpleBalance )
nodiscard

Definition at line 338 of file TokenHelpers.cpp.

◆ accountHolds() [2/4]

STAmount xrpl::accountHolds ( ReadView const & view,
AccountID const & account,
Issue const & issue,
FreezeHandling zeroIfFrozen,
beast::Journal j,
SpendableHandling includeFullBalance = SpendableHandling::SimpleBalance )
nodiscard

Definition at line 369 of file TokenHelpers.cpp.

◆ accountHolds() [3/4]

STAmount xrpl::accountHolds ( ReadView const & view,
AccountID const & account,
MPTIssue const & mptIssue,
FreezeHandling zeroIfFrozen,
AuthHandling zeroIfUnauthorized,
beast::Journal j,
SpendableHandling includeFullBalance = SpendableHandling::SimpleBalance )
nodiscard

Definition at line 382 of file TokenHelpers.cpp.

◆ accountHolds() [4/4]

STAmount xrpl::accountHolds ( ReadView const & view,
AccountID const & account,
Asset const & asset,
FreezeHandling zeroIfFrozen,
AuthHandling zeroIfUnauthorized,
beast::Journal j,
SpendableHandling includeFullBalance = SpendableHandling::SimpleBalance )
nodiscard

Definition at line 451 of file TokenHelpers.cpp.

◆ accountFunds() [1/2]

STAmount xrpl::accountFunds ( ReadView const & view,
AccountID const & id,
STAmount const & saDefault,
FreezeHandling freezeHandling,
beast::Journal j )
nodiscard

Definition at line 471 of file TokenHelpers.cpp.

◆ accountFunds() [2/2]

STAmount xrpl::accountFunds ( ReadView const & view,
AccountID const & id,
STAmount const & saDefault,
FreezeHandling freezeHandling,
AuthHandling authHandling,
beast::Journal j )
nodiscard

Definition at line 488 of file TokenHelpers.cpp.

◆ transferRate() [3/3]

Rate xrpl::transferRate ( ReadView const & view,
STAmount const & amount )
nodiscard

Returns the transfer fee as Rate based on the type of token.

Parameters
viewThe ledger view
amountThe amount to transfer

Definition at line 511 of file TokenHelpers.cpp.

◆ canAddHolding() [2/3]

TER xrpl::canAddHolding ( ReadView const & view,
Asset const & asset )
nodiscard

Definition at line 546 of file TokenHelpers.cpp.

◆ addEmptyHolding() [3/3]

TER xrpl::addEmptyHolding ( ApplyView & view,
AccountID const & accountID,
XRPAmount priorBalance,
Asset const & asset,
beast::Journal journal )
nodiscard

Definition at line 554 of file TokenHelpers.cpp.

◆ removeEmptyHolding() [3/3]

TER xrpl::removeEmptyHolding ( ApplyView & view,
AccountID const & accountID,
Asset const & asset,
beast::Journal journal )
nodiscard

Definition at line 569 of file TokenHelpers.cpp.

◆ requireAuth() [3/3]

TER xrpl::requireAuth ( ReadView const & view,
Asset const & asset,
AccountID const & account,
AuthType authType = AuthType::Legacy )
nodiscard

Definition at line 589 of file TokenHelpers.cpp.

◆ canTransfer() [3/3]

TER xrpl::canTransfer ( ReadView const & view,
Asset const & asset,
AccountID const & from,
AccountID const & to,
WaiveMPTCanTransfer waive = WaiveMPTCanTransfer::No,
std::uint8_t depth = 0 )
nodiscard

Definition at line 599 of file TokenHelpers.cpp.

◆ directSendNoFee()

TER xrpl::directSendNoFee ( ApplyView & view,
AccountID const & uSenderID,
AccountID const & uReceiverID,
STAmount const & saAmount,
bool bCheckIssuer,
beast::Journal j )

Calls static directSendNoFeeIOU if saAmount represents Issue.

Calls static directSendNoFeeMPT if saAmount represents MPTIssue.

Definition at line 1449 of file TokenHelpers.cpp.

◆ accountSend()

TER xrpl::accountSend ( ApplyView & view,
AccountID const & from,
AccountID const & to,
STAmount const & saAmount,
beast::Journal j,
WaiveTransferFee waiveFee = WaiveTransferFee::No,
AllowMPTOverflow allowOverflow = AllowMPTOverflow::No )
nodiscard

Calls static accountSendIOU if saAmount represents Issue.

Calls static accountSendMPT if saAmount represents MPTIssue.

Definition at line 1468 of file TokenHelpers.cpp.

◆ accountSendMulti()

TER xrpl::accountSendMulti ( ApplyView & view,
AccountID const & senderID,
Asset const & asset,
MultiplePaymentDestinations const & receivers,
beast::Journal j,
WaiveTransferFee waiveFee = WaiveTransferFee::No )
nodiscard

Like accountSend, except one account is sending multiple payments (with the same asset!) simultaneously.

Calls static accountSendMultiIOU if saAmount represents Issue. Calls static accountSendMultiMPT if saAmount represents MPTIssue.

Definition at line 1488 of file TokenHelpers.cpp.

◆ transferXRP()

TER xrpl::transferXRP ( ApplyView & view,
AccountID const & from,
AccountID const & to,
STAmount const & amount,
beast::Journal j )
nodiscard

Definition at line 1508 of file TokenHelpers.cpp.

◆ assetsToSharesDeposit()

std::optional< STAmount > xrpl::assetsToSharesDeposit ( SLE::const_ref vault,
SLE::const_ref issuance,
STAmount const & assets )
nodiscard

From the perspective of a vault, return the number of shares to give depositor when they offer a fixed amount of assets.

Note, since shares are MPT, this number is integral and always truncated in this calculation.

Parameters
vaultThe vault SLE.
issuanceThe MPTokenIssuance SLE for the vault's shares.
assetsThe amount of assets to convert.
Returns
The number of shares, or nullopt on error.

Definition at line 20 of file VaultHelpers.cpp.

◆ sharesToAssetsDeposit()

std::optional< STAmount > xrpl::sharesToAssetsDeposit ( SLE::const_ref vault,
SLE::const_ref issuance,
STAmount const & shares )
nodiscard

From the perspective of a vault, return the number of assets to take from depositor when they receive a fixed amount of shares.

Note, since shares are MPT, they are always an integral number.

Parameters
vaultThe vault SLE.
issuanceThe MPTokenIssuance SLE for the vault's shares.
sharesThe amount of shares to convert.
Returns
The number of assets, or nullopt on error.

Definition at line 44 of file VaultHelpers.cpp.

◆ assetsToSharesWithdraw()

std::optional< STAmount > xrpl::assetsToSharesWithdraw ( SLE::const_ref vault,
SLE::const_ref issuance,
STAmount const & assets,
TruncateShares truncate = TruncateShares::No,
WaiveUnrealizedLoss waive = WaiveUnrealizedLoss::No )
nodiscard

From the perspective of a vault, return the number of shares to demand from the depositor when they ask to withdraw a fixed amount of assets.

Since shares are MPT this number is integral, and it will be rounded to nearest unless explicitly requested to be truncated instead.

Parameters
vaultThe vault SLE.
issuanceThe MPTokenIssuance SLE for the vault's shares.
assetsThe amount of assets to convert.
truncateWhether to truncate instead of rounding.
waiveWhether to waive the unrealized-loss discount when computing the exchange rate.
Returns
The number of shares, or nullopt on error.

Definition at line 67 of file VaultHelpers.cpp.

◆ sharesToAssetsWithdraw()

std::optional< STAmount > xrpl::sharesToAssetsWithdraw ( SLE::const_ref vault,
SLE::const_ref issuance,
STAmount const & shares,
WaiveUnrealizedLoss waive = WaiveUnrealizedLoss::No )
nodiscard

From the perspective of a vault, return the number of assets to give the depositor when they redeem a fixed amount of shares.

Note, since shares are MPT, they are always an integral number.

Parameters
vaultThe vault SLE.
issuanceThe MPTokenIssuance SLE for the vault's shares.
sharesThe amount of shares to convert.
waiveWhether to waive (i.e. not subtract) the vault's unrealized loss when computing the exchange rate.
Returns
The number of assets, or nullopt on error.

Definition at line 96 of file VaultHelpers.cpp.

◆ isSoleShareholder()

bool xrpl::isSoleShareholder ( ReadView const & view,
AccountID const & account,
SLE::const_ref issuance )
nodiscard

Returns true iff account holds all of the vault's outstanding shares — i.e.

is the sole remaining shareholder. Returns false if the account holds no shares or fewer than the total outstanding.

Parameters
viewThe ledger view.
accountThe candidate sole shareholder.
issuanceThe MPTokenIssuance SLE for the vault's shares; provides both the share MPTID and the outstanding-amount total.

Definition at line 121 of file VaultHelpers.cpp.

◆ getNextLedgerTimeResolution()

template<class Rep, class Period, class Seq>
std::chrono::duration< Rep, Period > xrpl::getNextLedgerTimeResolution ( std::chrono::duration< Rep, Period > previousResolution,
bool previousAgree,
Seq ledgerSeq )

Calculates the close time resolution for the specified ledger.

The XRPL protocol uses binning to represent time intervals using only one timestamp. This allows servers to derive a common time for the next ledger, without the need for perfectly synchronized clocks. The time resolution (i.e. the size of the intervals) is adjusted dynamically based on what happened in the last ledger, to try to avoid disagreements.

Parameters
previousResolutionthe resolution used for the prior ledger
previousAgreewhether consensus agreed on the close time of the prior ledger
ledgerSeqthe sequence number of the new ledger
Precondition
previousResolution must be a valid bin from kLedgerPossibleTimeResolutions
Template Parameters
RepType representing number of ticks in std::chrono::duration
PeriodAn std::ratio representing tick period in std::chrono::duration
SeqUnsigned integer-like type corresponding to the ledger sequence number. It should be comparable to 0 and support modular division. Built-in and tagged_integers are supported.

Definition at line 60 of file LedgerTiming.h.

◆ roundCloseTime()

template<class Clock, class Duration, class Rep, class Period>
std::chrono::time_point< Clock, Duration > xrpl::roundCloseTime ( std::chrono::time_point< Clock, Duration > closeTime,
std::chrono::duration< Rep, Period > closeResolution )

Calculates the close time for a ledger, given a close time resolution.

Parameters
closeTimeThe time to be rounded
closeResolutionThe resolution
Returns
closeTime rounded to the nearest multiple of closeResolution. Rounds up if closeTime is midway between multiples of closeResolution.

Definition at line 109 of file LedgerTiming.h.

◆ effCloseTime()

template<class Clock, class Duration, class Rep, class Period>
std::chrono::time_point< Clock, Duration > xrpl::effCloseTime ( std::chrono::time_point< Clock, Duration > closeTime,
std::chrono::duration< Rep, Period > resolution,
std::chrono::time_point< Clock, Duration > priorCloseTime )

Calculate the effective ledger close time.

After adjusting the ledger close time based on the current resolution, also ensure it is sufficiently separated from the prior close time.

Parameters
closeTimeThe raw ledger close time
resolutionThe current close time resolution
priorCloseTimeThe close time of the prior ledger

Definition at line 132 of file LedgerTiming.h.

◆ affectedBooks()

hash_set< Book > xrpl::affectedBooks ( AcceptedLedgerTx const & alTx,
beast::Journal const & j )

Extract the set of books affected by a transaction.

Walks the transaction's metadata nodes and collects every order book whose offers were created, modified, or deleted. Used by NetworkOPs to fan transaction notifications out to book subscribers.

Parameters
alTxThe accepted ledger transaction to inspect.
jJournal used to log per-node parsing failures. Inspecting an offer node can throw if a required field is missing; in that case the bad node is skipped and a warn-level message is emitted via j. Other affected books in the same transaction are still returned.
Returns
The set of books whose offers were created, modified, or deleted. May be empty for non-offer transactions.

Definition at line 309 of file OrderBookDBImpl.cpp.

◆ makeRulesGivenLedger() [1/2]

Rules xrpl::makeRulesGivenLedger ( DigestAwareReadView const & ledger,
Rules const & current )

Definition at line 61 of file ReadView.cpp.

◆ makeRulesGivenLedger() [2/2]

Rules xrpl::makeRulesGivenLedger ( DigestAwareReadView const & ledger,
std::unordered_set< uint256, beast::Uhash<> > const & presets )

Definition at line 67 of file ReadView.cpp.

◆ hasExpired()

bool xrpl::hasExpired ( ReadView const & view,
std::optional< std::uint32_t > const & exp )
nodiscard

Determines whether the given expiration time has passed.

In the XRP Ledger, expiration times are defined as the number of whole seconds after the "XRPL epoch" which, for historical reasons, is set to January 1, 2000 (00:00 UTC).

This is like the way the Unix epoch works, except the XRPL epoch is precisely 946,684,800 seconds after the Unix Epoch.

See https://xrpl.org/basic-data-types.html#specifying-time

Expiration is defined in terms of the close time of the parent ledger, because we definitively know the time that it closed (since consensus agrees on time) but we do not know the closing time of the ledger that is under construction.

Parameters
viewThe ledger whose parent time is used as the clock.
expThe optional expiration time we want to check.
Returns
true if exp is in the past; false otherwise.

Definition at line 47 of file View.cpp.

◆ isVaultPseudoAccountFrozen()

bool xrpl::isVaultPseudoAccountFrozen ( ReadView const & view,
AccountID const & account,
MPTIssue const & mptShare,
std::uint8_t depth )
nodiscard

Definition at line 56 of file View.cpp.

◆ isLPTokenFrozen()

bool xrpl::isLPTokenFrozen ( ReadView const & view,
AccountID const & account,
Asset const & asset,
Asset const & asset2 )
nodiscard

Definition at line 123 of file View.cpp.

◆ getEnabledAmendments()

std::set< uint256 > xrpl::getEnabledAmendments ( ReadView const & view)
nodiscard

Definition at line 231 of file View.cpp.

◆ getMajorityAmendments()

majorityAmendments_t xrpl::getMajorityAmendments ( ReadView const & view)
nodiscard

Definition at line 248 of file View.cpp.

◆ hashOfSeq()

std::optional< uint256 > xrpl::hashOfSeq ( ReadView const & ledger,
LedgerIndex seq,
beast::Journal journal )
nodiscard

Return the hash of a ledger by sequence.

The hash is retrieved by looking up the "skip list" in the passed ledger. As the skip list is limited in size, if the requested ledger sequence number is out of the range of ledgers represented in the skip list, then std::nullopt is returned.

Returns
The hash of the ledger with the given sequence number or std::nullopt.

Definition at line 270 of file View.cpp.

◆ getCandidateLedger()

LedgerIndex xrpl::getCandidateLedger ( LedgerIndex requested)

Find a ledger index from which we could easily get the requested ledger.

The index that we return should meet two requirements: 1) It must be the index of a ledger that has the hash of the ledger we are looking for. This means that its sequence must be equal to greater than the sequence that we want but not more than 256 greater since each ledger contains the hashes of the 256 previous ledgers.

2) Its hash must be easy for us to find. This means it must be 0 mod 256 because every such ledger is permanently enshrined in a LedgerHashes page which we can easily retrieve via the skip list.

Definition at line 102 of file View.h.

◆ areCompatible() [1/2]

bool xrpl::areCompatible ( ReadView const & validLedger,
ReadView const & testLedger,
beast::Journal::Stream & s,
char const * reason )
nodiscard

Return false if the test ledger is provably incompatible with the valid ledger, that is, they could not possibly both be valid.

Use the first form if you have both ledgers, use the second form if you have not acquired the valid ledger yet

Definition at line 133 of file View.cpp.

◆ areCompatible() [2/2]

bool xrpl::areCompatible ( uint256 const & validHash,
LedgerIndex validIndex,
ReadView const & testLedger,
beast::Journal::Stream & s,
char const * reason )
nodiscard

Definition at line 191 of file View.cpp.

◆ dirLink()

TER xrpl::dirLink ( ApplyView & view,
AccountID const & owner,
SLE::pointer & object,
SF_UINT64 const & node = sfOwnerNode )
nodiscard

Definition at line 334 of file View.cpp.

◆ canWithdraw() [1/3]

TER xrpl::canWithdraw ( ReadView const & view,
AccountID const & from,
AccountID const & to,
SLE::const_ref toSle,
STAmount const & amount,
bool hasDestinationTag )
nodiscard

Checks that can withdraw funds from an object to itself or a destination.

The receiver may be either the submitting account (sfAccount) or a different destination account (sfDestination).

  • Checks that the receiver account exists.
  • If the receiver requires a destination tag, check that one exists, even if withdrawing to self.
  • If withdrawing to self, succeed.
  • If not, checks if the receiver requires deposit authorization, and if the sender has it.
  • Checks that the receiver will not exceed the limit (IOU trustline limit or MPT MaximumAmount).

Definition at line 387 of file View.cpp.

◆ canWithdraw() [2/3]

TER xrpl::canWithdraw ( ReadView const & view,
AccountID const & from,
AccountID const & to,
STAmount const & amount,
bool hasDestinationTag )
nodiscard

Checks that can withdraw funds from an object to itself or a destination.

The receiver may be either the submitting account (sfAccount) or a different destination account (sfDestination).

  • Checks that the receiver account exists.
  • If the receiver requires a destination tag, check that one exists, even if withdrawing to self.
  • If withdrawing to self, succeed.
  • If not, checks if the receiver requires deposit authorization, and if the sender has it.
  • Checks that the receiver will not exceed the limit (IOU trustline limit or MPT MaximumAmount).

Definition at line 411 of file View.cpp.

◆ canWithdraw() [3/3]

TER xrpl::canWithdraw ( ReadView const & view,
STTx const & tx )
nodiscard

Checks that can withdraw funds from an object to itself or a destination.

The receiver may be either the submitting account (sfAccount) or a different destination account (sfDestination).

  • Checks that the receiver account exists.
  • If the receiver requires a destination tag, check that one exists, even if withdrawing to self.
  • If withdrawing to self, succeed.
  • If not, checks if the receiver requires deposit authorization, and if the sender has it.
  • Checks that the receiver will not exceed the limit (IOU trustline limit or MPT MaximumAmount).

Definition at line 424 of file View.cpp.

◆ doWithdraw()

TER xrpl::doWithdraw ( ApplyView & view,
STTx const & tx,
AccountID const & senderAcct,
AccountID const & dstAcct,
AccountID const & sourceAcct,
XRPAmount priorBalance,
STAmount const & amount,
beast::Journal j )
nodiscard

Definition at line 433 of file View.cpp.

◆ cleanupOnAccountDelete() [1/2]

TER xrpl::cleanupOnAccountDelete ( ApplyView & view,
Keylet const & ownerDirKeylet,
EntryDeleter const & deleter,
beast::Journal j,
std::optional< std::uint16_t > maxNodesToDelete = std::nullopt )
nodiscard

Cleanup owner directory entries on account delete.

Used for a regular and AMM accounts deletion. The caller has to provide the deleter function, which handles details of specific account-owned object deletion.

Returns
tecINCOMPLETE indicates maxNodesToDelete are deleted and there remains more nodes to delete.

◆ after()

bool xrpl::after ( NetClock::time_point now,
std::uint32_t mark )

Has the specified time passed?

Parameters
nowthe current time
markthe cutoff point
Returns
true if now refers to a time strictly after mark, else false.

Definition at line 554 of file View.cpp.

◆ registerSSLCerts()

void xrpl::registerSSLCerts ( boost::asio::ssl::context & ctx,
boost::system::error_code & ec,
beast::Journal j )

Register default SSL certificates.

Register the system default SSL root certificates. On linux/mac, this just calls asio's set_default_verify_paths to look in standard operating system locations. On windows, it uses the OS certificate store accessible via CryptoAPI.

Definition at line 24 of file RegisterSSLCerts.cpp.

◆ toBase58() [1/4]

std::string xrpl::toBase58 ( AccountID const & v)

Convert AccountID to base58 checked string.

Definition at line 93 of file AccountID.cpp.

◆ parseBase58() [1/10]

template<>
std::optional< AccountID > xrpl::parseBase58 ( std::string const & s)

Parse AccountID from checked, base58 string.

Returns
std::nullopt if a parse error occurs

Definition at line 103 of file AccountID.cpp.

◆ xrpAccount()

AccountID const & xrpl::xrpAccount ( )

Compute AccountID from public key.

The account ID is computed as the 160-bit hash of the public key data. This excludes the version byte and guard bytes included in the base58 representation. A special account that's used as the "issuer" for XRP.

Definition at line 157 of file AccountID.cpp.

◆ noAccount()

AccountID const & xrpl::noAccount ( )

A placeholder for empty accounts.

Definition at line 164 of file AccountID.cpp.

◆ toIssuer()

bool xrpl::toIssuer ( AccountID & issuer,
std::string const & s )

Convert hex or base58 string to AccountID.

Returns
true if the parsing was successful.

Definition at line 171 of file AccountID.cpp.

◆ isXRP() [1/7]

bool xrpl::isXRP ( AccountID const & c)

Definition at line 70 of file AccountID.h.

◆ to_string() [13/32]

std::string xrpl::to_string ( AccountID const & account)

Definition at line 77 of file AccountID.h.

◆ operator<<() [4/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
AccountID const & x )

Definition at line 83 of file AccountID.h.

◆ initAccountIdCache()

void xrpl::initAccountIdCache ( std::size_t count)

Initialize the global cache used to map AccountID to base58 conversions.

The cache is optional and need not be initialized. But because conversion is expensive (it requires a SHA-256 operation) in most cases the overhead of the cache is worth the benefit.

Parameters
countThe number of entries the cache should accommodate. Zero will disable the cache, releasing any memory associated with it.
Note
The function will only initialize the cache the first time it is invoked. Subsequent invocations do nothing.

Definition at line 86 of file AccountID.cpp.

◆ ammLPTCurrency()

Currency xrpl::ammLPTCurrency ( Asset const & asset1,
Asset const & asset2 )

Calculate Liquidity Provider Token (LPT) Currency.

Definition at line 29 of file AMMCore.cpp.

◆ ammLPTIssue()

Issue xrpl::ammLPTIssue ( Asset const & asset1,
Asset const & asset2,
AccountID const & ammAccountID )

Calculate LPT Issue from AMM asset pair.

Definition at line 53 of file AMMCore.cpp.

◆ invalidAMMAmount()

NotTEC xrpl::invalidAMMAmount ( STAmount const & amount,
std::optional< std::pair< Asset, Asset > > const & pair = std::nullopt,
bool validZero = false )

Validate the amount.

If validZero is false and amount is beast::zero then invalid amount. Return error code if invalid amount. If pair then validate amount's issue matches one of the pair's issue.

Definition at line 97 of file AMMCore.cpp.

◆ invalidAMMAsset()

NotTEC xrpl::invalidAMMAsset ( Asset const & asset,
std::optional< std::pair< Asset, Asset > > const & pair = std::nullopt )

Definition at line 59 of file AMMCore.cpp.

◆ invalidAMMAssetPair()

NotTEC xrpl::invalidAMMAssetPair ( Asset const & asset1,
Asset const & asset2,
std::optional< std::pair< Asset, Asset > > const & pair = std::nullopt )

Definition at line 82 of file AMMCore.cpp.

◆ ammAuctionTimeSlot()

std::optional< std::uint8_t > xrpl::ammAuctionTimeSlot ( std::uint64_t current,
STObject const & auctionSlot )

Get time slot of the auction slot.

Definition at line 110 of file AMMCore.cpp.

◆ ammEnabled()

bool xrpl::ammEnabled ( Rules const & rules)

Return true if required AMM amendment is enabled.

Definition at line 128 of file AMMCore.cpp.

◆ getFee()

Number xrpl::getFee ( std::uint16_t tfee)

Convert to the fee from the basis points.

Parameters
tfeetrading fee in {0, 1000} 1 = 1/10bps or 0.001%, 1000 = 1%

Definition at line 78 of file AMMCore.h.

◆ feeMult()

Number xrpl::feeMult ( std::uint16_t tfee)

Get fee multiplier (1 - tfee) @tfee trading fee in basis points.

Definition at line 87 of file AMMCore.h.

◆ feeMultHalf()

Number xrpl::feeMultHalf ( std::uint16_t tfee)

Get fee multiplier (1 - tfee / 2) @tfee trading fee in basis points.

Definition at line 96 of file AMMCore.h.

◆ toSTAmount() [1/8]

STAmount xrpl::toSTAmount ( IOUAmount const & iou,
Asset const & asset )

Definition at line 13 of file AmountConversions.h.

◆ toSTAmount() [2/8]

STAmount xrpl::toSTAmount ( IOUAmount const & iou)

Definition at line 22 of file AmountConversions.h.

◆ toSTAmount() [3/8]

STAmount xrpl::toSTAmount ( XRPAmount const & xrp)

Definition at line 28 of file AmountConversions.h.

◆ toSTAmount() [4/8]

STAmount xrpl::toSTAmount ( XRPAmount const & xrp,
Asset const & asset )

Definition at line 36 of file AmountConversions.h.

◆ toSTAmount() [5/8]

STAmount xrpl::toSTAmount ( MPTAmount const & mpt)

Definition at line 43 of file AmountConversions.h.

◆ toSTAmount() [6/8]

STAmount xrpl::toSTAmount ( MPTAmount const & mpt,
Asset const & asset )

Definition at line 49 of file AmountConversions.h.

◆ toAmount() [1/5]

template<class T>
T xrpl::toAmount ( STAmount const & amt)
delete

◆ toAmount< STAmount >()

template<>
STAmount xrpl::toAmount< STAmount > ( STAmount const & amt)

Definition at line 60 of file AmountConversions.h.

◆ toAmount< IOUAmount >() [1/2]

template<>
IOUAmount xrpl::toAmount< IOUAmount > ( STAmount const & amt)

Definition at line 67 of file AmountConversions.h.

◆ toAmount< XRPAmount >() [1/2]

template<>
XRPAmount xrpl::toAmount< XRPAmount > ( STAmount const & amt)

Definition at line 81 of file AmountConversions.h.

◆ toAmount< MPTAmount >() [1/2]

template<>
MPTAmount xrpl::toAmount< MPTAmount > ( STAmount const & amt)

Definition at line 95 of file AmountConversions.h.

◆ toAmount() [2/5]

template<class T>
T xrpl::toAmount ( IOUAmount const & amt)
delete

◆ toAmount< IOUAmount >() [2/2]

template<>
IOUAmount xrpl::toAmount< IOUAmount > ( IOUAmount const & amt)

Definition at line 114 of file AmountConversions.h.

◆ toAmount() [3/5]

template<class T>
T xrpl::toAmount ( XRPAmount const & amt)
delete

◆ toAmount< XRPAmount >() [2/2]

template<>
XRPAmount xrpl::toAmount< XRPAmount > ( XRPAmount const & amt)

Definition at line 125 of file AmountConversions.h.

◆ toAmount() [4/5]

template<class T>
T xrpl::toAmount ( MPTAmount const & amt)
delete

◆ toAmount< MPTAmount >() [2/2]

template<>
MPTAmount xrpl::toAmount< MPTAmount > ( MPTAmount const & amt)

Definition at line 136 of file AmountConversions.h.

◆ toAmount() [5/5]

template<typename T>
T xrpl::toAmount ( Asset const & asset,
Number const & n,
Number::RoundingMode mode = Number::getround() )

Definition at line 144 of file AmountConversions.h.

◆ toMaxAmount()

template<typename T>
T xrpl::toMaxAmount ( Asset const & asset)

Definition at line 177 of file AmountConversions.h.

◆ toSTAmount() [7/8]

STAmount xrpl::toSTAmount ( Asset const & asset,
Number const & n,
Number::RoundingMode mode = Number::getround() )

Definition at line 209 of file AmountConversions.h.

◆ getAsset() [1/2]

template<typename T>
Asset xrpl::getAsset ( T const & amt)

Definition at line 216 of file AmountConversions.h.

◆ get() [3/6]

template<typename T>
T xrpl::get ( STAmount const & a)
constexpr

Definition at line 243 of file AmountConversions.h.

◆ forApiVersions()

template<unsigned MinVer, unsigned MaxVer, typename Fn, typename... Args>
requires (MaxVer >= MinVer) && (MinVer >= RPC::kApiMinimumSupportedVersion) && (RPC::kApiMaximumValidVersion >= MaxVer) && requires { fn(std::integral_constant<unsigned int, MinVer>{}, std::forward<Args>(args)...); fn(std::integral_constant<unsigned int, MaxVer>{}, std::forward<Args>(args)...); }
void xrpl::forApiVersions ( Fn const & fn,
Args &&... args )

Definition at line 137 of file ApiVersion.h.

◆ forAllApiVersions()

template<typename Fn, typename... Args>
requires requires { forApiVersions<RPC::kApiMinimumSupportedVersion, RPC::kApiMaximumValidVersion>( fn, std::forward<Args>(args)...); }
void xrpl::forAllApiVersions ( Fn const & fn,
Args &&... args )

Definition at line 158 of file ApiVersion.h.

◆ badAsset()

BadAsset const & xrpl::badAsset ( )

Definition at line 31 of file Asset.h.

◆ toJson() [1/4]

json::Value xrpl::toJson ( Asset const & asset)

Definition at line 157 of file Asset.h.

◆ operator==() [5/31]

bool xrpl::operator== ( Asset const & lhs,
Asset const & rhs )
constexpr

Definition at line 219 of file Asset.h.

◆ operator<=>() [2/7]

std::weak_ordering xrpl::operator<=> ( Asset const & lhs,
Asset const & rhs )
constexpr

Definition at line 236 of file Asset.h.

◆ operator==() [6/31]

bool xrpl::operator== ( Currency const & lhs,
Asset const & rhs )
constexpr

Definition at line 259 of file Asset.h.

◆ operator==() [7/31]

bool xrpl::operator== ( BadAsset const & lhs,
Asset const & rhs )
constexpr

Definition at line 267 of file Asset.h.

◆ equalTokens()

bool xrpl::equalTokens ( Asset const & lhs,
Asset const & rhs )
constexpr

Otherwise return false.

Definition at line 275 of file Asset.h.

◆ isXRP() [2/7]

bool xrpl::isXRP ( Asset const & asset)

Definition at line 297 of file Asset.h.

◆ to_string() [14/32]

std::string xrpl::to_string ( Asset const & asset)

Definition at line 45 of file Asset.cpp.

◆ validJSONAsset()

bool xrpl::validJSONAsset ( json::Value const & jv)

Definition at line 51 of file Asset.cpp.

◆ assetFromJson()

Asset xrpl::assetFromJson ( json::Value const & jv)

Definition at line 59 of file Asset.cpp.

◆ isConsistent() [1/3]

bool xrpl::isConsistent ( Asset const & asset)

Definition at line 312 of file Asset.h.

◆ validAsset()

bool xrpl::validAsset ( Asset const & asset)

Definition at line 320 of file Asset.h.

◆ hash_append() [2/11]

template<class Hasher>
void xrpl::hash_append ( Hasher & h,
Asset const & r )

Definition at line 329 of file Asset.h.

◆ operator<<() [5/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
Asset const & x )

Definition at line 69 of file Asset.cpp.

◆ serializeBatch()

void xrpl::serializeBatch ( Serializer & msg,
std::uint32_t const & flags,
std::vector< uint256 > const & txids )

Definition at line 10 of file protocol/Batch.h.

◆ isConsistent() [2/3]

bool xrpl::isConsistent ( Book const & book)

Definition at line 11 of file Book.cpp.

◆ to_string() [15/32]

std::string xrpl::to_string ( Book const & book)

Definition at line 17 of file Book.cpp.

◆ operator<<() [6/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
Book const & x )

Definition at line 22 of file Book.cpp.

◆ hash_append() [3/11]

template<class Hasher>
void xrpl::hash_append ( Hasher & h,
Book const & b )

Definition at line 41 of file Book.h.

◆ reversed()

Book xrpl::reversed ( Book const & book)

Definition at line 30 of file Book.cpp.

◆ operator==() [8/31]

bool xrpl::operator== ( Book const & lhs,
Book const & rhs )
nodiscardconstexpr

Equality comparison.

Definition at line 55 of file Book.h.

◆ operator<=>() [3/7]

std::weak_ordering xrpl::operator<=> ( Book const & lhs,
Book const & rhs )
nodiscardconstexpr

Strict weak ordering.

Definition at line 63 of file Book.h.

◆ incrementConfidentialVersion()

void xrpl::incrementConfidentialVersion ( STObject & mptoken)

Increments the confidential balance version counter on an MPToken.

The version counter is used to prevent replay attacks by binding proofs to a specific state of the account's confidential balance. Wraps to 0 on overflow (defined behavior for unsigned integers).

Parameters
mptokenThe MPToken ledger entry to update.

Definition at line 65 of file include/xrpl/protocol/ConfidentialTransfer.h.

◆ getSendContextHash()

uint256 xrpl::getSendContextHash ( AccountID const & account,
uint192 const & issuanceID,
std::uint32_t sequence,
AccountID const & destination,
std::uint32_t version )

Generates the context hash for ConfidentialMPTSend transactions.

Creates a unique 256-bit hash that binds the zero-knowledge proofs to this specific send transaction, preventing proof reuse across transactions.

Parameters
accountThe sender's account ID.
issuanceIDThe MPToken Issuance ID.
sequenceThe transaction sequence number or ticket number.
destinationThe destination account ID.
versionThe sender's confidential balance version.
Returns
A 256-bit context hash unique to this transaction.

Definition at line 65 of file ConfidentialTransfer.cpp.

◆ getClawbackContextHash()

uint256 xrpl::getClawbackContextHash ( AccountID const & account,
uint192 const & issuanceID,
std::uint32_t sequence,
AccountID const & holder )

Generates the context hash for ConfidentialMPTClawback transactions.

Creates a unique 256-bit hash that binds the equality proof to this specific clawback transaction.

Parameters
accountThe issuer's account ID.
issuanceIDThe MPToken Issuance ID.
sequenceThe transaction sequence number or ticket number.
holderThe holder's account ID being clawed back from.
Returns
A 256-bit context hash unique to this transaction.

Definition at line 84 of file ConfidentialTransfer.cpp.

◆ getConvertContextHash()

uint256 xrpl::getConvertContextHash ( AccountID const & account,
uint192 const & issuanceID,
std::uint32_t sequence )

Generates the context hash for ConfidentialMPTConvert transactions.

Creates a unique 256-bit hash that binds the Schnorr proof (for key registration) to this specific convert transaction.

Parameters
accountThe holder's account ID.
issuanceIDThe MPToken Issuance ID.
sequenceThe transaction sequence number or a ticket number.
Returns
A 256-bit context hash unique to this transaction.

Definition at line 101 of file ConfidentialTransfer.cpp.

◆ getConvertBackContextHash()

uint256 xrpl::getConvertBackContextHash ( AccountID const & account,
uint192 const & issuanceID,
std::uint32_t sequence,
std::uint32_t version )

Generates the context hash for ConfidentialMPTConvertBack transactions.

Creates a unique 256-bit hash that binds the zero-knowledge proofs to this specific convert-back transaction.

Parameters
accountThe holder's account ID.
issuanceIDThe MPToken Issuance ID.
sequenceThe transaction sequence number or a ticket number.
versionThe holder's confidential balance version.
Returns
A 256-bit context hash unique to this transaction.

Definition at line 110 of file ConfidentialTransfer.cpp.

◆ makeEcPair()

std::optional< EcPair > xrpl::makeEcPair ( Slice const & buffer)

Parses an ElGamal ciphertext into two secp256k1 public key components.

Breaks an encrypted amount (size=xrpl::kEcGamalEncryptedTotalLength, two compressed EC points of size=xrpl::kEcCiphertextComponentLength) into a pair containing (C1, C2) for use in cryptographic operations.

Parameters
bufferThe buffer containing the compressed ciphertext (size=xrpl::kEcGamalEncryptedTotalLength).
Returns
The parsed pair (c1, c2) if successful, std::nullopt if the buffer is invalid.

Definition at line 123 of file ConfidentialTransfer.cpp.

◆ serializeEcPair()

std::optional< Buffer > xrpl::serializeEcPair ( EcPair const & pair)

Serializes an EcPair into compressed form.

Converts an EcPair (C1, C2) back into a buffer (size=xrpl::kEcGamalEncryptedTotalLength) containing two compressed EC points (size=xrpl::kEcCiphertextComponentLength each).

Parameters
pairThe EcPair to serialize.
Returns
The buffer (size=xrpl::kEcGamalEncryptedTotalLength), or std::nullopt if serialization fails.

Definition at line 143 of file ConfidentialTransfer.cpp.

◆ isValidCiphertext()

bool xrpl::isValidCiphertext ( Slice const & buffer)

Verifies that a buffer contains two valid, parsable EC public keys.

Parameters
bufferThe input buffer containing two concatenated components.
Returns
true if both components can be parsed successfully, false otherwise.

Definition at line 164 of file ConfidentialTransfer.cpp.

◆ isValidCompressedECPoint()

bool xrpl::isValidCompressedECPoint ( Slice const & buffer)

Verifies that a buffer contains a valid, parsable compressed EC point.

Can be used to validate both compressed public keys and Pedersen commitments. Fails early if the prefix byte is not 0x02 or 0x03.

Parameters
bufferThe input buffer containing a compressed EC point (size=xrpl::kCompressedEcPointLength).
Returns
true if the point can be parsed successfully, false otherwise.

Definition at line 170 of file ConfidentialTransfer.cpp.

◆ homomorphicAdd()

std::optional< Buffer > xrpl::homomorphicAdd ( Slice const & a,
Slice const & b )

Homomorphically adds two ElGamal ciphertexts.

Uses the additive homomorphic property of ElGamal encryption to compute Enc(a + b) from Enc(a) and Enc(b) without decryption.

Parameters
aThe first ciphertext (size=xrpl::kEcGamalEncryptedTotalLength).
bThe second ciphertext (size=xrpl::kEcGamalEncryptedTotalLength).
Returns
The resulting ciphertext Enc(a + b), or std::nullopt on failure.

Definition at line 184 of file ConfidentialTransfer.cpp.

◆ homomorphicSubtract()

std::optional< Buffer > xrpl::homomorphicSubtract ( Slice const & a,
Slice const & b )

Homomorphically subtracts two ElGamal ciphertexts.

Uses the additive homomorphic property of ElGamal encryption to compute Enc(a - b) from Enc(a) and Enc(b) without decryption.

Parameters
aThe minuend ciphertext (size=xrpl::kEcGamalEncryptedTotalLength).
bThe subtrahend ciphertext (size=xrpl::kEcGamalEncryptedTotalLength).
Returns
The resulting ciphertext Enc(a - b), or std::nullopt on failure.

Definition at line 207 of file ConfidentialTransfer.cpp.

◆ rerandomizeCiphertext()

std::optional< Buffer > xrpl::rerandomizeCiphertext ( Slice const & ciphertext,
Slice const & pubKeySlice,
Slice const & randomness )

Re-randomizes an ElGamal ciphertext without changing its plaintext.

Adds Enc(0; randomness) under the supplied public key to the ciphertext. This is used when a public, deterministic scalar must perturb ciphertext randomness while preserving ledger reproducibility.

Parameters
ciphertextThe ciphertext to re-randomize (size=xrpl::kEcGamalEncryptedTotalLength).
pubKeySliceThe ElGamal public key matching the ciphertext recipient.
randomnessThe scalar used as zero-encryption randomness (size=xrpl::kEcScalarLength).
Returns
The re-randomized ciphertext, or std::nullopt on failure.

Definition at line 230 of file ConfidentialTransfer.cpp.

◆ encryptAmount()

std::optional< Buffer > xrpl::encryptAmount ( uint64_t const amt,
Slice const & pubKeySlice,
Slice const & blindingFactor )

Encrypts an amount using ElGamal encryption.

Produces a ciphertext C = (C1, C2) where C1 = r*G and C2 = m*G + r*Pk, using the provided blinding factor r.

Parameters
amtThe plaintext amount to encrypt.
pubKeySliceThe recipient's ElGamal public key (size=xrpl::kEcPubKeyLength).
blindingFactorThe randomness used as blinding factor r (size=xrpl::ecBlindingFactorLength).
Returns
The ciphertext (size=xrpl::kEcGamalEncryptedTotalLength), or std::nullopt on failure.

Definition at line 252 of file ConfidentialTransfer.cpp.

◆ encryptCanonicalZeroAmount()

std::optional< Buffer > xrpl::encryptCanonicalZeroAmount ( Slice const & pubKeySlice,
AccountID const & account,
MPTID const & mptId )

Generates the canonical zero encryption for a specific MPToken.

Creates a deterministic encryption of zero that is unique to the account and MPT issuance. Used to initialize confidential balance fields.

Parameters
pubKeySliceThe holder's ElGamal public key (size=xrpl::kEcPubKeyLength).
accountThe account ID of the token holder.
mptIdThe MPToken Issuance ID.
Returns
The canonical zero ciphertext (size=xrpl::kEcGamalEncryptedTotalLength), or std::nullopt on failure.

Definition at line 265 of file ConfidentialTransfer.cpp.

◆ verifySchnorrProof()

TER xrpl::verifySchnorrProof ( Slice const & pubKeySlice,
Slice const & proofSlice,
uint256 const & contextHash )

Verifies a Schnorr proof of knowledge of an ElGamal private key.

Proves that the submitter knows the secret key corresponding to the provided public key, without revealing the secret key itself.

Parameters
pubKeySliceThe ElGamal public key (size=xrpl::kEcPubKeyLength).
proofSliceThe Schnorr proof (size=xrpl::ecSchnorrProofLength).
contextHashThe 256-bit context hash binding the proof.
Returns
tesSUCCESS if valid, or an error code otherwise.

Definition at line 365 of file ConfidentialTransfer.cpp.

◆ checkEncryptedAmountFormat()

NotTEC xrpl::checkEncryptedAmountFormat ( STObject const & object)

Validates the format of encrypted amount fields in a transaction.

Checks that all ciphertext fields in the transaction object have the correct length and contain valid EC points. This function is only used by ConfidentialMPTConvert and ConfidentialMPTConvertBack transactions.

Parameters
objectThe transaction object containing encrypted amount fields.
Returns
tesSUCCESS if all formats are valid, temMALFORMED if required fields are missing, or temBAD_CIPHERTEXT if format validation fails.

Definition at line 331 of file ConfidentialTransfer.cpp.

◆ verifyRevealedAmount()

TER xrpl::verifyRevealedAmount ( uint64_t const amount,
Slice const & blindingFactor,
ConfidentialRecipient const & holder,
ConfidentialRecipient const & issuer,
std::optional< ConfidentialRecipient > const & auditor )

Verifies revealed amount encryptions for all recipients.

Validates that the same amount was correctly encrypted for the holder, issuer, and optionally the auditor using their respective public keys.

Parameters
amountThe revealed plaintext amount.
blindingFactorThe blinding factor used in all encryptions (size=xrpl::ecBlindingFactorLength).
holderThe holder's public key and encrypted amount.
issuerThe issuer's public key and encrypted amount.
auditorOptional auditor's public key and encrypted amount.
Returns
tesSUCCESS if all encryptions are valid, or an error code otherwise.

Definition at line 290 of file ConfidentialTransfer.cpp.

◆ getConfidentialRecipientCount()

uint8_t xrpl::getConfidentialRecipientCount ( bool hasAuditor)
constexpr

Returns the number of recipients in a confidential transfer.

Returns 4 if an auditor is present (sender, destination, issuer, auditor), or 3 if no auditor (sender, destination, issuer).

Parameters
hasAuditorWhether the issuance has an auditor configured.
Returns
The number of recipients (3 or 4).

Definition at line 331 of file include/xrpl/protocol/ConfidentialTransfer.h.

◆ verifyClawbackProof()

TER xrpl::verifyClawbackProof ( uint64_t const amount,
Slice const & proof,
Slice const & pubKeySlice,
Slice const & ciphertext,
uint256 const & contextHash )

Verifies a compact sigma clawback proof.

Proves that the issuer knows the exact amount encrypted in the holder's balance ciphertext. Used in ConfidentialMPTClawback to verify the issuer can decrypt the balance using their private key.

Parameters
amountThe revealed plaintext amount.
proofThe zero-knowledge proof bytes (ecClawbackProofLength).
pubKeySliceThe issuer's ElGamal public key (kEcPubKeyLength bytes).
ciphertextThe issuer's encrypted balance on the holder's account (kEcGamalEncryptedTotalLength bytes).
contextHashThe 256-bit context hash binding the proof.
Returns
tesSUCCESS if the proof is valid, or an error code otherwise.

Definition at line 377 of file ConfidentialTransfer.cpp.

◆ generateBlindingFactor()

Buffer xrpl::generateBlindingFactor ( )

Generates a cryptographically secure blinding factor (size=xrpl::kEcBlindingFactorLength).

Produces random bytes suitable for use as an ElGamal blinding factor or Pedersen commitment randomness.

Returns
A buffer containing the random blinding factor (size=xrpl::kEcBlindingFactorLength).

Definition at line 240 of file ConfidentialTransfer.cpp.

◆ verifySendProof()

TER xrpl::verifySendProof ( Slice const & proof,
ConfidentialRecipient const & sender,
ConfidentialRecipient const & destination,
ConfidentialRecipient const & issuer,
std::optional< ConfidentialRecipient > const & auditor,
Slice const & spendingBalance,
Slice const & amountCommitment,
Slice const & balanceCommitment,
uint256 const & contextHash )

Verifies all zero-knowledge proofs for a ConfidentialMPTSend transaction.

This function calls mpt_verify_send_proof API in the mpt-crypto utility lib, which verifies the equality proof, amount linkage, balance linkage, and range proof. Equality proof: Proves the same value is encrypted for the sender, receiver, issuer, and auditor. Amount linkage: Proves the send amount matches the amount Pedersen commitment. Balance linkage: Proves the sender's balance matches the balance Pedersen commitment. Range proof: Proves the amount and the remaining balance are within range [0, 2^64-1].

Parameters
proofThe full proof blob.
senderThe sender's public key and encrypted amount.
destinationThe destination's public key and encrypted amount.
issuerThe issuer's public key and encrypted amount.
auditorThe auditor's public key and encrypted amount if present.
spendingBalanceThe sender's current spending balance ciphertext.
amountCommitmentThe Pedersen commitment to the send amount.
balanceCommitmentThe Pedersen commitment to the sender's balance.
contextHashThe context hash binding the proof.
Returns
tesSUCCESS if all proofs are valid, or an error code otherwise.

Definition at line 400 of file ConfidentialTransfer.cpp.

◆ verifyConvertBackProof()

TER xrpl::verifyConvertBackProof ( Slice const & proof,
Slice const & pubKeySlice,
Slice const & spendingBalance,
Slice const & balanceCommitment,
uint64_t amount,
uint256 const & contextHash )

Verifies all zero-knowledge proofs for a ConfidentialMPTConvertBack transaction.

This function calls mpt_verify_convert_back_proof API in the mpt-crypto utility lib, which verifies the balance linkage proof and range proof. Balance linkage proof: proves the balance commitment matches the spending ciphertext. Range proof: proves the remaining balance after convert back is within range [0, 2^64-1].

Parameters
proofThe full proof blob.
pubKeySliceThe holder's public key.
spendingBalanceThe holder's spending balance ciphertext.
balanceCommitmentThe Pedersen commitment to the balance.
amountThe amount being converted back to public.
contextHashThe context hash binding the proof.
Returns
tesSUCCESS if all proofs are valid, or an error code otherwise.

Definition at line 458 of file ConfidentialTransfer.cpp.

◆ secp256k1Context()

template<class = void>
secp256k1_context const * xrpl::secp256k1Context ( )

Definition at line 9 of file secp256k1.h.

◆ tokenCodecErrcCategory()

xrpl::detail::TokenCodecErrcCategory const & xrpl::tokenCodecErrcCategory ( )

Definition at line 69 of file token_errors.h.

◆ make_error_code()

std::error_code xrpl::make_error_code ( xrpl::TokenCodecErrc e)

Definition at line 76 of file token_errors.h.

◆ sha512Half()

template<class... Args>
sha512_half_hasher::result_type xrpl::sha512Half ( Args const &... args)

Returns the SHA512-Half of a series of objects.

Definition at line 204 of file digest.h.

◆ sha512HalfS()

template<class... Args>
sha512_half_hasher_s::result_type xrpl::sha512HalfS ( Args const &... args)

Returns the SHA512-Half of a series of objects.

Postconditions: Temporary memory storing copies of input messages will be cleared.

Definition at line 220 of file digest.h.

◆ rpcErrorString()

std::string xrpl::rpcErrorString ( json::Value const & jv)

Returns a single string with the contents of an RPC error.

Definition at line 221 of file ErrorCodes.cpp.

◆ validFeatureNameSize()

auto xrpl::validFeatureNameSize ( auto fn) -> bool
consteval

Definition at line 80 of file Feature.h.

◆ validFeatureName()

auto xrpl::validFeatureName ( auto fn) -> bool
consteval

Definition at line 95 of file Feature.h.

◆ allAmendments()

std::map< std::string, AmendmentSupport > const & xrpl::allAmendments ( )

All amendments libxrpl knows about.

All amendments libxrpl knows of.

Definition at line 318 of file libxrpl/protocol/Feature.cpp.

◆ getRegisteredFeature()

std::optional< uint256 > xrpl::getRegisteredFeature ( std::string const & name)

Definition at line 349 of file libxrpl/protocol/Feature.cpp.

◆ featureToBitsetIndex()

size_t xrpl::featureToBitsetIndex ( uint256 const & f)

Definition at line 376 of file libxrpl/protocol/Feature.cpp.

◆ bitsetIndexToFeature()

uint256 xrpl::bitsetIndexToFeature ( size_t i)

Definition at line 382 of file libxrpl/protocol/Feature.cpp.

◆ featureToName()

std::string xrpl::featureToName ( uint256 const & f)

Definition at line 388 of file libxrpl/protocol/Feature.cpp.

◆ foreachFeature()

template<class F>
void xrpl::foreachFeature ( FeatureBitset bs,
F && f )

Definition at line 375 of file Feature.h.

◆ hash_append() [4/11]

template<class Hasher>
void xrpl::hash_append ( Hasher & h,
HashPrefix const & hp )
noexcept

Definition at line 74 of file HashPrefix.h.

◆ getBookBase()

uint256 xrpl::getBookBase ( Book const & book)

Definition at line 102 of file Indexes.cpp.

◆ getQualityNext()

uint256 xrpl::getQualityNext ( uint256 const & uBase)

Definition at line 144 of file Indexes.cpp.

◆ getQuality()

std::uint64_t xrpl::getQuality ( uint256 const & uBase)

Definition at line 152 of file Indexes.cpp.

◆ getTicketIndex() [1/2]

uint256 xrpl::getTicketIndex ( AccountID const & account,
std::uint32_t uSequence )

Definition at line 159 of file Indexes.cpp.

◆ getTicketIndex() [2/2]

uint256 xrpl::getTicketIndex ( AccountID const & account,
SeqProxy ticketSeq )

Definition at line 165 of file Indexes.cpp.

◆ makeMptID()

MPTID xrpl::makeMptID ( std::uint32_t sequence,
AccountID const & account )

Definition at line 172 of file Indexes.cpp.

◆ to_string() [16/32]

std::string xrpl::to_string ( IOUAmount const & amount)

Definition at line 87 of file IOUAmount.cpp.

◆ mulRatio() [1/3]

IOUAmount xrpl::mulRatio ( IOUAmount const & amt,
std::uint32_t num,
std::uint32_t den,
bool roundUp )

Definition at line 93 of file IOUAmount.cpp.

◆ isConsistent() [3/3]

bool xrpl::isConsistent ( Issue const & ac)

Definition at line 66 of file Issue.cpp.

◆ to_string() [17/32]

std::string xrpl::to_string ( Issue const & ac)

Definition at line 72 of file Issue.cpp.

◆ toJson() [2/4]

json::Value xrpl::toJson ( Issue const & is)

Definition at line 81 of file Issue.cpp.

◆ issueFromJson() [1/2]

Issue xrpl::issueFromJson ( json::Value const & v)

Definition at line 89 of file Issue.cpp.

◆ operator<<() [7/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
Issue const & x )

Definition at line 139 of file Issue.cpp.

◆ hash_append() [5/11]

template<class Hasher>
void xrpl::hash_append ( Hasher & h,
Issue const & r )

Definition at line 63 of file Issue.h.

◆ operator==() [9/31]

bool xrpl::operator== ( Issue const & lhs,
Issue const & rhs )
nodiscardconstexpr

Equality comparison.

Definition at line 72 of file Issue.h.

◆ operator<=>() [4/7]

std::weak_ordering xrpl::operator<=> ( Issue const & lhs,
Issue const & rhs )
nodiscardconstexpr

Strict weak ordering.

Definition at line 80 of file Issue.h.

◆ xrpIssue()

Issue const & xrpl::xrpIssue ( )

Returns an asset specifier that represents XRP.

Definition at line 97 of file Issue.h.

◆ noIssue()

Issue const & xrpl::noIssue ( )

Returns an asset specifier that represents no account and currency.

Definition at line 105 of file Issue.h.

◆ isXRP() [3/7]

bool xrpl::isXRP ( Issue const & issue)

Definition at line 112 of file Issue.h.

◆ keyTypeFromString()

std::optional< KeyType > xrpl::keyTypeFromString ( std::string const & s)

Definition at line 14 of file KeyType.h.

◆ to_string() [18/32]

char const * xrpl::to_string ( KeyType type)

Definition at line 26 of file KeyType.h.

◆ operator<<() [8/24]

template<class Stream>
Stream & xrpl::operator<< ( Stream & s,
KeyType type )

Definition at line 38 of file KeyType.h.

◆ getAllLedgerFlags()

std::vector< std::pair< std::string, LedgerFlagMap > > const & xrpl::getAllLedgerFlags ( )

Definition at line 261 of file LedgerFormats.h.

◆ getCloseAgree()

bool xrpl::getCloseAgree ( LedgerHeader const & info)

Definition at line 59 of file LedgerHeader.h.

◆ addRaw()

void xrpl::addRaw ( LedgerHeader const & info,
Serializer & s,
bool includeHash = false )

Definition at line 14 of file libxrpl/protocol/LedgerHeader.cpp.

◆ deserializeHeader()

LedgerHeader xrpl::deserializeHeader ( Slice data,
bool hasHash = false )

Deserialize a ledger header from a byte array.

Definition at line 31 of file libxrpl/protocol/LedgerHeader.cpp.

◆ deserializePrefixedHeader()

LedgerHeader xrpl::deserializePrefixedHeader ( Slice data,
bool hasHash = false )

Deserialize a ledger header (prefixed with 4 bytes) from a byte array.

Definition at line 54 of file libxrpl/protocol/LedgerHeader.cpp.

◆ calculateLedgerHash()

uint256 xrpl::calculateLedgerHash ( LedgerHeader const & info)

Calculate the hash of a ledger header.

Definition at line 60 of file libxrpl/protocol/LedgerHeader.cpp.

◆ operator<<() [9/24]

template<class Char, class Traits>
std::basic_ostream< Char, Traits > & xrpl::operator<< ( std::basic_ostream< Char, Traits > & os,
MPTAmount const & q )

Definition at line 122 of file MPTAmount.h.

◆ to_string() [19/32]

std::string xrpl::to_string ( MPTAmount const & amount)

Definition at line 136 of file MPTAmount.h.

◆ mulRatio() [2/3]

MPTAmount xrpl::mulRatio ( MPTAmount const & amt,
std::uint32_t num,
std::uint32_t den,
bool roundUp )

Definition at line 142 of file MPTAmount.h.

◆ operator==() [10/31]

bool xrpl::operator== ( MPTIssue const & lhs,
MPTIssue const & rhs )
constexpr

Definition at line 64 of file MPTIssue.h.

◆ operator<=>() [5/7]

std::weak_ordering xrpl::operator<=> ( MPTIssue const & lhs,
MPTIssue const & rhs )
constexpr

Definition at line 69 of file MPTIssue.h.

◆ isXRP() [4/7]

bool xrpl::isXRP ( MPTID const & )

MPT is a non-native token.

Definition at line 78 of file MPTIssue.h.

◆ getMPTIssuer() [1/3]

AccountID xrpl::getMPTIssuer ( MPTID const & mptid)

Definition at line 84 of file MPTIssue.h.

◆ getMPTIssuer() [2/3]

AccountID const & xrpl::getMPTIssuer ( MPTID const && )
delete

◆ getMPTIssuer() [3/3]

AccountID const & xrpl::getMPTIssuer ( MPTID && )
delete

◆ noMPT()

MPTID xrpl::noMPT ( )

Definition at line 103 of file MPTIssue.h.

◆ badMPT()

MPTID xrpl::badMPT ( )

Definition at line 110 of file MPTIssue.h.

◆ hash_append() [6/11]

template<class Hasher>
void xrpl::hash_append ( Hasher & h,
MPTIssue const & r )

Definition at line 118 of file MPTIssue.h.

◆ toJson() [3/4]

json::Value xrpl::toJson ( MPTIssue const & mptIssue)

Definition at line 53 of file MPTIssue.cpp.

◆ to_string() [20/32]

std::string xrpl::to_string ( MPTIssue const & mptIssue)

Definition at line 61 of file MPTIssue.cpp.

◆ mptIssueFromJson()

MPTIssue xrpl::mptIssueFromJson ( json::Value const & jv)

Definition at line 67 of file MPTIssue.cpp.

◆ operator<<() [10/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
MPTIssue const & x )

Definition at line 97 of file MPTIssue.cpp.

◆ canHaveNFTokenID()

bool xrpl::canHaveNFTokenID ( std::shared_ptr< STTx const > const & serializedTx,
TxMeta const & transactionMeta )

Add a nftoken_ids field to the meta output parameter.

The field is only added to successful NFTokenMint, NFTokenAcceptOffer, and NFTokenCancelOffer transactions.

Helper functions are not static because they can be used by Clio.

Definition at line 24 of file NFTokenID.cpp.

◆ getNFTokenIDFromPage()

std::optional< uint256 > xrpl::getNFTokenIDFromPage ( TxMeta const & transactionMeta)

Definition at line 41 of file NFTokenID.cpp.

◆ getNFTokenIDFromDeletedOffer()

std::vector< uint256 > xrpl::getNFTokenIDFromDeletedOffer ( TxMeta const & transactionMeta)

Definition at line 113 of file NFTokenID.cpp.

◆ insertNFTokenID()

void xrpl::insertNFTokenID ( json::Value & response,
std::shared_ptr< STTx const > const & transaction,
TxMeta const & transactionMeta )

Definition at line 136 of file NFTokenID.cpp.

◆ canHaveNFTokenOfferID()

bool xrpl::canHaveNFTokenOfferID ( std::shared_ptr< STTx const > const & serializedTx,
TxMeta const & transactionMeta )

Add an offer_id field to the meta output parameter.

The field is only added to successful NFTokenCreateOffer transactions.

Helper functions are not static because they can be used by Clio.

Definition at line 20 of file NFTokenOfferID.cpp.

◆ getOfferIDFromCreatedOffer()

std::optional< uint256 > xrpl::getOfferIDFromCreatedOffer ( TxMeta const & transactionMeta)

Definition at line 40 of file NFTokenOfferID.cpp.

◆ insertNFTokenOfferID()

void xrpl::insertNFTokenOfferID ( json::Value & response,
std::shared_ptr< STTx const > const & transaction,
TxMeta const & transactionMeta )

Definition at line 54 of file NFTokenOfferID.cpp.

◆ operator==() [11/31]

bool xrpl::operator== ( PathAsset const & lhs,
PathAsset const & rhs )
constexpr

Definition at line 98 of file PathAsset.h.

◆ hash_append() [7/11]

template<typename Hasher>
void xrpl::hash_append ( Hasher & h,
PathAsset const & pathAsset )

Definition at line 117 of file PathAsset.h.

◆ isXRP() [5/7]

bool xrpl::isXRP ( PathAsset const & asset)

Definition at line 123 of file PathAsset.h.

◆ to_string() [21/32]

std::string xrpl::to_string ( PathAsset const & asset)

Definition at line 10 of file PathAsset.cpp.

◆ operator<<() [11/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
PathAsset const & x )

Definition at line 15 of file PathAsset.cpp.

◆ serializePayChanAuthorization()

void xrpl::serializePayChanAuthorization ( Serializer & msg,
uint256 const & key,
XRPAmount const & amt )

Definition at line 11 of file PayChan.h.

◆ kBipsPerUnity()

Bips32 xrpl::kBipsPerUnity ( 100 * 100)
constexpr

There are 10,000 basis points (bips) in 100%.

Basis points represent 0.01%.

Given a value X, to find the amount for B bps, use X * B / bipsPerUnity

Example: If a loan broker has 999 XRP of debt, and must maintain 1,000 bps of that debt as cover (10%), then the minimum cover amount is 999,000,000 drops

  • 1000 / bipsPerUnity = 99,900,00 drops or 99.9 XRP.

Given a percentage P, to find the number of bps that percentage represents, use P * bipsPerUnity.

Example: 50% is 0.50 * bipsPerUnity = 5,000 bps.

◆ kTenthBipsPerUnity()

TenthBips32 xrpl::kTenthBipsPerUnity ( kBipsPerUnity.value() * 10)
constexpr

◆ percentageToBips()

Bips32 xrpl::percentageToBips ( std::uint32_t percentage)
constexpr

Definition at line 94 of file Protocol.h.

◆ percentageToTenthBips()

TenthBips32 xrpl::percentageToTenthBips ( std::uint32_t percentage)
constexpr

Definition at line 99 of file Protocol.h.

◆ bipsOfValue()

template<typename T, class TBips>
T xrpl::bipsOfValue ( T value,
Bips< TBips > bips )
constexpr

Definition at line 105 of file Protocol.h.

◆ tenthBipsOfValue()

template<typename T, class TBips>
T xrpl::tenthBipsOfValue ( T value,
TenthBips< TBips > bips )
constexpr

Definition at line 111 of file Protocol.h.

◆ isVotingLedger()

bool xrpl::isVotingLedger ( LedgerIndex seq)

Returns true if the given ledgerIndex is a voting ledgerIndex.

Definition at line 5 of file Protocol.cpp.

◆ isFlagLedger()

bool xrpl::isFlagLedger ( LedgerIndex seq)

Returns true if the given ledgerIndex is a flag ledgerIndex.

Definition at line 11 of file Protocol.cpp.

◆ operator<<() [12/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
PublicKey const & pk )

Print the public key to a stream.

Definition at line 28 of file PublicKey.cpp.

◆ operator==() [12/31]

bool xrpl::operator== ( PublicKey const & lhs,
PublicKey const & rhs )

Definition at line 120 of file PublicKey.h.

◆ operator<() [2/13]

bool xrpl::operator< ( PublicKey const & lhs,
PublicKey const & rhs )

Definition at line 125 of file PublicKey.h.

◆ hash_append() [8/11]

template<class Hasher>
void xrpl::hash_append ( Hasher & h,
PublicKey const & pk )

Definition at line 134 of file PublicKey.h.

◆ toBase58() [2/4]

std::string xrpl::toBase58 ( TokenType type,
PublicKey const & pk )

Definition at line 162 of file PublicKey.h.

◆ parseBase58() [2/10]

template<>
std::optional< PublicKey > xrpl::parseBase58 ( TokenType type,
std::string const & s )

Definition at line 37 of file PublicKey.cpp.

◆ ecdsaCanonicality()

std::optional< ECDSACanonicality > xrpl::ecdsaCanonicality ( Slice const & sig)

Determines the canonicality of a signature.

Determine whether a signature is canonical.

A canonical signature is in its most reduced form. For example the R and S components do not contain additional leading zeroes. However, even in canonical form, (R,S) and (R,G-S) are both valid signatures for message M.

Therefore, to prevent malleability attacks we define a fully canonical signature as one where:

R < G - S

where G is the curve order.

This routine returns std::nullopt if the format of the signature is invalid (for example, the points are encoded incorrectly).

Returns
std::nullopt if the signature fails validity checks.
Note
Only the format of the signature is checked, no verification cryptography is performed.

Canonical signatures are important to protect against signature morphing attacks.

Parameters
vSigthe signature data
sigLenthe length of the signature
strict_paramwhether to enforce strictly canonical semantics
Note
For more details please see: https://xrpl.org/transaction-malleability.html https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 https://github.com/sipa/bitcoin/commit/58bc86e37fda1aec270bccb3df6c20fbd2a6591c

Definition at line 112 of file PublicKey.cpp.

◆ publicKeyType() [1/2]

std::optional< KeyType > xrpl::publicKeyType ( Slice const & slice)
nodiscard

Returns the type of public key.

Returns
std::nullopt If the public key does not represent a known type.

Definition at line 208 of file PublicKey.cpp.

◆ publicKeyType() [2/2]

std::optional< KeyType > xrpl::publicKeyType ( PublicKey const & publicKey)
nodiscard

Definition at line 211 of file PublicKey.h.

◆ verifyDigest()

bool xrpl::verifyDigest ( PublicKey const & publicKey,
uint256 const & digest,
Slice const & sig,
bool mustBeFullyCanonical = true )
nodiscardnoexcept

Verify a secp256k1 signature on the digest of a message.

Definition at line 223 of file PublicKey.cpp.

◆ verify() [1/2]

bool xrpl::verify ( PublicKey const & publicKey,
Slice const & m,
Slice const & sig )
nodiscardnoexcept

Verify a signature on a message.

With secp256k1 signatures, the data is first hashed with SHA512-Half, and the resulting digest is signed.

Definition at line 271 of file PublicKey.cpp.

◆ calcNodeID()

NodeID xrpl::calcNodeID ( PublicKey const & pk)

Calculate the 160-bit node ID from a node public key.

Definition at line 295 of file PublicKey.cpp.

◆ calcAccountID()

AccountID xrpl::calcAccountID ( PublicKey const & pk)

Definition at line 147 of file AccountID.cpp.

◆ getFingerprint()

std::string xrpl::getFingerprint ( beast::IP::Endpoint const & address,
std::optional< PublicKey > const & publicKey = std::nullopt,
std::optional< std::string > const & id = std::nullopt )

Definition at line 242 of file PublicKey.h.

◆ operator==() [13/31]

template<class In, class Out>
bool xrpl::operator== ( TAmounts< In, Out > const & lhs,
TAmounts< In, Out > const & rhs )
noexcept

Definition at line 68 of file Quality.h.

◆ operator!=() [4/10]

template<class In, class Out>
bool xrpl::operator!= ( TAmounts< In, Out > const & lhs,
TAmounts< In, Out > const & rhs )
noexcept

Definition at line 75 of file Quality.h.

◆ composedQuality()

Quality xrpl::composedQuality ( Quality const & lhs,
Quality const & rhs )

Calculate the quality of a two-hop path given the two hops.

Parameters
lhsThe first leg of the path: input to intermediate.
rhsThe second leg of the path: intermediate to output.

Definition at line 114 of file Quality.cpp.

◆ operator==() [14/31]

bool xrpl::operator== ( Rate const & lhs,
Rate const & rhs )
noexcept

Definition at line 31 of file Rate.h.

◆ operator<() [3/13]

bool xrpl::operator< ( Rate const & lhs,
Rate const & rhs )
noexcept

Definition at line 36 of file Rate.h.

◆ operator<<() [13/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
Rate const & rate )

Definition at line 42 of file Rate.h.

◆ multiply() [2/3]

STAmount xrpl::multiply ( STAmount const & amount,
Rate const & rate )

Definition at line 34 of file Rate2.cpp.

◆ multiplyRound() [1/2]

STAmount xrpl::multiplyRound ( STAmount const & amount,
Rate const & rate,
bool roundUp )

Definition at line 45 of file Rate2.cpp.

◆ multiplyRound() [2/2]

STAmount xrpl::multiplyRound ( STAmount const & amount,
Rate const & rate,
Asset const & asset,
bool roundUp )

Definition at line 56 of file Rate2.cpp.

◆ divide() [1/2]

STAmount xrpl::divide ( STAmount const & amount,
Rate const & rate )

Definition at line 69 of file Rate2.cpp.

◆ divideRound() [1/2]

STAmount xrpl::divideRound ( STAmount const & amount,
Rate const & rate,
bool roundUp )

Definition at line 80 of file Rate2.cpp.

◆ divideRound() [2/2]

STAmount xrpl::divideRound ( STAmount const & amount,
Rate const & rate,
Asset const & asset,
bool roundUp )

Definition at line 91 of file Rate2.cpp.

◆ isRpcError()

bool xrpl::isRpcError ( json::Value jvResult)

Definition at line 22 of file RPCErr.cpp.

◆ rpcError()

json::Value xrpl::rpcError ( ErrorCodeI iError)

Definition at line 13 of file RPCErr.cpp.

◆ isFeatureEnabled() [1/2]

bool xrpl::isFeatureEnabled ( uint256 const & feature,
bool resultIfNoRules )

Check whether a feature is enabled in the current ledger rules.

Parameters
featureThe feature to be tested.
resultIfNoRulesWhat to return if called from outside a Transactor context.

Definition at line 194 of file Rules.cpp.

◆ isFeatureEnabled() [2/2]

bool xrpl::isFeatureEnabled ( uint256 const & feature)

Check whether a feature is enabled in the current ledger rules.

Parameters
featureThe feature to be tested.

Returns false if no global Rules object is available. i.e. Outside of a Transactor context

Definition at line 203 of file Rules.cpp.

◆ getCurrentTransactionRules()

std::optional< Rules > const & xrpl::getCurrentTransactionRules ( )

Definition at line 30 of file Rules.cpp.

◆ setCurrentTransactionRules()

void xrpl::setCurrentTransactionRules ( std::optional< Rules > r)

Definition at line 36 of file Rules.cpp.

◆ useRulesGuards()

bool xrpl::useRulesGuards ( Rules const & rules)

Definition at line 69 of file Rules.cpp.

◆ createGuards()

void xrpl::createGuards ( Rules const & rules,
std::optional< CurrentTransactionRulesGuard > & rulesGuard,
std::optional< NumberMantissaScaleGuard > & mantissaScaleGuard )

Definition at line 83 of file Rules.cpp.

◆ operator==() [15/31]

bool xrpl::operator== ( SecretKey const & lhs,
SecretKey const & rhs )
delete

◆ operator!=() [5/10]

bool xrpl::operator!= ( SecretKey const & lhs,
SecretKey const & rhs )
delete

◆ parseBase58() [3/10]

template<>
std::optional< SecretKey > xrpl::parseBase58 ( TokenType type,
std::string const & s )

Parse a secret key.

Definition at line 37 of file PublicKey.cpp.

◆ toBase58() [3/4]

std::string xrpl::toBase58 ( TokenType type,
SecretKey const & sk )

Definition at line 102 of file SecretKey.h.

◆ randomSecretKey()

SecretKey xrpl::randomSecretKey ( )

Create a secret key using secure random numbers.

Definition at line 271 of file SecretKey.cpp.

◆ generateSecretKey()

SecretKey xrpl::generateSecretKey ( KeyType type,
Seed const & seed )

Generate a new secret key deterministically.

Definition at line 281 of file SecretKey.cpp.

◆ derivePublicKey()

PublicKey xrpl::derivePublicKey ( KeyType type,
SecretKey const & sk )

Derive the public key from a secret key.

Definition at line 303 of file SecretKey.cpp.

◆ generateKeyPair()

std::pair< PublicKey, SecretKey > xrpl::generateKeyPair ( KeyType type,
Seed const & seed )

Generate a key pair deterministically.

This algorithm is specific to the XRPL:

For secp256k1 key pairs, the seed is converted to a Generator and used to compute the key pair corresponding to ordinal 0 for the generator.

Definition at line 335 of file SecretKey.cpp.

◆ randomKeyPair()

std::pair< PublicKey, SecretKey > xrpl::randomKeyPair ( KeyType type)

Create a key pair using secure random numbers.

Definition at line 352 of file SecretKey.cpp.

◆ signDigest() [1/2]

Buffer xrpl::signDigest ( PublicKey const & pk,
SecretKey const & sk,
uint256 const & digest )

Generate a signature for a message digest.

This can only be used with secp256k1 since Ed25519's security properties come, in part, from how the message is hashed.

Definition at line 205 of file SecretKey.cpp.

◆ signDigest() [2/2]

Buffer xrpl::signDigest ( KeyType type,
SecretKey const & sk,
uint256 const & digest )

Definition at line 144 of file SecretKey.h.

◆ sign() [1/3]

Buffer xrpl::sign ( PublicKey const & pk,
SecretKey const & sk,
Slice const & message )

Generate a signature for a message.

With secp256k1 signatures, the data is first hashed with SHA512-Half, and the resulting digest is signed.

Definition at line 230 of file SecretKey.cpp.

◆ sign() [2/3]

Buffer xrpl::sign ( KeyType type,
SecretKey const & sk,
Slice const & message )

Definition at line 159 of file SecretKey.h.

◆ randomSeed()

Seed xrpl::randomSeed ( )

Create a seed using secure random numbers.

Definition at line 48 of file Seed.cpp.

◆ generateSeed()

Seed xrpl::generateSeed ( std::string const & passPhrase)

Generate a seed deterministically.

The algorithm is specific to the XRPL:

The seed is calculated as the first 128 bits
of the SHA512-Half of the string text excluding
any terminating null.
Note
This will not attempt to determine the format of the string (e.g. hex or base58).

Definition at line 58 of file Seed.cpp.

◆ parseBase58() [4/10]

template<>
std::optional< Seed > xrpl::parseBase58 ( std::string const & s)

Parse a Base58 encoded string into a seed.

Parse a Base58 encoded string into a seed.

Returns
std::nullopt if a parse error occurs

Definition at line 103 of file AccountID.cpp.

◆ parseGenericSeed()

std::optional< Seed > xrpl::parseGenericSeed ( std::string const & str,
bool rfc1751 = true )

Attempt to parse a string as a seed.

Parameters
strthe string to parse
rfc1751true if we should attempt RFC1751 style parsing (deprecated)

Definition at line 79 of file Seed.cpp.

◆ seedAs1751()

std::string xrpl::seedAs1751 ( Seed const & seed)

Encode a Seed in RFC1751 format.

Definition at line 116 of file Seed.cpp.

◆ toBase58() [4/4]

std::string xrpl::toBase58 ( Seed const & seed)

Format a seed as a Base58 string.

Definition at line 114 of file Seed.h.

◆ serializeBlob()

template<class Object>
Blob xrpl::serializeBlob ( Object const & o)

Serialize an object to a blob.

Definition at line 12 of file serialize.h.

◆ serializeHex()

std::string xrpl::serializeHex ( STObject const & o)

Serialize an object to a hex string.

Definition at line 21 of file serialize.h.

◆ fieldCode() [1/2]

int xrpl::fieldCode ( SerializedTypeID id,
int index )

Definition at line 107 of file SField.h.

◆ fieldCode() [2/2]

int xrpl::fieldCode ( int id,
int index )

Definition at line 114 of file SField.h.

◆ operator~() [2/2]

template<class T>
OptionaledField< T > xrpl::operator~ ( TypedField< T > const & f)

Definition at line 324 of file SField.h.

◆ sign() [3/3]

void xrpl::sign ( STObject & st,
HashPrefix const & prefix,
KeyType type,
SecretKey const & sk,
SF_VL const & sigField = sfSignature )

Sign an STObject.

Parameters
stObject to sign
prefixPrefix to insert before serialized object when hashing
typeSigning key type used to derive public key
skSigning secret key
sigFieldField in which to store the signature on the object. If not specified the value defaults to sfSignature.
Note
If a signature already exists, it is overwritten.

Definition at line 16 of file libxrpl/protocol/Sign.cpp.

◆ verify() [2/2]

bool xrpl::verify ( STObject const & st,
HashPrefix const & prefix,
PublicKey const & pk,
SF_VL const & sigField = sfSignature )

Returns true if STObject contains valid signature.

Parameters
stSigned object
prefixPrefix inserted before serialized object when hashing
pkPublic key for verifying signature
sigFieldObject's field containing the signature. If not specified the value defaults to sfSignature.

Definition at line 30 of file libxrpl/protocol/Sign.cpp.

◆ buildMultiSigningData()

Serializer xrpl::buildMultiSigningData ( STObject const & obj,
AccountID const & signingID )

Return a Serializer suitable for computing a multisigning TxnSignature.

Definition at line 73 of file libxrpl/protocol/Sign.cpp.

◆ startMultiSigningData()

Serializer xrpl::startMultiSigningData ( STObject const & obj)

Break the multi-signing hash computation into 2 parts for optimization.

We can optimize verifying multiple multisignatures by splitting the data building into two parts; o A large part that is shared by all of the computations. o A small part that is unique to each signer in the multisignature.

The following methods support that optimization:

  1. startMultiSigningData provides the large part which can be shared.
  2. finishMultiSigningData caps the passed in serializer with each signer's unique data.

Definition at line 81 of file libxrpl/protocol/Sign.cpp.

◆ finishMultiSigningData()

void xrpl::finishMultiSigningData ( AccountID const & signingID,
Serializer & s )

Definition at line 64 of file Sign.h.

◆ operator==() [16/31]

bool xrpl::operator== ( STAccount const & lhs,
STAccount const & rhs )

Definition at line 85 of file STAccount.h.

◆ operator<() [4/13]

auto xrpl::operator< ( STAccount const & lhs,
STAccount const & rhs )

Definition at line 90 of file STAccount.h.

◆ operator==() [17/31]

bool xrpl::operator== ( STAccount const & lhs,
AccountID const & rhs )

Definition at line 97 of file STAccount.h.

◆ operator<() [5/13]

auto xrpl::operator< ( STAccount const & lhs,
AccountID const & rhs )

Definition at line 102 of file STAccount.h.

◆ operator<() [6/13]

auto xrpl::operator< ( AccountID const & lhs,
STAccount const & rhs )

Definition at line 108 of file STAccount.h.

◆ amountFromQuality()

STAmount xrpl::amountFromQuality ( std::uint64_t rate)

Definition at line 895 of file STAmount.cpp.

◆ amountFromString()

STAmount xrpl::amountFromString ( Asset const & asset,
std::string const & amount )

Definition at line 907 of file STAmount.cpp.

◆ amountFromJson()

STAmount xrpl::amountFromJson ( SField const & name,
json::Value const & v )

Definition at line 916 of file STAmount.cpp.

◆ amountFromJsonNoThrow()

bool xrpl::amountFromJsonNoThrow ( STAmount & result,
json::Value const & jvSource )

Definition at line 1040 of file STAmount.cpp.

◆ toSTAmount() [8/8]

STAmount const & xrpl::toSTAmount ( STAmount const & a)

Definition at line 429 of file STAmount.h.

◆ isLegalNet()

bool xrpl::isLegalNet ( STAmount const & value)
nodiscard

Definition at line 598 of file STAmount.h.

◆ isLegalMPT()

bool xrpl::isLegalMPT ( STAmount const & value)
nodiscard

Definition at line 604 of file STAmount.h.

◆ hasInvalidAmount() [1/4]

bool xrpl::hasInvalidAmount ( STBase const & field,
beast::Journal j )
nodiscard

Definition at line 1172 of file STAmount.cpp.

◆ operator==() [18/31]

bool xrpl::operator== ( STAmount const & lhs,
STAmount const & rhs )

Definition at line 1061 of file STAmount.cpp.

◆ operator<() [7/13]

bool xrpl::operator< ( STAmount const & lhs,
STAmount const & rhs )

Definition at line 1067 of file STAmount.cpp.

◆ operator!=() [6/10]

bool xrpl::operator!= ( STAmount const & lhs,
STAmount const & rhs )

Definition at line 628 of file STAmount.h.

◆ operator>() [1/2]

bool xrpl::operator> ( STAmount const & lhs,
STAmount const & rhs )

Definition at line 634 of file STAmount.h.

◆ operator<=() [1/2]

bool xrpl::operator<= ( STAmount const & lhs,
STAmount const & rhs )

Definition at line 639 of file STAmount.h.

◆ operator>=() [1/2]

bool xrpl::operator>= ( STAmount const & lhs,
STAmount const & rhs )

Definition at line 646 of file STAmount.h.

◆ operator-() [4/5]

STAmount xrpl::operator- ( STAmount const & value)

Definition at line 1102 of file STAmount.cpp.

◆ operator+() [4/4]

STAmount xrpl::operator+ ( STAmount const & v1,
STAmount const & v2 )

Definition at line 372 of file STAmount.cpp.

◆ operator-() [5/5]

STAmount xrpl::operator- ( STAmount const & v1,
STAmount const & v2 )

Definition at line 397 of file STAmount.cpp.

◆ divide() [2/2]

STAmount xrpl::divide ( STAmount const & v1,
STAmount const & v2,
Asset const & asset )

Definition at line 1227 of file STAmount.cpp.

◆ multiply() [3/3]

STAmount xrpl::multiply ( STAmount const & v1,
STAmount const & v2,
Asset const & asset )

Definition at line 1272 of file STAmount.cpp.

◆ mulRound()

STAmount xrpl::mulRound ( STAmount const & v1,
STAmount const & v2,
Asset const & asset,
bool roundUp )

Definition at line 1555 of file STAmount.cpp.

◆ mulRoundStrict()

STAmount xrpl::mulRoundStrict ( STAmount const & v1,
STAmount const & v2,
Asset const & asset,
bool roundUp )

Definition at line 1561 of file STAmount.cpp.

◆ divRound()

STAmount xrpl::divRound ( STAmount const & v1,
STAmount const & v2,
Asset const & asset,
bool roundUp )

Definition at line 1646 of file STAmount.cpp.

◆ divRoundStrict()

STAmount xrpl::divRoundStrict ( STAmount const & v1,
STAmount const & v2,
Asset const & asset,
bool roundUp )

Definition at line 1652 of file STAmount.cpp.

◆ getRate()

std::uint64_t xrpl::getRate ( STAmount const & offerOut,
STAmount const & offerIn )

Definition at line 422 of file STAmount.cpp.

◆ roundToScale()

STAmount xrpl::roundToScale ( STAmount const & value,
std::int32_t scale,
Number::RoundingMode rounding = Number::getround() )
nodiscard

Round an arbitrary precision Amount to the precision of an STAmount that has a given exponent.

This is used to ensure that calculations involving IOU amounts do not collect dust beyond the precision of the reference value.

Parameters
valueThe value to be rounded
scaleAn exponent value to establish the precision limit of value. Should be larger than value.exponent().
roundingOptional Number rounding mode

Definition at line 1405 of file STAmount.cpp.

◆ roundToAsset() [1/2]

template<AssetType A>
void xrpl::roundToAsset ( A const & asset,
Number & value )

Round an arbitrary precision Number IN PLACE to the precision of a given Asset.

This is used to ensure that calculations do not collect dust for IOUs, or fractional amounts for the integral types XRP and MPT.

Parameters
assetThe relevant asset
valueThe lvalue to be rounded

Definition at line 722 of file STAmount.h.

◆ roundToAsset() [2/2]

template<AssetType A>
Number xrpl::roundToAsset ( A const & asset,
Number const & value,
std::int32_t scale,
Number::RoundingMode rounding = Number::getround() )
nodiscard

Round an arbitrary precision Number to the precision of a given Asset.

This is used to ensure that calculations do not collect dust beyond specified scale for IOUs, or fractional amounts for the integral types XRP and MPT.

Parameters
assetThe relevant asset
valueThe value to be rounded
scaleOnly relevant to IOU assets. An exponent value to establish the precision limit of value. Should be larger than value.exponent().
roundingOptional Number rounding mode

Definition at line 740 of file STAmount.h.

◆ isXRP() [6/7]

bool xrpl::isXRP ( STAmount const & amount)

Definition at line 758 of file STAmount.h.

◆ canAdd()

bool xrpl::canAdd ( STAmount const & a,
STAmount const & b )

Safely checks if two STAmount values can be added without overflow, underflow, or precision loss.

This function determines whether the addition of two STAmount objects is safe, depending on their type:

  • For XRP amounts, it checks for integer overflow and underflow.
  • For IOU amounts, it checks for acceptable precision loss.
  • For MPT amounts, it checks for overflow and underflow within 63-bit signed integer limits.
  • If either amount is zero, addition is always considered safe.
  • If the amounts are of different currencies or types, addition is not allowed.
Parameters
aThe first STAmount to add.
bThe second STAmount to add.
Returns
true if the addition is safe; false otherwise.

Definition at line 464 of file STAmount.cpp.

◆ canSubtract()

bool xrpl::canSubtract ( STAmount const & a,
STAmount const & b )

Determines if it is safe to subtract one STAmount from another.

This function checks whether subtracting amount b from amount a is valid, considering currency compatibility and underflow conditions for specific types.

  • Subtracting zero is always allowed.
  • Subtraction is only allowed between comparable currencies.
  • For XRP amounts, ensures no underflow or overflow occurs.
  • For IOU amounts, subtraction is always allowed (no underflow).
  • For MPT amounts, ensures no underflow or overflow occurs.
Parameters
aThe minuend (amount to subtract from).
bThe subtrahend (amount to subtract).
Returns
true if subtraction is allowed, false otherwise.

Definition at line 541 of file STAmount.cpp.

◆ scale()

int xrpl::scale ( Number const & number,
Asset const & asset )

Get the scale of a Number for a given asset.

"scale" is similar to "exponent", but from the perspective of STAmount, which has different rules and mantissa ranges for determining the exponent than Number.

Parameters
numberThe Number to get the scale of.
assetThe asset to use for determining the scale.
Returns
The scale of this Number for the given asset.

Definition at line 779 of file STAmount.h.

◆ toJson() [4/4]

template<typename T>
json::Value xrpl::toJson ( T const & t)

Definition at line 81 of file STBase.h.

◆ operator<<() [14/24]

std::ostream & xrpl::operator<< ( std::ostream & out,
STBase const & t )

Definition at line 140 of file STBase.cpp.

◆ currencyFromJson()

STCurrency xrpl::currencyFromJson ( SField const & name,
json::Value const & v )

Definition at line 88 of file STCurrency.cpp.

◆ operator==() [19/31]

bool xrpl::operator== ( STCurrency const & lhs,
STCurrency const & rhs )

Definition at line 87 of file STCurrency.h.

◆ operator!=() [7/10]

bool xrpl::operator!= ( STCurrency const & lhs,
STCurrency const & rhs )

Definition at line 93 of file STCurrency.h.

◆ operator<() [8/13]

bool xrpl::operator< ( STCurrency const & lhs,
STCurrency const & rhs )

Definition at line 98 of file STCurrency.h.

◆ operator==() [20/31]

bool xrpl::operator== ( STCurrency const & lhs,
Currency const & rhs )

Definition at line 105 of file STCurrency.h.

◆ operator<() [9/13]

bool xrpl::operator< ( STCurrency const & lhs,
Currency const & rhs )

Definition at line 110 of file STCurrency.h.

◆ get() [4/6]

template<class T, class U>
std::optional< T > xrpl::get ( STObject const & st,
TypedField< U > const & f )

Return the value of a field in an STObject as a given type.

Definition at line 96 of file STExchange.h.

◆ get() [5/6]

template<class U>
std::optional< typename STExchange< U, typename U::value_type >::value_type > xrpl::get ( STObject const & st,
TypedField< U > const & f )

Definition at line 115 of file STExchange.h.

◆ set() [3/5]

template<class U, class T>
void xrpl::set ( STObject & st,
TypedField< U > const & f,
T && t )

Set a field value in an STObject.

Definition at line 124 of file STExchange.h.

◆ set() [4/5]

template<class Init>
void xrpl::set ( STObject & st,
TypedField< STBlob > const & f,
std::size_t size,
Init && init )

Set a blob field using an init function.

Definition at line 132 of file STExchange.h.

◆ set() [5/5]

template<class = void>
void xrpl::set ( STObject & st,
TypedField< STBlob > const & f,
void const * data,
std::size_t size )

Set a blob field from data.

Definition at line 140 of file STExchange.h.

◆ erase()

template<class U>
void xrpl::erase ( STObject & st,
TypedField< U > const & f )

Remove a field in an STObject.

Definition at line 148 of file STExchange.h.

◆ issueFromJson() [2/2]

STIssue xrpl::issueFromJson ( SField const & name,
json::Value const & v )

Definition at line 135 of file STIssue.cpp.

◆ operator==() [21/31]

bool xrpl::operator== ( STIssue const & lhs,
STIssue const & rhs )
constexpr

Definition at line 126 of file STIssue.h.

◆ operator<=>() [6/7]

std::weak_ordering xrpl::operator<=> ( STIssue const & lhs,
STIssue const & rhs )
constexpr

Definition at line 131 of file STIssue.h.

◆ operator==() [22/31]

bool xrpl::operator== ( STIssue const & lhs,
Asset const & rhs )
constexpr

Definition at line 138 of file STIssue.h.

◆ operator<=>() [7/7]

std::weak_ordering xrpl::operator<=> ( STIssue const & lhs,
Asset const & rhs )
constexpr

Definition at line 143 of file STIssue.h.

◆ operator<<() [15/24]

std::ostream & xrpl::operator<< ( std::ostream & out,
STNumber const & rhs )

Definition at line 155 of file STNumber.cpp.

◆ partsFromString()

NumberParts xrpl::partsFromString ( std::string const & number)

Definition at line 162 of file STNumber.cpp.

◆ numberFromJson()

STNumber xrpl::numberFromJson ( SField const & field,
json::Value const & value )

Definition at line 222 of file STNumber.cpp.

◆ throwFieldNotFound()

void xrpl::throwFieldNotFound ( SField const & field)

Definition at line 31 of file STObject.h.

◆ associateAsset() [1/2]

void xrpl::associateAsset ( STLedgerEntry & sle,
Asset const & asset )

Associate an Asset with all sMD_NeedsAsset fields in a ledger entry.

This function iterates over all fields in the given ledger entry. For each field that is set and has the SField::sMD_NeedsAsset metadata flag, it calls associateAsset on that field with the given Asset. Such field must be derived from STTakesAsset - if it is not, the conversion will throw.

Typically, associateAsset should be called near the end of doApply() of any Transactor classes on the SLEs of any new or modified ledger entries containing STNumber fields, after doing all of the modifications t the SLEs.

Parameters
sleThe ledger entry whose fields will be updated.
assetThe Asset to associate with the relevant fields.

◆ passesLocalChecks()

bool xrpl::passesLocalChecks ( STObject const & st,
std::string & reason )

Definition at line 771 of file STTx.cpp.

◆ sterilize()

std::shared_ptr< STTx const > xrpl::sterilize ( STTx const & stx)

Sterilize a transaction.

The transaction is serialized and then deserialized, ensuring that all equivalent transactions are in canonical form. This also ensures that program metadata such as the transaction's digest, are all computed.

Definition at line 801 of file STTx.cpp.

◆ isPseudoTx()

bool xrpl::isPseudoTx ( STObject const & tx)

Check whether a transaction is a pseudo-transaction.

Definition at line 810 of file STTx.cpp.

◆ operator==() [23/31]

bool xrpl::operator== ( STXChainBridge const & lhs,
STXChainBridge const & rhs )

Definition at line 115 of file STXChainBridge.h.

◆ operator<() [10/13]

bool xrpl::operator< ( STXChainBridge const & lhs,
STXChainBridge const & rhs )

Definition at line 129 of file STXChainBridge.h.

◆ systemName()

std::string const & xrpl::systemName ( )
static

Definition at line 15 of file SystemParameters.h.

◆ isLegalAmount()

bool xrpl::isLegalAmount ( XRPAmount const & amount)

Returns true if the amount does not exceed the initial XRP in existence.

Definition at line 30 of file SystemParameters.h.

◆ isLegalAmountSigned()

bool xrpl::isLegalAmountSigned ( XRPAmount const & amount)

Returns true if the absolute value of the amount does not exceed the initial XRP in existence.

Definition at line 38 of file SystemParameters.h.

◆ systemCurrencyCode()

std::string const & xrpl::systemCurrencyCode ( )
static

Definition at line 45 of file SystemParameters.h.

◆ TERtoInt() [1/6]

TERUnderlyingType xrpl::TERtoInt ( TELcodes v)
constexpr

Definition at line 373 of file TER.h.

◆ TERtoInt() [2/6]

TERUnderlyingType xrpl::TERtoInt ( TEMcodes v)
constexpr

Definition at line 379 of file TER.h.

◆ TERtoInt() [3/6]

TERUnderlyingType xrpl::TERtoInt ( TEFcodes v)
constexpr

Definition at line 385 of file TER.h.

◆ TERtoInt() [4/6]

TERUnderlyingType xrpl::TERtoInt ( TERcodes v)
constexpr

Definition at line 391 of file TER.h.

◆ TERtoInt() [5/6]

TERUnderlyingType xrpl::TERtoInt ( TEScodes v)
constexpr

Definition at line 397 of file TER.h.

◆ TERtoInt() [6/6]

TERUnderlyingType xrpl::TERtoInt ( TECcodes v)
constexpr

Definition at line 403 of file TER.h.

◆ operator==() [24/31]

template<typename L, typename R>
auto xrpl::operator== ( L const & lhs,
R const & rhs ) -> std::enable_if_t< std::is_same_v< decltype(TERtoInt(lhs)), int > &&std::is_same_v< decltype(TERtoInt(rhs)), int >, bool >
constexpr

Definition at line 507 of file TER.h.

◆ operator!=() [8/10]

template<typename L, typename R>
auto xrpl::operator!= ( L const & lhs,
R const & rhs ) -> std::enable_if_t< std::is_same_v< decltype(TERtoInt(lhs)), int > &&std::is_same_v< decltype(TERtoInt(rhs)), int >, bool >
constexpr

Definition at line 516 of file TER.h.

◆ operator<() [11/13]

template<typename L, typename R>
auto xrpl::operator< ( L const & lhs,
R const & rhs ) -> std::enable_if_t< std::is_same_v< decltype(TERtoInt(lhs)), int > &&std::is_same_v< decltype(TERtoInt(rhs)), int >, bool >
constexpr

Definition at line 524 of file TER.h.

◆ operator<=() [2/2]

template<typename L, typename R>
auto xrpl::operator<= ( L const & lhs,
R const & rhs ) -> std::enable_if_t< std::is_same_v< decltype(TERtoInt(lhs)), int > &&std::is_same_v< decltype(TERtoInt(rhs)), int >, bool >
constexpr

Definition at line 533 of file TER.h.

◆ operator>() [2/2]

template<typename L, typename R>
auto xrpl::operator> ( L const & lhs,
R const & rhs ) -> std::enable_if_t< std::is_same_v< decltype(TERtoInt(lhs)), int > &&std::is_same_v< decltype(TERtoInt(rhs)), int >, bool >
constexpr

Definition at line 543 of file TER.h.

◆ operator>=() [2/2]

template<typename L, typename R>
auto xrpl::operator>= ( L const & lhs,
R const & rhs ) -> std::enable_if_t< std::is_same_v< decltype(TERtoInt(lhs)), int > &&std::is_same_v< decltype(TERtoInt(rhs)), int >, bool >
constexpr

Definition at line 552 of file TER.h.

◆ isTelLocal()

bool xrpl::isTelLocal ( TER x)
noexcept

Definition at line 639 of file TER.h.

◆ isTemMalformed()

bool xrpl::isTemMalformed ( TER x)
noexcept

Definition at line 645 of file TER.h.

◆ isTefFailure()

bool xrpl::isTefFailure ( TER x)
noexcept

Definition at line 651 of file TER.h.

◆ isTerRetry()

bool xrpl::isTerRetry ( TER x)
noexcept

Definition at line 657 of file TER.h.

◆ isTesSuccess()

bool xrpl::isTesSuccess ( TER x)
noexcept

Definition at line 663 of file TER.h.

◆ isTecClaim()

bool xrpl::isTecClaim ( TER x)
noexcept

Definition at line 670 of file TER.h.

◆ transResults()

std::unordered_map< TERUnderlyingType, std::pair< char const *const, char const *const > > const & xrpl::transResults ( )

Definition at line 14 of file TER.cpp.

◆ transResultInfo()

bool xrpl::transResultInfo ( TER code,
std::string & token,
std::string & text )

Definition at line 232 of file TER.cpp.

◆ transToken()

std::string xrpl::transToken ( TER code)

Definition at line 247 of file TER.cpp.

◆ transHuman()

std::string xrpl::transHuman ( TER code)

Definition at line 256 of file TER.cpp.

◆ transCode()

std::optional< TER > xrpl::transCode ( std::string const & token)

Definition at line 265 of file TER.cpp.

◆ parseBase58() [5/10]

template<class T>
std::optional< T > xrpl::parseBase58 ( std::string const & s)
nodiscard

◆ parseBase58() [6/10]

template<class T>
std::optional< T > xrpl::parseBase58 ( TokenType type,
std::string const & s )
nodiscard

◆ encodeBase58Token()

std::string xrpl::encodeBase58Token ( TokenType type,
void const * token,
std::size_t size )
nodiscard

Encode data in Base58Check format using XRPL alphabet.

For details on the format see https://xrpl.org/base58-encodings.html#base58-encodings

Parameters
typeThe type of token to encode.
tokenPointer to the data to encode.
sizeThe size of the data to encode.
Returns
the encoded token.

Definition at line 178 of file tokens.cpp.

◆ decodeBase58Token()

std::string xrpl::decodeBase58Token ( std::string const & s,
TokenType type )
nodiscard

Definition at line 188 of file tokens.cpp.

◆ getUniversalFlags()

FlagMap const & xrpl::getUniversalFlags ( )

Definition at line 286 of file TxFlags.h.

◆ getAllTxFlags()

FlagMapPairList const & xrpl::getAllTxFlags ( )

Definition at line 306 of file TxFlags.h.

◆ getAsfFlagMap()

std::map< std::string, FlagValue > const & xrpl::getAsfFlagMap ( )

Definition at line 432 of file TxFlags.h.

◆ xrpCurrency()

Currency const & xrpl::xrpCurrency ( )

XRP currency.

Definition at line 99 of file UintTypes.cpp.

◆ noCurrency()

Currency const & xrpl::noCurrency ( )

A placeholder for empty currencies.

Definition at line 106 of file UintTypes.cpp.

◆ badCurrency()

Currency const & xrpl::badCurrency ( )

We deliberately disallow the currency that looks like "XRP" because too many people were using it instead of the correct XRP currency.

Definition at line 113 of file UintTypes.cpp.

◆ isXRP() [7/7]

bool xrpl::isXRP ( Currency const & c)

Definition at line 63 of file UintTypes.h.

◆ to_string() [22/32]

std::string xrpl::to_string ( Currency const & c)

Returns "", "XRP", or three letter ISO code.

Definition at line 36 of file UintTypes.cpp.

◆ toCurrency() [1/2]

bool xrpl::toCurrency ( Currency & currency,
std::string const & code )

Tries to convert a string to a Currency, returns true on success.

Note
This function will return success if the resulting currency is badCurrency(). This legacy behavior is unfortunate; changing this will require very careful checking everywhere and may mean having to rewrite some unit test code.

Definition at line 65 of file UintTypes.cpp.

◆ toCurrency() [2/2]

Currency xrpl::toCurrency ( std::string const & code)

Tries to convert a string to a Currency, returns noCurrency() on failure.

Note
This function can return badCurrency(). This legacy behavior is unfortunate; changing this will require very careful checking everywhere and may mean having to rewrite some unit test code.

Definition at line 90 of file UintTypes.cpp.

◆ operator<<() [16/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
Currency const & x )

Definition at line 91 of file UintTypes.h.

◆ mulDiv() [2/7]

template<class Source1, class Source2, unit::muldivable< Source1, Source2 > Dest>
std::optional< Dest > xrpl::mulDiv ( Source1 value,
Dest mul,
Source2 div )

Definition at line 443 of file Units.h.

◆ mulDiv() [3/7]

template<class Source1, class Source2, unit::muldivCommutable< Source1, Source2 > Dest>
std::optional< Dest > xrpl::mulDiv ( Dest value,
Source1 mul,
Source2 div )

Definition at line 450 of file Units.h.

◆ mulDiv() [4/7]

template<unit::muldivDest Dest>
std::optional< Dest > xrpl::mulDiv ( std::uint64_t value,
Dest mul,
std::uint64_t div )

Definition at line 458 of file Units.h.

◆ mulDiv() [5/7]

template<unit::muldivDest Dest>
std::optional< Dest > xrpl::mulDiv ( Dest value,
std::uint64_t mul,
std::uint64_t div )

Definition at line 467 of file Units.h.

◆ mulDiv() [6/7]

template<unit::muldivSource Source1, unit::muldivSources< Source1 > Source2>
std::optional< std::uint64_t > xrpl::mulDiv ( Source1 value,
std::uint64_t mul,
Source2 div )

Definition at line 475 of file Units.h.

◆ mulDiv() [7/7]

template<unit::muldivSource Source1, unit::muldivSources< Source1 > Source2>
std::optional< std::uint64_t > xrpl::mulDiv ( std::uint64_t value,
Source1 mul,
Source2 div )

Definition at line 489 of file Units.h.

◆ safeCast() [4/5]

template<unit::IntegralValue Dest, unit::CastableValue< Dest > Src>
Dest xrpl::safeCast ( Src s)
constexprnoexcept

Definition at line 497 of file Units.h.

◆ safeCast() [5/5]

template<unit::IntegralValue Dest, unit::Integral Src>
Dest xrpl::safeCast ( Src s)
constexprnoexcept

Definition at line 505 of file Units.h.

◆ unsafeCast() [4/5]

template<unit::IntegralValue Dest, unit::CastableValue< Dest > Src>
Dest xrpl::unsafeCast ( Src s)
constexprnoexcept

Definition at line 513 of file Units.h.

◆ unsafeCast() [5/5]

template<unit::IntegralValue Dest, unit::Integral Src>
Dest xrpl::unsafeCast ( Src s)
constexprnoexcept

Definition at line 521 of file Units.h.

◆ operator==() [25/31]

template<class TAttestation>
bool xrpl::operator== ( XChainAttestationsBase< TAttestation > const & lhs,
XChainAttestationsBase< TAttestation > const & rhs )
nodiscard

Definition at line 414 of file XChainAttestations.h.

◆ operator<<() [17/24]

template<class Char, class Traits>
std::basic_ostream< Char, Traits > & xrpl::operator<< ( std::basic_ostream< Char, Traits > & os,
XRPAmount const & q )

Definition at line 243 of file XRPAmount.h.

◆ to_string() [23/32]

std::string xrpl::to_string ( XRPAmount const & amount)

Definition at line 257 of file XRPAmount.h.

◆ mulRatio() [3/3]

XRPAmount xrpl::mulRatio ( XRPAmount const & amt,
std::uint32_t num,
std::uint32_t den,
bool roundUp )

Definition at line 263 of file XRPAmount.h.

◆ checkpointerFromId()

std::shared_ptr< Checkpointer > xrpl::checkpointerFromId ( std::uintptr_t id)

Definition at line 64 of file DatabaseCon.cpp.

◆ rangeCheckedCast()

template<typename T, typename C>
requires (std::is_arithmetic_v<T> && std::is_arithmetic_v<C> && std::convertible_to<C, T>)
T xrpl::rangeCheckedCast ( C c)

Definition at line 460 of file RelationalDatabase.h.

◆ open() [1/2]

void xrpl::open ( soci::session & s,
BasicConfig const & config,
std::string const & dbName )

Open a soci session.

Parameters
sSession to open.
configParameters to pick the soci backend and how to connect to that backend.
dbNameName of the database. This has different meaning for different backends. Sometimes it is part of a filename (sqlite3), other times it is a database name (postgresql).

Definition at line 92 of file SociDB.cpp.

◆ open() [2/2]

void xrpl::open ( soci::session & s,
std::string const & beName,
std::string const & connectionString )

Open a soci session.

Parameters
sSession to open.
beNameBackend name.
connectionStringConnection string to forward to soci::open. see the soci::open documentation for how to use this.

Definition at line 98 of file SociDB.cpp.

◆ getKBUsedAll()

std::uint32_t xrpl::getKBUsedAll ( soci::session & s)

Definition at line 125 of file SociDB.cpp.

◆ getKBUsedDB()

std::uint32_t xrpl::getKBUsedDB ( soci::session & s)

Definition at line 133 of file SociDB.cpp.

◆ convert() [1/4]

void xrpl::convert ( soci::blob & from,
std::vector< std::uint8_t > & to )

Definition at line 147 of file SociDB.cpp.

◆ convert() [2/4]

void xrpl::convert ( soci::blob & from,
std::string & to )

Definition at line 156 of file SociDB.cpp.

◆ convert() [3/4]

void xrpl::convert ( std::vector< std::uint8_t > const & from,
soci::blob & to )

Definition at line 164 of file SociDB.cpp.

◆ convert() [4/4]

void xrpl::convert ( std::string const & from,
soci::blob & to )

Definition at line 177 of file SociDB.cpp.

◆ makeCheckpointer()

std::shared_ptr< Checkpointer > xrpl::makeCheckpointer ( std::uintptr_t id,
std::weak_ptr< soci::session > session,
JobQueue & queue,
ServiceRegistry & registry )

Returns a new checkpointer which makes checkpoints of a soci database every checkpointPageCount pages, using a job on the job queue.

The checkpointer contains references to the session and job queue and so must outlive them both.

Definition at line 327 of file SociDB.cpp.

◆ httpReply()

void xrpl::httpReply ( int nStatus,
std::string const & strMsg,
json::Output const & output,
beast::Journal j )

Definition at line 34 of file JSONRPCUtil.cpp.

◆ getLowestLayer()

template<class T>
decltype(auto) xrpl::getLowestLayer ( T & t)
noexcept

Definition at line 14 of file LowestLayer.h.

◆ scaleFeeLoad()

XRPAmount xrpl::scaleFeeLoad ( XRPAmount fee,
LoadFeeTrack const & feeTrack,
Fees const & fees,
bool bUnlimited )

Definition at line 64 of file LoadFeeTrack.cpp.

◆ to_string() [24/32]

std::string xrpl::to_string ( Manifest const & m)

Format the specified manifest to a string for debugging purposes.

Definition at line 45 of file libxrpl/server/Manifest.cpp.

◆ deserializeManifest() [1/3]

std::optional< Manifest > xrpl::deserializeManifest ( Slice s,
beast::Journal journal )

Constructs Manifest from serialized string.

Parameters
sSerialized manifest string
Returns
std::nullopt if string is invalid
Note
This does not verify manifest signatures. Manifest::verify should be called after constructing manifest.

Definition at line 60 of file libxrpl/server/Manifest.cpp.

◆ deserializeManifest() [2/3]

std::optional< Manifest > xrpl::deserializeManifest ( std::string const & s,
beast::Journal journal = beast::Journal(beast::Journal::getNullSink()) )

Definition at line 149 of file Manifest.h.

◆ deserializeManifest() [3/3]

template<class T, class = std::enable_if_t<std::is_same_v<T, char> || std::is_same_v<T, unsigned char>>>
std::optional< Manifest > xrpl::deserializeManifest ( std::vector< T > const & v,
beast::Journal journal = beast::Journal(beast::Journal::getNullSink()) )

Definition at line 160 of file Manifest.h.

◆ operator==() [26/31]

bool xrpl::operator== ( Manifest const & lhs,
Manifest const & rhs )

Definition at line 169 of file Manifest.h.

◆ operator!=() [9/10]

bool xrpl::operator!= ( Manifest const & lhs,
Manifest const & rhs )

Definition at line 179 of file Manifest.h.

◆ loadValidatorToken()

std::optional< ValidatorToken > xrpl::loadValidatorToken ( std::vector< std::string > const & blob,
beast::Journal journal = beast::Journal(beast::Journal::getNullSink()) )

Definition at line 261 of file libxrpl/server/Manifest.cpp.

◆ to_string() [25/32]

std::string xrpl::to_string ( ManifestDisposition m)

Definition at line 213 of file Manifest.h.

◆ operator<<() [18/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
Port const & p )

Definition at line 43 of file Port.cpp.

◆ parsePort()

void xrpl::parsePort ( ParsedPort & port,
Section const & section,
std::ostream & log )

Definition at line 195 of file Port.cpp.

◆ makeServer()

template<class Handler>
std::unique_ptr< Server > xrpl::makeServer ( Handler & handler,
boost::asio::io_context & ioContext,
beast::Journal journal )

Create the HTTP server using the specified handler.

Definition at line 15 of file Server.h.

◆ initStateDB()

void xrpl::initStateDB ( soci::session & session,
BasicConfig const & config,
std::string const & dbName )

initStateDB Opens a session with the State database.

Parameters
sessionProvides a session with the database.
configPath to the database and other opening parameters.
dbNameName of the database.

Definition at line 21 of file State.cpp.

◆ getCanDelete()

LedgerIndex xrpl::getCanDelete ( soci::session & session)

getCanDelete Returns the ledger sequence which can be deleted.

Parameters
sessionSession with the database.
Returns
Ledger sequence.

Definition at line 70 of file State.cpp.

◆ setCanDelete()

LedgerIndex xrpl::setCanDelete ( soci::session & session,
LedgerIndex canDelete )

setCanDelete Updates the ledger sequence which can be deleted.

Parameters
sessionSession with the database.
canDeleteLedger sequence to save.
Returns
Previous value of the ledger sequence which can be deleted.

Definition at line 79 of file State.cpp.

◆ getSavedState()

SavedState xrpl::getSavedState ( soci::session & session)

getSavedState Returns the saved state.

Parameters
sessionSession with the database.
Returns
The SavedState structure which contains the names of the writable database, the archive database and the last rotated ledger sequence.

Definition at line 87 of file State.cpp.

◆ setSavedState()

void xrpl::setSavedState ( soci::session & session,
SavedState const & state )

setSavedState Saves the given state.

Parameters
sessionSession with the database.
stateThe SavedState structure which contains the names of the writable database, the archive database and the last rotated ledger sequence.

Definition at line 98 of file State.cpp.

◆ setLastRotated()

void xrpl::setLastRotated ( soci::session & session,
LedgerIndex seq )

setLastRotated Updates the last rotated ledger sequence.

Parameters
sessionSession with the database.
seqNew value of the last rotated ledger sequence.

Definition at line 109 of file State.cpp.

◆ doVacuumDB()

bool xrpl::doVacuumDB ( DatabaseCon::Setup const & setup,
beast::Journal j )

doVacuumDB Creates, initialises, and performs cleanup on a database.

Parameters
setupPath to the database and other opening parameters.
jJournal.
Returns
True if the vacuum process completed successfully.

Definition at line 21 of file Vacuum.cpp.

◆ makeWalletDB()

std::unique_ptr< DatabaseCon > xrpl::makeWalletDB ( DatabaseCon::Setup const & setup,
beast::Journal j )

makeWalletDB Opens the wallet database and returns it.

Parameters
setupPath to the database and other opening parameters.
jJournal.
Returns
Unique pointer to the database descriptor.

Definition at line 39 of file Wallet.cpp.

◆ makeTestWalletDB()

std::unique_ptr< DatabaseCon > xrpl::makeTestWalletDB ( DatabaseCon::Setup const & setup,
std::string const & dbname,
beast::Journal j )

makeTestWalletDB Opens a test wallet database with an arbitrary name.

Parameters
setupPath to the database and other opening parameters.
dbnameName of the database.
jJournal.
Returns
Unique pointer to the database descriptor.

Definition at line 47 of file Wallet.cpp.

◆ getManifests()

void xrpl::getManifests ( soci::session & session,
std::string const & dbTable,
ManifestCache & cache,
beast::Journal j )

getManifests Loads a manifest from the wallet database and stores it in the cache.

Parameters
sessionSession with the database.
dbTableName of the database table from which the manifest will be extracted.
cache_Cache for storing the manifest.
jJournal.

Definition at line 55 of file Wallet.cpp.

◆ saveManifests()

void xrpl::saveManifests ( soci::session & session,
std::string const & dbTable,
std::function< bool(PublicKey const &)> const & isTrusted,
hash_map< PublicKey, Manifest > const & map,
beast::Journal j )

saveManifests Saves all given manifests to the database.

Parameters
sessionSession with the database.
dbTableName of the database table that will store the manifest.
isTrustedCallback that returns true if the key is trusted.
mapMaps public keys to manifests.
jJournal.

Definition at line 99 of file Wallet.cpp.

◆ addValidatorManifest()

void xrpl::addValidatorManifest ( soci::session & session,
std::string const & serialized )

addValidatorManifest Saves the manifest of a validator to the database.

Parameters
sessionSession with the database.
serializedManifest of the validator in raw format.

Definition at line 124 of file Wallet.cpp.

◆ clearNodeIdentity()

void xrpl::clearNodeIdentity ( soci::session & session)

Delete any saved public/private key associated with this node.

Definition at line 132 of file Wallet.cpp.

◆ getNodeIdentity() [1/2]

std::pair< PublicKey, SecretKey > xrpl::getNodeIdentity ( soci::session & session)

Returns a stable public and private key for this node.

The node's public identity is defined by a secp256k1 keypair that is (normally) randomly generated. This function will return such a keypair, securely generating one if needed.

Parameters
sessionSession with the database.
Returns
Pair of public and private secp256k1 keys.

Definition at line 138 of file Wallet.cpp.

◆ getPeerReservationTable()

std::unordered_set< PeerReservation, beast::Uhash<>, KeyEqual > xrpl::getPeerReservationTable ( soci::session & session,
beast::Journal j )

getPeerReservationTable Returns the peer reservation table.

Parameters
sessionSession with the database.
jJournal.
Returns
Peer reservation hash table.

Definition at line 173 of file Wallet.cpp.

◆ insertPeerReservation()

void xrpl::insertPeerReservation ( soci::session & session,
PublicKey const & nodeId,
std::string const & description )

insertPeerReservation Adds an entry to the peer reservation table.

Parameters
sessionSession with the database.
nodeIdPublic key of the node.
descriptionDescription of the node.

Definition at line 208 of file Wallet.cpp.

◆ deletePeerReservation()

void xrpl::deletePeerReservation ( soci::session & session,
PublicKey const & nodeId )

deletePeerReservation Deletes an entry from the peer reservation table.

Parameters
sessionSession with the database.
nodeIdPublic key of the node to remove.

Definition at line 222 of file Wallet.cpp.

◆ createFeatureVotes()

bool xrpl::createFeatureVotes ( soci::session & session)

createFeatureVotes Creates the FeatureVote table if it does not exist.

Parameters
sessionSession with the wallet database.
Returns
true if the table already exists

Definition at line 229 of file Wallet.cpp.

◆ readAmendments()

void xrpl::readAmendments ( soci::session & session,
std::function< void(boost::optional< std::string > amendmentHash, boost::optional< std::string > amendmentName, boost::optional< AmendmentVote > vote)> const & callback )

readAmendments Reads all amendments from the FeatureVotes table.

Parameters
sessionSession with the wallet database.
callbackCallback called for each amendment with its hash, name and optionally a flag denoting whether the amendment should be vetoed.

Definition at line 253 of file Wallet.cpp.

◆ voteAmendment()

void xrpl::voteAmendment ( soci::session & session,
uint256 const & amendment,
std::string const & name,
AmendmentVote vote )

voteAmendment Set the veto value for a particular amendment.

Parameters
sessionSession with the wallet database.
amendmentHash of the amendment.
nameName of the amendment.
voteWhether to vote in favor of this amendment.

Definition at line 288 of file Wallet.cpp.

◆ popcnt16()

int xrpl::popcnt16 ( std::uint16_t a)
nodiscard

Definition at line 200 of file TaggedPointer.h.

◆ operator==() [27/31]

bool xrpl::operator== ( SHAMap::ConstIterator const & x,
SHAMap::ConstIterator const & y )

Definition at line 675 of file SHAMap.h.

◆ operator!=() [10/10]

bool xrpl::operator!= ( SHAMap::ConstIterator const & x,
SHAMap::ConstIterator const & y )

Definition at line 685 of file SHAMap.h.

◆ intrusive_ptr_add_ref()

void xrpl::intrusive_ptr_add_ref ( SHAMapItem const * x)

Definition at line 110 of file SHAMapItem.h.

◆ intrusive_ptr_release()

void xrpl::intrusive_ptr_release ( SHAMapItem const * x)

Definition at line 119 of file SHAMapItem.h.

◆ makeShamapitem() [1/2]

boost::intrusive_ptr< SHAMapItem > xrpl::makeShamapitem ( uint256 const & tag,
Slice data )

Definition at line 139 of file SHAMapItem.h.

◆ makeShamapitem() [2/2]

boost::intrusive_ptr< SHAMapItem > xrpl::makeShamapitem ( SHAMapItem const & other)

Definition at line 163 of file SHAMapItem.h.

◆ to_string() [26/32]

std::string xrpl::to_string ( SHAMapType t)

Definition at line 20 of file SHAMapMissingNode.h.

◆ to_string() [27/32]

std::string xrpl::to_string ( SHAMapNodeID const & node)

Definition at line 104 of file SHAMapNodeID.h.

◆ operator<<() [19/24]

std::ostream & xrpl::operator<< ( std::ostream & out,
SHAMapNodeID const & node )

Definition at line 112 of file SHAMapNodeID.h.

◆ deserializeSHAMapNodeID() [1/2]

std::optional< SHAMapNodeID > xrpl::deserializeSHAMapNodeID ( void const * data,
std::size_t size )
nodiscard

Return an object representing a serialized SHAMap Node ID.

Parameters
sA string of bytes
dataa non-null pointer to a buffer of
sizebytes.
sizethe size, in bytes, of the buffer pointed to by
data.
Returns
A seated optional if the buffer contained a serialized SHAMap node ID and an unseated optional otherwise.

Definition at line 91 of file SHAMapNodeID.cpp.

◆ deserializeSHAMapNodeID() [2/2]

std::optional< SHAMapNodeID > xrpl::deserializeSHAMapNodeID ( std::string_view s)
nodiscard

Definition at line 131 of file SHAMapNodeID.h.

◆ selectBranch()

unsigned int xrpl::selectBranch ( SHAMapNodeID const & id,
uint256 const & hash )
nodiscard

Returns the branch that would contain the given hash.

Definition at line 111 of file SHAMapNodeID.cpp.

◆ checkValidity()

std::pair< Validity, std::string > xrpl::checkValidity ( HashRouter & router,
STTx const & tx,
Rules const & rules )

Checks transaction signature and local checks.

Returns
A Validity enum representing how valid the STTx is and, if not Valid, a reason string.
Note
Results are cached internally, so tests will not be repeated over repeated calls, unless cache expires.
Returns
std::pair, where .first is the status, and .second is the reason if appropriate.
See also
Validity

Definition at line 37 of file apply.cpp.

◆ forceValidity()

void xrpl::forceValidity ( HashRouter & router,
uint256 const & txid,
Validity validity )

Sets the validity of a given transaction in the cache.

Warning
Use with extreme care.
Note
Can only raise the validity to a more valid state, and can not override anything cached bad.
See also
checkValidity, Validity

Definition at line 112 of file apply.cpp.

◆ apply() [1/3]

ApplyResult xrpl::apply ( ServiceRegistry & registry,
OpenView & view,
STTx const & tx,
ApplyFlags flags,
beast::Journal journal )

Apply a transaction to an OpenView.

This function is the canonical way to apply a transaction to a ledger. It rolls the validation and application steps into one function. To do the steps manually, the correct calling order is:

PreflightResult preflight(ServiceRegistry &registry, Rules const &rules, STTx const &tx, ApplyFlags flags, beast::Journal j)
Gate a transaction based on static information.
PreclaimResult preclaim(PreflightResult const &preflightResult, ServiceRegistry &registry, OpenView const &view)
Gate a transaction based on static ledger information.
ApplyResult doApply(PreclaimResult const &preclaimResult, ServiceRegistry &registry, OpenView &view)
Apply a prechecked transaction to an OpenView.

The result of one function must be passed to the next. The preflight result can be safely cached and reused asynchronously, but preclaim and doApply must be called in the same thread and with the same view.

Note
Does not throw.

For open ledgers, the Transactor will catch exceptions and return tefEXCEPTION. For closed ledgers, the Transactor will attempt to only charge a fee, and return tecFAILED_PROCESSING.

If the Transactor gets an exception while trying to charge the fee, it will be caught and turned into tefEXCEPTION.

For network health, a Transactor makes its best effort to at least charge a fee if the ledger is closed.

Parameters
appThe current running Application.
viewThe open ledger that the transaction will attempt to be applied to.
txThe transaction to be checked.
flagsApplyFlags describing processing options.
journalA journal.
See also
preflight, preclaim, doApply
Returns
A pair with the TER and a bool indicating whether or not the transaction was applied.

Definition at line 139 of file apply.cpp.

◆ applyTransaction()

ApplyTransactionResult xrpl::applyTransaction ( ServiceRegistry & registry,
OpenView & view,
STTx const & tx,
bool retryAssured,
ApplyFlags flags,
beast::Journal journal )

Transaction application helper.

Provides more detailed logging and decodes the correct behavior based on the TER type

See also
ApplyTransactionResult

Definition at line 222 of file apply.cpp.

◆ isTecClaimHardFail()

bool xrpl::isTecClaimHardFail ( TER ter,
ApplyFlags flags )

Return true if the transaction can claim a fee (tec), and the ApplyFlags do not allow soft failures.

Definition at line 28 of file applySteps.h.

◆ preflight() [1/2]

PreflightResult xrpl::preflight ( ServiceRegistry & registry,
Rules const & rules,
STTx const & tx,
ApplyFlags flags,
beast::Journal j )

Gate a transaction based on static information.

The transaction is checked against all possible validity constraints that do not require a ledger.

Parameters
appThe current running Application.
rulesThe Rules in effect at the time of the check.
txThe transaction to be checked.
flagsApplyFlags describing processing options.
jA journal.
See also
PreflightResult, preclaim, doApply, apply
Returns
A PreflightResult object containing, among other things, the TER code.

Definition at line 316 of file applySteps.cpp.

◆ preflight() [2/2]

PreflightResult xrpl::preflight ( ServiceRegistry & registry,
Rules const & rules,
uint256 const & parentBatchId,
STTx const & tx,
ApplyFlags flags,
beast::Journal j )

Definition at line 336 of file applySteps.cpp.

◆ preclaim()

PreclaimResult xrpl::preclaim ( PreflightResult const & preflightResult,
ServiceRegistry & registry,
OpenView const & view )

Gate a transaction based on static ledger information.

The transaction is checked against all possible validity constraints that DO require a ledger.

If preclaim succeeds, then the transaction is very likely to claim a fee. This will determine if the transaction is safe to relay without being applied to the open ledger.

"Succeeds" in this case is defined as returning a tes or tec, since both lead to claiming a fee.

Precondition
The transaction has been checked and validated using preflight
Parameters
preflightResultThe result of a previous call to preflight for the transaction.
appThe current running Application.
viewThe open ledger that the transaction will attempt to be applied to.
See also
PreclaimResult, preflight, doApply, apply
Returns
A PreclaimResult object containing, among other things the TER code and the base fee value for this transaction.

Definition at line 357 of file applySteps.cpp.

◆ calculateBaseFee()

XRPAmount xrpl::calculateBaseFee ( ReadView const & view,
STTx const & tx )

Compute only the expected base fee for a transaction.

Base fees are transaction specific, so any calculation needing them must get the base fee for each transaction.

No validation is done or implied by this function.

Caller is responsible for handling any exceptions. Since none should be thrown, that will usually mean terminating.

Parameters
viewThe current open ledger.
txThe transaction to be checked.
Returns
The base fee.

Definition at line 417 of file applySteps.cpp.

◆ calculateDefaultBaseFee()

XRPAmount xrpl::calculateDefaultBaseFee ( ReadView const & view,
STTx const & tx )

Return the minimum fee that an "ordinary" transaction would pay.

When computing the FeeLevel for a transaction the TxQ sometimes needs the know what an "ordinary" or reference transaction would be required to pay.

Parameters
viewThe current open ledger.
txThe transaction so the correct multisigner count is used.
Returns
The base fee in XRPAmount.

Definition at line 423 of file applySteps.cpp.

◆ doApply()

ApplyResult xrpl::doApply ( PreclaimResult const & preclaimResult,
ServiceRegistry & registry,
OpenView & view )

Apply a prechecked transaction to an OpenView.

Precondition
The transaction has been checked and validated using preflight and preclaim
Parameters
preclaimResultThe result of a previous call to preclaim for the transaction.
registryThe service registry.
viewThe open ledger that the transaction will attempt to be applied to.
See also
preflight, preclaim, apply
Returns
A pair with the TER and a bool indicating whether or not the transaction was applied.

Definition at line 429 of file applySteps.cpp.

◆ getInvariantChecks()

InvariantChecks xrpl::getInvariantChecks ( )

get a tuple of all invariant checks

Returns
std::tuple of instances that implement the required invariant check methods
See also
xrpl::InvariantChecker_PROTOTYPE

Definition at line 430 of file InvariantCheck.h.

◆ operator|() [4/4]

Privilege xrpl::operator| ( Privilege lhs,
Privilege rhs )
constexpr

Definition at line 53 of file InvariantCheckPrivilege.h.

◆ hasPrivilege()

bool xrpl::hasPrivilege ( STTx const & tx,
Privilege priv )

Definition at line 51 of file InvariantCheck.cpp.

◆ get() [6/6]

template<StepAmount T>
T const & xrpl::get ( EitherAmount const & amt)

Definition at line 49 of file EitherAmount.h.

◆ setUnion()

template<class T>
void xrpl::setUnion ( boost::container::flat_set< T > & dst,
boost::container::flat_set< T > const & src )

Given two flat sets dst and src, compute dst = dst union src.

Parameters
dstset to store the resulting union, and also a source of elements for the union
srcsecond source of elements for the union

Definition at line 15 of file FlatSets.h.

◆ checkFreeze()

TER xrpl::checkFreeze ( ReadView const & view,
AccountID const & src,
AccountID const & dst,
Currency const & currency )

Definition at line 13 of file StepChecks.h.

◆ checkNoRipple()

TER xrpl::checkNoRipple ( ReadView const & view,
AccountID const & prev,
AccountID const & cur,
AccountID const & next,
Currency const & currency,
beast::Journal j )

Definition at line 64 of file StepChecks.h.

◆ redeems()

bool xrpl::redeems ( DebtDirection dir)

Definition at line 27 of file Steps.h.

◆ issues()

bool xrpl::issues ( DebtDirection dir)

Definition at line 33 of file Steps.h.

◆ normalizePath()

std::pair< TER, STPath > xrpl::normalizePath ( AccountID const & src,
AccountID const & dst,
Asset const & deliver,
std::optional< Asset > const & sendMaxAsset,
STPath const & path )

◆ toStrand()

std::pair< TER, Strand > xrpl::toStrand ( ReadView const & sb,
AccountID const & src,
AccountID const & dst,
Asset const & deliver,
std::optional< Quality > const & limitQuality,
std::optional< Asset > const & sendMaxAsset,
STPath const & path,
bool ownerPaysTransferFee,
OfferCrossing offerCrossing,
AMMContext & ammContext,
std::optional< uint256 > const & domainID,
beast::Journal j )

Create a Strand for the specified path.

Parameters
sbview for trust lines, balances, and attributes like auth and freeze
srcAccount that is sending assets
dstAccount that is receiving assets
deliverAsset the dst account will receive (if issuer of deliver == dst, then accept any issuer)
limitQualityOffer crossing BookSteps use this value in an optimization. If, during direct offer crossing, the quality of the tip of the book drops below this value, then evaluating the strand can stop.
sendMaxAssetOptional asset to send.
pathLiquidity sources to use for this strand of the payment. The path contains an ordered collection of the offer books to use and accounts to ripple through.
ownerPaysTransferFeefalse -> charge sender; true -> charge offer owner
offerCrossingfalse -> payment; true -> offer crossing
ammContextcounts iterations with AMM offers
domainIDthe domain that order books will use
jJournal for logging messages
Returns
Error code and constructed Strand

Definition at line 170 of file PaySteps.cpp.

◆ toStrands()

std::pair< TER, std::vector< Strand > > xrpl::toStrands ( ReadView const & sb,
AccountID const & src,
AccountID const & dst,
Asset const & deliver,
std::optional< Quality > const & limitQuality,
std::optional< Asset > const & sendMax,
STPathSet const & paths,
bool addDefaultPath,
bool ownerPaysTransferFee,
OfferCrossing offerCrossing,
AMMContext & ammContext,
std::optional< uint256 > const & domainID,
beast::Journal j )

Create a Strand for each specified path (including the default path, if indicated).

Parameters
sbView for trust lines, balances, and attributes like auth and freeze
srcAccount that is sending assets
dstAccount that is receiving assets
deliverAsset the dst account will receive (if issuer of deliver == dst, then accept any issuer)
limitQualityOffer crossing BookSteps use this value in an optimization. If, during direct offer crossing, the quality of the tip of the book drops below this value, then evaluating the strand can stop.
sendMaxOptional asset to send.
pathsPaths to use to fulfill the payment. Each path in the pathset contains an ordered collection of the offer books to use and accounts to ripple through.
addDefaultPathDetermines if the default path should be included
ownerPaysTransferFeefalse -> charge sender; true -> charge offer owner
offerCrossingfalse -> payment; true -> offer crossing
ammContextcounts iterations with AMM offers
domainIDthe domain that order books will use
jJournal for logging messages
Returns
error code and collection of strands

Definition at line 574 of file PaySteps.cpp.

◆ flow() [1/3]

template<class TInAmt, class TOutAmt>
StrandResult< TInAmt, TOutAmt > xrpl::flow ( PaymentSandbox const & baseView,
Strand const & strand,
std::optional< TInAmt > const & maxIn,
TOutAmt const & out,
beast::Journal j )

Request out amount from a strand.

Parameters
baseViewTrust lines and balances
strandSteps of Accounts to ripple through and offer books to use
maxInMax amount of input allowed
outAmount of output requested from the strand
jJournal to write log messages to
Returns
Actual amount in and out from the strand, errors, offers to remove, and payment sandbox

Definition at line 81 of file StrandFlow.h.

◆ flow() [2/3]

template<StepAmount TInAmt, StepAmount TOutAmt>
FlowResult< TInAmt, TOutAmt > xrpl::flow ( PaymentSandbox const & baseView,
std::vector< Strand > const & strands,
TOutAmt const & outReq,
bool partialPayment,
OfferCrossing offerCrossing,
std::optional< Quality > const & limitQuality,
std::optional< STAmount > const & sendMaxST,
beast::Journal j,
AMMContext & ammContext,
path::detail::FlowDebugInfo * flowDebugInfo = nullptr )

Request out amount from a collection of strands.

Attempt to fulfill the payment by using liquidity from the strands in order from least expensive to most expensive

Parameters
baseViewTrust lines and balances
strandsEach strand contains the steps of accounts to ripple through and offer books to use
outReqAmount of output requested from the strand
partialPaymentIf true allow less than the full payment
offerCrossingIf true offer crossing, not handling a standard payment
limitQualityIf present, the minimum quality for any strand taken
sendMaxSTIf present, the maximum STAmount to send
jJournal to write journal messages to
ammContextcounts iterations with AMM offers
flowDebugInfoIf pointer is non-null, write flow debug info here
Returns
Actual amount in and out from the strands, errors, and payment sandbox

Definition at line 555 of file StrandFlow.h.

◆ flow() [3/3]

path::RippleCalc::Output xrpl::flow ( PaymentSandbox & view,
STAmount const & deliver,
AccountID const & src,
AccountID const & dst,
STPathSet const & paths,
bool defaultPaths,
bool partialPayment,
bool ownerPaysTransferFee,
OfferCrossing offerCrossing,
std::optional< Quality > const & limitQuality,
std::optional< STAmount > const & sendMax,
std::optional< uint256 > const & domainID,
beast::Journal j,
path::detail::FlowDebugInfo * flowDebugInfo = nullptr )

Make a payment from the src account to the dst account.

Parameters
viewTrust lines and balances
deliverAmount to deliver to the dst account
srcAccount providing input funds for the payment
dstAccount receiving the payment
pathsSet of paths to explore for liquidity
defaultPathsInclude defaultPaths in the path set
partialPaymentIf the payment cannot deliver the entire requested amount, deliver as much as possible, given the constraints
ownerPaysTransferFeeIf true then owner, not sender, pays fee
offerCrossingIf Yes or Sell then flow is executing offer crossing, not payments
limitQualityDo not use liquidity below this quality threshold
sendMaxDo not spend more than this amount
jJournal to write journal messages to
flowDebugInfoIf non-null a pointer to FlowDebugInfo for debugging
Returns
Actual amount in and out, and the result code

Definition at line 44 of file Flow.cpp.

◆ operator<<() [20/24]

template<StepAmount TIn, StepAmount TOut>
std::ostream & xrpl::operator<< ( std::ostream & os,
TOffer< TIn, TOut > const & offer )

Definition at line 245 of file tx/paths/Offer.h.

◆ preflight0()

NotTEC xrpl::preflight0 ( PreflightContext const & ctx,
std::uint32_t flagMask )

Performs early sanity checks on the txid and flags.

Performs early sanity checks on the txid.

Definition at line 60 of file Transactor.cpp.

◆ debugSink()

DebugSink & xrpl::debugSink ( )
static

Definition at line 386 of file Log.cpp.

◆ divu10()

unsigned xrpl::divu10 ( uint128_t & u)
static

Definition at line 137 of file Number.cpp.

◆ doNormalize()

template<class T>
void xrpl::doNormalize ( bool & negative,
T & mantissa,
int & exponent,
MantissaRange::rep const & minMantissa,
MantissaRange::rep const & maxMantissa,
MantissaRange::CuspRoundingFix cuspRoundingFixEnabled,
bool dropped )

Definition at line 527 of file Number.cpp.

◆ operator<<() [21/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
Section const & section )

Definition at line 104 of file BasicConfig.cpp.

◆ operator<<() [22/24]

std::ostream & xrpl::operator<< ( std::ostream & ss,
BasicConfig const & c )

Definition at line 175 of file BasicConfig.cpp.

◆ operator<() [12/13]

bool xrpl::operator< ( CanonicalTXSet::Key const & lhs,
CanonicalTXSet::Key const & rhs )

Definition at line 15 of file CanonicalTXSet.cpp.

◆ confineOwnerCount()

std::uint32_t xrpl::confineOwnerCount ( std::uint32_t current,
std::int32_t adjustment,
std::optional< AccountID > const & id = std::nullopt,
beast::Journal j = beast::Journal{beast::Journal::getNullSink()} )
static

Definition at line 51 of file AccountRootHelpers.cpp.

◆ deleteAMMTrustLines()

TER xrpl::deleteAMMTrustLines ( Sandbox & sb,
AccountID const & ammAccountID,
std::uint16_t maxTrustlinesToDelete,
beast::Journal j )
static

Definition at line 664 of file AMMHelpers.cpp.

◆ deleteAMMMPTokens()

TER xrpl::deleteAMMMPTokens ( Sandbox & sb,
AccountID const & ammAccountID,
beast::Journal j )
static

Definition at line 704 of file AMMHelpers.cpp.

◆ checkDepositPreauth() [2/2]

TER xrpl::checkDepositPreauth ( STTx const & tx,
ReadView const & view,
AccountID const & src,
AccountID const & dst,
SLE::const_ref sleDst,
beast::Journal j )

Definition at line 349 of file CredentialHelpers.cpp.

◆ isChannelExpired() [2/2]

bool xrpl::isChannelExpired ( ApplyView const & view,
std::optional< uint32_t > timeField )

Definition at line 84 of file PaymentChannelHelpers.cpp.

◆ updateTrustLine()

bool xrpl::updateTrustLine ( ApplyView & view,
SLE::pointer state,
bool bSenderHigh,
AccountID const & sender,
STAmount const & before,
STAmount const & after,
beast::Journal j )
static

Definition at line 333 of file RippleStateHelpers.cpp.

◆ getLineIfUsable()

SLE::const_pointer xrpl::getLineIfUsable ( ReadView const & view,
AccountID const & account,
Currency const & currency,
AccountID const & issuer,
FreezeHandling zeroIfFrozen,
beast::Journal j )
static

Definition at line 251 of file TokenHelpers.cpp.

◆ getTrustLineBalance()

STAmount xrpl::getTrustLineBalance ( ReadView const & view,
SLE::const_ref sle,
AccountID const & account,
Currency const & currency,
AccountID const & issuer,
bool includeOppositeLimit,
beast::Journal j )
static

Definition at line 300 of file TokenHelpers.cpp.

◆ canAddHolding() [3/3]

TER xrpl::canAddHolding ( ReadView const & view,
Issue const & issue )
nodiscard

Definition at line 525 of file TokenHelpers.cpp.

◆ directSendNoFeeIOU()

TER xrpl::directSendNoFeeIOU ( ApplyView & view,
AccountID const & uSenderID,
AccountID const & uReceiverID,
STAmount const & saAmount,
bool bCheckIssuer,
beast::Journal j )
static

Definition at line 625 of file TokenHelpers.cpp.

◆ directSendNoLimitIOU()

TER xrpl::directSendNoLimitIOU ( ApplyView & view,
AccountID const & uSenderID,
AccountID const & uReceiverID,
STAmount const & saAmount,
STAmount & saActual,
beast::Journal j,
WaiveTransferFee waiveFee )
static

Definition at line 771 of file TokenHelpers.cpp.

◆ directSendNoLimitMultiIOU()

TER xrpl::directSendNoLimitMultiIOU ( ApplyView & view,
AccountID const & senderID,
Issue const & issue,
MultiplePaymentDestinations const & receivers,
STAmount & actual,
beast::Journal j,
WaiveTransferFee waiveFee )
static

Definition at line 820 of file TokenHelpers.cpp.

◆ accountSendIOU()

TER xrpl::accountSendIOU ( ApplyView & view,
AccountID const & uSenderID,
AccountID const & uReceiverID,
STAmount const & saAmount,
beast::Journal j,
WaiveTransferFee waiveFee )
static

Definition at line 893 of file TokenHelpers.cpp.

◆ accountSendMultiIOU()

TER xrpl::accountSendMultiIOU ( ApplyView & view,
AccountID const & senderID,
Issue const & issue,
MultiplePaymentDestinations const & receivers,
beast::Journal j,
WaiveTransferFee waiveFee )
static

Definition at line 1010 of file TokenHelpers.cpp.

◆ directSendNoFeeMPT()

TER xrpl::directSendNoFeeMPT ( ApplyView & view,
AccountID const & uSenderID,
AccountID const & uReceiverID,
STAmount const & saAmount,
beast::Journal j )
static

Definition at line 1137 of file TokenHelpers.cpp.

◆ directSendNoLimitMPT()

TER xrpl::directSendNoLimitMPT ( ApplyView & view,
AccountID const & uSenderID,
AccountID const & uReceiverID,
STAmount const & saAmount,
STAmount & saActual,
beast::Journal j,
WaiveTransferFee waiveFee,
AllowMPTOverflow allowOverflow )
static

Definition at line 1222 of file TokenHelpers.cpp.

◆ directSendNoLimitMultiMPT()

TER xrpl::directSendNoLimitMultiMPT ( ApplyView & view,
AccountID const & senderID,
MPTIssue const & mptIssue,
MultiplePaymentDestinations const & receivers,
STAmount & actual,
beast::Journal j,
WaiveTransferFee waiveFee )
static

Definition at line 1283 of file TokenHelpers.cpp.

◆ accountSendMPT()

TER xrpl::accountSendMPT ( ApplyView & view,
AccountID const & uSenderID,
AccountID const & uReceiverID,
STAmount const & saAmount,
beast::Journal j,
WaiveTransferFee waiveFee,
AllowMPTOverflow allowOverflow )
static

Definition at line 1403 of file TokenHelpers.cpp.

◆ accountSendMultiMPT()

TER xrpl::accountSendMultiMPT ( ApplyView & view,
AccountID const & senderID,
MPTIssue const & mptIssue,
MultiplePaymentDestinations const & receivers,
beast::Journal j,
WaiveTransferFee waiveFee )
static

Definition at line 1429 of file TokenHelpers.cpp.

◆ withdrawToDestExceedsLimit()

TER xrpl::withdrawToDestExceedsLimit ( ReadView const & view,
AccountID const & from,
AccountID const & to,
STAmount const & amount )
static

Definition at line 361 of file View.cpp.

◆ cleanupOnAccountDelete() [2/2]

TER xrpl::cleanupOnAccountDelete ( ApplyView & view,
Keylet const & ownerDirKeylet,
EntryDeleter const & deleter,
beast::Journal j,
std::optional< uint16_t > maxNodesToDelete )

Definition at line 478 of file View.cpp.

◆ parseBase58() [7/10]

template<>
std::optional< AccountID > xrpl::parseBase58 ( std::string const & s)

Parse AccountID from checked, base58 string.

Parse a Base58 encoded string into a seed.

Returns
std::nullopt if a parse error occurs

Definition at line 103 of file AccountID.cpp.

◆ hash_value()

std::size_t xrpl::hash_value ( xrpl::uint256 const & feature)

Definition at line 27 of file libxrpl/protocol/Feature.cpp.

◆ registerFeature()

uint256 xrpl::registerFeature ( std::string const & name,
Supported support,
VoteBehavior vote )

Definition at line 355 of file libxrpl/protocol/Feature.cpp.

◆ retireFeature()

uint256 xrpl::retireFeature ( std::string const & name)

Definition at line 363 of file libxrpl/protocol/Feature.cpp.

◆ registrationIsDone()

bool xrpl::registrationIsDone ( )

Tell FeatureCollections when registration is complete.

Definition at line 370 of file libxrpl/protocol/Feature.cpp.

◆ enforceValidFeatureName()

auto xrpl::enforceValidFeatureName ( auto fn) -> char const *
consteval

Definition at line 406 of file libxrpl/protocol/Feature.cpp.

◆ indexHash()

template<class... Args>
uint256 xrpl::indexHash ( LedgerNameSpace space,
Args const &... args )
static

Definition at line 96 of file Indexes.cpp.

◆ parseBase58() [8/10]

template<>
std::optional< PublicKey > xrpl::parseBase58 ( TokenType type,
std::string const & s )

Parse a secret key.

Definition at line 37 of file PublicKey.cpp.

◆ sigPart()

std::optional< Slice > xrpl::sigPart ( Slice & buf)
static

Definition at line 51 of file PublicKey.cpp.

◆ sliceToHex()

std::string xrpl::sliceToHex ( Slice const & slice)
static

Definition at line 77 of file PublicKey.cpp.

◆ ed25519Canonical()

bool xrpl::ed25519Canonical ( Slice const & sig)
static

Definition at line 153 of file PublicKey.cpp.

◆ ceilInImpl()

template<STAmount(*)(STAmount const &, STAmount const &, Asset const &, bool) DivRoundFunc>
Amounts xrpl::ceilInImpl ( Amounts const & amount,
STAmount const & limit,
bool roundUp,
Quality const & quality )
static

Definition at line 57 of file Quality.cpp.

◆ ceilOutImpl()

template<STAmount(*)(STAmount const &, STAmount const &, Asset const &, bool) MulRoundFunc>
Amounts xrpl::ceilOutImpl ( Amounts const & amount,
STAmount const & limit,
bool roundUp,
Quality const & quality )
static

Definition at line 86 of file Quality.cpp.

◆ kParityRate()

Rate const xrpl::kParityRate ( QUALITY_ONE )

◆ parseBase58() [9/10]

template<>
std::optional< SecretKey > xrpl::parseBase58 ( TokenType type,
std::string const & s )

Parse a secret key.

Definition at line 360 of file SecretKey.cpp.

◆ parseBase58() [10/10]

template<>
std::optional< Seed > xrpl::parseBase58 ( std::string const & s)

Parse AccountID from checked, base58 string.

Parse a Base58 encoded string into a seed.

Returns
std::nullopt if a parse error occurs

Definition at line 68 of file Seed.cpp.

◆ sfInvalid()

SField const xrpl::sfInvalid ( access ,
- 1,
""  )

◆ sfGeneric()

SField const xrpl::sfGeneric ( access ,
0 ,
"Generic"  )

◆ getInt64Value()

std::int64_t xrpl::getInt64Value ( STAmount const & amount,
bool valid,
char const * error )
static

Definition at line 58 of file STAmount.cpp.

◆ getSNValue()

std::int64_t xrpl::getSNValue ( STAmount const & amount)
static

Definition at line 77 of file STAmount.cpp.

◆ getMPTValue()

std::int64_t xrpl::getMPTValue ( STAmount const & amount)
static

Definition at line 83 of file STAmount.cpp.

◆ areComparable()

bool xrpl::areComparable ( STAmount const & v1,
STAmount const & v2 )
static

Definition at line 89 of file STAmount.cpp.

◆ hasInvalidAmount() [2/4]

bool xrpl::hasInvalidAmount ( STBase const & field,
int depth,
beast::Journal j )
static

Definition at line 1133 of file STAmount.cpp.

◆ hasInvalidAmount() [3/4]

bool xrpl::hasInvalidAmount ( STObject const & object,
int depth,
beast::Journal j )
static

Definition at line 1119 of file STAmount.cpp.

◆ hasInvalidAmount() [4/4]

bool xrpl::hasInvalidAmount ( STArray const & array,
int depth,
beast::Journal j )
static

Definition at line 1126 of file STAmount.cpp.

◆ muldiv()

std::uint64_t xrpl::muldiv ( std::uint64_t multiplier,
std::uint64_t multiplicand,
std::uint64_t divisor )
static

Definition at line 1186 of file STAmount.cpp.

◆ muldivRound()

std::uint64_t xrpl::muldivRound ( std::uint64_t multiplier,
std::uint64_t multiplicand,
std::uint64_t divisor,
std::uint64_t rounding )
static

Definition at line 1204 of file STAmount.cpp.

◆ canonicalizeRound()

void xrpl::canonicalizeRound ( bool integral,
std::uint64_t & value,
int & offset,
bool  )
static

Definition at line 1329 of file STAmount.cpp.

◆ canonicalizeRoundStrict()

void xrpl::canonicalizeRoundStrict ( bool integral,
std::uint64_t & value,
int & offset,
bool roundUp )
static

Definition at line 1368 of file STAmount.cpp.

◆ mulRoundImpl()

template<void(*)(bool, std::uint64_t &, int &, bool) CanonicalizeFunc, typename MightSaveRound>
STAmount xrpl::mulRoundImpl ( STAmount const & v1,
STAmount const & v2,
Asset const & asset,
bool roundUp )
static

Definition at line 1456 of file STAmount.cpp.

◆ divRoundImpl()

template<typename MightSaveRound>
STAmount xrpl::divRoundImpl ( STAmount const & num,
STAmount const & den,
Asset const & asset,
bool roundUp )
static

Definition at line 1570 of file STAmount.cpp.

◆ associateAsset() [2/2]

void xrpl::associateAsset ( SLE & sle,
Asset const & asset )

Definition at line 13 of file STTakesAsset.cpp.

◆ getTxFormat()

auto xrpl::getTxFormat ( TxType type)
static

Definition at line 56 of file STTx.cpp.

◆ getSigningData()

Blob xrpl::getSigningData ( STTx const & that)
static

Definition at line 165 of file STTx.cpp.

◆ singleSignHelper()

std::expected< void, std::string > xrpl::singleSignHelper ( STObject const & sigObject,
Slice const & data )
static

Definition at line 393 of file STTx.cpp.

◆ multiSignHelper()

std::expected< void, std::string > xrpl::multiSignHelper ( STObject const & sigObject,
std::optional< AccountID > txnAccountID,
std::function< Serializer(AccountID const &)> makeMsg,
Rules const & rules )

Definition at line 438 of file STTx.cpp.

◆ isMemoOkay()

bool xrpl::isMemoOkay ( STObject const & st,
std::string & reason )
static

Definition at line 599 of file STTx.cpp.

◆ isAccountFieldOkay()

bool xrpl::isAccountFieldOkay ( STObject const & st)
static

Definition at line 690 of file STTx.cpp.

◆ invalidMPTAmountInTx()

bool xrpl::invalidMPTAmountInTx ( STObject const & tx)
static

Definition at line 703 of file STTx.cpp.

◆ isRawTransactionOkay()

bool xrpl::isRawTransactionOkay ( STObject const & st,
std::string & reason )
static

Definition at line 730 of file STTx.cpp.

◆ digest() [1/2]

template<class Hasher>
Hasher::result_type xrpl::digest ( void const * data,
std::size_t size )
staticnoexcept

Definition at line 139 of file tokens.cpp.

◆ digest() [2/2]

template<class Hasher, class T, std::size_t N, class = std::enable_if_t<sizeof(T) == 1>>
Hasher::result_type xrpl::digest ( std::array< T, N > const & v)
static

Definition at line 148 of file tokens.cpp.

◆ digest2()

template<class Hasher, class... Args>
Hasher::result_type xrpl::digest2 ( Args const &... args)
static

Definition at line 156 of file tokens.cpp.

◆ checksum()

void xrpl::checksum ( void * out,
void const * message,
std::size_t size )
static

Calculate a 4-byte checksum of the data.

The checksum is calculated as the first 4 bytes of the SHA256 digest of the message. This is added to the base58 encoding of identifiers to detect user error in data entry.

Note
This checksum algorithm is part of the client API

Definition at line 171 of file tokens.cpp.

◆ operator==() [28/31]

bool xrpl::operator== ( XChainClaimAttestation const & lhs,
XChainClaimAttestation const & rhs )

Definition at line 475 of file XChainAttestations.cpp.

◆ operator==() [29/31]

bool xrpl::operator== ( XChainCreateAccountAttestation const & lhs,
XChainCreateAccountAttestation const & rhs )

Definition at line 601 of file XChainAttestations.cpp.

◆ getConnection()

sqlite_api::sqlite3 * xrpl::getConnection ( soci::session & s)
static

Definition at line 111 of file SociDB.cpp.

◆ getHTTPHeaderTimestamp()

std::string xrpl::getHTTPHeaderTimestamp ( )

Definition at line 15 of file JSONRPCUtil.cpp.

◆ logMftAct() [1/2]

template<class Stream>
Stream & xrpl::logMftAct ( Stream & s,
std::string const & action,
PublicKey const & pk,
std::uint32_t seq )

Definition at line 172 of file libxrpl/server/Manifest.cpp.

◆ logMftAct() [2/2]

template<class Stream>
Stream & xrpl::logMftAct ( Stream & s,
std::string const & action,
PublicKey const & pk,
std::uint32_t seq,
std::uint32_t oldSeq )

Definition at line 181 of file libxrpl/server/Manifest.cpp.

◆ populate()

void xrpl::populate ( Section const & section,
std::string const & field,
std::ostream & log,
std::vector< boost::asio::ip::network_v4 > & nets4,
std::vector< boost::asio::ip::network_v6 > & nets6 )
static

Definition at line 85 of file Port.cpp.

◆ saveManifest()

void xrpl::saveManifest ( soci::session & session,
std::string const & dbTable,
std::string const & serialized )
static

Definition at line 88 of file Wallet.cpp.

◆ makeTypedLeaf()

intr_ptr::SharedPtr< SHAMapLeafNode > xrpl::makeTypedLeaf ( SHAMapNodeType type,
boost::intrusive_ptr< SHAMapItem const > item,
std::uint32_t owner )
nodiscard

Definition at line 44 of file SHAMap.cpp.

◆ depthMask()

uint256 const & xrpl::depthMask ( unsigned int depth)
static

Definition at line 17 of file SHAMapNodeID.cpp.

◆ apply() [2/3]

template<typename PreflightChecks>
ApplyResult xrpl::apply ( ServiceRegistry & registry,
OpenView & view,
PreflightChecks && preflightChecks )

Definition at line 133 of file apply.cpp.

◆ apply() [3/3]

ApplyResult xrpl::apply ( ServiceRegistry & registry,
OpenView & view,
uint256 const & parentBatchId,
STTx const & tx,
ApplyFlags flags,
beast::Journal j )

Definition at line 146 of file apply.cpp.

◆ applyBatchTransactions()

bool xrpl::applyBatchTransactions ( ServiceRegistry & registry,
OpenView & batchView,
STTx const & batchTxn,
beast::Journal j )
static

Definition at line 160 of file apply.cpp.

◆ consequencesHelper()

template<class T>
TxConsequences xrpl::consequencesHelper ( PreflightContext const & ctx)

Definition at line 108 of file applySteps.cpp.

◆ invokePreflight()

std::pair< NotTEC, TxConsequences > xrpl::invokePreflight ( PreflightContext const & ctx)
static

Definition at line 132 of file applySteps.cpp.

◆ invokePreclaim()

TER xrpl::invokePreclaim ( PreclaimContext const & ctx)
static

Definition at line 154 of file applySteps.cpp.

◆ invokeCalculateBaseFee()

XRPAmount xrpl::invokeCalculateBaseFee ( ReadView const & view,
STTx const & tx )
static

Calculates the base fee for a given transaction.

This function determines the base fee required for the specified transaction by invoking the appropriate fee calculation logic based on the transaction type. It uses a type-dispatch mechanism to select the correct calculation method.

Parameters
viewThe ledger view to use for fee calculation.
txThe transaction for which the base fee is to be calculated.
Returns
The calculated base fee as an XRPAmount.
Exceptions
std::exceptionIf an error occurs during fee calculation, including but not limited to unknown transaction types or internal errors, the function logs an error and returns an XRPAmount of zero.

Definition at line 230 of file applySteps.cpp.

◆ invokeApply()

ApplyResult xrpl::invokeApply ( ApplyContext & ctx)
static

Definition at line 283 of file applySteps.cpp.

◆ makeTransactor()

std::unique_ptr< Transactor > xrpl::makeTransactor ( ApplyContext & ctx)

Definition at line 307 of file applySteps.cpp.

◆ validBalances()

bool xrpl::validBalances ( STAmount const & amount,
STAmount const & amount2,
STAmount const & lptAMMBalance,
ValidAMM::ZeroAllowed zeroAllowed )
static

Definition at line 69 of file AMMInvariant.cpp.

◆ limitStepIn()

template<class TIn, class TOut, class Offer>
void xrpl::limitStepIn ( Offer const & offer,
TAmounts< TIn, TOut > & ofrAmt,
TAmounts< TIn, TOut > & stpAmt,
TOut & ownerGives,
std::uint32_t transferRateIn,
std::uint32_t transferRateOut,
TIn const & limit )
static

Definition at line 633 of file BookStep.cpp.

◆ limitStepOut()

template<class TIn, class TOut, class Offer>
void xrpl::limitStepOut ( Offer const & offer,
TAmounts< TIn, TOut > & ofrAmt,
TAmounts< TIn, TOut > & stpAmt,
TOut & ownerGives,
std::uint32_t transferRateIn,
std::uint32_t transferRateOut,
TOut const & limit )
static

Definition at line 662 of file BookStep.cpp.

◆ sum()

template<class TCollection>
auto xrpl::sum ( TCollection const & col)
static

Definition at line 993 of file BookStep.cpp.

◆ makeBookStepHelper()

template<class TIn, class TOut>
std::pair< TER, std::unique_ptr< Step > > xrpl::makeBookStepHelper ( StrandContext const & ctx,
Asset const & in,
Asset const & out )
static

Definition at line 1504 of file BookStep.cpp.

◆ makeBookStepIi()

std::pair< TER, std::unique_ptr< Step > > xrpl::makeBookStepIi ( StrandContext const & ctx,
Issue const & in,
Issue const & out )

Definition at line 1527 of file BookStep.cpp.

◆ makeBookStepIx()

std::pair< TER, std::unique_ptr< Step > > xrpl::makeBookStepIx ( StrandContext const & ctx,
Issue const & in )

Definition at line 1533 of file BookStep.cpp.

◆ makeBookStepXi()

std::pair< TER, std::unique_ptr< Step > > xrpl::makeBookStepXi ( StrandContext const & ctx,
Issue const & out )

Definition at line 1539 of file BookStep.cpp.

◆ makeBookStepMm()

std::pair< TER, std::unique_ptr< Step > > xrpl::makeBookStepMm ( StrandContext const & ctx,
MPTIssue const & in,
MPTIssue const & out )

Definition at line 1546 of file BookStep.cpp.

◆ makeBookStepMi()

std::pair< TER, std::unique_ptr< Step > > xrpl::makeBookStepMi ( StrandContext const & ctx,
MPTIssue const & in,
Issue const & out )

Definition at line 1552 of file BookStep.cpp.

◆ makeBookStepIm()

std::pair< TER, std::unique_ptr< Step > > xrpl::makeBookStepIm ( StrandContext const & ctx,
Issue const & in,
MPTIssue const & out )

Definition at line 1558 of file BookStep.cpp.

◆ makeBookStepMx()

std::pair< TER, std::unique_ptr< Step > > xrpl::makeBookStepMx ( StrandContext const & ctx,
MPTIssue const & in )

Definition at line 1564 of file BookStep.cpp.

◆ makeBookStepXm()

std::pair< TER, std::unique_ptr< Step > > xrpl::makeBookStepXm ( StrandContext const & ctx,
MPTIssue const & out )

Definition at line 1570 of file BookStep.cpp.

◆ makeDirectStepI()

std::pair< TER, std::unique_ptr< Step > > xrpl::makeDirectStepI ( StrandContext const & ctx,
AccountID const & src,
AccountID const & dst,
Currency const & c )

Definition at line 923 of file DirectStep.cpp.

◆ finishFlow()

template<class FlowResult>
auto xrpl::finishFlow ( PaymentSandbox & sb,
Asset const & srcAsset,
Asset const & dstAsset,
FlowResult && f )
static

Definition at line 24 of file Flow.cpp.

◆ makeMptEndpointStep()

std::pair< TER, std::unique_ptr< Step > > xrpl::makeMptEndpointStep ( StrandContext const & ctx,
AccountID const & src,
AccountID const & dst,
MPTID const & mpt )

Definition at line 911 of file MPTEndpointStep.cpp.

◆ accountFundsHelper()

template<StepAmount T>
T xrpl::accountFundsHelper ( ReadView const & view,
AccountID const & id,
T const & amtDefault,
Asset const & asset,
FreezeHandling freezeHandling,
AuthHandling authHandling,
beast::Journal j )
static

Definition at line 104 of file OfferStream.cpp.

◆ checkNear()

bool xrpl::checkNear ( IOUAmount const & expected,
IOUAmount const & actual )

Definition at line 36 of file PaySteps.cpp.

◆ isXRPAccount()

bool xrpl::isXRPAccount ( STPathElement const & pe)
static

Definition at line 58 of file PaySteps.cpp.

◆ toStep()

std::pair< TER, std::unique_ptr< Step > > xrpl::toStep ( StrandContext const & ctx,
STPathElement const * e1,
STPathElement const * e2,
Asset const & curAsset )
static

Definition at line 66 of file PaySteps.cpp.

◆ operator==() [30/31]

template<class TDerived>
bool xrpl::operator== ( XRPEndpointStep< TDerived > const & lhs,
XRPEndpointStep< TDerived > const & rhs )

Definition at line 246 of file XRPEndpointStep.cpp.

◆ makeXrpEndpointStep()

std::pair< TER, std::unique_ptr< Step > > xrpl::makeXrpEndpointStep ( StrandContext const & ctx,
AccountID const & acc )

Definition at line 394 of file XRPEndpointStep.cpp.

◆ removeUnfundedOffers()

void xrpl::removeUnfundedOffers ( ApplyView & view,
std::vector< uint256 > const & offers,
beast::Journal viewJ )
static

Definition at line 1017 of file Transactor.cpp.

◆ removeExpiredNFTokenOffers()

void xrpl::removeExpiredNFTokenOffers ( ApplyView & view,
std::vector< uint256 > const & offers,
beast::Journal viewJ )
static

Definition at line 1034 of file Transactor.cpp.

◆ removeExpiredCredentials()

void xrpl::removeExpiredCredentials ( ApplyView & view,
std::vector< uint256 > const & creds,
beast::Journal viewJ )
static

Definition at line 1053 of file Transactor.cpp.

◆ removeDeletedTrustLines()

void xrpl::removeDeletedTrustLines ( ApplyView & view,
std::vector< uint256 > const & trustLines,
beast::Journal viewJ )
static

Definition at line 1070 of file Transactor.cpp.

◆ signerCountBasedOwnerCountDelta()

int xrpl::signerCountBasedOwnerCountDelta ( std::size_t entryCount,
Rules const & rules )
static

Definition at line 153 of file SignerListSet.cpp.

◆ removeSignersFromLedger()

TER xrpl::removeSignersFromLedger ( ServiceRegistry & registry,
ApplyView & view,
Keylet const & accountKeylet,
Keylet const & ownerDirKeylet,
Keylet const & signerListKeylet,
beast::Journal j )
static

Definition at line 180 of file SignerListSet.cpp.

◆ applyBid()

std::pair< TER, bool > xrpl::applyBid ( ApplyContext & ctx,
Sandbox & sb,
AccountID const & account,
beast::Journal j )
static

Definition at line 179 of file AMMBid.cpp.

◆ applyCreate()

std::pair< TER, bool > xrpl::applyCreate ( ApplyContext & ctx,
Sandbox & sb,
AccountID const & account,
beast::Journal j )
static

Definition at line 243 of file AMMCreate.cpp.

◆ adjustLPTokensOut()

STAmount xrpl::adjustLPTokensOut ( Rules const & rules,
STAmount const & lptAMMBalance,
STAmount const & lpTokensDeposit )
static

Definition at line 666 of file AMMDeposit.cpp.

◆ applyVote()

std::pair< TER, bool > xrpl::applyVote ( ApplyContext & ctx,
Sandbox & sb,
AccountID const & accountID,
beast::Journal j )
static

Definition at line 82 of file AMMVote.cpp.

◆ tokensWithdraw()

std::optional< STAmount > xrpl::tokensWithdraw ( STAmount const & lpTokens,
std::optional< STAmount > const & tokensIn,
std::uint32_t flags )
static

Definition at line 170 of file AMMWithdraw.cpp.

◆ adjustLPTokensIn()

STAmount xrpl::adjustLPTokensIn ( Rules const & rules,
STAmount const & lptAMMBalance,
STAmount const & lpTokensWithdraw,
WithdrawAll withdrawAll )
static

Definition at line 751 of file AMMWithdraw.cpp.

◆ addSLE()

TER xrpl::addSLE ( ApplyContext & ctx,
SLE::ref sle,
AccountID const & owner )
static

Definition at line 66 of file DIDSet.cpp.

◆ escrowCancelPreclaimHelper()

template<ValidIssueType T>
TER xrpl::escrowCancelPreclaimHelper ( PreclaimContext const & ctx,
AccountID const & account,
STAmount const & amount )
static

◆ escrowCancelPreclaimHelper< Issue >()

template<>
TER xrpl::escrowCancelPreclaimHelper< Issue > ( PreclaimContext const & ctx,
AccountID const & account,
STAmount const & amount )

Definition at line 44 of file EscrowCancel.cpp.

◆ escrowCancelPreclaimHelper< MPTIssue >()

template<>
TER xrpl::escrowCancelPreclaimHelper< MPTIssue > ( PreclaimContext const & ctx,
AccountID const & account,
STAmount const & amount )

Definition at line 63 of file EscrowCancel.cpp.

◆ escrowCreatePreflightHelper()

template<ValidIssueType T>
NotTEC xrpl::escrowCreatePreflightHelper ( PreflightContext const & ctx)
static

◆ escrowCreatePreflightHelper< Issue >()

Definition at line 99 of file EscrowCreate.cpp.

◆ escrowCreatePreflightHelper< MPTIssue >()

Definition at line 113 of file EscrowCreate.cpp.

◆ escrowCreatePreclaimHelper()

template<ValidIssueType T>
TER xrpl::escrowCreatePreclaimHelper ( PreclaimContext const & ctx,
AccountID const & account,
AccountID const & dest,
STAmount const & amount )
static

◆ escrowCreatePreclaimHelper< Issue >()

template<>
TER xrpl::escrowCreatePreclaimHelper< Issue > ( PreclaimContext const & ctx,
AccountID const & account,
AccountID const & dest,
STAmount const & amount )

Definition at line 190 of file EscrowCreate.cpp.

◆ escrowCreatePreclaimHelper< MPTIssue >()

template<>
TER xrpl::escrowCreatePreclaimHelper< MPTIssue > ( PreclaimContext const & ctx,
AccountID const & account,
AccountID const & dest,
STAmount const & amount )

Definition at line 261 of file EscrowCreate.cpp.

◆ escrowLockApplyHelper()

template<ValidIssueType T>
TER xrpl::escrowLockApplyHelper ( ApplyView & view,
AccountID const & issuer,
AccountID const & sender,
STAmount const & amount,
beast::Journal journal )
static

◆ escrowLockApplyHelper< Issue >()

template<>
TER xrpl::escrowLockApplyHelper< Issue > ( ApplyView & view,
AccountID const & issuer,
AccountID const & sender,
STAmount const & amount,
beast::Journal journal )

Definition at line 381 of file EscrowCreate.cpp.

◆ escrowLockApplyHelper< MPTIssue >()

template<>
TER xrpl::escrowLockApplyHelper< MPTIssue > ( ApplyView & view,
AccountID const & issuer,
AccountID const & sender,
STAmount const & amount,
beast::Journal journal )

Definition at line 401 of file EscrowCreate.cpp.

◆ checkCondition()

bool xrpl::checkCondition ( Slice f,
Slice c )
static

Definition at line 47 of file EscrowFinish.cpp.

◆ escrowFinishPreclaimHelper()

template<ValidIssueType T>
TER xrpl::escrowFinishPreclaimHelper ( PreclaimContext const & ctx,
AccountID const & dest,
STAmount const & amount )
static

◆ escrowFinishPreclaimHelper< Issue >()

template<>
TER xrpl::escrowFinishPreclaimHelper< Issue > ( PreclaimContext const & ctx,
AccountID const & dest,
STAmount const & amount )

Definition at line 140 of file EscrowFinish.cpp.

◆ escrowFinishPreclaimHelper< MPTIssue >()

template<>
TER xrpl::escrowFinishPreclaimHelper< MPTIssue > ( PreclaimContext const & ctx,
AccountID const & dest,
STAmount const & amount )

Definition at line 163 of file EscrowFinish.cpp.

◆ determineBrokerID()

std::expected< uint256, TER > xrpl::determineBrokerID ( ReadView const & view,
STTx const & tx )

Definition at line 87 of file LoanBrokerCoverClawback.cpp.

◆ determineAsset()

std::expected< Asset, TER > xrpl::determineAsset ( ReadView const & view,
AccountID const & account,
AccountID const & brokerPseudoAccountID,
STAmount const & amount )

Definition at line 130 of file LoanBrokerCoverClawback.cpp.

◆ determineClawAmount()

std::expected< STAmount, TER > xrpl::determineClawAmount ( SLE const & sleBroker,
Asset const & vaultAsset,
std::optional< STAmount > const & amount,
SLE::const_ref vaultSle,
Rules const & rules )

Definition at line 160 of file LoanBrokerCoverClawback.cpp.

◆ preclaimHelper() [1/2]

template<ValidIssueType T>
TER xrpl::preclaimHelper ( PreclaimContext const & ctx,
SLE const & sleIssuer,
STAmount const & clawAmount )
static

◆ preclaimHelper< Issue >() [1/2]

template<>
TER xrpl::preclaimHelper< Issue > ( PreclaimContext const & ctx,
SLE const & sleIssuer,
STAmount const & clawAmount )

Definition at line 203 of file LoanBrokerCoverClawback.cpp.

◆ preclaimHelper< MPTIssue >() [1/2]

template<>
TER xrpl::preclaimHelper< MPTIssue > ( PreclaimContext const & ctx,
SLE const & sleIssuer,
STAmount const & clawAmount )

Definition at line 215 of file LoanBrokerCoverClawback.cpp.

◆ owedToVault()

Number xrpl::owedToVault ( SLE::ref loanSle)
static

Definition at line 131 of file LoanManage.cpp.

◆ getStartDate()

std::uint32_t xrpl::getStartDate ( ReadView const & view)
static

Definition at line 211 of file LoanSet.cpp.

◆ extractNFTokenFlagsFromTxFlags()

std::uint16_t xrpl::extractNFTokenFlagsFromTxFlags ( std::uint32_t txFlags)
static

Definition at line 35 of file NFTokenMint.cpp.

◆ hasOfferFields()

bool xrpl::hasOfferFields ( PreflightContext const & ctx)
static

Definition at line 41 of file NFTokenMint.cpp.

◆ tokenPairKey()

std::pair< Currency, Currency > xrpl::tokenPairKey ( STObject const & pair)
static

Definition at line 33 of file OracleSet.cpp.

◆ adjustOwnerCount() [2/2]

bool xrpl::adjustOwnerCount ( ApplyContext & ctx,
int count )
static

Definition at line 182 of file OracleSet.cpp.

◆ setPriceDataInnerObjTemplate()

void xrpl::setPriceDataInnerObjTemplate ( STObject & obj)
static

Definition at line 194 of file OracleSet.cpp.

◆ getMaxSourceAmount()

STAmount xrpl::getMaxSourceAmount ( AccountID const & account,
STAmount const & dstAmount,
std::optional< STAmount > const & sendMax )

Definition at line 61 of file Payment.cpp.

◆ preflightHelper()

template<ValidIssueType T>
NotTEC xrpl::preflightHelper ( PreflightContext const & ctx)
static

◆ preflightHelper< Issue >()

template<>
NotTEC xrpl::preflightHelper< Issue > ( PreflightContext const & ctx)

Definition at line 35 of file Clawback.cpp.

◆ preflightHelper< MPTIssue >()

template<>
NotTEC xrpl::preflightHelper< MPTIssue > ( PreflightContext const & ctx)

Definition at line 54 of file Clawback.cpp.

◆ preclaimHelper() [2/2]

template<ValidIssueType T>
TER xrpl::preclaimHelper ( PreclaimContext const & ctx,
SLE const & sleIssuer,
AccountID const & issuer,
AccountID const & holder,
STAmount const & clawAmount )
static

◆ preclaimHelper< Issue >() [2/2]

template<>
TER xrpl::preclaimHelper< Issue > ( PreclaimContext const & ctx,
SLE const & sleIssuer,
AccountID const & issuer,
AccountID const & holder,
STAmount const & clawAmount )

Definition at line 98 of file Clawback.cpp.

◆ preclaimHelper< MPTIssue >() [2/2]

template<>
TER xrpl::preclaimHelper< MPTIssue > ( PreclaimContext const & ctx,
SLE const & sleIssuer,
AccountID const & issuer,
AccountID const & holder,
STAmount const & clawAmount )

Definition at line 148 of file Clawback.cpp.

◆ applyHelper()

template<ValidIssueType T>
TER xrpl::applyHelper ( ApplyContext & ctx)
static

◆ applyHelper< Issue >()

template<>
TER xrpl::applyHelper< Issue > ( ApplyContext & ctx)

Definition at line 217 of file Clawback.cpp.

◆ applyHelper< MPTIssue >()

template<>
TER xrpl::applyHelper< MPTIssue > ( ApplyContext & ctx)

Definition at line 243 of file Clawback.cpp.

◆ verifyProofs()

TER xrpl::verifyProofs ( STTx const & tx,
std::shared_ptr< SLE const > const & issuance,
std::shared_ptr< SLE const > const & mptoken )
static

Verifies the cryptographic proofs for a ConvertBack transaction.

This function verifies three proofs:

  1. Revealed amount proof: verifies the encrypted amounts (holder, issuer, auditor) all encrypt the same revealed amount using the blinding factor.
  2. Pedersen linkage proof: verifies the balance commitment is derived from the holder's encrypted spending balance.
  3. Bulletproof (range proof): verifies the remaining balance (balance - amount) is non-negative, preventing overdrafts.

All proofs are verified before returning any error to prevent timing attacks.

Definition at line 73 of file ConfidentialMPTConvertBack.cpp.

◆ clawbackAmount()

STAmount xrpl::clawbackAmount ( SLE::const_ref vault,
std::optional< STAmount > const & maybeAmount,
AccountID const & account )
nodiscard

Definition at line 62 of file VaultClawback.cpp.

◆ roundToVaultScale()

STAmount xrpl::roundToVaultScale ( STAmount const & amount,
SLE::const_ref vault )
staticnodiscard

Definition at line 32 of file VaultDeposit.cpp.

◆ shouldWaiveWithdrawal()

WaiveUnrealizedLoss xrpl::shouldWaiveWithdrawal ( ReadView const & view,
AccountID const & account,
SLE::const_ref issuance )
static

Definition at line 31 of file VaultWithdraw.cpp.

◆ BEAST_DEFINE_TESTSUITE_PRIO() [1/11]

xrpl::BEAST_DEFINE_TESTSUITE_PRIO ( AccountSet ,
app ,
xrpl ,
1  )

◆ BEAST_DEFINE_TESTSUITE() [1/67]

xrpl::BEAST_DEFINE_TESTSUITE ( AccountTxPaging ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [2/67]

xrpl::BEAST_DEFINE_TESTSUITE ( AmendmentTable ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [3/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Check ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [4/67]

xrpl::BEAST_DEFINE_TESTSUITE ( CheckMPT ,
tx ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [5/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Clawback ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [6/67]

xrpl::BEAST_DEFINE_TESTSUITE ( ClawbackMPT ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [7/67]

xrpl::BEAST_DEFINE_TESTSUITE ( ConfidentialTransfer ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [8/67]

xrpl::BEAST_DEFINE_TESTSUITE ( ConfidentialTransferExtended ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [9/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Discrepancy ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [10/67]

xrpl::BEAST_DEFINE_TESTSUITE ( FixNFTokenPageLinks ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [11/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Freeze ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [12/67]

xrpl::BEAST_DEFINE_TESTSUITE ( LedgerLoad ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [13/67]

xrpl::BEAST_DEFINE_TESTSUITE ( LoadFeeTrack ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE_PRIO() [2/11]

xrpl::BEAST_DEFINE_TESTSUITE_PRIO ( NFTokenBaseUtil ,
app ,
xrpl ,
2  )

◆ BEAST_DEFINE_TESTSUITE_PRIO() [3/11]

xrpl::BEAST_DEFINE_TESTSUITE_PRIO ( NFTokenDisallowIncoming ,
app ,
xrpl ,
2  )

◆ BEAST_DEFINE_TESTSUITE_PRIO() [4/11]

xrpl::BEAST_DEFINE_TESTSUITE_PRIO ( NFTokenWOMintOffer ,
app ,
xrpl ,
2  )

◆ BEAST_DEFINE_TESTSUITE_PRIO() [5/11]

xrpl::BEAST_DEFINE_TESTSUITE_PRIO ( NFTokenWOModify ,
app ,
xrpl ,
2  )

◆ BEAST_DEFINE_TESTSUITE_PRIO() [6/11]

xrpl::BEAST_DEFINE_TESTSUITE_PRIO ( NFTokenAllFeatures ,
app ,
xrpl ,
2  )

◆ BEAST_DEFINE_TESTSUITE_PRIO() [7/11]

xrpl::BEAST_DEFINE_TESTSUITE_PRIO ( NFTokenAuth ,
app ,
xrpl ,
2  )

◆ BEAST_DEFINE_TESTSUITE_PRIO() [8/11]

xrpl::BEAST_DEFINE_TESTSUITE_PRIO ( NFTokenBurn ,
app ,
xrpl ,
3  )

◆ BEAST_DEFINE_TESTSUITE_PRIO() [9/11]

xrpl::BEAST_DEFINE_TESTSUITE_PRIO ( NFTokenDir ,
app ,
xrpl ,
1  )

◆ BEAST_DEFINE_TESTSUITE() [14/67]

xrpl::BEAST_DEFINE_TESTSUITE ( OfferStream ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [15/67]

xrpl::BEAST_DEFINE_TESTSUITE ( SetRegularKey ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [16/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Ticket ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [17/67]

xrpl::BEAST_DEFINE_TESTSUITE ( TrustAndBalance ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [18/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Apply ,
tx ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE_PRIO() [10/11]

xrpl::BEAST_DEFINE_TESTSUITE_PRIO ( Vault ,
app ,
xrpl ,
1  )

◆ BEAST_DEFINE_TESTSUITE() [19/67]

xrpl::BEAST_DEFINE_TESTSUITE ( FileUtilities ,
basics ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [20/67]

xrpl::BEAST_DEFINE_TESTSUITE ( hardened_hash ,
basics ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [21/67]

xrpl::BEAST_DEFINE_TESTSUITE ( IOUAmount ,
basics ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [22/67]

xrpl::BEAST_DEFINE_TESTSUITE ( KeyCache ,
basics ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [23/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Number ,
basics ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [24/67]

xrpl::BEAST_DEFINE_TESTSUITE ( PerfLog ,
basics ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [25/67]

xrpl::BEAST_DEFINE_TESTSUITE ( StringUtilities ,
basics ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [26/67]

xrpl::BEAST_DEFINE_TESTSUITE ( TaggedCache ,
basics ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [27/67]

xrpl::BEAST_DEFINE_TESTSUITE ( XRPAmount ,
basics ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [28/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Config ,
core ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [29/67]

xrpl::BEAST_DEFINE_TESTSUITE ( SociDB ,
core ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [30/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Workers ,
core ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [31/67]

xrpl::BEAST_DEFINE_TESTSUITE ( ProtocolVersion ,
overlay ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [32/67]

xrpl::BEAST_DEFINE_TESTSUITE ( short_read ,
overlay ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [33/67]

xrpl::BEAST_DEFINE_TESTSUITE ( BuildInfo ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [34/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Hooks ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [35/67]

xrpl::BEAST_DEFINE_TESTSUITE ( InnerObjectFormatsParsedJSON ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [36/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Issue ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [37/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Memo ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [38/67]

xrpl::BEAST_DEFINE_TESTSUITE ( PublicKey ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [39/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Quality ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [40/67]

xrpl::BEAST_DEFINE_TESTSUITE ( SecretKey ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [41/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Seed ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [42/67]

xrpl::BEAST_DEFINE_TESTSUITE ( SeqProxy ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [43/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Serializer ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [44/67]

xrpl::BEAST_DEFINE_TESTSUITE ( STAccount ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [45/67]

xrpl::BEAST_DEFINE_TESTSUITE ( STAmount ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [46/67]

xrpl::BEAST_DEFINE_TESTSUITE ( STInteger ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [47/67]

xrpl::BEAST_DEFINE_TESTSUITE ( STNumber ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [48/67]

xrpl::BEAST_DEFINE_TESTSUITE ( STObject ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [49/67]

xrpl::BEAST_DEFINE_TESTSUITE ( STParsedJSON ,
protocol ,
xrpl  )

◆ matches()

bool xrpl::matches ( char const * string,
char const * regex )

Return true if the string loosely matches the regex.

Meant for testing human-readable strings that may change over time.

Definition at line 41 of file STTx_test.cpp.

◆ BEAST_DEFINE_TESTSUITE() [50/67]

xrpl::BEAST_DEFINE_TESTSUITE ( STTx ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [51/67]

xrpl::BEAST_DEFINE_TESTSUITE ( InnerObjectFormatsSerializer ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [52/67]

xrpl::BEAST_DEFINE_TESTSUITE ( STValidation ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [53/67]

xrpl::BEAST_DEFINE_TESTSUITE ( TER ,
protocol ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [54/67]

xrpl::BEAST_DEFINE_TESTSUITE ( AccountCurrencies ,
rpc ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [55/67]

xrpl::BEAST_DEFINE_TESTSUITE ( AmendmentBlocked ,
rpc ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [56/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Connect ,
rpc ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [57/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Feature ,
rpc ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [58/67]

xrpl::BEAST_DEFINE_TESTSUITE ( GetCounts ,
rpc ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [59/67]

xrpl::BEAST_DEFINE_TESTSUITE ( LedgerClosed ,
rpc ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE_PRIO() [11/11]

xrpl::BEAST_DEFINE_TESTSUITE_PRIO ( LedgerData ,
rpc ,
xrpl ,
1  )

◆ BEAST_DEFINE_TESTSUITE() [60/67]

xrpl::BEAST_DEFINE_TESTSUITE ( LedgerHeader ,
rpc ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [61/67]

xrpl::BEAST_DEFINE_TESTSUITE ( NoRippleCheck ,
rpc ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE_MANUAL_PRIO()

xrpl::BEAST_DEFINE_TESTSUITE_MANUAL_PRIO ( NoRippleCheckLimits ,
rpc ,
xrpl ,
1  )

◆ BEAST_DEFINE_TESTSUITE() [62/67]

xrpl::BEAST_DEFINE_TESTSUITE ( OwnerInfo ,
rpc ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [63/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Peers ,
rpc ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [64/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Transaction ,
rpc ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [65/67]

xrpl::BEAST_DEFINE_TESTSUITE ( TransactionEntry ,
rpc ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [66/67]

xrpl::BEAST_DEFINE_TESTSUITE ( TransactionHistory ,
rpc ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [67/67]

xrpl::BEAST_DEFINE_TESTSUITE ( Version ,
rpc ,
xrpl  )

◆ TEST() [1/17]

xrpl::TEST ( json_value ,
limits  )

Definition at line 23 of file Value.cpp.

◆ TEST() [2/17]

xrpl::TEST ( json_value ,
construct_and_compare_Json_StaticString  )

Definition at line 31 of file Value.cpp.

◆ TEST() [3/17]

xrpl::TEST ( json_value ,
different_types  )

Definition at line 54 of file Value.cpp.

◆ TEST() [4/17]

xrpl::TEST ( json_value ,
compare_strings  )

Definition at line 208 of file Value.cpp.

◆ TEST() [5/17]

xrpl::TEST ( json_value ,
bool  )

Definition at line 562 of file Value.cpp.

◆ TEST() [6/17]

xrpl::TEST ( json_value ,
bad_json  )

Definition at line 585 of file Value.cpp.

◆ TEST() [7/17]

xrpl::TEST ( json_value ,
edge_cases  )

Definition at line 595 of file Value.cpp.

◆ TEST() [8/17]

xrpl::TEST ( json_value ,
copy  )

Definition at line 742 of file Value.cpp.

◆ TEST() [9/17]

xrpl::TEST ( json_value ,
move  )

Definition at line 763 of file Value.cpp.

◆ TEST() [10/17]

xrpl::TEST ( json_value ,
comparisons  )

Definition at line 782 of file Value.cpp.

◆ TEST() [11/17]

xrpl::TEST ( json_value ,
compact  )

Definition at line 837 of file Value.cpp.

◆ TEST() [12/17]

xrpl::TEST ( json_value ,
conversions  )

Definition at line 860 of file Value.cpp.

◆ TEST() [13/17]

xrpl::TEST ( json_value ,
access_members  )

Definition at line 1076 of file Value.cpp.

◆ TEST() [14/17]

xrpl::TEST ( json_value ,
remove_members  )

Definition at line 1169 of file Value.cpp.

◆ TEST() [15/17]

xrpl::TEST ( json_value ,
iterator  )

Definition at line 1196 of file Value.cpp.

◆ TEST() [16/17]

xrpl::TEST ( json_value ,
nest_limits  )

Definition at line 1282 of file Value.cpp.

◆ TEST() [17/17]

xrpl::TEST ( json_value ,
memory_leak  )

Definition at line 1328 of file Value.cpp.

◆ canonical_UINT8()

UInt8Value xrpl::canonical_UINT8 ( )

Definition at line 33 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_UINT16()

UInt16Value xrpl::canonical_UINT16 ( )

Definition at line 40 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_UINT32()

UInt32Value xrpl::canonical_UINT32 ( )

Definition at line 47 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_UINT64()

UInt64Value xrpl::canonical_UINT64 ( )

Definition at line 54 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_UINT128()

UInt128Value xrpl::canonical_UINT128 ( )

Definition at line 61 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_UINT160()

UInt160Value xrpl::canonical_UINT160 ( )

Definition at line 68 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_UINT192()

UInt192Value xrpl::canonical_UINT192 ( )

Definition at line 75 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_UINT256()

UInt256Value xrpl::canonical_UINT256 ( )

Definition at line 82 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_INT32()

Int32Value xrpl::canonical_INT32 ( )

Definition at line 89 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_NUMBER()

NumberValue xrpl::canonical_NUMBER ( )

Definition at line 96 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_AMOUNT()

AmountValue xrpl::canonical_AMOUNT ( )

Definition at line 103 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_ACCOUNT()

AccountValue xrpl::canonical_ACCOUNT ( )

Definition at line 110 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_CURRENCY()

CurrencyValue xrpl::canonical_CURRENCY ( )

Definition at line 117 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_ISSUE()

IssueValue xrpl::canonical_ISSUE ( )

Definition at line 124 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_VECTOR256()

Vector256Value xrpl::canonical_VECTOR256 ( )

Definition at line 131 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_VL()

BlobValue xrpl::canonical_VL ( )

Definition at line 138 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_XCHAIN_BRIDGE()

XChainBridgeValue xrpl::canonical_XCHAIN_BRIDGE ( )

Definition at line 146 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_ARRAY()

STArray xrpl::canonical_ARRAY ( )

Definition at line 154 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_OBJECT()

STObject xrpl::canonical_OBJECT ( )

Definition at line 160 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ canonical_PATHSET()

STPathSet xrpl::canonical_PATHSET ( )

Definition at line 166 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ expectEqualField() [1/2]

template<class T>
void xrpl::expectEqualField ( T const & expected,
T const & actual,
char const * fieldName )

Definition at line 177 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ expectEqualField< STObject >()

template<>
void xrpl::expectEqualField< STObject > ( STObject const & expected,
STObject const & actual,
char const * fieldName )

Definition at line 184 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ expectEqualField< STPathSet >()

template<>
void xrpl::expectEqualField< STPathSet > ( STPathSet const & expected,
STPathSet const & actual,
char const * fieldName )

Definition at line 192 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ expectEqualField() [2/2]

template<class T>
void xrpl::expectEqualField ( T const & expected,
std::reference_wrapper< T const > actual,
char const * fieldName )

Definition at line 204 of file /libxrpl/protocol_autogen/TestHelpers.h.

◆ proposalUniqueId()

uint256 xrpl::proposalUniqueId ( uint256 const & proposeHash,
uint256 const & previousLedger,
std::uint32_t proposeSeq,
NetClock::time_point closeTime,
Slice const & publicKey,
Slice const & signature )

Calculate a unique identifier for a signed proposal.

The identifier is based on all the fields that contribute to the signature, as well as the signature itself. The "last closed ledger" field may be omitted, but the signer will compute the signature as if this field was present. Recipients of the proposal will inject the last closed ledger in order to validate the signature. If the last closed ledger is left out, then it is considered as all zeroes for the purposes of signing.

Parameters
proposeHashThe hash of the proposed position
previousLedgerThe hash of the ledger the proposal is based upon
proposeSeqSequence number of the proposal
closeTimeClose time of the proposal
publicKeySigner's public key
signatureProposal signature

Definition at line 53 of file RCLCxPeerPos.cpp.

◆ mismatch()

RCLValidatedLedger::Seq xrpl::mismatch ( RCLValidatedLedger const & a,
RCLValidatedLedger const & b )

Definition at line 92 of file RCLValidations.cpp.

◆ handleNewValidation()

void xrpl::handleNewValidation ( Application & app,
std::shared_ptr< STValidation > const & val,
std::string const & source,
BypassAccept const bypassAccept = BypassAccept::No,
std::optional< beast::Journal > j = std::nullopt )

Handle a new validation.

Also sets the trust status of a validation based on the validating node's public key and this node's current UNL.

Parameters
appApplication object containing validations and ledgerMaster
valThe validation to add
sourceName associated with validation used in logging

Definition at line 152 of file RCLValidations.cpp.

◆ buildLedger() [1/2]

std::shared_ptr< Ledger > xrpl::buildLedger ( std::shared_ptr< Ledger const > const & parent,
NetClock::time_point closeTime,
bool const closeTimeCorrect,
NetClock::duration closeResolution,
Application & app,
CanonicalTXSet & txns,
std::set< TxID > & failedTxs,
beast::Journal j )

Build a new ledger by applying consensus transactions.

Build a new ledger by applying a set of transactions accepted as part of consensus.

Parameters
parentThe ledger to apply transactions to
closeTimeThe time the ledger closed
closeTimeCorrectWhether consensus agreed on close time
closeResolutionResolution used to determine consensus close time
appHandle to application instance
txsOn entry, transactions to apply; on exit, transactions that must be retried in next round.
failedTxsPopulated with transactions that failed in this round
jJournal to use for logging
Returns
The newly built ledger

Definition at line 173 of file BuildLedger.cpp.

◆ buildLedger() [2/2]

std::shared_ptr< Ledger > xrpl::buildLedger ( LedgerReplay const & replayData,
ApplyFlags applyFlags,
Application & app,
beast::Journal j )

Build a new ledger by replaying transactions.

Build a new ledger by replaying transactions accepted into a prior ledger.

Parameters
replayDataData of the ledger to replay
applyFlagsFlags to use when applying transactions
appHandle to application instance
jJournal to use for logging
Returns
The newly built ledger

Definition at line 217 of file BuildLedger.cpp.

◆ buildLedgerImpl()

template<class ApplyTxs>
std::shared_ptr< Ledger > xrpl::buildLedgerImpl ( std::shared_ptr< Ledger const > const & parent,
NetClock::time_point closeTime,
bool const closeTimeCorrect,
NetClock::duration closeResolution,
Application & app,
beast::Journal j,
ApplyTxs && applyTxs )

Definition at line 37 of file BuildLedger.cpp.

◆ applyTransactions()

std::size_t xrpl::applyTransactions ( Application & app,
std::shared_ptr< Ledger const > const & built,
CanonicalTXSet & txns,
std::set< TxID > & failed,
OpenView & view,
beast::Journal j )

Apply a set of consensus transactions to a ledger.

Parameters
appHandle to application
txnsthe set of transactions to apply,
failedset of transactions that failed to apply
viewledger to apply to
jJournal for logging
Returns
number of transactions applied; transactions to retry left in txns

Definition at line 94 of file BuildLedger.cpp.

◆ neededHashes()

std::vector< uint256 > xrpl::neededHashes ( uint256 const & root,
SHAMap & map,
int max,
SHAMapSyncFilter const * filter )
static

Definition at line 190 of file InboundLedger.cpp.

◆ makeInboundLedgers()

std::unique_ptr< InboundLedgers > xrpl::makeInboundLedgers ( Application & app,
InboundLedgers::clock_type & clock,
beast::insight::Collector::ptr const & collector )

Definition at line 457 of file InboundLedgers.cpp.

◆ makeInboundTransactions()

std::unique_ptr< InboundTransactions > xrpl::makeInboundTransactions ( Application & app,
beast::insight::Collector::ptr const & collector,
std::function< void(std::shared_ptr< SHAMap > const &, bool)> gotSet )

Definition at line 262 of file InboundTransactions.cpp.

◆ makeLedgerCleaner()

std::unique_ptr< LedgerCleaner > xrpl::makeLedgerCleaner ( Application & app,
beast::Journal journal )

Definition at line 454 of file app/ledger/detail/LedgerCleaner.cpp.

◆ shouldAcquire()

bool xrpl::shouldAcquire ( std::uint32_t const currentLedger,
std::uint32_t const ledgerHistory,
std::optional< LedgerIndex > const minimumOnline,
std::uint32_t const candidateLedger,
beast::Journal j )
static

Definition at line 95 of file LedgerMaster.cpp.

◆ populateFetchPack()

void xrpl::populateFetchPack ( SHAMap const & want,
SHAMap const * have,
std::uint32_t cnt,
protocol::TMGetObjectByHash * into,
std::uint32_t seq,
bool withLeaves = true )
static

Populate a fetch pack with data from the map the recipient wants.

A recipient may or may not have the map that they are asking for. If they do, we can optimize the transfer by not including parts of the map that they are already have.

Parameters
haveThe map that the recipient already has (if any).
cntThe maximum number of nodes to return.
intoThe protocol object into which we add information.
seqThe sequence number of the ledger the map is a part of.
withLeavesTrue if leaf nodes should be included.
Note
: The withLeaves parameter is configurable even though the code, so far, only ever sets the parameter to true.

The rationale is that for transaction trees, it may make sense to not include the leaves if the fetch pack is being constructed for someone attempting to get a recent ledger for which they already have the transactions.

However, for historical ledgers, which is the only use we have for fetch packs right now, it makes sense to include the transactions because the caller is unlikely to have them.

Definition at line 2024 of file LedgerMaster.cpp.

◆ saveValidatedLedger()

bool xrpl::saveValidatedLedger ( ServiceRegistry & registry,
std::shared_ptr< Ledger const > const & ledger,
bool current )
static

Definition at line 25 of file LedgerPersistence.cpp.

◆ pendSaveValidated()

bool xrpl::pendSaveValidated ( ServiceRegistry & registry,
std::shared_ptr< Ledger const > const & ledger,
bool isSynchronous,
bool isCurrent )

Save, or arrange to save, a fully-validated ledger.

Parameters
registryThe service registry providing access to required services.
ledgerThe fully-validated ledger to save.
isSynchronousIf true, wait for the save to complete.
isCurrentIf true, the ledger is the current validated ledger.
Returns
false on error.

Definition at line 50 of file LedgerPersistence.cpp.

◆ loadLedgerHelper()

std::shared_ptr< Ledger > xrpl::loadLedgerHelper ( LedgerHeader const & info,
Rules const & rules,
Fees const & fees,
ServiceRegistry & registry,
bool acquire )

Make ledger using info loaded from database.

Parameters
infoLedger information.
rulesRules to use (may be overwritten by setup()).
feesFees to use (may be overwritten by setup()).
registryService registry for dependency injection.
acquireAcquire the ledger if not found locally.
Returns
Shared pointer to the ledger.

Definition at line 95 of file LedgerPersistence.cpp.

◆ finishLoadByIndexOrHash()

void xrpl::finishLoadByIndexOrHash ( std::shared_ptr< Ledger > const & ledger,
beast::Journal j )
static

Definition at line 119 of file LedgerPersistence.cpp.

◆ getLatestLedger()

std::tuple< std::shared_ptr< Ledger >, std::uint32_t, uint256 > xrpl::getLatestLedger ( Rules const & rules,
Fees const & fees,
ServiceRegistry & registry )

Fetch the ledger with the highest sequence contained in the database.

Parameters
rulesRules to use (may be overwritten by setup()).
feesFees to use (may be overwritten by setup()).
registryService registry for dependency injection.
Returns
Tuple of (ledger, sequence, hash), or empty if not found.

Definition at line 135 of file LedgerPersistence.cpp.

◆ loadByIndex()

std::shared_ptr< Ledger > xrpl::loadByIndex ( std::uint32_t ledgerIndex,
Rules const & rules,
Fees const & fees,
ServiceRegistry & registry,
bool acquire = true )

Load a ledger by its sequence number.

Parameters
ledgerIndexThe sequence number of the ledger to load.
rulesRules to use (may be overwritten by setup()).
feesFees to use (may be overwritten by setup()).
registryService registry for dependency injection.
acquireAcquire the ledger if not found locally.
Returns
Shared pointer to the ledger, or nullptr if not found.

Definition at line 144 of file LedgerPersistence.cpp.

◆ loadByHash()

std::shared_ptr< Ledger > xrpl::loadByHash ( uint256 const & ledgerHash,
Rules const & rules,
Fees const & fees,
ServiceRegistry & registry,
bool acquire = true )

Load a ledger by its hash.

Parameters
ledgerHashThe hash of the ledger to load.
rulesRules to use (may be overwritten by setup()).
feesFees to use (may be overwritten by setup()).
registryService registry for dependency injection.
acquireAcquire the ledger if not found locally.
Returns
Shared pointer to the ledger, or nullptr if not found.

Definition at line 162 of file LedgerPersistence.cpp.

◆ addJson()

void xrpl::addJson ( json::Value & json,
LedgerFill const & fill )

Given a Ledger and options, fill a json::Value with a description of the ledger.

Definition at line 353 of file LedgerToJson.cpp.

◆ getJson()

json::Value xrpl::getJson ( LedgerFill const & fill)

Return a new json::Value representing the ledger with given options.

Definition at line 366 of file LedgerToJson.cpp.

◆ copyFrom()

void xrpl::copyFrom ( json::Value & to,
json::Value const & from )

Copy all the keys and values from one object into another.

Definition at line 374 of file LedgerToJson.cpp.

◆ makeLocalTxs()

std::unique_ptr< LocalTxs > xrpl::makeLocalTxs ( )

Definition at line 184 of file LocalTxs.cpp.

◆ debugTxstr()

std::string xrpl::debugTxstr ( std::shared_ptr< STTx const > const & tx)

Definition at line 194 of file OpenLedger.cpp.

◆ debugTostr() [1/3]

std::string xrpl::debugTostr ( OrderedTxs const & set)

Definition at line 202 of file OpenLedger.cpp.

◆ debugTostr() [2/3]

std::string xrpl::debugTostr ( SHAMap const & set)

Definition at line 211 of file OpenLedger.cpp.

◆ debugTostr() [3/3]

std::string xrpl::debugTostr ( std::shared_ptr< ReadView const > const & view)

Definition at line 231 of file OpenLedger.cpp.

◆ logOne()

void xrpl::logOne ( ReadView const & ledger,
uint256 const & tx,
char const * msg,
beast::Journal & j )
static

Definition at line 158 of file LedgerHistory.cpp.

◆ logMetadataDifference()

void xrpl::logMetadataDifference ( ReadView const & builtLedger,
ReadView const & validLedger,
uint256 const & tx,
beast::Journal j )
static

Definition at line 176 of file LedgerHistory.cpp.

◆ leaves()

std::vector< SHAMapItem const * > xrpl::leaves ( SHAMap const & sm)
static

Definition at line 302 of file LedgerHistory.cpp.

◆ makeOrderBookDb()

std::unique_ptr< OrderBookDB > xrpl::makeOrderBookDb ( ServiceRegistry & registry,
OrderBookDBConfig const & config )

Create an OrderBookDB instance.

Parameters
registryService registry for accessing other services
configConfiguration parameters
Returns
A new OrderBookDB instance

Definition at line 43 of file OrderBookDBImpl.cpp.

◆ fixConfigPorts()

void xrpl::fixConfigPorts ( Config & config,
Endpoints const & endpoints )
static

Definition at line 2169 of file Application.cpp.

◆ makeApplication()

std::unique_ptr< Application > xrpl::makeApplication ( std::unique_ptr< Config > config,
std::unique_ptr< Logs > logs,
std::unique_ptr< TimeKeeper > timeKeeper )

Definition at line 2159 of file Application.cpp.

◆ makeCollectorManager()

std::unique_ptr< CollectorManager > xrpl::makeCollectorManager ( Section const & params,
beast::Journal journal )

Definition at line 65 of file CollectorManager.cpp.

◆ makeLoadManager()

std::unique_ptr< LoadManager > xrpl::makeLoadManager ( Application & app,
beast::Journal journal )

Definition at line 177 of file LoadManager.cpp.

◆ adjustDescriptorLimit()

bool xrpl::adjustDescriptorLimit ( int needed,
beast::Journal j )

Definition at line 82 of file Main.cpp.

◆ printHelp()

void xrpl::printHelp ( po::options_description const & desc)

Definition at line 130 of file Main.cpp.

◆ run()

int xrpl::run ( int argc,
char ** argv )

Definition at line 354 of file Main.cpp.

◆ getNodeIdentity() [2/2]

std::pair< PublicKey, SecretKey > xrpl::getNodeIdentity ( Application & app,
boost::program_options::variables_map const & cmdline )

The cryptographic credentials identifying this server instance.

Parameters
appThe application object
cmdlineThe command line parameters passed into the application.

Definition at line 23 of file NodeIdentity.cpp.

◆ make_AmendmentTable()

std::unique_ptr< AmendmentTable > xrpl::make_AmendmentTable ( ServiceRegistry & registry,
std::chrono::seconds majorityTime,
std::vector< AmendmentTable::FeatureInfo > const & supported,
Section const & enabled,
Section const & vetoed,
beast::Journal journal )

◆ convertBlobsToTxResult()

void xrpl::convertBlobsToTxResult ( RelationalDatabase::AccountTxs & to,
std::uint32_t ledgerIndex,
std::string const & status,
Blob const & rawTxn,
Blob const & rawMeta,
Application & app )

Definition at line 24 of file AccountTxPaging.cpp.

◆ saveLedgerAsync()

void xrpl::saveLedgerAsync ( Application & app,
std::uint32_t seq )

Definition at line 58 of file AccountTxPaging.cpp.

◆ parseSection()

std::vector< std::pair< uint256, std::string > > xrpl::parseSection ( Section const & section)
static

Definition at line 50 of file AmendmentTable.cpp.

◆ setupHashRouter()

HashRouter::Setup xrpl::setupHashRouter ( Config const & config)

Create HashRouter setup from configuration.

Definition at line 17 of file setup_HashRouter.cpp.

◆ getFeeLevelPaid()

FeeLevel64 xrpl::getFeeLevelPaid ( ReadView const & view,
STTx const & tx )
static

Definition at line 56 of file TxQ.cpp.

◆ getLastLedgerSequence()

std::optional< LedgerIndex > xrpl::getLastLedgerSequence ( STTx const & tx)
static

Definition at line 84 of file TxQ.cpp.

◆ increase()

FeeLevel64 xrpl::increase ( FeeLevel64 level,
std::uint32_t increasePercent )
static

Definition at line 92 of file TxQ.cpp.

◆ setupTxQ()

TxQ::Setup xrpl::setupTxQ ( Config const & config)

Build a TxQ::Setup object from application configuration.

Definition at line 1872 of file TxQ.cpp.

◆ to_string() [28/32]

std::string xrpl::to_string ( ListDisposition disposition)

Definition at line 63 of file ValidatorList.cpp.

◆ splitMessageParts()

std::size_t xrpl::splitMessageParts ( std::vector< ValidatorList::MessageWithHash > & messages,
protocol::TMValidatorListCollection const & largeMsg,
std::size_t maxSize,
std::size_t begin,
std::size_t end )

Definition at line 516 of file ValidatorList.cpp.

◆ splitMessage()

std::size_t xrpl::splitMessage ( std::vector< ValidatorList::MessageWithHash > & messages,
protocol::TMValidatorListCollection const & largeMsg,
std::size_t maxSize,
std::size_t begin = 0,
std::size_t end = 0 )

Definition at line 495 of file ValidatorList.cpp.

◆ buildValidatorListMessage() [1/2]

std::size_t xrpl::buildValidatorListMessage ( std::vector< ValidatorList::MessageWithHash > & messages,
std::uint32_t rawVersion,
std::string const & rawManifest,
ValidatorBlobInfo const & currentBlob,
std::size_t maxSize )

Definition at line 575 of file ValidatorList.cpp.

◆ buildValidatorListMessage() [2/2]

std::size_t xrpl::buildValidatorListMessage ( std::vector< ValidatorList::MessageWithHash > & messages,
std::uint64_t peerSequence,
std::uint32_t rawVersion,
std::string const & rawManifest,
std::map< std::size_t, ValidatorBlobInfo > const & blobInfos,
std::size_t maxSize )

Definition at line 607 of file ValidatorList.cpp.

◆ makeFeeVote()

std::unique_ptr< FeeVote > xrpl::makeFeeVote ( FeeSetup const & setup,
beast::Journal journal )

Create an instance of the FeeVote logic.

Parameters
setupThe fee schedule to vote for.
journalWhere to log.

Definition at line 317 of file FeeVoteImpl.cpp.

◆ makeNetworkOPs()

std::unique_ptr< NetworkOPs > xrpl::makeNetworkOPs ( ServiceRegistry & registry,
NetworkOPs::clock_type & clock,
bool standalone,
std::size_t minPeerCount,
bool startValid,
JobQueue & jobQueue,
LedgerMaster & ledgerMaster,
ValidatorKeys const & validatorKeys,
boost::asio::io_context & ioSvc,
beast::Journal journal,
beast::insight::Collector::ptr const & collector )

Definition at line 4846 of file NetworkOPs.cpp.

◆ trunc32()

std::uint32_t xrpl::trunc32 ( std::uint64_t v)
static

Definition at line 2308 of file NetworkOPs.cpp.

◆ makeSHAMapStore()

std::unique_ptr< SHAMapStore > xrpl::makeSHAMapStore ( Application & app,
NodeStore::Scheduler & scheduler,
beast::Journal journal )

Definition at line 671 of file SHAMapStoreImp.cpp.

◆ toDrops()

template<class T>
XRPAmount xrpl::toDrops ( FeeLevel< T > const & level,
XRPAmount baseFee )

Definition at line 830 of file TxQ.h.

◆ toFeeLevel()

FeeLevel64 xrpl::toFeeLevel ( XRPAmount const & drops,
XRPAmount const & baseFee )

Definition at line 836 of file TxQ.h.

◆ hash_append() [9/11]

template<class Hasher>
void xrpl::hash_append ( Hasher & h,
ValidatorBlobInfo const & blobInfo )

Definition at line 887 of file ValidatorList.h.

◆ hash_append() [10/11]

template<class Hasher>
void xrpl::hash_append ( Hasher & h,
std::vector< ValidatorBlobInfo > const & blobs )

Definition at line 899 of file ValidatorList.h.

◆ hash_append() [11/11]

template<class Hasher>
void xrpl::hash_append ( Hasher & h,
std::map< std::size_t, ValidatorBlobInfo > const & blobs )

Definition at line 907 of file ValidatorList.h.

◆ setupRelationalDatabase()

SQLiteDatabase xrpl::setupRelationalDatabase ( ServiceRegistry & registry,
Config const & config,
JobQueue & jobQueue )

setupRelationalDatabase Creates and returns a SQLiteDatabase instance based on configuration.

It's recommended to use it as a singleton, but it's not enforced (e.g. if you have more than one database).

Parameters
registryThe service registry.
configConfig object.
jobQueueJobQueue object.
Returns
SQLiteDatabase instance.

Definition at line 652 of file SQLiteDatabase.cpp.

◆ initPeerFinderDB()

void xrpl::initPeerFinderDB ( soci::session & session,
BasicConfig const & config,
beast::Journal j )

initPeerFinderDB Opens a session with the peer finder database.

Parameters
sessionSession with the peer finder database.
configPath to the database and other opening parameters.
jJournal.

Definition at line 28 of file PeerFinder.cpp.

◆ updatePeerFinderDB()

void xrpl::updatePeerFinderDB ( soci::session & session,
int currentSchemaVersion,
beast::Journal j )

updatePeerFinderDB Updates the peer finder database to a new version.

Parameters
sessionSession with the database.
currentSchemaVersionNew version of the database.
jJournal.

Definition at line 60 of file PeerFinder.cpp.

◆ readPeerFinderDB()

void xrpl::readPeerFinderDB ( soci::session & session,
std::function< void(std::string const &, int)> const & func )

readPeerFinderDB Reads all entries from the peer finder database and invokes the given callback for each entry.

Parameters
sessionSession with the database.
funcCallback to invoke for each entry.

Definition at line 209 of file PeerFinder.cpp.

◆ savePeerFinderDB()

void xrpl::savePeerFinderDB ( soci::session & session,
std::vector< PeerFinder::Store::Entry > const & v )

savePeerFinderDB Saves a new entry to the peer finder database.

Parameters
sessionSession with the database.
vEntry to save which contains information about a new peer.

Definition at line 229 of file PeerFinder.cpp.

◆ shouldCloseLedger()

bool xrpl::shouldCloseLedger ( bool anyTransactions,
std::size_t prevProposers,
std::size_t proposersClosed,
std::size_t proposersValidated,
std::chrono::milliseconds prevRoundTime,
std::chrono::milliseconds timeSincePrevClose,
std::chrono::milliseconds openTime,
std::chrono::milliseconds idleInterval,
ConsensusParms const & parms,
beast::Journal j,
std::unique_ptr< std::stringstream > const & clog = {} )

Determines whether the current ledger should close at this time.

This function should be called when a ledger is open and there is no close in progress, or when a transaction is received and no close is in progress.

Parameters
anyTransactionsindicates whether any transactions have been received
prevProposersproposers in the last closing
proposersClosedproposers who have currently closed this ledger
proposersValidatedproposers who have validated the last closed ledger
prevRoundTimetime for the previous ledger to reach consensus
timeSincePrevClosetime since the previous ledger's (possibly rounded) close time
openTimeduration this ledger has been open
idleIntervalthe network's desired idle interval
parmsConsensus constant parameters
jjournal for logging
cloglog object to which to append

Definition at line 18 of file Consensus.cpp.

◆ checkConsensusReached()

bool xrpl::checkConsensusReached ( std::size_t agreeing,
std::size_t total,
bool countSelf,
std::size_t minConsensusPct,
bool reachedMax,
bool stalled,
std::unique_ptr< std::stringstream > const & clog )

Definition at line 93 of file Consensus.cpp.

◆ checkConsensus()

ConsensusState xrpl::checkConsensus ( std::size_t prevProposers,
std::size_t currentProposers,
std::size_t currentAgree,
std::size_t currentFinished,
std::chrono::milliseconds previousAgreeTime,
std::chrono::milliseconds currentAgreeTime,
bool stalled,
ConsensusParms const & parms,
bool proposing,
beast::Journal j,
std::unique_ptr< std::stringstream > const & clog = {} )

Determine whether the network reached consensus and whether we joined.

Parameters
prevProposersproposers in the last closing (not including us)
currentProposersproposers in this closing so far (not including us)
currentAgreeproposers who agree with us
currentFinishedproposers who have validated a ledger after this one
previousAgreeTimehow long, in milliseconds, it took to agree on the last ledger
currentAgreeTimehow long, in milliseconds, we've been trying to agree
stalledthe network appears to be stalled, where neither we nor our peers have changed their vote on any disputes in a while. This is undesirable, and should be rare, and will cause us to end consensus without 80% agreement.
parmsConsensus constant parameters
proposingwhether we should count ourselves
jjournal for logging
cloglog object to which to append

Definition at line 161 of file Consensus.cpp.

◆ participantsNeeded()

int xrpl::participantsNeeded ( int participants,
int percent )

How many of the participants must agree to reach a given threshold?

Note that the number may not precisely yield the requested percentage. For example, with with size = 5 and percent = 70, we return 3, but 3 out of 5 works out to 60%. There are no security implications to this.

Parameters
participantsThe number of participants (i.e. validators)
percentThe percent that we want to reach
Returns
the number of participants which must agree

Definition at line 1436 of file Consensus.h.

◆ getNeededWeight()

std::pair< std::size_t, std::optional< ConsensusParms::AvalancheState > > xrpl::getNeededWeight ( ConsensusParms const & p,
ConsensusParms::AvalancheState currentState,
int percentTime,
std::size_t currentRounds,
std::size_t minimumRounds )

Definition at line 152 of file ConsensusParms.h.

◆ operator==() [31/31]

template<class NodeId, class LedgerId, class Position>
bool xrpl::operator== ( ConsensusProposal< NodeId, LedgerId, Position > const & a,
ConsensusProposal< NodeId, LedgerId, Position > const & b )

Definition at line 254 of file ConsensusProposal.h.

◆ to_string() [29/32]

std::string xrpl::to_string ( ConsensusMode m)

Definition at line 52 of file ConsensusTypes.h.

◆ to_string() [30/32]

std::string xrpl::to_string ( ConsensusPhase p)

Definition at line 99 of file ConsensusTypes.h.

◆ isCurrent()

bool xrpl::isCurrent ( ValidationParms const & p,
NetClock::time_point now,
NetClock::time_point signTime,
NetClock::time_point seenTime )

Whether a validation is still current.

Determines whether a validation can still be considered the current validation from a node based on when it was signed by that node and first seen by this node.

Parameters
pValidationParms with timing parameters
nowCurrent time
signTimeWhen the validation was signed
seenTimeWhen the validation was first seen locally

Definition at line 129 of file Validations.h.

◆ to_string() [31/32]

std::string xrpl::to_string ( ValStatus m)

Definition at line 162 of file Validations.h.

◆ setupFeeVote()

FeeSetup xrpl::setupFeeVote ( Section const & section)

Definition at line 1199 of file Config.cpp.

◆ setupDatabaseCon()

DatabaseCon::Setup xrpl::setupDatabaseCon ( Config const & c,
std::optional< beast::Journal > j = std::nullopt )

Definition at line 1219 of file Config.cpp.

◆ parseIniFile()

IniFileSections xrpl::parseIniFile ( std::string const & strInput,
bool const bTrim )

Definition at line 164 of file Config.cpp.

◆ getIniFileSection()

IniFileSections::mapped_type * xrpl::getIniFileSection ( IniFileSections & secSource,
std::string const & strSection )

Definition at line 212 of file Config.cpp.

◆ getSingleSection()

bool xrpl::getSingleSection ( IniFileSections & secSource,
std::string const & strSection,
std::string & strValue,
beast::Journal j )

Definition at line 221 of file Config.cpp.

◆ getEnvVar()

std::string xrpl::getEnvVar ( char const * name)
staticnodiscard

Definition at line 256 of file Config.cpp.

◆ checkZeroPorts()

void xrpl::checkZeroPorts ( Config const & config)
static

Definition at line 424 of file Config.cpp.

◆ getFeatureValue()

std::optional< std::string > xrpl::getFeatureValue ( boost::beast::http::fields const & headers,
std::string const & feature )

Get feature's header value.

Parameters
headersrequest/response header
featurename
Returns
seated optional with feature's value if the feature is found in the header, unseated optional otherwise

Definition at line 51 of file Handshake.cpp.

◆ isFeatureValue()

bool xrpl::isFeatureValue ( boost::beast::http::fields const & headers,
std::string const & feature,
std::string const & value )

Check if a feature's value is equal to the specified value.

Parameters
headersrequest/response header
featureto check
valueof the feature to check, must be a single value; i.e. not value1,value2...
Returns
true if the feature's value matches the specified value, false if doesn't match or the feature is not found in the header

Definition at line 65 of file Handshake.cpp.

◆ featureEnabled()

bool xrpl::featureEnabled ( boost::beast::http::fields const & headers,
std::string const & feature )

Check if a feature is enabled.

Parameters
headersrequest/response header
featureto check
Returns
true if enabled

Definition at line 77 of file Handshake.cpp.

◆ makeFeaturesRequestHeader()

std::string xrpl::makeFeaturesRequestHeader ( bool comprEnabled,
bool ledgerReplayEnabled,
bool txReduceRelayEnabled,
bool vpReduceRelayEnabled )

Make request header X-Protocol-Ctl value with supported features.

Parameters
comprEnabledif true then compression feature is enabled
ledgerReplayEnabledif true then ledger-replay feature is enabled
txReduceRelayEnabledif true then transaction reduce-relay feature is enabled
vpReduceRelayEnabledif true then validation/proposal reduce-relay base squelch feature is enabled
Returns
X-Protocol-Ctl header value

Definition at line 83 of file Handshake.cpp.

◆ makeFeaturesResponseHeader()

std::string xrpl::makeFeaturesResponseHeader ( http_request_type const & headers,
bool comprEnabled,
bool ledgerReplayEnabled,
bool txReduceRelayEnabled,
bool vpReduceRelayEnabled )

Make response header X-Protocol-Ctl value with supported features.

If the request has a feature that we support enabled and the feature's configuration is enabled then enable this feature in the response header.

Parameters
headerrequest's header
comprEnabledif true then compression feature is enabled
ledgerReplayEnabledif true then ledger-replay feature is enabled
txReduceRelayEnabledif true then transaction reduce-relay feature is enabled
vpReduceRelayEnabledif true then validation/proposal reduce-relay base squelch feature is enabled
Returns
X-Protocol-Ctl header value

Definition at line 102 of file Handshake.cpp.

◆ hashLastMessage()

std::optional< BaseUInt< 512 > > xrpl::hashLastMessage ( SSL const * ssl,
size_t(* get )(const SSL *, void *, size_t) )
static

Hashes the latest finished message from an SSL stream.

Parameters
sslthe session to get the message from.
geta pointer to the function to call to retrieve the finished message. This can be either:
  • SSL_get_finished or
  • SSL_get_peer_finished.
Returns
true if successful, false otherwise.
Note
This construct is non-standard. There are potential "standard" alternatives that should be considered. For a discussion, on this topic, see https://github.com/openssl/openssl/issues/5509 and https://github.com/XRPLF/rippled/issues/2413.

Definition at line 136 of file Handshake.cpp.

◆ makeSharedValue()

std::optional< uint256 > xrpl::makeSharedValue ( stream_type & ssl,
beast::Journal journal )

Computes a shared value based on the SSL connection state.

When there is no man in the middle, both sides will compute the same value. In the presence of an attacker, the computed values will be different.

Parameters
sslthe SSL/TLS connection state.
Returns
A 256-bit value on success; an unseated optional otherwise.

Definition at line 154 of file Handshake.cpp.

◆ buildHandshake()

void xrpl::buildHandshake ( boost::beast::http::fields & h,
xrpl::uint256 const & sharedValue,
std::optional< std::uint32_t > networkID,
beast::IP::Address publicIp,
beast::IP::Address remoteIp,
Application & app )

Insert fields headers necessary for upgrading the link to the peer protocol.

Definition at line 184 of file Handshake.cpp.

◆ verifyHandshake()

PublicKey xrpl::verifyHandshake ( boost::beast::http::fields const & headers,
uint256 const & sharedValue,
std::optional< std::uint32_t > networkID,
beast::IP::Address publicIp,
beast::IP::Address remote,
Application & app )

Validate header fields necessary for upgrading the link to the peer protocol.

This performs critical security checks that ensure that prevent MITM attacks on our peer-to-peer links and that the remote peer has the private keys that correspond to the public identity it claims.

Returns
The public key of the remote peer.
Exceptions
Aclass derived from std::exception.

Definition at line 229 of file Handshake.cpp.

◆ makeRequest()

request_type xrpl::makeRequest ( bool crawlPublic,
bool comprEnabled,
bool ledgerReplayEnabled,
bool txReduceRelayEnabled,
bool vpReduceRelayEnabled )

Make outbound http request.

Parameters
crawlPublicif true then server's IP/Port are included in crawl
comprEnabledif true then compression feature is enabled
ledgerReplayEnabledif true then ledger-replay feature is enabled
txReduceRelayEnabledif true then transaction reduce-relay feature is enabled
vpReduceRelayEnabledif true then validation/proposal reduce-relay feature is enabled
Returns
http request with empty body

Definition at line 365 of file Handshake.cpp.

◆ makeResponse()

http_response_type xrpl::makeResponse ( bool crawlPublic,
http_request_type const & req,
beast::IP::Address publicIp,
beast::IP::Address remoteIp,
uint256 const & sharedValue,
std::optional< std::uint32_t > networkID,
ProtocolVersion version,
Application & app )

Make http response.

Parameters
crawlPublicif true then server's IP/Port are included in crawl
reqincoming http request
publicIpserver's public IP
remoteIppeer's IP
sharedValueshared value based on the SSL connection state
networkIDspecifies what network we intend to connect to
versionsupported protocol version
appApplication's reference to access some common properties
Returns
http response

Definition at line 389 of file Handshake.cpp.

◆ peerFeatureEnabled() [1/2]

template<typename Headers>
bool xrpl::peerFeatureEnabled ( Headers const & request,
std::string const & feature,
std::string value,
bool config )

Check if a feature should be enabled for a peer.

The feature is enabled if its configured value is true and the http header has the specified feature value.

Template Parameters
headersrequest (inbound) or response (outbound) header
Parameters
requesthttp headers
featureto check
configfeature's configuration value
valuefeature's value to check in the headers
Returns
true if the feature is enabled

Definition at line 171 of file Handshake.h.

◆ peerFeatureEnabled() [2/2]

template<typename Headers>
bool xrpl::peerFeatureEnabled ( Headers const & request,
std::string const & feature,
bool config )

Wrapper for enable(1)/disable type(0) of feature.

Definition at line 183 of file Handshake.h.

◆ makeSquelchMessage()

std::shared_ptr< Message > xrpl::makeSquelchMessage ( PublicKey const & validator,
bool squelch,
uint32_t squelchDuration )

Definition at line 1400 of file OverlayImpl.cpp.

◆ setupOverlay() [1/2]

Overlay::Setup xrpl::setupOverlay ( BasicConfig const & config,
beast::Journal j )

Definition at line 1515 of file OverlayImpl.cpp.

◆ makeOverlay()

std::unique_ptr< Overlay > xrpl::makeOverlay ( Application & app,
Overlay::Setup const & setup,
ServerHandler & serverHandler,
Resource::Manager & resourceManager,
Resolver & resolver,
boost::asio::io_context & ioContext,
BasicConfig const & config,
beast::insight::Collector::ptr const & collector )

Creates the implementation of Overlay.

Definition at line 1626 of file OverlayImpl.cpp.

◆ stringIsUInt256Sized()

bool xrpl::stringIsUInt256Sized ( std::string const & pBuffStr)
static

Definition at line 192 of file PeerImp.cpp.

◆ getPeerWithTree()

std::shared_ptr< PeerImp > xrpl::getPeerWithTree ( OverlayImpl & ov,
uint256 const & rootHash,
PeerImp const * skip )
static

Definition at line 3087 of file PeerImp.cpp.

◆ getPeerWithLedger()

std::shared_ptr< PeerImp > xrpl::getPeerWithLedger ( OverlayImpl & ov,
uint256 const & ledgerHash,
LedgerIndex ledger,
PeerImp const * skip )
static

Definition at line 3111 of file PeerImp.cpp.

◆ makePeerSetBuilder()

std::unique_ptr< PeerSetBuilder > xrpl::makePeerSetBuilder ( Application & app)

Definition at line 137 of file PeerSet.cpp.

◆ makeDummyPeerSet()

std::unique_ptr< PeerSet > xrpl::makeDummyPeerSet ( Application & app)

Make a dummy PeerSet that does not do anything.

Note
For the use case of InboundLedger in ApplicationImp::loadOldLedger(), where a real PeerSet is not needed.

Definition at line 180 of file PeerSet.cpp.

◆ protocolMessageType() [1/3]

protocol::MessageType xrpl::protocolMessageType ( protocol::TMGetLedger const & )

Definition at line 21 of file ProtocolMessage.h.

◆ protocolMessageType() [2/3]

protocol::MessageType xrpl::protocolMessageType ( protocol::TMReplayDeltaRequest const & )

Definition at line 27 of file ProtocolMessage.h.

◆ protocolMessageType() [3/3]

protocol::MessageType xrpl::protocolMessageType ( protocol::TMProofPathRequest const & )

Definition at line 33 of file ProtocolMessage.h.

◆ protocolMessageName()

template<class = void>
std::string xrpl::protocolMessageName ( int type)

Returns the name of a protocol message given its type.

Definition at line 41 of file ProtocolMessage.h.

◆ invokeProtocolMessage()

template<class Buffers, class Handler>
std::pair< std::size_t, boost::system::error_code > xrpl::invokeProtocolMessage ( Buffers const & buffers,
Handler & handler,
std::size_t & hint )

Calls the handler for up to one protocol message in the passed buffers.

If there is insufficient data to produce a complete protocol message, zero is returned for the number of bytes consumed.

Parameters
buffersThe buffer that contains the data we've received
handlerThe handler that will be used to process the message
hintIf possible, a hint as to the amount of data to read next. The returned value MAY be zero, which means "no hint"
Returns
The number of bytes consumed, or the error code if any.

Definition at line 309 of file ProtocolMessage.h.

◆ to_string() [32/32]

std::string xrpl::to_string ( ProtocolVersion const & p)

Print a protocol version a human-readable string.

Definition at line 61 of file ProtocolVersion.cpp.

◆ parseProtocolVersions()

std::vector< ProtocolVersion > xrpl::parseProtocolVersions ( boost::beast::string_view const & s)

Parse a set of protocol versions.

Given a comma-separated string, extract and return all those that look like valid protocol versions (i.e. XRPL/2.0 and later). Strings that are not parsable as valid protocol strings are excluded from the result set.

Returns
A list of all apparently valid protocol versions.
Note
The returned list of protocol versions is guaranteed to contain no duplicates and will be sorted in ascending protocol order.

Definition at line 67 of file ProtocolVersion.cpp.

◆ negotiateProtocolVersion() [1/2]

std::optional< ProtocolVersion > xrpl::negotiateProtocolVersion ( std::vector< ProtocolVersion > const & versions)

Given a list of supported protocol versions, choose the one we prefer.

Definition at line 115 of file ProtocolVersion.cpp.

◆ negotiateProtocolVersion() [2/2]

std::optional< ProtocolVersion > xrpl::negotiateProtocolVersion ( boost::beast::string_view const & versions)

Given a list of supported protocol versions, choose the one we prefer.

Definition at line 134 of file ProtocolVersion.cpp.

◆ supportedProtocolVersions()

std::string const & xrpl::supportedProtocolVersions ( )

The list of all the protocol versions we support.

Definition at line 142 of file ProtocolVersion.cpp.

◆ isProtocolSupported()

bool xrpl::isProtocolSupported ( ProtocolVersion const & v)

Determine whether we support a specific protocol version.

Definition at line 160 of file ProtocolVersion.cpp.

◆ makeProtocol()

ProtocolVersion xrpl::makeProtocol ( std::uint16_t major,
std::uint16_t minor )
constexpr

Definition at line 21 of file ProtocolVersion.h.

◆ sendIf()

template<typename Predicate>
SendIfPred< Predicate > xrpl::sendIf ( std::shared_ptr< Message > const & m,
Predicate const & f )

Helper function to aid in type deduction.

Definition at line 54 of file predicates.h.

◆ sendIfNot()

template<typename Predicate>
SendIfNotPred< Predicate > xrpl::sendIfNot ( std::shared_ptr< Message > const & m,
Predicate const & f )

Helper function to aid in type deduction.

Definition at line 85 of file predicates.h.

◆ accountSourceAssets()

hash_set< PathAsset > xrpl::accountSourceAssets ( AccountID const & account,
std::shared_ptr< AssetCache > const & lrCache,
bool includeXRP )

Definition at line 17 of file AccountAssets.cpp.

◆ accountDestAssets()

hash_set< PathAsset > xrpl::accountDestAssets ( AccountID const & account,
std::shared_ptr< AssetCache > const & lrCache,
bool includeXRP )

Definition at line 61 of file AccountAssets.cpp.

◆ operator<<() [23/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
Pathfinder::NodeType t )
static

Definition at line 46 of file Pathfinder.cpp.

◆ operator<<() [24/24]

std::ostream & xrpl::operator<< ( std::ostream & os,
Pathfinder::PaymentType t )
static

Definition at line 51 of file Pathfinder.cpp.

◆ isDefaultPath()

bool xrpl::isDefaultPath ( STPath const & path)
static

Definition at line 492 of file Pathfinder.cpp.

◆ removeIssuer()

STPath xrpl::removeIssuer ( STPath const & path)
static

Definition at line 511 of file Pathfinder.cpp.

◆ addUniquePath()

void xrpl::addUniquePath ( STPathSet & pathSet,
STPath const & path )

Definition at line 963 of file Pathfinder.cpp.

◆ largestAmount()

STAmount xrpl::largestAmount ( STAmount const & amt)

Definition at line 8 of file PathfinderUtils.h.

◆ convertAmount()

STAmount xrpl::convertAmount ( STAmount const & amt,
bool all )

Definition at line 20 of file PathfinderUtils.h.

◆ convertAllCheck()

bool xrpl::convertAllCheck ( STAmount const & a)

Definition at line 29 of file PathfinderUtils.h.

◆ passwordUnrequiredOrSentCorrect()

bool xrpl::passwordUnrequiredOrSentCorrect ( Port const & port,
json::Value const & params )

Definition at line 28 of file Role.cpp.

◆ ipAllowed()

bool xrpl::ipAllowed ( beast::IP::Address const & remoteIp,
std::vector< boost::asio::ip::network_v4 > const & nets4,
std::vector< boost::asio::ip::network_v6 > const & nets6 )

True if remoteIp is in any of adminIp.

Parameters
remoteIpRemote address for which to search.
adminIpList of IP's in which to search.
Returns
Whether remoteIp is in adminIp.

Definition at line 42 of file Role.cpp.

◆ isAdmin()

bool xrpl::isAdmin ( Port const & port,
json::Value const & params,
beast::IP::Address const & remoteIp )

Definition at line 81 of file Role.cpp.

◆ requestRole()

Role xrpl::requestRole ( Role const & required,
Port const & port,
json::Value const & params,
beast::IP::Endpoint const & remoteIp,
std::string_view user )

Return the allowed privilege role.

params must meet the requirements of the JSON-RPC specification. It must be of type Object, containing the key params which is an array with at least one object. Inside this object are the optional keys 'admin_user' and 'admin_password' used to validate the credentials. If user is non-blank, it's username passed in the HTTP header by a secureGateway proxy.

Definition at line 88 of file Role.cpp.

◆ isUnlimited() [1/2]

bool xrpl::isUnlimited ( Role const & role)

ADMIN and IDENTIFIED roles shall have unlimited resources.

Check if the role entitles the user to unlimited resources.

Definition at line 115 of file Role.cpp.

◆ isUnlimited() [2/2]

bool xrpl::isUnlimited ( Role const & required,
Port const & port,
json::Value const & params,
beast::IP::Endpoint const & remoteIp,
std::string const & user )

Definition at line 121 of file Role.cpp.

◆ requestInboundEndpoint()

Resource::Consumer xrpl::requestInboundEndpoint ( Resource::Manager & manager,
beast::IP::Endpoint const & remoteAddress,
Role const & role,
std::string_view user,
std::string_view forwardedFor )

Definition at line 132 of file Role.cpp.

◆ extractIpAddrFromField()

std::string_view xrpl::extractIpAddrFromField ( std::string_view field)
static

Definition at line 146 of file Role.cpp.

◆ forwardedFor()

std::string_view xrpl::forwardedFor ( http_request_type const & request)

Definition at line 251 of file Role.cpp.

◆ createHTTPPost()

std::string xrpl::createHTTPPost ( std::string const & strHost,
std::string const & strPath,
std::string const & strMsg,
std::unordered_map< std::string, std::string > const & mapRequestHeaders )

Definition at line 67 of file RPCCall.cpp.

◆ jsonrpcRequest()

std::string xrpl::jsonrpcRequest ( std::string const & strMethod,
json::Value const & params,
json::Value const & id )

Definition at line 1524 of file RPCCall.cpp.

◆ rpcCmdToJson()

json::Value xrpl::rpcCmdToJson ( std::vector< std::string > const & args,
json::Value & retParams,
unsigned int apiVersion,
beast::Journal j )

Definition at line 1621 of file RPCCall.cpp.

◆ rpcClient()

std::pair< int, json::Value > xrpl::rpcClient ( std::vector< std::string > const & args,
Config const & config,
Logs & logs,
unsigned int apiVersion,
std::unordered_map< std::string, std::string > const & headers = {} )

Internal invocation of RPC client.

Used by both xrpld command line as well as xrpld unit tests

Definition at line 1666 of file RPCCall.cpp.

◆ makeRPCSub()

std::shared_ptr< RPCSub > xrpl::makeRPCSub ( InfoSub::Source & source,
boost::asio::io_context & ioContext,
JobQueue & jobQueue,
std::string const & strUrl,
std::string const & strUsername,
std::string const & strPassword,
ServiceRegistry & registry )

Definition at line 211 of file RPCSub.cpp.

◆ isStatusRequest()

bool xrpl::isStatusRequest ( http_request_type const & request)
static

Definition at line 82 of file ServerHandler.cpp.

◆ statusRequestResponse()

Handoff xrpl::statusRequestResponse ( http_request_type const & request,
boost::beast::http::status status )
static

Definition at line 89 of file ServerHandler.cpp.

◆ authorized()

bool xrpl::authorized ( Port const & port,
std::map< std::string, std::string > const & h )
static

Definition at line 107 of file ServerHandler.cpp.

◆ makeOutput()

json::Output xrpl::makeOutput ( Session & session)
static

Definition at line 265 of file ServerHandler.cpp.

◆ buildMap()

std::map< std::string, std::string > xrpl::buildMap ( boost::beast::http::fields const & h)
static

Definition at line 271 of file ServerHandler.cpp.

◆ buffersToString()

template<class ConstBufferSequence>
std::string xrpl::buffersToString ( ConstBufferSequence const & bs)
static

Definition at line 288 of file ServerHandler.cpp.

◆ logDuration()

template<class T>
void xrpl::logDuration ( json::Value const & request,
T const & duration,
beast::Journal & journal )

Definition at line 396 of file ServerHandler.cpp.

◆ makeJsonError()

json::Value xrpl::makeJsonError ( json::Int code,
json::Value && message )
static

Definition at line 585 of file ServerHandler.cpp.

◆ toPort()

Port xrpl::toPort ( ParsedPort const & parsed,
std::ostream & log )
static

Definition at line 1081 of file ServerHandler.cpp.

◆ parsePorts()

std::vector< Port > xrpl::parsePorts ( Config const & config,
std::ostream & log )
static

Definition at line 1127 of file ServerHandler.cpp.

◆ setupClient()

void xrpl::setupClient ( ServerHandler::Setup & setup)
static

Definition at line 1200 of file ServerHandler.cpp.

◆ setupOverlay() [2/2]

void xrpl::setupOverlay ( ServerHandler::Setup & setup)
static

Definition at line 1229 of file ServerHandler.cpp.

◆ setupServerHandler()

ServerHandler::Setup xrpl::setupServerHandler ( Config const & config,
std::ostream & log )

Definition at line 1242 of file ServerHandler.cpp.

◆ makeServerHandler()

std::unique_ptr< ServerHandler > xrpl::makeServerHandler ( Application & app,
boost::asio::io_context & ioContext,
JobQueue & jobQueue,
NetworkOPs & networkOPs,
Resource::Manager & resourceManager,
CollectorManager & cm )

Definition at line 1254 of file ServerHandler.cpp.

◆ doLedgerGrpc()

std::pair< org::xrpl::rpc::v1::GetLedgerResponse, grpc::Status > xrpl::doLedgerGrpc ( RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerRequest > & context)

Definition at line 168 of file xrpld/rpc/handlers/ledger/Ledger.cpp.

◆ doLedgerEntryGrpc()

std::pair< org::xrpl::rpc::v1::GetLedgerEntryResponse, grpc::Status > xrpl::doLedgerEntryGrpc ( RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerEntryRequest > & context)

Definition at line 977 of file LedgerEntry.cpp.

◆ doLedgerDataGrpc()

std::pair< org::xrpl::rpc::v1::GetLedgerDataResponse, grpc::Status > xrpl::doLedgerDataGrpc ( RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerDataRequest > & context)

Definition at line 134 of file LedgerData.cpp.

◆ doLedgerDiffGrpc()

std::pair< org::xrpl::rpc::v1::GetLedgerDiffResponse, grpc::Status > xrpl::doLedgerDiffGrpc ( RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerDiffRequest > & context)

Definition at line 18 of file LedgerDiff.cpp.

◆ addChannel()

void xrpl::addChannel ( json::Value & jsonLines,
SLE const & line )

Definition at line 39 of file AccountChannels.cpp.

◆ doAccountChannels()

json::Value xrpl::doAccountChannels ( RPC::JsonContext & context)

Definition at line 72 of file AccountChannels.cpp.

◆ doAccountCurrencies()

json::Value xrpl::doAccountCurrencies ( RPC::JsonContext & context)

Definition at line 22 of file AccountCurrencies.cpp.

◆ injectSLE()

void xrpl::injectSLE ( json::Value & jv,
SLE const & sle )

Injects JSON describing a ledger entry.

Parameters
jvThe JSON value to populate.
sleThe ledger entry to describe.

Populates the provided JSON value with the description of the specified ledger entry. If the entry is an account root and contains an email hash, adds a 'urlgravatar' field with the corresponding Gravatar URL. If the entry is not an account root, sets the 'Invalid' field to true.

Definition at line 50 of file AccountInfo.cpp.

◆ doAccountInfo()

json::Value xrpl::doAccountInfo ( RPC::JsonContext & context)

Definition at line 87 of file AccountInfo.cpp.

◆ addLine()

void xrpl::addLine ( json::Value & jsonLines,
RPCTrustLine const & line )

Definition at line 38 of file AccountLines.cpp.

◆ doAccountLines()

json::Value xrpl::doAccountLines ( RPC::JsonContext & context)

Definition at line 85 of file AccountLines.cpp.

◆ doAccountNFTs()

json::Value xrpl::doAccountNFTs ( RPC::JsonContext & context)

General RPC command that can retrieve objects in the account root.

{ account: <account> ledger_hash: <string> // optional ledger_index: <string | unsigned integer> // optional type: <string> // optional, defaults to all account objects types limit: <integer> // optional marker: <opaque> // optional, resume previous query }

Definition at line 36 of file AccountNFTs.cpp.

◆ getAccountObjects()

bool xrpl::getAccountObjects ( ReadView const & ledger,
AccountID const & account,
std::optional< std::vector< LedgerEntryType > > const & typeFilter,
uint256 dirIndex,
uint256 entryIndex,
std::uint32_t const limit,
json::Value & jvResult )

Gathers all objects for an account in a ledger.

Parameters
ledgerLedger to search account objects.
accountAccountID to find objects for.
typeFilterGathers objects of these types. empty gathers all types.
dirIndexBegin gathering account objects from this directory.
entryIndexBegin gathering objects from this directory node.
limitMaximum number of objects to find.
jvResultA JSON result that holds the request objects.

Definition at line 39 of file AccountObjects.cpp.

◆ doAccountObjects()

json::Value xrpl::doAccountObjects ( RPC::JsonContext & context)

Definition at line 226 of file AccountObjects.cpp.

◆ appendOfferJson()

void xrpl::appendOfferJson ( SLE::const_ref offer,
json::Value & offers )

Definition at line 36 of file AccountOffers.cpp.

◆ doAccountOffers()

json::Value xrpl::doAccountOffers ( RPC::JsonContext & context)

Definition at line 57 of file AccountOffers.cpp.

◆ parseLedgerArgs()

std::variant< std::optional< LedgerSpecifier >, json::Value > xrpl::parseLedgerArgs ( RPC::Context & context,
json::Value const & params )

Definition at line 50 of file AccountTx.cpp.

◆ getLedgerRange()

std::variant< LedgerRange, RPC::Status > xrpl::getLedgerRange ( RPC::Context & context,
std::optional< LedgerSpecifier > const & ledgerSpecifier )

Definition at line 133 of file AccountTx.cpp.

◆ doAccountTxHelp()

std::pair< AccountTxResult, RPC::Status > xrpl::doAccountTxHelp ( RPC::Context & context,
AccountTxArgs const & args )

Definition at line 212 of file AccountTx.cpp.

◆ populateJsonResponse() [1/2]

json::Value xrpl::populateJsonResponse ( std::pair< AccountTxResult, RPC::Status > const & res,
AccountTxArgs const & args,
RPC::JsonContext const & context )

Definition at line 276 of file AccountTx.cpp.

◆ doAccountTx()

json::Value xrpl::doAccountTx ( RPC::JsonContext & context)

Definition at line 391 of file AccountTx.cpp.

◆ doGatewayBalances()

json::Value xrpl::doGatewayBalances ( RPC::JsonContext & context)

Definition at line 52 of file GatewayBalances.cpp.

◆ fillTransaction()

void xrpl::fillTransaction ( RPC::JsonContext & context,
json::Value & txArray,
AccountID const & accountID,
std::uint32_t & sequence,
ReadView const & ledger )
static

Definition at line 28 of file NoRippleCheck.cpp.

◆ doNoRippleCheck()

json::Value xrpl::doNoRippleCheck ( RPC::JsonContext & context)

Definition at line 52 of file NoRippleCheck.cpp.

◆ doOwnerInfo()

json::Value xrpl::doOwnerInfo ( RPC::JsonContext & context)

Definition at line 20 of file OwnerInfo.cpp.

◆ doBlackList()

json::Value xrpl::doBlackList ( RPC::JsonContext & context)

Definition at line 11 of file BlackList.cpp.

◆ doCanDelete()

json::Value xrpl::doCanDelete ( RPC::JsonContext & context)

Definition at line 22 of file CanDelete.cpp.

◆ doLedgerCleaner()

json::Value xrpl::doLedgerCleaner ( RPC::JsonContext & context)

Definition at line 12 of file rpc/handlers/admin/data/LedgerCleaner.cpp.

◆ doLedgerRequest()

json::Value xrpl::doLedgerRequest ( RPC::JsonContext & context)

Definition at line 16 of file LedgerRequest.cpp.

◆ validationSeed()

std::optional< Seed > xrpl::validationSeed ( json::Value const & params)
static

Definition at line 18 of file ValidationCreate.cpp.

◆ doValidationCreate()

json::Value xrpl::doValidationCreate ( RPC::JsonContext & context)

Definition at line 33 of file ValidationCreate.cpp.

◆ estimateEntropy()

double xrpl::estimateEntropy ( std::string const & input)

Definition at line 26 of file WalletPropose.cpp.

◆ doWalletPropose()

json::Value xrpl::doWalletPropose ( RPC::JsonContext & context)

Definition at line 55 of file WalletPropose.cpp.

◆ walletPropose()

json::Value xrpl::walletPropose ( json::Value const & params)

Definition at line 61 of file WalletPropose.cpp.

◆ doLogLevel()

json::Value xrpl::doLogLevel ( RPC::JsonContext & context)

Definition at line 19 of file LogLevel.cpp.

◆ doLogRotate()

json::Value xrpl::doLogRotate ( RPC::JsonContext & context)

Definition at line 12 of file LogRotate.cpp.

◆ doConnect()

json::Value xrpl::doConnect ( RPC::JsonContext & context)

Definition at line 24 of file Connect.cpp.

◆ doPeerReservationsAdd()

json::Value xrpl::doPeerReservationsAdd ( RPC::JsonContext & context)

Definition at line 18 of file PeerReservationsAdd.cpp.

◆ doPeerReservationsDel()

json::Value xrpl::doPeerReservationsDel ( RPC::JsonContext & context)

Definition at line 16 of file PeerReservationsDel.cpp.

◆ doPeerReservationsList()

json::Value xrpl::doPeerReservationsList ( RPC::JsonContext & context)

Definition at line 10 of file PeerReservationsList.cpp.

◆ doPeers()

json::Value xrpl::doPeers ( RPC::JsonContext & context)

Definition at line 20 of file Peers.cpp.

◆ doLedgerAccept()

json::Value xrpl::doLedgerAccept ( RPC::JsonContext & context)

Definition at line 15 of file LedgerAccept.cpp.

◆ doStop()

json::Value xrpl::doStop ( RPC::JsonContext & context)

Definition at line 14 of file Stop.cpp.

◆ doChannelAuthorize()

json::Value xrpl::doChannelAuthorize ( RPC::JsonContext & context)

Definition at line 33 of file ChannelAuthorize.cpp.

◆ doSign()

json::Value xrpl::doSign ( RPC::JsonContext & context)

Definition at line 18 of file xrpld/rpc/handlers/admin/signing/Sign.cpp.

◆ doSignFor()

json::Value xrpl::doSignFor ( RPC::JsonContext & context)

Definition at line 19 of file SignFor.cpp.

◆ doConsensusInfo()

json::Value xrpl::doConsensusInfo ( RPC::JsonContext & context)

Definition at line 10 of file ConsensusInfo.cpp.

◆ doFetchInfo()

json::Value xrpl::doFetchInfo ( RPC::JsonContext & context)

Definition at line 10 of file FetchInfo.cpp.

◆ textTime()

void xrpl::textTime ( std::string & text,
UptimeClock::time_point & seconds,
char const * unitName,
std::chrono::seconds unitVal )
static

Definition at line 21 of file GetCounts.cpp.

◆ getCountsJson()

json::Value xrpl::getCountsJson ( Application & app,
int minObjectCount )

Definition at line 46 of file GetCounts.cpp.

◆ doGetCounts()

json::Value xrpl::doGetCounts ( RPC::JsonContext & context)

Definition at line 114 of file GetCounts.cpp.

◆ doPrint()

json::Value xrpl::doPrint ( RPC::JsonContext & context)

Definition at line 11 of file Print.cpp.

◆ doValidatorInfo()

json::Value xrpl::doValidatorInfo ( RPC::JsonContext & context)

Definition at line 15 of file ValidatorInfo.cpp.

◆ doValidatorListSites()

json::Value xrpl::doValidatorListSites ( RPC::JsonContext & context)

Definition at line 10 of file ValidatorListSites.cpp.

◆ doValidators()

json::Value xrpl::doValidators ( RPC::JsonContext & context)

Definition at line 10 of file Validators.cpp.

◆ doUnlList()

json::Value xrpl::doUnlList ( RPC::JsonContext & context)

Definition at line 15 of file UnlList.cpp.

◆ doChannelVerify()

json::Value xrpl::doChannelVerify ( RPC::JsonContext & context)

Definition at line 30 of file ChannelVerify.cpp.

◆ doAMMInfo()

json::Value xrpl::doAMMInfo ( RPC::JsonContext & context)

Definition at line 64 of file AMMInfo.cpp.

◆ doBookOffers()

json::Value xrpl::doBookOffers ( RPC::JsonContext & context)

Definition at line 165 of file BookOffers.cpp.

◆ doBookChanges()

json::Value xrpl::doBookChanges ( RPC::JsonContext & context)

Definition at line 13 of file BookChanges.cpp.

◆ doDepositAuthorized()

json::Value xrpl::doDepositAuthorized ( RPC::JsonContext & context)

Definition at line 35 of file DepositAuthorized.cpp.

◆ doFeature()

json::Value xrpl::doFeature ( RPC::JsonContext & context)

Definition at line 21 of file xrpld/rpc/handlers/server_info/Feature.cpp.

◆ doFee()

json::Value xrpl::doFee ( RPC::JsonContext & context)

Definition at line 11 of file Fee.cpp.

◆ doGetAggregatePrice()

json::Value xrpl::doGetAggregatePrice ( RPC::JsonContext & context)

oracles: array of {account, oracle_document_id} base_asset: is the asset to be priced quote_asset: is the denomination in which the prices are expressed trim : percentage of outliers to trim [optional] time_threshold : defines a range of prices to include based on the timestamp range - {most recent, most recent - time_threshold} [optional]

Definition at line 151 of file GetAggregatePrice.cpp.

◆ doLedgerClosed()

json::Value xrpl::doLedgerClosed ( RPC::JsonContext & context)

Definition at line 13 of file LedgerClosed.cpp.

◆ doLedgerCurrent()

json::Value xrpl::doLedgerCurrent ( RPC::JsonContext & context)

Definition at line 11 of file LedgerCurrent.cpp.

◆ doLedgerData()

json::Value xrpl::doLedgerData ( RPC::JsonContext & context)

Definition at line 39 of file LedgerData.cpp.

◆ doLedgerEntry()

json::Value xrpl::doLedgerEntry ( RPC::JsonContext & context)

Definition at line 834 of file LedgerEntry.cpp.

◆ doLedgerHeader()

json::Value xrpl::doLedgerHeader ( RPC::JsonContext & context)

Definition at line 21 of file xrpld/rpc/handlers/ledger/LedgerHeader.cpp.

◆ doManifest()

json::Value xrpl::doManifest ( RPC::JsonContext & context)

Definition at line 15 of file xrpld/rpc/handlers/server_info/Manifest.cpp.

◆ doNFTBuyOffers()

json::Value xrpl::doNFTBuyOffers ( RPC::JsonContext & context)

Definition at line 13 of file NFTBuyOffers.cpp.

◆ doNFTSellOffers()

json::Value xrpl::doNFTSellOffers ( RPC::JsonContext & context)

Definition at line 13 of file NFTSellOffers.cpp.

◆ doPathFind()

json::Value xrpl::doPathFind ( RPC::JsonContext & context)

Definition at line 16 of file PathFind.cpp.

◆ doPause()

json::Value xrpl::doPause ( RPC::JsonContext & )

◆ doPing()

json::Value xrpl::doPing ( RPC::JsonContext & context)

Definition at line 14 of file Ping.cpp.

◆ doRandom()

json::Value xrpl::doRandom ( RPC::JsonContext & context)

Definition at line 22 of file Random.cpp.

◆ doResume()

json::Value xrpl::doResume ( RPC::JsonContext & )

◆ doRipplePathFind()

json::Value xrpl::doRipplePathFind ( RPC::JsonContext & context)

Definition at line 24 of file RipplePathFind.cpp.

◆ doServerDefinitions()

json::Value xrpl::doServerDefinitions ( RPC::JsonContext & context)

Definition at line 385 of file ServerDefinitions.cpp.

◆ doServerInfo()

json::Value xrpl::doServerInfo ( RPC::JsonContext & context)

Definition at line 12 of file ServerInfo.cpp.

◆ doServerState()

json::Value xrpl::doServerState ( RPC::JsonContext & context)

Definition at line 11 of file ServerState.cpp.

◆ doSimulate()

json::Value xrpl::doSimulate ( RPC::JsonContext & context)

Definition at line 307 of file Simulate.cpp.

◆ doSubmit()

json::Value xrpl::doSubmit ( RPC::JsonContext & context)

Definition at line 45 of file Submit.cpp.

◆ doSubmitMultiSigned()

json::Value xrpl::doSubmitMultiSigned ( RPC::JsonContext & context)

Definition at line 16 of file SubmitMultiSigned.cpp.

◆ doSubscribe()

json::Value xrpl::doSubscribe ( RPC::JsonContext & context)

Definition at line 30 of file Subscribe.cpp.

◆ doTransactionEntry()

json::Value xrpl::doTransactionEntry ( RPC::JsonContext & context)

Definition at line 24 of file TransactionEntry.cpp.

◆ doTxJson()

json::Value xrpl::doTxJson ( RPC::JsonContext & context)

Definition at line 270 of file Tx.cpp.

◆ doTxHistory()

json::Value xrpl::doTxHistory ( RPC::JsonContext & context)

Definition at line 19 of file TxHistory.cpp.

◆ doTxReduceRelay()

json::Value xrpl::doTxReduceRelay ( RPC::JsonContext & context)

Definition at line 10 of file TxReduceRelay.cpp.

◆ doUnsubscribe()

json::Value xrpl::doUnsubscribe ( RPC::JsonContext & context)

Definition at line 21 of file Unsubscribe.cpp.

◆ doVaultInfo()

json::Value xrpl::doVaultInfo ( RPC::JsonContext & context)

Definition at line 64 of file VaultInfo.cpp.

◆ parseFixed()

std::expected< uint256, json::Value > xrpl::parseFixed ( Keylet const & keylet,
json::Value const & params,
json::StaticString const & fieldName,
unsigned const apiVersion )
static

Definition at line 440 of file LedgerEntry.cpp.

◆ fixed()

FunctionType xrpl::fixed ( Keylet const & keylet)
static

Definition at line 53 of file LedgerEntry.cpp.

◆ parseObjectID()

std::expected< uint256, json::Value > xrpl::parseObjectID ( json::Value const & params,
json::StaticString const fieldName,
std::string const & expectedType = "hex string or object" )
static

Definition at line 64 of file LedgerEntry.cpp.

◆ parseIndex()

std::expected< uint256, json::Value > xrpl::parseIndex ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 77 of file LedgerEntry.cpp.

◆ parseAccountRoot()

std::expected< uint256, json::Value > xrpl::parseAccountRoot ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 99 of file LedgerEntry.cpp.

◆ parseAMM()

std::expected< uint256, json::Value > xrpl::parseAMM ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 115 of file LedgerEntry.cpp.

◆ parseBridge()

std::expected< uint256, json::Value > xrpl::parseBridge ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 143 of file LedgerEntry.cpp.

◆ parseCheck()

std::expected< uint256, json::Value > xrpl::parseCheck ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 176 of file LedgerEntry.cpp.

◆ parseCredential()

std::expected< uint256, json::Value > xrpl::parseCredential ( json::Value const & cred,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 185 of file LedgerEntry.cpp.

◆ parseDelegate()

std::expected< uint256, json::Value > xrpl::parseDelegate ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 214 of file LedgerEntry.cpp.

◆ parseAuthorizeCredentials()

std::expected< STArray, json::Value > xrpl::parseAuthorizeCredentials ( json::Value const & jv)
static

Definition at line 238 of file LedgerEntry.cpp.

◆ parseDepositPreauth()

std::expected< uint256, json::Value > xrpl::parseDepositPreauth ( json::Value const & dp,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 300 of file LedgerEntry.cpp.

◆ parseDID()

std::expected< uint256, json::Value > xrpl::parseDID ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 351 of file LedgerEntry.cpp.

◆ parseDirectoryNode()

std::expected< uint256, json::Value > xrpl::parseDirectoryNode ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 366 of file LedgerEntry.cpp.

◆ parseEscrow()

std::expected< uint256, json::Value > xrpl::parseEscrow ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 417 of file LedgerEntry.cpp.

◆ parseLedgerHashes()

std::expected< uint256, json::Value > xrpl::parseLedgerHashes ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 459 of file LedgerEntry.cpp.

◆ parseLoanBroker()

std::expected< uint256, json::Value > xrpl::parseLoanBroker ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 479 of file LedgerEntry.cpp.

◆ parseLoan()

std::expected< uint256, json::Value > xrpl::parseLoan ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 500 of file LedgerEntry.cpp.

◆ parseMPToken()

std::expected< uint256, json::Value > xrpl::parseMPToken ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 522 of file LedgerEntry.cpp.

◆ parseMPTokenIssuance()

std::expected< uint256, json::Value > xrpl::parseMPTokenIssuance ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 546 of file LedgerEntry.cpp.

◆ parseNFTokenOffer()

std::expected< uint256, json::Value > xrpl::parseNFTokenOffer ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 562 of file LedgerEntry.cpp.

◆ parseNFTokenPage()

std::expected< uint256, json::Value > xrpl::parseNFTokenPage ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 571 of file LedgerEntry.cpp.

◆ parseOffer()

std::expected< uint256, json::Value > xrpl::parseOffer ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 582 of file LedgerEntry.cpp.

◆ parseOracle()

std::expected< uint256, json::Value > xrpl::parseOracle ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 604 of file LedgerEntry.cpp.

◆ parsePayChannel()

std::expected< uint256, json::Value > xrpl::parsePayChannel ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 627 of file LedgerEntry.cpp.

◆ parsePermissionedDomain()

std::expected< uint256, json::Value > xrpl::parsePermissionedDomain ( json::Value const & pd,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 636 of file LedgerEntry.cpp.

◆ parseRippleState()

std::expected< uint256, json::Value > xrpl::parseRippleState ( json::Value const & jvRippleState,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 665 of file LedgerEntry.cpp.

◆ parseSignerList()

std::expected< uint256, json::Value > xrpl::parseSignerList ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 714 of file LedgerEntry.cpp.

◆ parseTicket()

std::expected< uint256, json::Value > xrpl::parseTicket ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 723 of file LedgerEntry.cpp.

◆ parseVault() [1/2]

std::expected< uint256, json::Value > xrpl::parseVault ( json::Value const & params,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 746 of file LedgerEntry.cpp.

◆ parseXChainOwnedClaimID()

std::expected< uint256, json::Value > xrpl::parseXChainOwnedClaimID ( json::Value const & claimId,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 768 of file LedgerEntry.cpp.

◆ parseXChainOwnedCreateAccountClaimID()

std::expected< uint256, json::Value > xrpl::parseXChainOwnedCreateAccountClaimID ( json::Value const & claimId,
json::StaticString const fieldName,
unsigned const apiVersion )
static

Definition at line 794 of file LedgerEntry.cpp.

◆ getAsset() [2/2]

std::expected< Asset, ErrorCodeI > xrpl::getAsset ( json::Value const & v,
beast::Journal j )

Definition at line 39 of file AMMInfo.cpp.

◆ toIso8601()

std::string xrpl::toIso8601 ( NetClock::time_point tp)

Definition at line 53 of file AMMInfo.cpp.

◆ validateTakerJSON()

std::optional< json::Value > xrpl::validateTakerJSON ( json::Value const & taker,
json::StaticString const & name )

Definition at line 31 of file BookOffers.cpp.

◆ parseTakerAssetJSON()

std::optional< json::Value > xrpl::parseTakerAssetJSON ( Asset & asset,
json::Value const & taker,
json::StaticString const & name,
beast::Journal j )

Definition at line 55 of file BookOffers.cpp.

◆ parseTakerIssuerJSON()

std::optional< json::Value > xrpl::parseTakerIssuerJSON ( Asset & asset,
json::Value const & taker,
json::StaticString const & name,
beast::Journal j )

Definition at line 96 of file BookOffers.cpp.

◆ iteratePriceData()

void xrpl::iteratePriceData ( RPC::JsonContext & context,
SLE::const_ref sle,
std::function< bool(STObject const &)> const & f )
static

Calls callback "f" on the ledger-object sle and up to three previous metadata objects.

Stops early if the callback returns true.

Definition at line 49 of file GetAggregatePrice.cpp.

◆ getStats()

std::tuple< STAmount, Number, std::uint16_t > xrpl::getStats ( Prices::right_const_iterator const & begin,
Prices::right_const_iterator const & end )
static

Definition at line 124 of file GetAggregatePrice.cpp.

◆ appendNftOfferJson()

void xrpl::appendNftOfferJson ( Application const & app,
SLE::const_ref offer,
json::Value & offers )

Definition at line 20 of file NFTOffersHelpers.h.

◆ enumerateNFTOffers()

json::Value xrpl::enumerateNFTOffers ( RPC::JsonContext & context,
uint256 const & nftId,
Keylet const & directory )

Definition at line 45 of file NFTOffersHelpers.h.

◆ getServerDefinitionsJson()

json::Value const & xrpl::getServerDefinitionsJson ( )

Definition at line 379 of file ServerDefinitions.cpp.

◆ getAutofillSequence()

std::expected< std::uint32_t, json::Value > xrpl::getAutofillSequence ( json::Value const & txJson,
RPC::JsonContext & context )
static

Definition at line 46 of file Simulate.cpp.

◆ autofillSignature()

std::optional< json::Value > xrpl::autofillSignature ( json::Value & sigObject)
static

Definition at line 79 of file Simulate.cpp.

◆ autofillTx()

std::optional< json::Value > xrpl::autofillTx ( json::Value & txJson,
RPC::JsonContext & context )
static

Definition at line 132 of file Simulate.cpp.

◆ getTxJsonFromParams()

json::Value xrpl::getTxJsonFromParams ( json::Value const & params)
static

Definition at line 173 of file Simulate.cpp.

◆ simulateTxn()

json::Value xrpl::simulateTxn ( RPC::JsonContext & context,
std::shared_ptr< Transaction > transaction )
static

Definition at line 232 of file Simulate.cpp.

◆ getFailHard()

std::expected< NetworkOPs::FailHard, json::Value > xrpl::getFailHard ( RPC::JsonContext const & context)
static

Definition at line 30 of file Submit.cpp.

◆ isValidated()

bool xrpl::isValidated ( LedgerMaster & ledgerMaster,
std::uint32_t seq,
uint256 const & hash )
static

Definition at line 41 of file Tx.cpp.

◆ doTxHelp()

std::pair< TxResult, RPC::Status > xrpl::doTxHelp ( RPC::Context & context,
TxArgs args )

Definition at line 72 of file Tx.cpp.

◆ populateJsonResponse() [2/2]

json::Value xrpl::populateJsonResponse ( std::pair< TxResult, RPC::Status > const & res,
TxArgs const & args,
RPC::JsonContext const & context )

Definition at line 180 of file Tx.cpp.

◆ parseVault() [2/2]

std::optional< uint256 > xrpl::parseVault ( json::Value const & params,
json::Value & jvResult )
static

Definition at line 19 of file VaultInfo.cpp.

◆ operator<() [13/13]

bool xrpl::operator< ( Port const & lhs,
Port const & rhs )

Definition at line 24 of file ServerHandler.h.

Variable Documentation

◆ kEpochOffset

std::chrono::seconds xrpl::kEpochOffset
staticconstexpr
Initial value:
=
date::sys_days{date::year{2000} / 1 / 1} - date::sys_days{date::year{1970} / 1 / 1}

Clock for measuring the network time.

The epoch is January 1, 2000

epoch_offset = date(2000-01-01) - date(1970-0-01) = days(10957) = seconds(946684800)

Definition at line 33 of file chrono.h.

◆ kMuldivMax

auto xrpl::kMuldivMax = std::numeric_limits<std::uint64_t>::max()
constexpr

Definition at line 8 of file mulDiv.h.

◆ kPowerOfTen

Definition at line 78 of file Number.h.

◆ kNumZero

Number xrpl::kNumZero {}
staticconstexpr

Definition at line 612 of file Number.h.

◆ kAMMInvariantRelativeTolerance

Number const xrpl::kAMMInvariantRelativeTolerance {1, -11}

Definition at line 40 of file AMMHelpers.h.

◆ kSecondsInYear

std::uint32_t xrpl::kSecondsInYear = 365 * 24 * 60 * 60
staticconstexpr

Definition at line 44 of file LendingHelpers.h.

◆ kCreateGenesis

CreateGenesisT const xrpl::kCreateGenesis {}

Definition at line 49 of file libxrpl/ledger/Ledger.cpp.

◆ kLedgerPossibleTimeResolutions

std::chrono::seconds xrpl::kLedgerPossibleTimeResolutions[]
constexpr
Initial value:
= {
std::chrono::seconds{60},
std::chrono::seconds{90},
std::chrono::seconds{120}}

Possible ledger close time resolutions.

Values should not be duplicated.

See also
getNextLedgerTimeResolution

Definition at line 15 of file LedgerTiming.h.

◆ kLedgerDefaultTimeResolution

auto xrpl::kLedgerDefaultTimeResolution = kLedgerPossibleTimeResolutions[2]
constexpr

Initial resolution of ledger close time.

Definition at line 24 of file LedgerTiming.h.

◆ kLedgerGenesisTimeResolution

auto xrpl::kLedgerGenesisTimeResolution = kLedgerPossibleTimeResolutions[0]
constexpr

Close time resolution in genesis ledger.

Definition at line 27 of file LedgerTiming.h.

◆ kIncreaseLedgerTimeResolutionEvery

auto xrpl::kIncreaseLedgerTimeResolutionEvery = 8
constexpr

How often we increase the close time resolution (in numbers of ledgers).

Definition at line 30 of file LedgerTiming.h.

◆ kDecreaseLedgerTimeResolutionEvery

auto xrpl::kDecreaseLedgerTimeResolutionEvery = 1
constexpr

How often we decrease the close time resolution (in numbers of ledgers).

Definition at line 33 of file LedgerTiming.h.

◆ kOpenLedger

struct xrpl::OpenLedgerT xrpl::kOpenLedger

◆ kBatchView

struct xrpl::BatchViewT xrpl::kBatchView

◆ kTradingFeeThreshold

std::uint16_t xrpl::kTradingFeeThreshold = 1000
constexpr

Definition at line 11 of file AMMCore.h.

◆ kTotalTimeSlotSecs

std::uint32_t xrpl::kTotalTimeSlotSecs = 24 * 3600
constexpr

Definition at line 14 of file AMMCore.h.

◆ kAuctionSlotTimeIntervals

std::uint16_t xrpl::kAuctionSlotTimeIntervals = 20
constexpr

Definition at line 15 of file AMMCore.h.

◆ kAuctionSlotMaxAuthAccounts

std::uint16_t xrpl::kAuctionSlotMaxAuthAccounts = 4
constexpr

Definition at line 16 of file AMMCore.h.

◆ kAuctionSlotFeeScaleFactor

std::uint32_t xrpl::kAuctionSlotFeeScaleFactor = 100000
constexpr

Definition at line 17 of file AMMCore.h.

◆ kAuctionSlotDiscountedFeeFraction

std::uint32_t xrpl::kAuctionSlotDiscountedFeeFraction = 10
constexpr

Definition at line 18 of file AMMCore.h.

◆ kAuctionSlotMinFeeFraction

std::uint32_t xrpl::kAuctionSlotMinFeeFraction = 25
constexpr

Definition at line 19 of file AMMCore.h.

◆ kAuctionSlotIntervalDuration

std::uint32_t xrpl::kAuctionSlotIntervalDuration
constexpr
Initial value:
=
constexpr std::uint32_t kTotalTimeSlotSecs
Definition AMMCore.h:14
constexpr std::uint16_t kAuctionSlotTimeIntervals
Definition AMMCore.h:15

Definition at line 20 of file AMMCore.h.

◆ kVoteMaxSlots

std::uint16_t xrpl::kVoteMaxSlots = 8
constexpr

Definition at line 24 of file AMMCore.h.

◆ kVoteWeightScaleFactor

std::uint32_t xrpl::kVoteWeightScaleFactor = 100000
constexpr

Definition at line 25 of file AMMCore.h.

◆ kIsIssueV

template<ValidIssueType TIss>
bool xrpl::kIsIssueV = std::is_same_v<TIss, Issue>
constexpr

Definition at line 151 of file Asset.h.

◆ kIsMptissueV

template<ValidIssueType TIss>
bool xrpl::kIsMptissueV = std::is_same_v<TIss, MPTIssue>
constexpr

Definition at line 154 of file Asset.h.

◆ kMaxFeatureNameSize

std::size_t xrpl::kMaxFeatureNameSize = 63
staticconstexpr

Definition at line 68 of file Feature.h.

◆ kReservedFeatureNameSize

std::size_t xrpl::kReservedFeatureNameSize = 32
staticconstexpr

Definition at line 72 of file Feature.h.

◆ kFeeUnitsDeprecated

std::uint32_t xrpl::kFeeUnitsDeprecated = 10
constexpr

Definition at line 9 of file protocol/Fees.h.

◆ kDirectAccountKeylets

std::array<KeyletDesc<AccountID const&>, 6> const xrpl::kDirectAccountKeylets
Initial value:
{
{{.function = &keylet::account, .expectedLEName = jss::AccountRoot, .includeInTests = false},
{.function = &keylet::ownerDir, .expectedLEName = jss::DirectoryNode, .includeInTests = true},
{.function = &keylet::signerList, .expectedLEName = jss::SignerList, .includeInTests = true},
{.function = &keylet::nftokenPageMin,
.expectedLEName = jss::NFTokenPage,
.includeInTests = true},
{.function = &keylet::nftokenPageMax,
.expectedLEName = jss::NFTokenPage,
.includeInTests = true},
{.function = &keylet::did, .expectedLEName = jss::DID, .includeInTests = true}}}
Keylet did(AccountID const &account) noexcept
Definition Indexes.cpp:509
Keylet signerList(AccountID const &account) noexcept
A SignerList.
Definition Indexes.cpp:316
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition Indexes.cpp:357
Keylet nftokenPageMin(AccountID const &owner)
NFT page keylets.
Definition Indexes.cpp:384
Keylet nftokenPageMax(AccountID const &owner)
A keylet for the owner's last possible NFT page.
Definition Indexes.cpp:392
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition Indexes.cpp:186

Definition at line 360 of file Indexes.h.

◆ kSLcfNoConsensusTime

std::uint32_t const xrpl::kSLcfNoConsensusTime = 0x01
static

Definition at line 56 of file LedgerHeader.h.

◆ kIsCurrencyV

template<ValidPathAsset PA>
bool xrpl::kIsCurrencyV = std::is_same_v<PA, Currency>
constexpr

Definition at line 55 of file PathAsset.h.

◆ kIsMptidV

template<ValidPathAsset PA>
bool xrpl::kIsMptidV = std::is_same_v<PA, MPTID>
constexpr

Definition at line 58 of file PathAsset.h.

◆ kTxMinSizeBytes

std::size_t xrpl::kTxMinSizeBytes = 32
constexpr

Protocol specific constants.

This information is, implicitly, part of the protocol.

Note
Changing these values without adding code to the server to detect "pre-change" and "post-change" will result in a hard fork. Smallest legal byte size of a transaction.

Definition at line 26 of file Protocol.h.

◆ kTxMaxSizeBytes

std::size_t xrpl::kTxMaxSizeBytes = megabytes(1)
constexpr

Largest legal byte size of a transaction.

Definition at line 29 of file Protocol.h.

◆ kUnfundedOfferRemoveLimit

std::size_t xrpl::kUnfundedOfferRemoveLimit = 1000
constexpr

The maximum number of unfunded offers to delete at once.

Definition at line 32 of file Protocol.h.

◆ kExpiredOfferRemoveLimit

std::size_t xrpl::kExpiredOfferRemoveLimit = 256
constexpr

The maximum number of expired offers to delete at once.

Definition at line 35 of file Protocol.h.

◆ kOversizeMetaDataCap

std::size_t xrpl::kOversizeMetaDataCap = 5200
constexpr

The maximum number of metadata entries allowed in one transaction.

Definition at line 38 of file Protocol.h.

◆ kDirNodeMaxEntries

std::size_t xrpl::kDirNodeMaxEntries = 32
constexpr

The maximum number of entries per directory page.

Definition at line 41 of file Protocol.h.

◆ kDirNodeMaxPages

std::uint64_t xrpl::kDirNodeMaxPages = 262144
constexpr

The maximum number of pages allowed in a directory.

Made obsolete by fixDirectoryLimit amendment.

Definition at line 47 of file Protocol.h.

◆ kDirMaxTokensPerPage

std::size_t xrpl::kDirMaxTokensPerPage = 32
constexpr

The maximum number of items in an NFT page.

Definition at line 50 of file Protocol.h.

◆ kMaxDeletableDirEntries

std::size_t xrpl::kMaxDeletableDirEntries = 1000
constexpr

The maximum number of owner directory entries for account to be deletable.

Definition at line 53 of file Protocol.h.

◆ kMaxTokenOfferCancelCount

std::size_t xrpl::kMaxTokenOfferCancelCount = 500
constexpr

The maximum number of token offers that can be canceled at once.

Definition at line 56 of file Protocol.h.

◆ kMaxDeletableTokenOfferEntries

std::size_t xrpl::kMaxDeletableTokenOfferEntries = 500
constexpr

The maximum number of offers in an offer directory for NFT to be burnable.

Definition at line 59 of file Protocol.h.

◆ kMaxTransferFee

std::uint16_t xrpl::kMaxTransferFee = 50000
constexpr

The maximum token transfer fee allowed.

Token transfer fees can range from 0% to 50% and are specified in tenths of a basis point; that is a value of 1000 represents a transfer fee of 1% and a value of 10000 represents a transfer fee of 10%.

Note that for extremely low transfer fees values, it is possible that the calculated fee will be 0.

Definition at line 70 of file Protocol.h.

◆ kMaxTokenUriLength

std::size_t xrpl::kMaxTokenUriLength = 256
constexpr

The maximum length of a URI inside an NFT.

Definition at line 207 of file Protocol.h.

◆ kMaxDidDocumentLength

std::size_t xrpl::kMaxDidDocumentLength = 256
constexpr

The maximum length of a Data element inside a DID.

Definition at line 210 of file Protocol.h.

◆ kMaxDidUriLength

std::size_t xrpl::kMaxDidUriLength = 256
constexpr

The maximum length of a URI inside a DID.

Definition at line 213 of file Protocol.h.

◆ kMaxDidDataLength

std::size_t xrpl::kMaxDidDataLength = 256
constexpr

The maximum length of an Attestation inside a DID.

Definition at line 216 of file Protocol.h.

◆ kMaxDomainLength

std::size_t xrpl::kMaxDomainLength = 256
constexpr

The maximum length of a domain.

Definition at line 219 of file Protocol.h.

◆ kMaxCredentialUriLength

std::size_t xrpl::kMaxCredentialUriLength = 256
constexpr

The maximum length of a URI inside a Credential.

Definition at line 222 of file Protocol.h.

◆ kMaxCredentialTypeLength

std::size_t xrpl::kMaxCredentialTypeLength = 64
constexpr

The maximum length of a CredentialType inside a Credential.

Definition at line 225 of file Protocol.h.

◆ kMaxCredentialsArraySize

std::size_t xrpl::kMaxCredentialsArraySize = 8
constexpr

The maximum number of credentials can be passed in array.

Definition at line 228 of file Protocol.h.

◆ kMaxPermissionedDomainCredentialsArraySize

std::size_t xrpl::kMaxPermissionedDomainCredentialsArraySize = 10
constexpr

The maximum number of credentials can be passed in array for permissioned domain.

Definition at line 232 of file Protocol.h.

◆ kMaxMpTokenMetadataLength

std::size_t xrpl::kMaxMpTokenMetadataLength = 1024
constexpr

The maximum length of MPTokenMetadata.

Definition at line 235 of file Protocol.h.

◆ kMaxMpTokenAmount

std::uint64_t xrpl::kMaxMpTokenAmount = 0x7FFF'FFFF'FFFF'FFFFull
constexpr

The maximum amount of MPTokenIssuance.

Definition at line 238 of file Protocol.h.

◆ kMaxDataPayloadLength

std::size_t xrpl::kMaxDataPayloadLength = 256
constexpr

The maximum length of Data payload.

Definition at line 242 of file Protocol.h.

◆ kVaultStrategyFirstComeFirstServe

std::uint8_t xrpl::kVaultStrategyFirstComeFirstServe = 1
constexpr

Vault withdrawal policies.

Definition at line 245 of file Protocol.h.

◆ kVaultDefaultIouScale

std::uint8_t xrpl::kVaultDefaultIouScale = 6
constexpr

Default IOU scale factor for a Vault.

Definition at line 248 of file Protocol.h.

◆ kVaultMaximumIouScale

std::uint8_t xrpl::kVaultMaximumIouScale = 18
constexpr

Maximum scale factor for a Vault.

The number is chosen to ensure that 1 IOU can be always converted to shares. 10^19 > maxMPTokenAmount (2^64-1) > 10^18

Definition at line 252 of file Protocol.h.

◆ kMaxAssetCheckDepth

std::uint8_t xrpl::kMaxAssetCheckDepth = 5
constexpr

Maximum recursion depth for vault shares being put as an asset inside another vault; counted from 0.

Definition at line 256 of file Protocol.h.

◆ kFlagLedgerInterval

std::uint32_t xrpl::kFlagLedgerInterval = 256
constexpr

Definition at line 261 of file Protocol.h.

◆ kMaxDeletableAmmTrustLines

std::uint16_t xrpl::kMaxDeletableAmmTrustLines = 512
constexpr

The maximum number of trustlines to delete as part of AMM account deletion cleanup.

Definition at line 280 of file Protocol.h.

◆ kMaxOracleUri

std::size_t xrpl::kMaxOracleUri = 256
constexpr

The maximum length of a URI inside an Oracle.

Definition at line 283 of file Protocol.h.

◆ kMaxOracleProvider

std::size_t xrpl::kMaxOracleProvider = 256
constexpr

The maximum length of a Provider inside an Oracle.

Definition at line 286 of file Protocol.h.

◆ kMaxOracleDataSeries

std::size_t xrpl::kMaxOracleDataSeries = 10
constexpr

The maximum size of a data series array inside an Oracle.

Definition at line 289 of file Protocol.h.

◆ kMaxOracleSymbolClass

std::size_t xrpl::kMaxOracleSymbolClass = 16
constexpr

The maximum length of a SymbolClass inside an Oracle.

Definition at line 292 of file Protocol.h.

◆ kMaxLastUpdateTimeDelta

std::size_t xrpl::kMaxLastUpdateTimeDelta = 300
constexpr

The maximum allowed time difference between lastUpdateTime and the time of the last closed ledger.

Definition at line 297 of file Protocol.h.

◆ kMaxPriceScale

std::size_t xrpl::kMaxPriceScale = 20
constexpr

The maximum price scaling factor.

Definition at line 301 of file Protocol.h.

◆ kMaxTrim

std::size_t xrpl::kMaxTrim = 25
constexpr

The maximum percentage of outliers to trim.

Definition at line 305 of file Protocol.h.

◆ kPermissionMaxSize

std::size_t xrpl::kPermissionMaxSize = 10
constexpr

The maximum number of delegate permissions an account can grant.

Definition at line 309 of file Protocol.h.

◆ kMaxBatchTxCount

std::size_t xrpl::kMaxBatchTxCount = 8
constexpr

The maximum number of transactions that can be in a batch.

Definition at line 312 of file Protocol.h.

◆ kEcScalarLength

std::size_t xrpl::kEcScalarLength = kMPT_SCALAR_SIZE
constexpr

Length of a secp256k1 scalar in bytes.

Definition at line 315 of file Protocol.h.

◆ kCompressedEcPointLength

std::size_t xrpl::kCompressedEcPointLength = 33
constexpr

Length of EC point (compressed).

Definition at line 318 of file Protocol.h.

◆ kEcCiphertextComponentLength

std::size_t xrpl::kEcCiphertextComponentLength = kMPT_ELGAMAL_CIPHER_SIZE
constexpr

Length of one compressed EC point component in an EC ElGamal ciphertext.

Definition at line 321 of file Protocol.h.

◆ kEcGamalEncryptedTotalLength

std::size_t xrpl::kEcGamalEncryptedTotalLength = kMPT_ELGAMAL_TOTAL_SIZE
constexpr

EC ElGamal ciphertext length: two compressed EC points concatenated.

Definition at line 324 of file Protocol.h.

◆ kEcPubKeyLength

std::size_t xrpl::kEcPubKeyLength = kMPT_PUBKEY_SIZE
constexpr

Length of EC public key (compressed).

Definition at line 327 of file Protocol.h.

◆ kEcPrivKeyLength

std::size_t xrpl::kEcPrivKeyLength = kMPT_PRIVKEY_SIZE
constexpr

Length of EC private key in bytes.

Definition at line 330 of file Protocol.h.

◆ kEcBlindingFactorLength

std::size_t xrpl::kEcBlindingFactorLength = kMPT_BLINDING_FACTOR_SIZE
constexpr

Length of the EC blinding factor in bytes.

Definition at line 333 of file Protocol.h.

◆ kEcSchnorrProofLength

std::size_t xrpl::kEcSchnorrProofLength = kMPT_SCHNORR_PROOF_SIZE
constexpr

Length of Schnorr ZKProof for public key registration (compact form) in bytes.

Definition at line 336 of file Protocol.h.

◆ kEcPedersenCommitmentLength

std::size_t xrpl::kEcPedersenCommitmentLength = kMPT_PEDERSEN_COMMIT_SIZE
constexpr

Length of Pedersen Commitment (compressed).

Definition at line 339 of file Protocol.h.

◆ kEcSingleBulletproofLength

std::size_t xrpl::kEcSingleBulletproofLength = kMPT_SINGLE_BULLETPROOF_SIZE
constexpr

Length of single bulletproof (range proof for 1 commitment) in bytes.

Definition at line 342 of file Protocol.h.

◆ kEcDoubleBulletproofLength

std::size_t xrpl::kEcDoubleBulletproofLength = kMPT_DOUBLE_BULLETPROOF_SIZE
constexpr

Length of double bulletproof (range proof for 2 commitments) in bytes.

Definition at line 345 of file Protocol.h.

◆ kEcSendSigmaProofLength

std::size_t xrpl::kEcSendSigmaProofLength = SECP256K1_COMPACT_STANDARD_PROOF_SIZE
constexpr

Length of the compact sigma proof component for ConfidentialMPTSend.

Definition at line 348 of file Protocol.h.

◆ kEcSendProofLength

std::size_t xrpl::kEcSendProofLength = kEcSendSigmaProofLength + kEcDoubleBulletproofLength
constexpr

192 bytes compact sigma proof + 754 bytes double bulletproof.

Definition at line 351 of file Protocol.h.

◆ kEcConvertBackSigmaProofLength

std::size_t xrpl::kEcConvertBackSigmaProofLength = SECP256K1_COMPACT_CONVERTBACK_PROOF_SIZE
constexpr

Length of the compact sigma proof component for ConfidentialMPTConvertBack.

Definition at line 354 of file Protocol.h.

◆ kEcConvertBackProofLength

std::size_t xrpl::kEcConvertBackProofLength
constexpr
Initial value:
=
constexpr std::size_t kEcConvertBackSigmaProofLength
Length of the compact sigma proof component for ConfidentialMPTConvertBack.
Definition Protocol.h:354
constexpr std::size_t kEcSingleBulletproofLength
Length of single bulletproof (range proof for 1 commitment) in bytes.
Definition Protocol.h:342

128 bytes compact sigma proof + 688 bytes single bulletproof.

Definition at line 357 of file Protocol.h.

◆ kEcClawbackProofLength

std::size_t xrpl::kEcClawbackProofLength = SECP256K1_COMPACT_CLAWBACK_PROOF_SIZE
constexpr

Length of the ZKProof for ConfidentialMPTClawback.

Definition at line 361 of file Protocol.h.

◆ kConfidentialFeeMultiplier

std::uint32_t xrpl::kConfidentialFeeMultiplier = 9
constexpr

Extra base fee multiplier charged to confidential MPT transactions.

Definition at line 364 of file Protocol.h.

◆ kEcCompressedPrefixEvenY

std::uint8_t xrpl::kEcCompressedPrefixEvenY = 0x02
constexpr

Compressed EC point prefix for even y-coordinate.

Definition at line 367 of file Protocol.h.

◆ kEcCompressedPrefixOddY

std::uint8_t xrpl::kEcCompressedPrefixOddY = 0x03
constexpr

Compressed EC point prefix for odd y-coordinate.

Definition at line 370 of file Protocol.h.

◆ kParityRate

Rate const xrpl::kParityRate(QUALITY_ONE)

A transfer rate signifying a 1:1 exchange.

◆ kSTypeMap

std::map<std::string, int> const xrpl::kSTypeMap = {XMACRO(TO_MAP)}
static

Definition at line 95 of file SField.h.

◆ sfInvalid

SField const xrpl::sfInvalid(access, -1, "")

◆ sfGeneric

SField const xrpl::sfGeneric(access, 0, "Generic")

◆ kMaxParsedJsonDepth

std::size_t xrpl::kMaxParsedJsonDepth = 64
constexpr

Maximum JSON object nesting depth permitted during parsing.

Definition at line 10 of file STParsedJSON.h.

◆ kMaxParsedJsonArraySize

std::size_t xrpl::kMaxParsedJsonArraySize = 512
constexpr

Maximum number of elements permitted in any JSON array field during parsing.

Requests exceeding this limit are rejected with an invalidParams error.

Definition at line 14 of file STParsedJSON.h.

◆ kVfFullValidation

std::uint32_t xrpl::kVfFullValidation = 0x00000001
constexpr

Definition at line 19 of file STValidation.h.

◆ kVfFullyCanonicalSig

std::uint32_t xrpl::kVfFullyCanonicalSig = 0x80000000
constexpr

Definition at line 22 of file STValidation.h.

◆ kInitialXrp

XRPAmount xrpl::kInitialXrp {100'000'000'000 * kDropsPerXrp}
constexpr

Configure the native currency.

Number of drops in the genesis account.

Definition at line 24 of file SystemParameters.h.

◆ kXrpLedgerEarliestSeq

std::uint32_t xrpl::kXrpLedgerEarliestSeq {32570u}
staticconstexpr

The XRP ledger network's earliest allowed sequence.

Definition at line 52 of file SystemParameters.h.

◆ kXrpLedgerEarliestFees

std::uint32_t xrpl::kXrpLedgerEarliestFees {562177u}
staticconstexpr

The XRP Ledger mainnet's earliest ledger with a FeeSettings object.

Only used in asserts and tests.

Definition at line 56 of file SystemParameters.h.

◆ kAmendmentMajorityCalcThreshold

std::ratio<80, 100> xrpl::kAmendmentMajorityCalcThreshold
constexpr

The minimum amount of support an amendment should have.

Definition at line 59 of file SystemParameters.h.

◆ kDefaultAmendmentMajorityTime

std::chrono::seconds const xrpl::kDefaultAmendmentMajorityTime = weeks{2}
constexpr

The minimum amount of time an amendment must hold a majority.

Definition at line 62 of file SystemParameters.h.

◆ tfFullyCanonicalSig

FlagValue xrpl::tfFullyCanonicalSig = 0x80000000
constexpr

Definition at line 42 of file TxFlags.h.

◆ tfInnerBatchTxn

FlagValue xrpl::tfInnerBatchTxn = 0x40000000
constexpr

Definition at line 43 of file TxFlags.h.

◆ tfUniversal

FlagValue xrpl::tfUniversal = tfFullyCanonicalSig | tfInnerBatchTxn
constexpr

Definition at line 44 of file TxFlags.h.

◆ tfUniversalMask

FlagValue xrpl::tfUniversalMask = ~tfUniversal
constexpr

Definition at line 45 of file TxFlags.h.

◆ tfMPTPaymentMask

FlagValue xrpl::tfMPTPaymentMask = ~(tfUniversal | tfPartialPayment)
constexpr

Definition at line 339 of file TxFlags.h.

◆ tfTrustSetPermissionMask

FlagValue xrpl::tfTrustSetPermissionMask
constexpr
Initial value:
=
~(tfUniversal | tfSetfAuth | tfSetFreeze | tfClearFreeze)
constexpr FlagValue tfUniversal
Definition TxFlags.h:44

Definition at line 340 of file TxFlags.h.

◆ tmfMPTCanEnableCanLock

FlagValue xrpl::tmfMPTCanEnableCanLock = lsmfMPTCanEnableCanLock
constexpr

Definition at line 345 of file TxFlags.h.

◆ tmfMPTCanEnableRequireAuth

FlagValue xrpl::tmfMPTCanEnableRequireAuth = lsmfMPTCanEnableRequireAuth
constexpr

Definition at line 346 of file TxFlags.h.

◆ tmfMPTCanEnableCanEscrow

FlagValue xrpl::tmfMPTCanEnableCanEscrow = lsmfMPTCanEnableCanEscrow
constexpr

Definition at line 347 of file TxFlags.h.

◆ tmfMPTCanEnableCanTrade

FlagValue xrpl::tmfMPTCanEnableCanTrade = lsmfMPTCanEnableCanTrade
constexpr

Definition at line 348 of file TxFlags.h.

◆ tmfMPTCanEnableCanTransfer

FlagValue xrpl::tmfMPTCanEnableCanTransfer = lsmfMPTCanEnableCanTransfer
constexpr

Definition at line 349 of file TxFlags.h.

◆ tmfMPTCanEnableCanClawback

FlagValue xrpl::tmfMPTCanEnableCanClawback = lsmfMPTCanEnableCanClawback
constexpr

Definition at line 350 of file TxFlags.h.

◆ tmfMPTCanMutateMetadata

FlagValue xrpl::tmfMPTCanMutateMetadata = lsmfMPTCanMutateMetadata
constexpr

Definition at line 351 of file TxFlags.h.

◆ tmfMPTCanMutateTransferFee

FlagValue xrpl::tmfMPTCanMutateTransferFee = lsmfMPTCanMutateTransferFee
constexpr

Definition at line 352 of file TxFlags.h.

◆ tmfMPTCannotEnableCanHoldConfidentialBalance

FlagValue xrpl::tmfMPTCannotEnableCanHoldConfidentialBalance
constexpr
Initial value:
=
lsmfMPTCannotEnableCanHoldConfidentialBalance

Definition at line 353 of file TxFlags.h.

◆ tmfMPTokenIssuanceCreateMutableMask

FlagValue xrpl::tmfMPTokenIssuanceCreateMutableMask
constexpr
Initial value:
=
constexpr FlagValue tmfMPTCanEnableCanClawback
Definition TxFlags.h:350
constexpr FlagValue tmfMPTCanEnableCanTransfer
Definition TxFlags.h:349
constexpr FlagValue tmfMPTCannotEnableCanHoldConfidentialBalance
Definition TxFlags.h:353
constexpr FlagValue tmfMPTCanEnableCanLock
Definition TxFlags.h:345
constexpr FlagValue tmfMPTCanMutateMetadata
Definition TxFlags.h:351
constexpr FlagValue tmfMPTCanMutateTransferFee
Definition TxFlags.h:352
constexpr FlagValue tmfMPTCanEnableRequireAuth
Definition TxFlags.h:346
constexpr FlagValue tmfMPTCanEnableCanEscrow
Definition TxFlags.h:347
constexpr FlagValue tmfMPTCanEnableCanTrade
Definition TxFlags.h:348

Definition at line 355 of file TxFlags.h.

◆ tmfMPTSetCanLock

FlagValue xrpl::tmfMPTSetCanLock = 0x00000001
constexpr

Definition at line 365 of file TxFlags.h.

◆ tmfMPTSetRequireAuth

FlagValue xrpl::tmfMPTSetRequireAuth = 0x00000002
constexpr

Definition at line 366 of file TxFlags.h.

◆ tmfMPTSetCanEscrow

FlagValue xrpl::tmfMPTSetCanEscrow = 0x00000004
constexpr

Definition at line 367 of file TxFlags.h.

◆ tmfMPTSetCanTrade

FlagValue xrpl::tmfMPTSetCanTrade = 0x00000008
constexpr

Definition at line 368 of file TxFlags.h.

◆ tmfMPTSetCanTransfer

FlagValue xrpl::tmfMPTSetCanTransfer = 0x00000010
constexpr

Definition at line 369 of file TxFlags.h.

◆ tmfMPTSetCanClawback

FlagValue xrpl::tmfMPTSetCanClawback = 0x00000020
constexpr

Definition at line 370 of file TxFlags.h.

◆ tmfMPTSetCanHoldConfidentialBalance

FlagValue xrpl::tmfMPTSetCanHoldConfidentialBalance = 0x00000040
constexpr

Definition at line 371 of file TxFlags.h.

◆ tmfMPTokenIssuanceSetMutableMask

FlagValue xrpl::tmfMPTokenIssuanceSetMutableMask
constexpr
Initial value:
=
constexpr FlagValue tmfMPTSetCanLock
Definition TxFlags.h:365
constexpr FlagValue tmfMPTSetCanClawback
Definition TxFlags.h:370
constexpr FlagValue tmfMPTSetCanHoldConfidentialBalance
Definition TxFlags.h:371
constexpr FlagValue tmfMPTSetCanTrade
Definition TxFlags.h:368
constexpr FlagValue tmfMPTSetCanTransfer
Definition TxFlags.h:369
constexpr FlagValue tmfMPTSetCanEscrow
Definition TxFlags.h:367
constexpr FlagValue tmfMPTSetRequireAuth
Definition TxFlags.h:366

Definition at line 372 of file TxFlags.h.

◆ tfTrustLine

FlagValue xrpl::tfTrustLine = 0x00000004
constexpr

Definition at line 387 of file TxFlags.h.

◆ tfNFTokenMintMaskWithoutMutable

FlagValue xrpl::tfNFTokenMintMaskWithoutMutable
constexpr
Initial value:
=
~(tfUniversal | tfBurnable | tfOnlyXRP | tfTransferable)

Definition at line 388 of file TxFlags.h.

◆ tfNFTokenMintOldMask

FlagValue xrpl::tfNFTokenMintOldMask = ~(~tfNFTokenMintMaskWithoutMutable | tfTrustLine)
constexpr

Definition at line 391 of file TxFlags.h.

◆ tfNFTokenMintOldMaskWithMutable

FlagValue xrpl::tfNFTokenMintOldMaskWithMutable = ~(~tfNFTokenMintOldMask | tfMutable)
constexpr

Definition at line 394 of file TxFlags.h.

◆ tfWithdrawSubTx

FlagValue xrpl::tfWithdrawSubTx
constexpr
Initial value:
= tfLPToken | tfSingleAsset | tfTwoAsset |
tfOneAssetLPToken | tfLimitLPToken | tfWithdrawAll | tfOneAssetWithdrawAll

Definition at line 396 of file TxFlags.h.

◆ tfDepositSubTx

FlagValue xrpl::tfDepositSubTx
constexpr
Initial value:
=
tfLPToken | tfSingleAsset | tfTwoAsset | tfOneAssetLPToken | tfLimitLPToken | tfTwoAssetIfEmpty

Definition at line 398 of file TxFlags.h.

◆ kDropsPerXrp

XRPAmount xrpl::kDropsPerXrp {1'000'000}
constexpr

Number of drops per 1 XRP.

Definition at line 240 of file XRPAmount.h.

◆ kCommonDbPragmaJournal

char const* xrpl::kCommonDbPragmaJournal {"PRAGMA journal_mode=%s;"}
constexpr

Definition at line 12 of file DBInit.h.

◆ kCommonDbPragmaSync

char const* xrpl::kCommonDbPragmaSync {"PRAGMA synchronous=%s;"}
constexpr

Definition at line 13 of file DBInit.h.

◆ kCommonDbPragmaTemp

char const* xrpl::kCommonDbPragmaTemp {"PRAGMA temp_store=%s;"}
constexpr

Definition at line 14 of file DBInit.h.

◆ kSqliteTuningCutoff

std::uint32_t xrpl::kSqliteTuningCutoff = 10'000'000
constexpr

Definition at line 20 of file DBInit.h.

◆ kLgrDbName

auto xrpl::kLgrDbName {"ledger.db"}
constexpr

Definition at line 23 of file DBInit.h.

◆ kLgrDbInit

std::array<char const*, 5> xrpl::kLgrDbInit
constexpr
Initial value:
{
{"BEGIN TRANSACTION;",
"CREATE TABLE IF NOT EXISTS Ledgers ( \
LedgerHash CHARACTER(64) PRIMARY KEY, \
LedgerSeq BIGINT UNSIGNED, \
PrevHash CHARACTER(64), \
TotalCoins BIGINT UNSIGNED, \
ClosingTime BIGINT UNSIGNED, \
PrevClosingTime BIGINT UNSIGNED, \
CloseTimeRes BIGINT UNSIGNED, \
CloseFlags BIGINT UNSIGNED, \
AccountSetHash CHARACTER(64), \
TransSetHash CHARACTER(64) \
);",
"CREATE INDEX IF NOT EXISTS SeqLedger ON Ledgers(LedgerSeq);",
"DROP TABLE IF EXISTS Validations;",
"END TRANSACTION;"}}

Definition at line 25 of file DBInit.h.

◆ kTxDbName

auto xrpl::kTxDbName {"transaction.db"}
constexpr

Definition at line 50 of file DBInit.h.

◆ kTxDbInit

std::array<char const*, 8> xrpl::kTxDbInit
constexpr
Initial value:
{
{"BEGIN TRANSACTION;",
"CREATE TABLE IF NOT EXISTS Transactions ( \
TransID CHARACTER(64) PRIMARY KEY, \
TransType CHARACTER(24), \
FromAcct CHARACTER(35), \
FromSeq BIGINT UNSIGNED, \
LedgerSeq BIGINT UNSIGNED, \
Status CHARACTER(1), \
RawTxn BLOB, \
TxnMeta BLOB \
);",
"CREATE INDEX IF NOT EXISTS TxLgrIndex ON \
Transactions(LedgerSeq);",
"CREATE TABLE IF NOT EXISTS AccountTransactions ( \
TransID CHARACTER(64), \
Account CHARACTER(64), \
LedgerSeq BIGINT UNSIGNED, \
TxnSeq INTEGER \
);",
"CREATE INDEX IF NOT EXISTS AcctTxIDIndex ON \
AccountTransactions(TransID);",
"CREATE INDEX IF NOT EXISTS AcctTxIndex ON \
AccountTransactions(Account, LedgerSeq, TxnSeq, TransID);",
"CREATE INDEX IF NOT EXISTS AcctLgrIndex ON \
AccountTransactions(LedgerSeq, Account, TransID);",
"END TRANSACTION;"}}

Definition at line 52 of file DBInit.h.

◆ kWalletDbName

auto xrpl::kWalletDbName {"wallet.db"}
constexpr

Definition at line 85 of file DBInit.h.

◆ kWalletDbInit

std::array<char const*, 6> xrpl::kWalletDbInit
constexpr
Initial value:
{
{"BEGIN TRANSACTION;",
"CREATE TABLE IF NOT EXISTS NodeIdentity ( \
PublicKey CHARACTER(53), \
PrivateKey CHARACTER(52) \
);",
"CREATE TABLE IF NOT EXISTS PeerReservations ( \
PublicKey CHARACTER(53) UNIQUE NOT NULL, \
Description CHARACTER(64) NOT NULL \
);",
"CREATE TABLE IF NOT EXISTS ValidatorManifests ( \
RawData BLOB NOT NULL \
);",
"CREATE TABLE IF NOT EXISTS PublisherManifests ( \
RawData BLOB NOT NULL \
);",
"END TRANSACTION;"}}

Definition at line 87 of file DBInit.h.

◆ kWireTypeTransaction

unsigned char const xrpl::kWireTypeTransaction = 0
staticconstexpr

Definition at line 21 of file SHAMapTreeNode.h.

◆ kWireTypeAccountState

unsigned char const xrpl::kWireTypeAccountState = 1
staticconstexpr

Definition at line 22 of file SHAMapTreeNode.h.

◆ kWireTypeInner

unsigned char const xrpl::kWireTypeInner = 2
staticconstexpr

Definition at line 23 of file SHAMapTreeNode.h.

◆ kWireTypeCompressedInner

unsigned char const xrpl::kWireTypeCompressedInner = 3
staticconstexpr

Definition at line 24 of file SHAMapTreeNode.h.

◆ kWireTypeTransactionWithMeta

unsigned char const xrpl::kWireTypeTransactionWithMeta = 4
staticconstexpr

Definition at line 25 of file SHAMapTreeNode.h.

◆ kMinShaMapItemBytes

std::size_t xrpl::kMinShaMapItemBytes = 12
constexpr

Definition at line 28 of file SHAMapTreeNode.h.

◆ kXbridgeMaxAccountCreateClaims

size_t xrpl::kXbridgeMaxAccountCreateClaims = 128
constexpr

Definition at line 8 of file XChainBridge.h.

◆ gHttpClientSslContext

std::optional<HTTPClientSSLContext> xrpl::gHttpClientSslContext
static

Definition at line 36 of file libxrpl/net/HTTPClient.cpp.

◆ gAccountIdCache

std::unique_ptr<detail::AccountIdCache> xrpl::gAccountIdCache
static

Definition at line 83 of file AccountID.cpp.

◆ kReadOnlySet

bool const xrpl::kReadOnlySet = gFeatureCollections.registrationIsDone()
static

Definition at line 449 of file libxrpl/protocol/Feature.cpp.

◆ kMinMantissa

std::int64_t xrpl::kMinMantissa = STAmount::kMinValue
staticconstexpr

Definition at line 22 of file IOUAmount.cpp.

◆ kMaxMantissa

std::int64_t xrpl::kMaxMantissa = STAmount::kMaxValue
staticconstexpr

Definition at line 23 of file IOUAmount.cpp.

◆ kMinExponent

int xrpl::kMinExponent = STAmount::kMinOffset
staticconstexpr

Definition at line 25 of file IOUAmount.cpp.

◆ kMaxExponent

int xrpl::kMaxExponent = STAmount::kMaxOffset
staticconstexpr

Definition at line 26 of file IOUAmount.cpp.

◆ access

SField::PrivateAccessTagT xrpl::access
static

Definition at line 22 of file SField.cpp.

◆ kSfHash

SField const xrpl::kSfHash(access, STI_UINT256, 257, "hash") ( access ,
STI_UINT256 ,
257 ,
"hash"  )

◆ kSfIndex

SField const xrpl::kSfIndex(access, STI_UINT256, 258, "index") ( access ,
STI_UINT256 ,
258 ,
"index"  )

◆ kTenTO14

std::uint64_t const xrpl::kTenTO14 = 100000000000000ull
static

Definition at line 52 of file STAmount.cpp.

◆ kTenTO14M1

std::uint64_t const xrpl::kTenTO14M1 = kTenTO14 - 1
static

Definition at line 53 of file STAmount.cpp.

◆ kTenTO17

std::uint64_t const xrpl::kTenTO17 = kTenTO14 * 1000
static

Definition at line 54 of file STAmount.cpp.

◆ kAlphabetForward

char const* xrpl::kAlphabetForward
staticconstexpr
Initial value:
=
"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"

Definition at line 125 of file tokens.cpp.

◆ kAlphabetReverse

std::array<int, 256> const xrpl::kAlphabetReverse
staticconstexpr
Initial value:
= []() {
for (auto& m : map)
m = -1;
for (int i = 0, j = 0; kAlphabetForward[i] != 0; ++i)
map[static_cast<unsigned char>(kAlphabetForward[i])] = j++;
return map;
}()
static constexpr char const * kAlphabetForward
Definition tokens.cpp:125

Definition at line 128 of file tokens.cpp.

◆ gCheckpointers

CheckpointersCollection xrpl::gCheckpointers

Definition at line 61 of file DatabaseCon.cpp.

◆ gCheckpointPageCount

auto xrpl::gCheckpointPageCount = 1000
static

Definition at line 36 of file SociDB.cpp.

◆ kNoItem

boost::intrusive_ptr<SHAMapItem const> const xrpl::kNoItem
static

Definition at line 496 of file SHAMap.cpp.

◆ kSfSigbad

HashRouterFlags xrpl::kSfSigbad = HashRouterFlags::PRIVATE1
constexpr

Definition at line 29 of file apply.cpp.

◆ kSfSiggood

HashRouterFlags xrpl::kSfSiggood = HashRouterFlags::PRIVATE2
constexpr

Definition at line 30 of file apply.cpp.

◆ kSfLocalbad

HashRouterFlags xrpl::kSfLocalbad = HashRouterFlags::PRIVATE3
constexpr

Definition at line 31 of file apply.cpp.

◆ kSfLocalgood

HashRouterFlags xrpl::kSfLocalgood = HashRouterFlags::PRIVATE4
constexpr

Definition at line 32 of file apply.cpp.

◆ kDefaultSignerListId

std::uint32_t const xrpl::kDefaultSignerListId = 0
static

Definition at line 40 of file SignerListSet.cpp.

◆ kSfCfInvalid

HashRouterFlags xrpl::kSfCfInvalid = HashRouterFlags::PRIVATE5
constexpr

Definition at line 41 of file EscrowFinish.cpp.

◆ kSfCfValid

HashRouterFlags xrpl::kSfCfValid = HashRouterFlags::PRIVATE6
constexpr

Definition at line 42 of file EscrowFinish.cpp.

◆ kMptMutabilityFlags

std::array<MPTMutabilityFlags, 6> xrpl::kMptMutabilityFlags
staticconstexpr
Initial value:
= {
{{.setFlag = tmfMPTSetCanLock,
.canEnableFlag = lsmfMPTCanEnableCanLock,
.ledgerFlag = lsfMPTCanLock},
{.setFlag = tmfMPTSetRequireAuth,
.canEnableFlag = lsmfMPTCanEnableRequireAuth,
.ledgerFlag = lsfMPTRequireAuth},
{.setFlag = tmfMPTSetCanEscrow,
.canEnableFlag = lsmfMPTCanEnableCanEscrow,
.ledgerFlag = lsfMPTCanEscrow},
{.setFlag = tmfMPTSetCanTrade,
.canEnableFlag = lsmfMPTCanEnableCanTrade,
.ledgerFlag = lsfMPTCanTrade},
{.setFlag = tmfMPTSetCanTransfer,
.canEnableFlag = lsmfMPTCanEnableCanTransfer,
.ledgerFlag = lsfMPTCanTransfer},
{.setFlag = tmfMPTSetCanClawback,
.canEnableFlag = lsmfMPTCanEnableCanClawback,
.ledgerFlag = lsfMPTCanClawback}}}

Definition at line 51 of file MPTokenIssuanceSet.cpp.

◆ kPeerCountStart

auto xrpl::kPeerCountStart = 5
staticconstexpr

Definition at line 58 of file InboundLedger.cpp.

◆ kPeerCountAdd

auto xrpl::kPeerCountAdd = 3
staticconstexpr

Definition at line 59 of file InboundLedger.cpp.

◆ kLedgerTimeoutRetriesMax

auto xrpl::kLedgerTimeoutRetriesMax = 6
staticconstexpr

Definition at line 60 of file InboundLedger.cpp.

◆ kLedgerBecomeAggressiveThreshold

auto xrpl::kLedgerBecomeAggressiveThreshold
staticconstexpr
Initial value:
=
4

Definition at line 61 of file InboundLedger.cpp.

◆ kMissingNodesFind

auto xrpl::kMissingNodesFind = 256
staticconstexpr

Definition at line 63 of file InboundLedger.cpp.

◆ kReqNodesReply

auto xrpl::kReqNodesReply = 128
staticconstexpr

Definition at line 64 of file InboundLedger.cpp.

◆ kReqNodes

auto xrpl::kReqNodes = 12
staticconstexpr

Definition at line 65 of file InboundLedger.cpp.

◆ kLedgerAcquireTimeout

auto xrpl::kLedgerAcquireTimeout = 3000ms
constexpr

Definition at line 68 of file InboundLedger.cpp.

◆ kStartPeers

auto xrpl::kStartPeers = 2
staticconstexpr

Definition at line 31 of file InboundTransactions.cpp.

◆ kSetKeepRounds

auto xrpl::kSetKeepRounds = 3
staticconstexpr

Definition at line 32 of file InboundTransactions.cpp.

◆ kMaxLedgerGap

int xrpl::kMaxLedgerGap {100}
staticconstexpr

Definition at line 84 of file LedgerMaster.cpp.

◆ kMaxLedgerAgeAcquire

std::chrono::minutes xrpl::kMaxLedgerAgeAcquire {1}
staticconstexpr

Definition at line 87 of file LedgerMaster.cpp.

◆ kMaxWriteLoadAcquire

int xrpl::kMaxWriteLoadAcquire {8192}
staticconstexpr

Definition at line 90 of file LedgerMaster.cpp.

◆ kTxAcquireTimeout

auto xrpl::kTxAcquireTimeout = 250ms
constexpr

Definition at line 32 of file TransactionAcquire.cpp.

◆ kNormTimeouts

auto xrpl::kNormTimeouts = 4
staticconstexpr

Definition at line 34 of file TransactionAcquire.cpp.

◆ kMaxTimeouts

auto xrpl::kMaxTimeouts = 20
staticconstexpr

Definition at line 35 of file TransactionAcquire.cpp.

◆ kFullBelowTargetSize

std::size_t xrpl::kFullBelowTargetSize = 524288
constexpr

Definition at line 7 of file src/xrpld/app/main/Tuning.h.

◆ kFullBelowExpiration

std::chrono::seconds xrpl::kFullBelowExpiration = std::chrono::minutes{10}
constexpr

Definition at line 8 of file src/xrpld/app/main/Tuning.h.

◆ kMaxPoppedTransactions

std::size_t xrpl::kMaxPoppedTransactions = 10
constexpr

Definition at line 10 of file src/xrpld/app/main/Tuning.h.

◆ kDefaultRefreshInterval

auto xrpl::kDefaultRefreshInterval = std::chrono::minutes{5}
constexpr

Definition at line 47 of file ValidatorSite.cpp.

◆ kErrorRetryInterval

auto xrpl::kErrorRetryInterval = std::chrono::seconds{30}
constexpr

Definition at line 48 of file ValidatorSite.cpp.

◆ kMaxRedirects

unsigned constexpr short xrpl::kMaxRedirects = 3
constexpr

Definition at line 49 of file ValidatorSite.cpp.

◆ kStateNames

std::array<char const*, 5> const xrpl::kStateNames
static
Initial value:
{
{"disconnected", "connected", "syncing", "tracking", "full"}}

Definition at line 943 of file NetworkOPs.cpp.

◆ kGenesisAccountId

auto const xrpl::kGenesisAccountId
static
Initial value:
=
Seed generateSeed(std::string const &passPhrase)
Generate a seed deterministically.
Definition Seed.cpp:58
std::pair< PublicKey, SecretKey > generateKeyPair(KeyType type, Seed const &seed)
Generate a key pair deterministically.
AccountID calcAccountID(PublicKey const &pk)

Definition at line 955 of file NetworkOPs.cpp.

◆ kSizedItems

std::array<std::pair<SizedItem, std::array<int, 5> >, 13> xrpl::kSizedItems
constexpr
Initial value:
{{
{SizedItem::SweepInterval, {{ 10, 30, 60, 90, 120 }}},
{SizedItem::TreeCacheSize, {{ 262144, 524288, 2097152, 4194304, 8388608 }}},
{SizedItem::TreeCacheAge, {{ 30, 60, 90, 120, 900 }}},
{SizedItem::LedgerSize, {{ 32, 32, 64, 256, 384 }}},
{SizedItem::LedgerAge, {{ 30, 60, 180, 300, 600 }}},
{SizedItem::LedgerFetch, {{ 2, 3, 4, 5, 8 }}},
{SizedItem::HashNodeDbCache, {{ 4, 12, 24, 64, 128 }}},
{SizedItem::TxnDbCache, {{ 4, 12, 24, 64, 128 }}},
{SizedItem::LgrDbCache, {{ 4, 8, 16, 32, 128 }}},
{SizedItem::OpenFinalLimit, {{ 8, 16, 32, 64, 128 }}},
{SizedItem::BurstSize, {{ 4, 8, 16, 32, 48 }}},
{SizedItem::RamSizeGb, {{ 6, 8, 12, 24, 0 }}},
{SizedItem::AccountIdCacheSize, {{ 20047, 50053, 77081, 150061, 300007 }}}
}}
@ AccountIdCacheSize
Definition Config.h:40

Definition at line 116 of file Config.cpp.

◆ kFeatureCompr

char xrpl::kFeatureCompr[] = "compr"
staticconstexpr

Definition at line 118 of file Handshake.h.

◆ kFeatureVprr

char xrpl::kFeatureVprr[] = "vprr"
staticconstexpr

Definition at line 120 of file Handshake.h.

◆ kFeatureTxrr

char xrpl::kFeatureTxrr[] = "txrr"
staticconstexpr

Definition at line 122 of file Handshake.h.

◆ kFeatureLedgerReplay

char xrpl::kFeatureLedgerReplay[] = "ledgerreplay"
staticconstexpr

Definition at line 124 of file Handshake.h.

◆ kDelimFeature

char xrpl::kDelimFeature[] = ";"
staticconstexpr

Definition at line 125 of file Handshake.h.

◆ kDelimValue

char xrpl::kDelimValue[] = ","
staticconstexpr

Definition at line 126 of file Handshake.h.

◆ kSupportedProtocolList

ProtocolVersion const xrpl::kSupportedProtocolList[]
constexpr
Initial value:
{
{2, 1},
{2, 2},
}

The list of protocol versions we speak and we prefer to use.

Note
The list must be sorted in strictly ascending order (and so it may not contain any duplicates!)

Definition at line 28 of file ProtocolVersion.cpp.

◆ kTypeLookup

std::unordered_map<protocol::MessageType, TrafficCount::Category> const xrpl::kTypeLookup
Initial value:
= {
{protocol::mtPING, TrafficCount::Category::Base},
{protocol::mtSTATUS_CHANGE, TrafficCount::Category::Base},
{protocol::mtMANIFESTS, TrafficCount::Category::Manifests},
{protocol::mtENDPOINTS, TrafficCount::Category::Overlay},
{protocol::mtTRANSACTION, TrafficCount::Category::Transaction},
{protocol::mtVALIDATOR_LIST, TrafficCount::Category::Validatorlist},
{protocol::mtVALIDATOR_LIST_COLLECTION, TrafficCount::Category::Validatorlist},
{protocol::mtVALIDATION, TrafficCount::Category::Validation},
{protocol::mtPROPOSE_LEDGER, TrafficCount::Category::Proposal},
{protocol::mtPROOF_PATH_REQ, TrafficCount::Category::ProofPathRequest},
{protocol::mtPROOF_PATH_RESPONSE, TrafficCount::Category::ProofPathResponse},
{protocol::mtREPLAY_DELTA_REQ, TrafficCount::Category::ReplayDeltaRequest},
{protocol::mtREPLAY_DELTA_RESPONSE, TrafficCount::Category::ReplayDeltaResponse},
{protocol::mtHAVE_TRANSACTIONS, TrafficCount::Category::HaveTransactions},
{protocol::mtTRANSACTIONS, TrafficCount::Category::RequestedTransactions},
{protocol::mtSQUELCH, TrafficCount::Category::Squelch},
}

Definition at line 11 of file TrafficCount.cpp.

◆ kMaximumMessageSize

std::size_t xrpl::kMaximumMessageSize = megabytes(64)
constexpr

Definition at line 14 of file Message.h.

◆ kMethodNotFound

json::Int xrpl::kMethodNotFound = -32601
constexpr

Definition at line 595 of file ServerHandler.cpp.

◆ kServerOverloaded

json::Int xrpl::kServerOverloaded = -32604
constexpr

Definition at line 596 of file ServerHandler.cpp.

◆ kForbidden

json::Int xrpl::kForbidden = -32605
constexpr

Definition at line 597 of file ServerHandler.cpp.

◆ kWrongVersion

json::Int xrpl::kWrongVersion = -32606
constexpr

Definition at line 598 of file ServerHandler.cpp.

◆ parseAmendments

auto const xrpl::parseAmendments = fixed(keylet::amendments())

Definition at line 112 of file LedgerEntry.cpp.

◆ parseFeeSettings

auto const xrpl::parseFeeSettings = fixed(keylet::feeSettings())

Definition at line 437 of file LedgerEntry.cpp.

◆ parseNegativeUNL

auto const xrpl::parseNegativeUNL = fixed(keylet::negativeUNL())

Definition at line 579 of file LedgerEntry.cpp.