xrpl_dart library

xrpledger Library

This library provides a comprehensive set of tools and utilities for working with the XRPL (XRP Ledger). It supports various XRPL functionalities, including transaction handling, address encoding and decoding, XRPL network interaction through JSON-RPC API, and more.

Features:

  • Create all transaction types
  • Sign XRP transactions with ED25519 and SECP256K1 algorithms.
  • Encoding and decoding of XRPL addresses.
  • Interacting with the XRPL network via JSON-RPC API.
  • Fee calculation for XRPL transactions.
  • X-Address support for enhanced address features.
  • Utility functions for managing XRPL data structures.

Classes

AccountData
AccountDelete
Represents an AccountDelete transaction AccountDelete transaction, which deletes an account and any objects it owns in the XRP Ledger, if possible, sending the account's remaining XRP to a specified destination account. See Deletion of Accounts for the requirements to delete an account.
AccountFlags
AccountInfo
AccountingDuration
AccountObjectType
AccountSet
Represents an AccountSet transaction, which modifies the properties of an account in the XRP Ledger.
AccountSetAsfFlag
Enum for AccountSet Flags.
AccountSetConst
AccountSetFlag
Enum for AccountSet Transaction Flags. Transactions of the AccountSet type support additional values in the Flags field. This enum represents those options. See AccountSet tf Flags
Alternatives
AMMBid
Bid on an Automated Market Maker's (AMM's) auction slot. If you win, you can trade against the AMM at a discounted fee until you are outbid or 24 hours have passed. If you are outbid before 24 hours have passed, you are refunded part of the cost of your bid based on how much time remains. You bid using the AMM's LP Tokens; the amount of a winning bid is returned to the AMM, decreasing the outstanding balance of LP Tokens.
AMMCreate
Create a new Automated Market Maker (AMM) instance for trading a pair of assets (fungible tokens or XRP).
AMMDelete
Delete an empty Automated Market Maker (AMM) instance that could not be fully deleted automatically.
AMMDeposit
Deposit funds into an Automated Market Maker (AMM) instance and receive the AMM's liquidity provider tokens (LP Tokens) in exchange.
AMMDepositFlag
Transactions of the AMMDeposit type support additional values in the Flags field. This enum represents those options.
AMMDepositFlagInterface
AMMVote
Vote on the trading fee for an Automated Market Maker (AMM) instance. Up to 8 accounts can vote in proportion to the amount of the AMM's LP Tokens they hold. Each new vote re-calculates the AMM's trading fee based on a weighted average of the votes.
AMMWithdraw
Withdraw assets from an Automated Market Maker (AMM) instance by returning the AMM's liquidity provider tokens (LP Tokens).
AMMWithdrawFlag
Transactions of the AMMWithdraw type support additional values in the Flags field. This enum represents those options.
AMMWithdrawFlagInterface
ANS1RawOptions
Placeholder for the ANS1RawOptions class - adjust according to your actual implementation
ASN1RawEncoder
AuthAccount
Represents one entry in a list of AuthAccounts used in AMMBid transaction.
CheckCancel
Represents a CheckCancel https://xrpl.org/checkcancel.html transaction, which cancels an unredeemed Check, removing it from the ledger without sending any money. The source or the destination of the check can cancel a Check at any time using this transaction type. If the Check has expired, any address can cancel it.
CheckCash
Represents a CheckCash transaction https://xrpl.org/checkcash.html, which redeems a Check object to receive up to the amount authorized by the corresponding CheckCreate transaction. Only the Destination address of a Check can cash it.
CheckCreate
Represents a CheckCreate https://xrpl.org/checkcreate.html transaction, which creates a Check object. A Check object is a deferred payment that can be cashed by its intended destination. The sender of this transaction is the sender of the Check.
Clawback
The clawback transaction claws back issued funds from token holders.
CurrencyAmount
Represents an amount of currency, which can be either XRP or an issued currency.
DepositPreauth
Represents a DepositPreauth transaction, which gives another account pre-approval to deliver payments to the sender of this transaction, if this account is using Deposit Authorization.
DIDDelete
Represents a DIDDelete transaction.
DIDSet
Represents a DIDSet transaction.
Drops
EscrowCancel
Represents an EscrowCancel transaction, which returns escrowed XRP to the sender after the Escrow has expired.
EscrowCreate
Represents an EscrowCreate transaction, which locks up XRP until a specific time or condition is met.
EscrowFinish
Represents an EscrowFinish transaction, delivers XRP from a held payment to the recipient.
FlagsInterface
FulfillmentPreimageSha256
Represents a fulfillment with SHA-256 preimage in Dart. Crypto-Conditions Fulfillment
Info
IssuedCurrency
Represents a currency issued on the XRP Ledger with a specific issuer.
IssuedCurrencyAmount
Represents an amount of a specific issued currency on the XRP Ledger.
LastClose
LedgerData
LedgerDepositPreauth
LedgerDirectory
LedgerEntryType
LedgerEscrow
LedgerInfo
LedgerOffer
LedgerRippleState
LedgerTicket
LedgerXChainClaimID
LedgerXChainCreateAccountClaimID
Levels
NFTokenAcceptOffer
The NFTokenOfferAccept transaction is used to accept offers to buy or sell an NFToken. It can either:
NFTokenBurn
The NFTokenBurn transaction is used to remove an NFToken object from the NFTokenPage in which it is being held, effectively removing the token from the ledger ("burning" it). If this operation succeeds, the corresponding NFToken is removed. If this operation empties the NFTokenPage holding the NFToken or results in the consolidation, thus removing an NFTokenPage, the owner’s reserve requirement is reduced by one.
NFTokenCancelOffer
The NFTokenCancelOffer transaction deletes existing NFTokenOffer objects. It is useful if you want to free up space on your account to lower your reserve requirement. The transaction can be executed by the account that originally created the NFTokenOffer, the account in the Recipient field of the NFTokenOffer (if present), or any account if the NFTokenOffer has an Expiration and the NFTokenOffer has already expired.
NFTokenCreateOffer
The NFTokenCreateOffer transaction creates either an offer to buy an NFT the submitting account does not own, or an offer to sell an NFT the submitting account does own.
NFTokenMint
The NFTokenMint transaction creates an NFToken object and adds it to the relevant NFTokenPage object of the minter. If the transaction is successful, the newly minted token will be owned by the minter account specified by the transaction.
NFTokenMintFlag
Transaction Flags for an NFTokenMint Transaction.
NFTTokenConst
NftTokenCreateOfferFlag
Transaction Flags for an NFTokenCreateOffer Transaction.
NftTokenCreateOfferFlagInterface
NftTokenMintFlagInterface
NoRippleCheckRole
OfferCancel
import 'package:xrpl_dart/src/xrpl/utilities.dart'; Represents an OfferCancel transaction, which removes an Offer object from the decentralized exchange
OfferCreate
Represents an OfferCreate transaction, which executes a limit order in the decentralized exchange https://xrpl.org/decentralized-exchange.html If the specified exchange cannot be completely fulfilled, it creates an Offer object for the remainder. Offers can be partially fulfilled.
OfferCreateFlag
Transactions of the OfferCreate type support additional values in the Flags field. This enum represents those options. See OfferCreate Flags https://xrpl.org/offercreate.html#offercreate-flags
OfferCreateFlagInterface
OnChainXRPLMemo
PathFindSubcommand
PathStep
A PathStep represents an individual step along a Path.
Payment
Represents a Payment https://xrpl.org/payment.html transaction, which sends value from one account to another. (Depending on the path taken, this can involve additional exchanges of value, which occur atomically.) This transaction type can be used for several types of payments http://xrpl.local/payment.html#types-of-payments. Payments are also the only way to create accounts http://xrpl.local/payment.html#creating-accounts.
PaymentChannelClaim
Represents a PaymentChannelClaim xrpl.org/paymentchannelclaim.html_ transaction, which claims XRP from a payment channel xrpl.org/payment-channels.html_, adjusts channel's expiration, or both. This transaction can be used differently depending on the transaction sender's role in the specified channel.
PaymentChannelClaimFlag
PaymentChannelClaimFlagInterface
PaymentChannelCreate
Represents a PaymentChannelCreate transaction, which creates a payment channel and funds it with XRP. The sender of this transaction is the "source address" of the payment channel.
PaymentChannelFund
Represents a PaymentChannelFund transaction, adds additional XRP to an open payment channel and optionally updates the expiration time of the channel. Only the source address of the channel can use this transaction.
PaymentFlag
Transactions of the Payment type support additional values in the Flags field. This enum represents those options. See Payment Flags
RippleKeyConst
RipplePathFound
RPCSubscribe
The subscribe method requests periodic notifications from the server when certain events happen. WebSocket API only. See subscribe
RPCUnSubscribe
The unsubscribe command tells the server to stop sending messages for a particular subscription or set of subscriptions. WebSocket API only. See unsubscribe
ServerInfo
SetRegularKey
Represents a SetRegularKey transaction, which assigns, changes, or removes a secondary "regular" key pair associated with an account.
SignerEntry
Represents one entry in a list of multi-signers authorized to an account.
SignerListSet
Represents a SignerListSet transaction, which creates, replaces, or removes a list of signers that can be used to multi-sign a transaction .
StateAccounting
StreamParameter
SubscribeBook
Format for elements in the books array for Subscribe only.
TicketCreate
A TicketCreate transaction sets aside one or more sequence numbers as Tickets.
TransactionData
TrustSet
Represents a TrustSet transaction on the XRP Ledger. Creates or modifies a trust line linking two accounts. See TrustSet
TrustSetFlag
Transactions of the TrustSet type support additional values in the Flags field. This enum represents those options.
UnsubscribeBook
Format for elements in the books array for Unsubscribe only..
ValidatedLedger
XChainAccountCreateCommit
Represents a XChainAccountCreateCommit transaction on the XRP Ledger. The XChainAccountCreateCommit transaction creates a new account on one of the chains a bridge connects, which serves as the bridge entrance for that chain.
XChainAddAccountCreateAttestation
Represents a XChainAddAccountCreateAttestation transaction. The XChainAddAccountCreateAttestation transaction provides an attestation from a witness server that a XChainAccountCreateCommit transaction occurred on the other chain.
XChainAddClaimAttestation
Represents a XChainAddClaimAttestation transaction. The XChainAddClaimAttestation transaction provides proof from a witness server, attesting to an XChainCommit transaction.
XChainBridge
XChainClaim
Represents a XChainClaim transaction. The XChainClaim transaction completes a cross-chain transfer of value. It allows a user to claim the value on the destination chain - the equivalent of the value locked on the source chain.
XChainCommit
Represents a XChainCommit transaction. The XChainCommit transaction is the second step in a cross-chain transfer. It puts assets into trust on the locking chain so that they can be wrapped on the issuing chain, or burns wrapped assets on the issuing chain so that they can be returned on the locking chain.
XChainCreateBridge
Represents a XChainCreateBridge transaction. The XChainCreateBridge transaction creates a new Bridge ledger object and defines a new cross-chain bridge entrance on the chain that the transaction is submitted on. It includes information about door accounts and assets for the bridge.
XChainCreateClaimId
XChainModifyBridge
XChainModifyBridgeFlag
XChainModifyBridgeFlagInterface
XRP
Represents the XRP (native currency) on the XRP Ledger.
XRPAddress
XRPAddressConst
XRPCurrencies
An abstract class representing different currencies in the XRP Ledger.
XRPHelper
XRPKeyAlgorithm
Enum representing different XRP key algorithms.
XrpKeyConst
XRPLastClose
XRPLBase
XRPLedgerRequest<RESULT, RESPONSE>
An abstract class representing an XRPLedgerRequest.
XRPLedgerState
XRPLedgerStateAccounting
XRPLedgerStateAccountingDuration
XRPLedgerStateDetails
XRPLedgerValidatedLedger
XRPLLedgerIndex
XRPLMemo
An arbitrary piece of data attached to a transaction. A transaction can have multiple Memo objects as an array in the Memos field. Must contain one or more of memo_data, memo_format, and memo_type.
XRPLSignature
XRPLSigners
One Signer in a multi-signature. A multi-signed transaction can have an array of up to 8 Signers, each contributing a signature, in the Signers field.
XRPLTransactionResult
XRPLTransactionType
XRPLTxJson
XRPPrivateKey
XRPProvider
XRPL RPC Client
XRPProviderConst
XRPPublicKey
XRPRequestAccountChannel
This request returns information about an account's Payment Channels. This includes only channels where the specified account is the channel's source, not the destination. (A channel's "source" and "owner" are the same.) All information retrieved is relative to a particular version of the ledger. See account_channels
XRPRequestAccountCurrencies
This request retrieves a list of currencies that an account can send or receive, based on its trust lines. This is not a thoroughly confirmed list, but it can be used to populate user interfaces. See account_currencies
XRPRequestAccountInfo
This request retrieves information about an account, its activity, and its XRP balance. All information retrieved is relative to a particular version of the ledger. See account_info
XRPRequestAccountLines
This request returns information about an account's trust lines, including balances in all non-XRP currencies and assets. All information retrieved is relative to a particular version of the ledger. See account_lines
XRPRequestAccountNFTs
This method retrieves all of the NFTs currently owned by the specified account.
XRPRequestAccountObjectType
This request returns the raw ledger format for all objects owned by an account. For a higher-level view of an account's trust lines and balances, see AccountLinesRequest instead.
XRPRequestAccountOffer
This request retrieves a list of offers made by a given account that are outstanding as of a particular ledger version. See account_offers
XRPRequestAccountTx
This request retrieves from the ledger a list of transactions that involved the specified account. See account_tx
XRPRequestAMMInfo
The amm_info method gets information about an Automated Market Maker (AMM) instance.
XRPRequestBookOffers
The book_offers method retrieves a list of offers, also known as the order book, between two currencies.
XRPRequestChannelAuthorize
The channel_authorize method creates a signature that can be used to redeem a specific amount of XRP from a payment channel. Warning: Do not send secret keys to untrusted servers or through unsecured network connections. (This includes the secret, seed, seed_hex, or passphrase fields of this request.) You should only use this method on a secure, encrypted network connection to a server you run or fully trust with your funds. Otherwise, eavesdroppers could use your secret key to sign claims and take all the money from this payment channel and anything else using the same key pair. See Set Up Secure Signing for instructions.
XRPRequestChannelVerify
The channel_verify method checks the validity of a signature that can be used to redeem a specific amount of XRP from a payment channel.
XRPRequestDepositAuthorized
The deposit_authorized command indicates whether one account is authorized to send payments directly to another. See Deposit Authorization for information on how to require authorization to deliver money to your account.
XRPRequestDetails
Represents details of an RPC (Remote Procedure Call) request.
XRPRequestFee
The fee command reports the current state of the open-ledger requirements for the transaction cost. This requires the FeeEscalation amendment to be enabled. This is a public command available to unprivileged users.
XRPRequestGatewayBalances
This request calculates the total balances issued by a given account, optionally excluding amounts held by operational addresses. See gateway_balances
XRPRequestLedger
Retrieve information about the public ledger. See ledger
XRPRequestLedgerClosed
The ledger_closed method returns the unique identifiers of the most recently closed ledger. (This ledger is not necessarily validated and immutable yet.)
XRPRequestLedgerCurrent
The ledger_current method returns the unique identifiers of the current in-progress ledger. This command is mostly useful for testing, because the ledger returned is still in flux.
XRPRequestLedgerData
The ledger_data method retrieves contents of the specified ledger. You can iterate through several calls to retrieve the entire contents of a single ledger version. See ledger data
XRPRequestLedgerEntry
The ledger_entry method returns a single ledger object from the XRP Ledger in its raw format. See ledger format for information on the different types of objects you can retrieve. See ledger entry
XRPRequestManifest
The manifest method reports the current "manifest" information for a given validator public key. The "manifest" is the public portion of that validator's configured token.
XRPRequestMethod
XRPRequestNFTBuyOffers
The nft_buy_offers method retrieves all of buy offers for the specified NFToken.
XRPRequestNFTHistory
The nft_history method retreives a list of transactions that involved the specified NFToken.
XRPRequestNFTInfo
The nft_info method retrieves all the information about the NFToken
XRPRequestNFTSellOffers
The nft_sell_offers method retrieves all of sell offers for the specified NFToken.
XRPRequestNoRippleCheck
This request provides a quick way to check the status of the Default Ripple field for an account and the No Ripple flag of its trust lines, compared with the recommended settings. See noripple_check
XRPRequestPathFind
WebSocket API only! The path_find method searches for a path along which a transaction can possibly be made, and periodically sends updates when the path changes over time. For a simpler version that is supported by JSON-XRPRequest, see the ripple_path_find method. For payments occurring strictly in XRP, it is not necessary to find a path, because XRP can be sent directly to any account. Although the rippled server tries to find the cheapest path or combination of paths for making a payment, it is not guaranteed that the paths returned by this method are, in fact, the best paths. Due to server load, pathfinding may not find the best results. Additionally, you should be careful with the pathfinding results from untrusted servers. A server could be modified to return less-than-optimal paths to earn money for its operators. If you do not have your own server that you can trust with pathfinding, you should compare the results of pathfinding from multiple servers run by different parties, to minimize the risk of a single server returning poor results. (Note: A server returning less-than-optimal results is not necessarily proof of malicious behavior; it could also be a symptom of heavy server load.)
XRPRequestPing
The ping command returns an acknowledgement, so that clients can test the connection status and latency.
XRPRequestRandom
The random command provides a random number to be used as a source of entropy for random number generation by clients.
XRPRequestRipplePathFind
The ripple_path_find method is a simplified version of the path_find method that provides a single response with a payment path you can use right away. It is available in both the WebSocket and JSON-XRPRequest APIs. However, the results tend to become outdated as time passes. Instead of making multiple calls to stay updated, you should instead use the path_find method to subscribe to continued updates where possible. Although the rippled server tries to find the cheapest path or combination of paths for making a payment, it is not guaranteed that the paths returned by this method are, in fact, the best paths.
XRPRequestServerDefinitions
The definitions command asks the server for a human-readable version of various information about the rippled server being queried.
XRPRequestServerInfo
The server_info command asks the server for a human-readable version of various information about the rippled server being queried.
XRPRequestServerState
The server_state command asks the server for various machine-readable information about the rippled server's current state. The response is almost the same as the server_info method, but uses units that are easier to process instead of easier to read. (For example, XRP values are given in integer drops instead of scientific notation or decimal values, and time is given in milliseconds instead of seconds.)
XRPRequestSign
The sign method takes a transaction in JSON format and a seed value, and returns a signed binary representation of the transaction. To contribute one signature to a multi-signed transaction, use the sign_for method instead. By default, this method is admin-only. It can be used as a public method if the server has enabled public signing. Caution: Unless you run the rippled server yourself, you should do local signing with RippleAPI instead of using this command. An untrustworthy server could change the transaction before signing it, or use your secret key to sign additional arbitrary transactions as if they came from you.
XRPRequestSignFor
The sign_for command provides one signature for a multi-signed transaction. By default, this method is admin-only. It can be used as a public method if the server has enabled public signing. This command requires the MultiSign amendment to be enabled. See sign_for
XRPRequestSubmitMultisigned
The submit_multisigned command applies a multi-signed transaction and sends it to the network to be included in future ledgers. (You can also submit multi-signed transactions in binary form using the submit command in submit-only mode.) This command requires the MultiSign amendment to be enabled. See submit_multisigned
XRPRequestSubmitOnly
The submit method applies a transaction and sends it to the network to be confirmed and included in future ledgers. This command has two modes:
XRPRequestTransactionEntry
The transaction_entry method retrieves information on a single transaction from a specific ledger version. (The tx method, by contrast, searches all ledgers for the specified transaction. We recommend using that method instead.) `See transaction_entry
XRPRequestTx
XrpSeedUtils
XRPTransaction
The base class for all transaction types https://xrpl.org/transaction-types.html. Represents fields common to all transaction types https://xrpl.org/transaction-common-fields.html.

Enums

XrplFeeType

Typedefs

OnGenerateRpc = Future<XRPServiceProvider> Function(String httpUri, String websocketUri)
XRPServiceResponse<T> = BaseServiceResponse<T>

Exceptions / Errors

ASN1CodecException