XRPLRpc class

XRPL RPC Client

This class provides access to the XRPL (XRP Ledger) network through JSON-RPC. It supports different XRPL networks, including Testnet, Mainnet, Devnet, and AMM Devnet.

Constructors

XRPLRpc.ammDevnet()
Create an XRPL RPC client for the AMM Devnet network.
XRPLRpc.devNet()
Create an XRPL RPC client for the Devnet network.
XRPLRpc.mainnet()
Create an XRPL RPC client for the Mainnet network.
XRPLRpc.testNet()
Create an XRPL RPC client for the Testnet network.

Properties

hashCode int
The hash code for this object.
no setterinherited
RESTRICTED_NETWORKS int
Constants related to XRPL networks and versions
final
rpc → JsonRPC
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

channelAutorize(String channelId, BigInt amount, {String? secret, String? seed, String? seedHex, String? passphrase, CryptoAlgorithm? keyType}) Future<Map<String, dynamic>>
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.
channelVerify(String channelId, BigInt amount, String publicKey, String signature) Future<Map<String, dynamic>>
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.
depositAutorize(String sourceAccount, BigInt destinationAmount, {String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
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.
getAccountChannels(String address, {String? destinationAmount, int limit = 200, String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
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
getAccountCurrencies(String address, {bool strict = false, String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
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
getAccountInfo(String address, {bool queue = false, bool signersList = false, bool strict = false, String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<AccountInfo>
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
getAccountLines(String address, {String? peer, int? limit, String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
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
getAccountNFTS(String address, {int? limit, String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
This method retrieves all of the NFTs currently owned by the specified account.
getAccountObjects(String address, {AccountObjectType? type, bool? deletionBlockersOnly, int? limit}) Future<Map<String, dynamic>>
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.
getAccountOffer(String address, {int? limit, bool strict = false, String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
This request retrieves a list of offers made by a given account that are outstanding as of a particular ledger version.
getAccountTX(String address, {int? ledgerIndexMin, int? ledgerIndexMax, bool binary = false, bool forward = false, int? limit, String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
This request retrieves from the ledger a list of transactions that involved the specified account.
getAMMInfo(XRPCurrencies asset, XRPCurrencies asset2) Future<Map<String, dynamic>>
The amm_info method gets information about an Automated Market Maker (AMM) instance.
getBookOffer(XRPCurrencies takerGets, XRPCurrencies takerPays, {String? taker, int? limit, String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
The book_offers method retrieves a list of offers, also known as the order book, between two currencies.
getFaucetUrl(String url, [String? faucetHost]) String
Get Faucet URL
getFee() Future<LedgerInfo>
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.
getFucent(String address) Future<Map<String, dynamic>>
get fucent in specify node
getLedger({bool queue = false, bool full = false, bool accounts = false, bool transactions = false, bool expand = false, bool ownerFunds = false, bool binary = false, String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated, LedgerEntryType? type}) Future<LedgerData>
Retrieve information about the public ledger. See ledger
getRipplePathFound({required String sourceAccount, required String destinationAccount, required CurrencyAmount destinationAmount, CurrencyAmount? sendMax, List<XRPCurrencies>? currencies}) Future<RipplePathFound>
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-RPC 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.
getServerInfo() Future<ServerInfo>
The server_info command asks the server for a human-readable version of various information about the rippled server being queried.
getTransactionNetworkId() Future<int?>
Get the network ID for XRPL transactions.
getwayBalance(String account, {bool strict = false, dynamic hotwallet, String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
This request calculates the total balances issued by a given account, optionally excluding amounts held by operational addresses.
ledgerClosed() Future<Map<String, dynamic>>
The ledger_closed method returns the unique identifiers of the most recently closed ledger. (This ledger is not necessarily validated and immutable yet.)
ledgerCurrent() Future<Map<String, dynamic>>
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.
ledgerData({bool binary = false, int? limit, String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated, LedgerEntryType? type}) Future<Map<String, dynamic>>
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
makeCustomCall<T>(String function, [List? params]) Future<T>
Make custom request
manifest(String publicKey) Future<Map<String, dynamic>>
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.
NFTBuyOffers(String nftId, {String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
The nft_buy_offers method retrieves all of buy offers for the specified NFToken.
NFTHistory(String nftId, {int? ledgerIndexMin, int? ledgerIndexMax, bool binary = false, bool forward = false, int? limit, String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
The nft_history method retreives a list of transactions that involved the specified NFToken.
NFTInfo(String nftId, {String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
The nft_info method retrieves all the information about the NFToken
NFTSellOffers(String nftId, {String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
The nft_sell_offers method retrieves all of sell offers for the specified NFToken.
noRippleCheck(String account, NoRippleCheckRole role, {bool transactions = false, int? limit = 300, String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
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.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pathFind(PathFindSubcommand subcommand, String sourceAccount, String destinationAccount, XRP destinationAmount, {List<List<PathStep>>? paths, XRP? sendMax}) Future<Map<String, dynamic>>
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-RPC, 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.)
ping() Future<Map<String, dynamic>>
The ping command returns an acknowledgement, so that clients can test the connection status and latency.
serverState() Future<XRPLedgerState>
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.)
submit(String txBlob, {bool failHard = false}) Future<XRPLTransactionResult>
WARNING: This object should never be created. You should create an object of type SignAndSubmit or SubmitOnly instead. 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:
submitOnly(String txBlob, {bool failHard = false}) Future<XRPLTransactionResult>
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:
toString() String
A string representation of this object.
inherited
transactionEntry(String txHash, {String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
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
tx(String txHash, {String? ledgerHash, XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) Future<Map<String, dynamic>>
The tx method retrieves information on a single transaction. See tx

Operators

operator ==(Object other) bool
The equality operator.
inherited