Interaction with the XRP Ledger
Last updated
Last updated
This section will guide you through interacting with the XRP Ledger using the XRP Ledger Snap. You'll learn how to request account balances, submit transactions, make payments, create trustlines, and send tokens.
Before using the XRP Ledger Snap you must read first the official documentation of the XRPL.
To retrieve the balance of an XRP Ledger account, you can use the following method:
In the XRP Ledger you need 10 XRP to active your account.
The Balance will be returned in drops
The balance you get from the response is not the available balance that the account has to spend.
Each account has a reserve:
Base reserve: 10 XRP
Owner reserve: 2 XRP per item
So to get the available balance in drops:
To learn more visit:
A drop is the minimum amount valid in the XRP Ledger, each drop is equal to 0.000001 XRP.
You can easily convert drops to xrp with xrpl.js
.
To send XRP from one account to another, you can submit a payment transaction:
This transaction sends 1 XRP from your account to the specified destination account.
A trustline is required to hold tokens issued by other accounts on the XRP Ledger. Hereโs how to create a trustline:
This transaction establishes a trustline allowing your account to hold up to 1000 units of a specified token issued by another account.
Once a trustline is established, you can send tokens to another account as follows:
This transaction sends 10 units of the specified token from your account to the recipient's account.
To learn more about the tokens in the XRP Ledger visit:
If you need more examples about all the transactions that you can submit and how to do it visit: