Skip to main content

XRPL

The XRP Ledger is a decentralized cryptographic ledger powered by a network of peer-to-peer servers. It is fast, energy efficient, and reliable, with low transaction costs. XRP is the native cryptocurrency of the XRP Ledger, used to facilitate transactions on the network.

Core Concepts

  1. Accounts: XRPL Accounts
  2. Transactions: Transaction Basics
  3. Consensus: XRPL Consensus
  4. Fees: XRPL Fees

Setting up your wallet

To interact with the XRP Ledger, you need a wallet. You can use various wallet solutions, such as: For development purposes, you can generate a test wallet using the XRPL Faucet.

Creating the SDK Instance

Import the SDK and create a new instance:
The with_reconnect parameter is optional and defaults to true. It is used to specify whether the SDK should attempt to reconnect to the XRPL if the web socket connection is lost.
The XRPL SDK uses a web socket connection. HTTP RPCs are not supported.

Connecting your wallet

To perform transactions, connect your wallet to the SDK:
You can view the address of your connected wallet using the getAddress method:

Getting balance

To get the balance of an account:

Token transfer

To create a transaction to transfer XRP, use the preparePay method:
The signedTx object contains the signed transaction that can be used in a DEMOS transaction.

Multiple transfers

To prepare multiple transfers at once, use the preparePays method:

Signing Messages

Advanced Usage

The DEMOS XRPL SDK is built on top of the XRPL JS Library, and provides a limited set of methods to interact with the XRP Ledger. For more advanced use cases, you can access the underlying API to have more control over the transactions and interactions with the blockchain. Here is a list of the objects you can access:

API Reference

https://kynesyslabs.github.io/demosdk-api-ref/classes/xmwebsdk.XRPL.html

Resources