• Stars
    star
    1,202
  • Rank 38,817 (Top 0.8 %)
  • Language
    TypeScript
  • Created over 11 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

xrpl.js

A JavaScript/TypeScript library for interacting with the XRP Ledger

NPM npm bundle size

This is the recommended library for integrating a JavaScript/TypeScript app with the XRP Ledger, especially if you intend to use advanced functionality such as IOUs, payment paths, the decentralized exchange, account settings, payment channels, escrows, multi-signing, and more.

➡️ Reference Documentation

See the full reference documentation for all classes, methods, and utilities.

Features

  1. Managing keys & creating test credentials (Wallet && Client.fundWallet())
  2. Submitting transactions to the XRP Ledger (Client.submit(...) & transaction types)
  3. Sending requests to observe the ledger (Client.request(...) using public API methods)
  4. Subscribing to changes in the ledger (Ex. ledger, transactions, & more...)
  5. Parsing ledger data into more convenient formats (xrpToDrops and rippleTimeToISOTime)

All of which works in Node.js (tested for v14+) & web browsers (tested for Chrome).

Quickstart

Requirements

  • Node.js v16 is recommended. We also support v14, v18 and v20. Other versions may work but are not frequently tested.

Installing xrpl.js

In an existing project (with package.json), install xrpl.js with:

$ npm install --save xrpl

Or with yarn:

$ yarn add xrpl

Example usage:

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

  const response = await client.request({
    command: "account_info",
    account: "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
    ledger_index: "validated",
  });
  console.log(response);

  client.disconnect();
}
main();

For a more in-depth example, you can copy/forking this Code Sandbox template!
https://codesandbox.io/s/xrpl-intro-pxgdjr?file=/src/App.js

It goes through:

  1. Creating a new test account
  2. Sending a payment transaction
  3. And sending requests to see your account balance!

Case by Case Setup Steps

If you're using xrpl.js with React or Deno, you'll need to do a couple extra steps to set it up:

Documentation

As you develop with xrpl.js, there's two sites you'll use extensively:

  1. xrpl.org is the primary source for:
  2. js.xrpl.org has the reference docs for this library

Mailing Lists

If you want to hear when we release new versions of xrpl.js, you can join our low-traffic mailing list (About 1 email per week):

If you're using the XRP Ledger in production, you should run a rippled server and subscribe to the ripple-server mailing list as well.

Asking for help

One of the best spots to ask for help is in the XRPL Developer Discord - There's a channel for xrpl.js where other community members can help you figure out how to accomplish your goals.

You are also welcome to create an issue here and we'll do our best to respond within 3 days.

Key Links

More Repositories

1

rippled

Decentralized cryptocurrency blockchain daemon implementing the XRP Ledger protocol in C++
C++
4,511
star
2

xrpl-dev-portal

Source code for xrpl.org including developer documentation
JavaScript
519
star
3

XRPL-Standards

XLS: XRP(L) community defined Suggestions, Proposals, RFCs / Standards / Drafts & discussions, to be added to the core protocol, used for platform & apps devemopment, etc.
JavaScript
188
star
4

xrpl-py

A Python library to interact with the XRP Ledger (XRPL) blockchain
Python
150
star
5

xrpl4j

A 100% Java implementation to interact with the XRP Ledger.
Java
86
star
6

clio

An XRP Ledger API Server
C++
61
star
7

xrpl-hooks-ide

XRPL Hooks Builder - Add smart contract functionality to the XRP Ledger
TypeScript
17
star
8

rippled-portable-builds

Portable binaries of the rippled server
Shell
11
star
9

xrpl-node-configurator

Configuration tool that will produce the required config files to run your XRP Ledger server.
Vue
10
star
10

XRPL-Technical-Explorer

Technical (JSON viewer) explorer for XRPL devs. Click on account / hash / ... to zoom in.
Vue
10
star
11

xrpl4j-sample

Sample project using xrpl4j
Java
9
star
12

hook-cleaner-c

Hook Cleaner removes unwanted compiler-provided exports and functions from a wasm binary to make it (more) suitable for being used as a Hook
C
8
star
13

Understanding_the_XRP_Ledger

An open source textbook covering the fundamentals of the XRP Ledger (rippled) codebase
5
star
14

xrpl-hooks-compiler

Repository for compiler and language server logic
TypeScript
5
star
15

xbridge-cli

Python
4
star
16

CTID

Improved Concise Transaction Identifier (CTIM) code samples and test cases
Python
4
star
17

xrpl.ws-stats.com-Frontend

XRPL.WS Stats & Status frontend
JavaScript
4
star
18

Supply-Calculator

Fetch an entire ledger and calculate the (available for spending) XRP supply on the XRPL
JavaScript
4
star
19

Hooks

Hooks Monorepo: Hooks IDE / xrpld (rippled) with Hooks support / Sample Hooks / Discussions
4
star
20

xrpl-deserializer-c

A fast command-line XRPL serialized binary object deserializer
C
3
star
21

Validation-Stream

Validation Stream WebUI (alpha)
Vue
3
star
22

xrplf.org-placeholder

https://xrplf.org Placeholder website
HTML
2
star
23

xrpld-debug-stream

xrpld (rippled) Debug Stream WebSocket to subscribe to logs containing a specific account address
JavaScript
2
star
24

rpc2ws

Proxy: offers rippled compatible JSON RPC endpoint, internally sending to WebSocket, replying RPC
JavaScript
2
star
25

api

api.xrplf.org - Pointing at endpoints
HTML
2
star
26

typescript-style

TypeScript linter and code formatting rules
JavaScript
1
star
27

XRPL-Cluster.com

Website for xrplcluster.com - Redundant, geo available XRPL full history servers
CSS
1
star
28

xrpl-project-directory

Python
1
star
29

clio-gha

GitHub actions for building, testing and packaging Clio
Shell
1
star