🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

xrpl

Package Overview
Dependencies
Maintainers
10
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xrpl

A TypeScript/JavaScript API for interacting with the XRP Ledger in Node.js and the browser

4.2.5
latest
Source
npm
Version published
Weekly downloads
149K
-26.48%
Maintainers
10
Weekly downloads
 
Created

What is xrpl?

The xrpl npm package is a JavaScript library for interacting with the XRP Ledger, a decentralized blockchain platform. It provides tools for building applications that can send and receive XRP, manage accounts, and interact with the XRP Ledger's decentralized exchange.

What are xrpl's main functionalities?

Connecting to the XRP Ledger

This feature allows you to establish a connection to the XRP Ledger using a WebSocket client. The code sample demonstrates how to connect to the test network of the XRP Ledger.

const xrpl = require('xrpl');
const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233');
await client.connect();
console.log('Connected to the XRP Ledger');

Creating and Submitting Transactions

This feature allows you to create and submit transactions to the XRP Ledger. The code sample shows how to create a payment transaction, sign it with a wallet, and submit it to the ledger.

const wallet = xrpl.Wallet.fromSeed('s████████████████████████████');
const transaction = {
  TransactionType: 'Payment',
  Account: wallet.classicAddress,
  Amount: xrpl.xrpToDrops('10'),
  Destination: 'r████████████████████████████'
};
const prepared = await client.autofill(transaction);
const signed = wallet.sign(prepared);
const result = await client.submitAndWait(signed.tx_blob);
console.log('Transaction result:', result);

Querying Account Information

This feature allows you to query information about an account on the XRP Ledger. The code sample demonstrates how to request account information for a specific account address.

const accountInfo = await client.request({
  command: 'account_info',
  account: 'r████████████████████████████',
  ledger_index: 'validated'
});
console.log('Account info:', accountInfo);

Other packages similar to xrpl

Keywords

ripple-lib

FAQs

Package last updated on 22 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts