XRPL in JavaScript (xrpl.js)

The XRPL JS SDK is the xrpl package on npm — same library people search as xrpl.js. One client, a WebSocket, no gas oracle. Practice on Testnet, then point at Mainnet.

Updated 23 Sep 2026 · Uses xrpl on npm

What you install

The official XRPL JavaScript / TypeScript SDK lives on GitHub as XRPLF/xrpl.js. On npm the package name is xrpl:

npm install xrpl

That is the whole “XRPL npm” answer. There is no second official SDK with a different name. Prefer the package above over random “xrpl-sdk” forks.

Connect and read a ledger

xrpl.js wants a WebSocket. Testnet first — fake XRP, same transaction types as Mainnet:

import xrpl from "xrpl";

const client = new xrpl.Client("wss://s.altnet.rippletest.net:51233");
await client.connect();

const ledger = await client.request({
  command: "ledger",
  ledger_index: "validated",
});
console.log("ledger_index", ledger.result.ledger_index);

await client.disconnect();

When the index ticks, you are on XRPL. On Mainnet we publish that close as XRPL Pulse — ledger age and typical fee from our own node, not a copied explorer. Holders can later swap the URL for the Pixelverse rippled endpoint.

Fund a Testnet wallet

The client can request Testnet XRP from the faucet. Do not reuse those seeds on Mainnet. More faucet / network URLs: XRPL testnet and faucet.

const wallet = (await client.fundWallet()).wallet;
console.log(wallet.address);

When to use JS vs Python

Use xrpl.js in a Node service or a browser dApp. Use xrpl-py for cron jobs and one-file scripts — JSON-RPC is boring in a good way. Same ledger, same fees. Then automate in Python if the job is a loop, not a UI.

Script the ledger in JS. Hold the NFT in a wallet you actually click.

XRPL testnet XRPL Pulse Mint on Pixelverse