ripple-lib (RippleAPI)
A JavaScript/TypeScript API for interacting with the XRP Ledger
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.
See the full reference documentation on the XRP Ledger Dev Portal.
What is ripple-lib used for? The applications on the list linked above use ripple-lib
. Open a PR to add your app or project to the list!
Features
- Connect to a
rippled
server from Node.js or a web browser
- Helpers for creating requests and parsing responses for the rippled API
- Listen to events on the XRP Ledger (transactions, ledger, validations, etc.)
- Sign and submit transactions to the XRP Ledger
- Type definitions for TypeScript
Requirements
- Node.js v14 is recommended. Other versions may work but are not frequently tested.
- Yarn is recommended.
npm
may work but we use yarn.lock
.
Getting Started
See also: RippleAPI Beginners Guide
In an existing project (with package.json
), install ripple-lib
:
$ yarn add ripple-lib
Then see the documentation.
Using ripple-lib with React Native
If you want to use ripple-lib
with React Native you will need to have some of the NodeJS modules available. To help with this you can use a module like rn-nodeify.
-
Install dependencies (you can use npm
as well):
yarn add react-native-crypto
yarn add ripple-lib
# install peer deps
yarn add react-native-randombytes
# install latest rn-nodeify
yarn add rn-nodeify@latest --dev
-
After that, run the following command:
# install node core shims and recursively hack package.json files
# in ./node_modules to add/update the "browser"/"react-native" field with relevant mappings
./node_modules/.bin/rn-nodeify --hack --install
-
Enable crypto
:
rn-nodeify
will create a shim.js
file in the project root directory.
Open it and uncomment the line that requires the crypto module:
// If using the crypto shim, uncomment the following line to ensure
// crypto is loaded first, so it can populate global.crypto
require('crypto')
-
Import shim
in your project (it must be the first line):
import './shim'
...
Using ripple-lib with Deno
Until official support for Deno is added, you can use the following work-around to use ripple-lib
with Deno:
import ripple from 'https://dev.jspm.io/npm:ripple-lib';
(async () => {
const api = new (ripple as any).RippleAPI({ server: 'wss://s.altnet.rippletest.net:51233' });
const address = 'rH8NxV12EuV...khfJ5uw9kT';
api.connect().then(() => {
api.getBalances(address).then((balances: any) => {
console.log(JSON.stringify(balances, null, 2));
});
});
})();
Documentation
Mailing Lists
We have a low-traffic mailing list for announcements of new ripple-lib releases. (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.
Development
To build the library for Node.js and the browser:
$ yarn build
The TypeScript compiler will output the resulting JS files in ./dist/npm/
.
webpack will output the resulting JS files in ./build/
.
For details, see the scripts
in package.json
.
Running Tests
Unit Tests
- Clone the repository
cd
into the repository and install dependencies with yarn install
yarn test
Linting
Run yarn lint
to lint the code with eslint
.
Generating Documentation
Do not edit ./docs/index.md
directly because it is a generated file.
Instead, edit the appropriate .md.ejs
files in ./docs/src/
.
If you make changes to the JSON schemas, fixtures, or documentation sources, update the documentation by running yarn run docgen
.
More Information
Current Tags
218 Versions
-
1.10.1
[deprecated]
...
3 years ago
-
1.9.8-storm.4
[deprecated]
...
3 years ago
-
1.9.8-storm.3
[deprecated]
...
3 years ago
-
1.9.8-storm.2
[deprecated]
...
3 years ago
-
1.9.8-storm.1
[deprecated]
...
3 years ago
-
1.9.8-storm.0
[deprecated]
...
3 years ago
-
1.10.0
[deprecated]
...
3 years ago
-
1.9.8
[deprecated]
...
3 years ago
-
1.9.7
[deprecated]
...
3 years ago
-
1.9.6
[deprecated]
...
3 years ago
-
1.9.5
[deprecated]
...
4 years ago
-
1.9.4
[deprecated]
...
4 years ago
-
1.9.3
[deprecated]
...
4 years ago
-
1.9.3-beta.0
[deprecated]
...
4 years ago
-
1.9.2
[deprecated]
...
4 years ago
-
1.9.1
[deprecated]
...
4 years ago
-
1.9.0
[deprecated]
...
4 years ago
-
1.8.2
[deprecated]
...
4 years ago
-
1.8.2-beta.1
[deprecated]
...
4 years ago
-
1.8.2-beta.0
[deprecated]
...
4 years ago
-
1.8.1
[deprecated]
...
4 years ago
-
1.8.1-beta.0
[deprecated]
...
4 years ago
-
1.8.0
[deprecated]
...
4 years ago
-
1.7.1
[deprecated]
...
5 years ago
-
1.7.0
[deprecated]
...
5 years ago
-
1.6.6-beta.2
[deprecated]
...
5 years ago
-
1.6.6-beta.1
[deprecated]
...
5 years ago
-
1.6.5
[deprecated]
...
5 years ago
-
1.6.4
[deprecated]
...
5 years ago
-
1.6.3
[deprecated]
...
5 years ago
-
1.6.3-beta.1
[deprecated]
...
5 years ago
-
1.6.3-beta.0
[deprecated]
...
5 years ago
-
1.6.2
[deprecated]
...
5 years ago
-
1.6.1
[deprecated]
...
5 years ago
-
1.6.0
[deprecated]
...
5 years ago
-
1.5.1
[deprecated]
...
5 years ago
-
1.5.0
[deprecated]
...
5 years ago
-
1.4.2
[deprecated]
...
5 years ago
-
1.4.1
[deprecated]
...
5 years ago
-
1.4.0
[deprecated]
...
5 years ago
-
1.3.4
[deprecated]
...
5 years ago
-
1.4.0-b2
[deprecated]
...
5 years ago
-
1.4.0-b1
[deprecated]
...
5 years ago
-
1.3.3
[deprecated]
...
5 years ago
-
1.3.2
[deprecated]
...
5 years ago
-
1.3.1
[deprecated]
...
5 years ago
-
1.3.0
[deprecated]
...
5 years ago
-
1.2.5
[deprecated]
...
5 years ago
-
1.2.4
[deprecated]
...
6 years ago
-
1.2.3
[deprecated]
...
6 years ago
-
1.2.1
[deprecated]
...
6 years ago
-
1.2.0
[deprecated]
...
6 years ago
-
1.1.2
[deprecated]
...
6 years ago
-
1.1.1
[deprecated]
...
6 years ago
-
1.1.0
[deprecated]
...
6 years ago
-
1.0.2
[deprecated]
...
6 years ago
-
1.0.1
[deprecated]
...
6 years ago
-
1.0.0
[deprecated]
...
6 years ago
-
1.0.0-beta.5
[deprecated]
...
6 years ago
-
1.0.0-beta.4
[deprecated]
...
6 years ago
-
1.0.0-beta.3
[deprecated]
...
6 years ago
-
1.0.0-beta.2
[deprecated]
...
7 years ago
-
1.0.0-beta.1
[deprecated]
...
7 years ago
-
1.0.0-beta.0
[deprecated]
...
7 years ago
-
0.22.0
[deprecated]
...
7 years ago
-
0.21.0
[deprecated]
...
7 years ago
-
0.20.0
[deprecated]
...
7 years ago
-
0.19.1
[deprecated]
...
7 years ago
-
0.19.0
[deprecated]
...
7 years ago
-
0.18.2
[deprecated]
...
7 years ago
-
0.18.1
[deprecated]
...
7 years ago
-
0.18.0
[deprecated]
...
7 years ago
-
0.17.9
[deprecated]
...
7 years ago
-
0.17.8
[deprecated]
...
7 years ago
-
0.17.7
[deprecated]
...
8 years ago
-
0.17.6
[deprecated]
...
8 years ago
-
0.17.5
[deprecated]
...
8 years ago
-
0.17.4
[deprecated]
...
8 years ago
-
0.17.3
[deprecated]
...
8 years ago
-
0.17.2
[deprecated]
...
9 years ago
-
0.17.1
[deprecated]
...
9 years ago
-
0.17.0
[deprecated]
...
9 years ago
-
0.16.10
[deprecated]
...
9 years ago
-
0.16.9
[deprecated]
...
9 years ago
-
0.16.8
[deprecated]
...
9 years ago
-
0.16.7
[deprecated]
...
9 years ago
-
0.16.6
[deprecated]
...
9 years ago
-
0.16.5
[deprecated]
...
9 years ago
-
0.16.4
[deprecated]
...
9 years ago
-
0.16.3
[deprecated]
...
9 years ago
-
0.16.2
[deprecated]
...
9 years ago
-
0.16.1
[deprecated]
...
9 years ago
-
0.16.0
[deprecated]
...
9 years ago
-
0.15.2
[deprecated]
...
9 years ago
-
0.15.1
[deprecated]
...
9 years ago
-
0.15.0
[deprecated]
...
9 years ago
-
0.14.0
[deprecated]
...
9 years ago
-
0.13.2
[deprecated]
...
9 years ago
-
0.13.1
[deprecated]
...
9 years ago
-
0.13.0
[deprecated]
...
9 years ago
-
0.13.0-rc16
[deprecated]
...
9 years ago
-
0.13.0-rc15
[deprecated]
...
9 years ago
-
0.13.0-rc11.1
[deprecated]
...
9 years ago
-
0.13.0-rc14
[deprecated]
...
9 years ago
-
0.13.0-rc13
[deprecated]
...
9 years ago
-
0.13.0-rc12
[deprecated]
...
9 years ago
-
0.12.9
[deprecated]
...
9 years ago
-
0.13.0-rc11
[deprecated]
...
9 years ago
-
0.13.0-rc6.0
[deprecated]
...
9 years ago
-
0.12.8
[deprecated]
...
9 years ago
-
0.13.0-rc10
[deprecated]
...
9 years ago
-
0.12.7
[deprecated]
...
9 years ago
-
0.12.6
[deprecated]
...
9 years ago
-
0.12.5
[deprecated]
...
9 years ago
-
0.13.0-rc1
[deprecated]
...
9 years ago
-
0.12.5-rc2
[deprecated]
...
10 years ago
-
0.12.5-rc1
[deprecated]
...
10 years ago
-
0.12.4
[deprecated]
...
10 years ago
-
0.12.4-rc1
[deprecated]
...
10 years ago
-
0.12.3
[deprecated]
...
10 years ago
-
0.12.3-rc2
[deprecated]
...
10 years ago
-
0.12.3-rc1
[deprecated]
...
10 years ago
-
0.12.2
[deprecated]
...
10 years ago
-
0.12.2-rc1
[deprecated]
...
10 years ago
-
0.12.1
[deprecated]
...
10 years ago
-
0.12.1-rc6
[deprecated]
...
10 years ago
-
0.12.1-rc5
[deprecated]
...
10 years ago
-
0.12.1-rc4
[deprecated]
...
10 years ago
-
0.12.1-rc3
[deprecated]
...
10 years ago
-
0.12.1-rc2
[deprecated]
...
10 years ago
-
0.12.1-rc1
[deprecated]
...
10 years ago
-
0.12.0
[deprecated]
...
10 years ago
-
0.12.0-rc3
[deprecated]
...
10 years ago
-
0.12.0-rc2
[deprecated]
...
10 years ago
-
0.12.0-rc1
[deprecated]
...
10 years ago
-
0.11.0
[deprecated]
...
10 years ago
-
0.11.0-rc3
[deprecated]
...
10 years ago
-
0.11.0-rc2
[deprecated]
...
10 years ago
-
0.11.0-rc1
[deprecated]
...
10 years ago
-
0.10.1-rc2
[deprecated]
...
10 years ago
-
0.10.1-rc1
[deprecated]
...
10 years ago
-
0.10.0
[deprecated]
...
10 years ago
-
0.10.0-rc2
[deprecated]
...
10 years ago
-
0.10.0-rc1
[deprecated]
...
10 years ago
-
0.9.4
[deprecated]
...
10 years ago
-
0.9.4-rc2
[deprecated]
...
10 years ago
-
0.9.4-rc1
[deprecated]
...
10 years ago
-
0.9.3
[deprecated]
...
10 years ago
-
0.9.3-rc3
[deprecated]
...
10 years ago
-
0.9.3-rc2
[deprecated]
...
10 years ago
-
0.9.3-rc1
[deprecated]
...
10 years ago
-
0.9.2
[deprecated]
...
10 years ago
-
0.9.2-rc6
[deprecated]
...
10 years ago
-
0.9.2-rc5
[deprecated]
...
10 years ago
-
0.9.2-rc4
[deprecated]
...
10 years ago
-
0.9.2-rc3
[deprecated]
...
10 years ago
-
0.9.2-rc2
[deprecated]
...
10 years ago
-
0.9.2-rc1
[deprecated]
...
10 years ago
-
0.9.1
[deprecated]
...
10 years ago
-
0.9.1-rc3
[deprecated]
...
10 years ago
-
0.9.1-rc2
[deprecated]
...
10 years ago
-
0.9.1-rc1
[deprecated]
...
10 years ago
-
0.9.0
[deprecated]
...
10 years ago
-
0.9.0-rc5
[deprecated]
...
10 years ago
-
0.9.0-rc4
[deprecated]
...
10 years ago
-
0.9.0-rc3
[deprecated]
...
10 years ago
-
0.9.0-rc2
[deprecated]
...
10 years ago
-
0.9.0-rc1
[deprecated]
...
10 years ago
-
0.8.3-rc1
[deprecated]
...
10 years ago
-
0.8.2
[deprecated]
...
10 years ago
-
0.8.2-rc2
[deprecated]
...
10 years ago
-
0.8.2-rc1
[deprecated]
...
10 years ago
-
0.8.1
[deprecated]
...
10 years ago
-
0.8.1-rc3
[deprecated]
...
10 years ago
-
0.8.1-rc2
[deprecated]
...
10 years ago
-
0.8.1-rc1
[deprecated]
...
10 years ago
-
0.8.0
[deprecated]
...
10 years ago
-
0.8.0-rc3
[deprecated]
...
10 years ago
-
0.8.0-rc2
[deprecated]
...
10 years ago
-
0.8.0-beta
[deprecated]
...
10 years ago
-
0.7.39
[deprecated]
...
10 years ago
-
0.7.38-beta
[deprecated]
...
10 years ago
-
0.7.37
[deprecated]
...
11 years ago
-
0.7.36
[deprecated]
...
11 years ago
-
0.7.35
[deprecated]
...
11 years ago
-
0.7.34
[deprecated]
...
11 years ago
-
0.7.33
[deprecated]
...
11 years ago
-
0.7.32
[deprecated]
...
11 years ago
-
0.7.31
[deprecated]
...
11 years ago
-
0.7.30
[deprecated]
...
11 years ago
-
0.7.29
[deprecated]
...
11 years ago
-
0.7.28
[deprecated]
...
11 years ago
-
0.7.26
[deprecated]
...
11 years ago
-
0.7.25
[deprecated]
...
11 years ago
-
0.7.24
[deprecated]
...
11 years ago
-
0.7.23
[deprecated]
...
11 years ago
-
0.7.22
[deprecated]
...
11 years ago
-
0.7.21
[deprecated]
...
11 years ago
-
0.7.20
[deprecated]
...
11 years ago
-
0.7.19
[deprecated]
...
11 years ago
-
0.7.18
[deprecated]
...
11 years ago
-
0.7.17
[deprecated]
...
11 years ago
-
0.7.16
[deprecated]
...
11 years ago
-
0.7.14
[deprecated]
...
12 years ago
-
0.7.13
[deprecated]
...
12 years ago
-
0.7.12
[deprecated]
...
12 years ago
-
0.7.11
[deprecated]
...
12 years ago
-
0.7.10
[deprecated]
...
12 years ago
-
0.7.9
[deprecated]
...
12 years ago
-
0.7.8
[deprecated]
...
12 years ago
-
0.7.7
[deprecated]
...
12 years ago
-
0.7.6
[deprecated]
...
12 years ago
-
0.7.5
[deprecated]
...
12 years ago
-
0.7.4
[deprecated]
...
12 years ago
-
0.7.3
[deprecated]
...
12 years ago
-
0.7.2
[deprecated]
...
12 years ago
-
0.7.1
[deprecated]
...
12 years ago
-
0.7.0
[deprecated]
...
12 years ago