mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-04 13:05:49 +00:00
build: rename ripple-lib to xrpl.js (#1608)
* build: rename ripple-lib to xrpl.js
This commit is contained in:
committed by
Mayukha Vadari
parent
af7b187dc7
commit
33f83947f1
@@ -1,6 +1,6 @@
|
||||
# Applications using ripple-lib (RippleAPI)
|
||||
# Applications using xrpl.js
|
||||
|
||||
A curated list of some of the projects and apps that leverage `ripple-lib` in some way.
|
||||
A curated list of some of the projects and apps that leverage `xrpl.js` in some way.
|
||||
|
||||
**Have one to add?** Please edit this file and open a PR!
|
||||
|
||||
@@ -132,7 +132,7 @@ Warning: Use at your own risk.
|
||||
|
||||
- **[XRP Faucets for Testnet and Devnet](https://xrpl.org/xrp-testnet-faucet.html)**
|
||||
|
||||
Get some test funds for development on the test network. The faucet uses `ripple-lib`.
|
||||
Get some test funds for development on the test network. The faucet uses `xrpl.js`.
|
||||
|
||||
## Code samples and libraries
|
||||
|
||||
@@ -156,7 +156,7 @@ Warning: Use at your own risk.
|
||||
|
||||
For about $30 in parts (Raspberry Pi, 3.3V Relay board and a few wires) you can build your own power switch that will switch on if a streaming ILP payment comes in. When the payment stream stops, the power turns off.
|
||||
|
||||
## Related apps that do not appear to use ripple-lib
|
||||
## Related apps that do not appear to use xrpl.js
|
||||
|
||||
- **[XRP Stats](https://ledger.exposed/)** (ledger.exposed)
|
||||
|
||||
|
||||
36
README.md
36
README.md
@@ -1,8 +1,8 @@
|
||||
# ripple-lib (RippleAPI)
|
||||
# xrpl.js
|
||||
|
||||
A JavaScript/TypeScript API for interacting with the XRP Ledger
|
||||
A JavaScript/TypeScript library for interacting with the XRP Ledger
|
||||
|
||||
[](https://www.npmjs.org/package/ripple-lib)
|
||||
[](https://www.npmjs.org/package/xrpl)
|
||||
|
||||
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.
|
||||
|
||||
@@ -12,7 +12,7 @@ See the full reference documentation on the XRP Ledger Dev Portal.
|
||||
|
||||
## [➡️ Applications and Projects](APPLICATIONS.md)
|
||||
|
||||
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!
|
||||
What is xrpl.js used for? The applications on the list linked above use `xrpl.js`. Open a PR to add your app or project to the list!
|
||||
|
||||
### Features
|
||||
|
||||
@@ -31,22 +31,22 @@ What is ripple-lib used for? The applications on the list linked above use `ripp
|
||||
|
||||
See also: [RippleAPI Beginners Guide](https://xrpl.org/get-started-with-rippleapi-for-javascript.html)
|
||||
|
||||
In an existing project (with `package.json`), install `ripple-lib`:
|
||||
In an existing project (with `package.json`), install `xrpl.js`:
|
||||
```
|
||||
$ npm install ripple-lib
|
||||
$ npm install xrpl
|
||||
```
|
||||
|
||||
Then see the [documentation](#documentation).
|
||||
|
||||
### Using ripple-lib with React Native
|
||||
### Using xrpl.js 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](https://github.com/tradle/rn-nodeify).
|
||||
If you want to use `xrpl.js` 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](https://github.com/tradle/rn-nodeify).
|
||||
|
||||
1. Install dependencies (you can use `npm` as well):
|
||||
|
||||
```shell
|
||||
npm install react-native-crypto
|
||||
npm install ripple-lib
|
||||
npm install xrpl
|
||||
# install peer deps
|
||||
npm install react-native-randombytes
|
||||
# install latest rn-nodeify
|
||||
@@ -79,15 +79,15 @@ If you want to use `ripple-lib` with React Native you will need to have some of
|
||||
...
|
||||
```
|
||||
|
||||
### Using ripple-lib with Deno
|
||||
### Using xrpl.js with Deno
|
||||
|
||||
Until official support for [Deno](https://deno.land) is added, you can use the following work-around to use `ripple-lib` with Deno:
|
||||
Until official support for [Deno](https://deno.land) is added, you can use the following work-around to use `xrpl.js` with Deno:
|
||||
|
||||
```javascript
|
||||
import ripple from 'https://dev.jspm.io/npm:ripple-lib';
|
||||
import xrpl from 'https://dev.jspm.io/npm:xrpl';
|
||||
|
||||
(async () => {
|
||||
const api = new (ripple as any).RippleAPI({ server: 'wss://s.altnet.rippletest.net:51233' });
|
||||
const api = new (xrpl as any).RippleAPI({ server: 'wss://s.altnet.rippletest.net:51233' });
|
||||
const address = 'rH8NxV12EuV...khfJ5uw9kT';
|
||||
|
||||
api.connect().then(() => {
|
||||
@@ -106,7 +106,7 @@ import ripple from 'https://dev.jspm.io/npm:ripple-lib';
|
||||
|
||||
### Mailing Lists
|
||||
|
||||
We have a low-traffic mailing list for announcements of new ripple-lib releases. (About 1 email per week)
|
||||
We have a low-traffic mailing list for announcements of new xrpl.js releases. (About 1 email per week)
|
||||
|
||||
+ [Subscribe to ripple-lib-announce](https://groups.google.com/forum/#!forum/ripple-lib-announce)
|
||||
|
||||
@@ -141,16 +141,10 @@ Run `npm run 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 `npm run docgen`.
|
||||
Update the documentation by running `npm run docgen`.
|
||||
|
||||
## More Information
|
||||
|
||||
+ [ripple-lib-announce mailing list](https://groups.google.com/forum/#!forum/ripple-lib-announce) - subscribe for release announcements
|
||||
+ [RippleAPI Reference](https://xrpl.org/rippleapi-reference.html) - XRP Ledger Dev Portal
|
||||
+ [XRP Ledger Dev Portal](https://xrpl.org/)
|
||||
|
||||
[](https://travis-ci.org/ripple/ripple-lib)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Supported Versions
|
||||
|
||||
This table shows which versions of ripple-lib are currently supported with security updates:
|
||||
This table shows which versions of xrpl.js are currently supported with security updates:
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ---------------------- |
|
||||
|
||||
3
package-lock.json
generated
3
package-lock.json
generated
@@ -1,10 +1,11 @@
|
||||
{
|
||||
"name": "ripple-lib",
|
||||
"name": "xrpl",
|
||||
"version": "1.10.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "xrpl",
|
||||
"version": "1.10.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
// * - https://xrpl.org/monitor-incoming-payments-with-websocket.html.
|
||||
// *
|
||||
// * For the implementation in this example, we have made the following decisions:
|
||||
// * 1) The script will choose the account sequence and LastLedgerSequence numbers automatically. We allow ripple-lib to choose the fee.
|
||||
// * 1) The script will choose the account sequence and LastLedgerSequence numbers automatically. We allow xrpl.js to choose the fee.
|
||||
// * Payments are defined upfront, and idempotency is not needed. If the script is run a second time, duplicate payments will result.
|
||||
// * 2) We will listen for notification that a new validated ledger has been found, and poll for transaction status at that time.
|
||||
// * Futhermore, as a precaution, we will wait until the server is 3 ledgers past the transaction's LastLedgerSequence
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div id="mocha"></div>
|
||||
<script src="../node_modules/mocha/mocha.js"></script>
|
||||
<script src="hacks/phantomhacks.js"></script>
|
||||
<script src="../build/ripple-latest.js"></script>
|
||||
<script src="../build/xrpl-latest.js"></script>
|
||||
<script>
|
||||
if (window.initMochaPhantomJS) {
|
||||
window.initMochaPhantomJS();
|
||||
|
||||
@@ -2,36 +2,39 @@
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const assert = require('assert')
|
||||
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer')
|
||||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
|
||||
|
||||
function getDefaultConfiguration() {
|
||||
return {
|
||||
cache: true,
|
||||
performance: {hints: false},
|
||||
performance: { hints: false },
|
||||
stats: 'errors-only',
|
||||
entry: './dist/npm/index.js',
|
||||
output: {
|
||||
library: 'ripple',
|
||||
path: path.join(__dirname, 'build/'),
|
||||
filename: `ripple-lib.default.js`
|
||||
filename: `xrpl.default.js`,
|
||||
},
|
||||
plugins: [
|
||||
new webpack.NormalModuleReplacementPlugin(/^ws$/, './wsWrapper'),
|
||||
new webpack.NormalModuleReplacementPlugin(/^\.\/wallet\/index$/, './wallet-web'),
|
||||
new webpack.NormalModuleReplacementPlugin(
|
||||
/^\.\/wallet\/index$/,
|
||||
'./wallet-web',
|
||||
),
|
||||
new webpack.NormalModuleReplacementPlugin(
|
||||
/^.*setup-api$/,
|
||||
'./setup-api-web'
|
||||
'./setup-api-web',
|
||||
),
|
||||
new webpack.ProvidePlugin({process: 'process/browser'}),
|
||||
new webpack.ProvidePlugin({Buffer: ['buffer', 'Buffer']})
|
||||
new webpack.ProvidePlugin({ process: 'process/browser' }),
|
||||
new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }),
|
||||
],
|
||||
module: {
|
||||
rules: []
|
||||
rules: [],
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'ws': './dist/npm/client/wsWrapper.js',
|
||||
'https-proxy-agent': false
|
||||
ws: './dist/npm/client/wsWrapper.js',
|
||||
'https-proxy-agent': false,
|
||||
},
|
||||
extensions: ['.js', '.json'],
|
||||
fallback: {
|
||||
@@ -41,9 +44,9 @@ function getDefaultConfiguration() {
|
||||
stream: require.resolve('stream-browserify'),
|
||||
crypto: require.resolve('crypto-browserify'),
|
||||
https: require.resolve('https-browserify'),
|
||||
http: require.resolve('stream-http')
|
||||
}
|
||||
}
|
||||
http: require.resolve('stream-http'),
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,24 +61,24 @@ function webpackForTest(testFileName) {
|
||||
externals: [
|
||||
{
|
||||
'xrpl-local': 'ripple',
|
||||
'net': 'null'
|
||||
}
|
||||
net: 'null',
|
||||
},
|
||||
],
|
||||
entry: testFileName,
|
||||
output: {
|
||||
library: match[1].replace(/-/g, '_'),
|
||||
path: path.join(__dirname, './testCompiledForWeb/'),
|
||||
filename: match[1] + '.js'
|
||||
filename: match[1] + '.js',
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({process: 'process/browser'}),
|
||||
new webpack.ProvidePlugin({Buffer: ['buffer', 'Buffer']})
|
||||
new webpack.ProvidePlugin({ process: 'process/browser' }),
|
||||
new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }),
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /jayson/,
|
||||
use: 'null'
|
||||
use: 'null',
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
@@ -86,23 +89,23 @@ function webpackForTest(testFileName) {
|
||||
compilerOptions: {
|
||||
composite: false,
|
||||
declaration: false,
|
||||
declarationMap: false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
declarationMap: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
node: {
|
||||
global: true,
|
||||
__filename: false,
|
||||
__dirname: true
|
||||
__dirname: true,
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'ws': './dist/npm/client/wsWrapper.js',
|
||||
'https-proxy-agent': false
|
||||
ws: './dist/npm/client/wsWrapper.js',
|
||||
'https-proxy-agent': false,
|
||||
},
|
||||
extensions: ['.ts', '.js', '.json'],
|
||||
fallback: {
|
||||
@@ -112,9 +115,9 @@ function webpackForTest(testFileName) {
|
||||
stream: require.resolve('stream-browserify'),
|
||||
crypto: require.resolve('crypto-browserify'),
|
||||
path: require.resolve('path-browserify'),
|
||||
http: require.resolve('stream-http')
|
||||
}
|
||||
}
|
||||
http: require.resolve('stream-http'),
|
||||
},
|
||||
},
|
||||
}
|
||||
return Object.assign({}, getDefaultConfiguration(), test)
|
||||
}
|
||||
@@ -123,17 +126,17 @@ module.exports = [
|
||||
(env, argv) => {
|
||||
const config = getDefaultConfiguration()
|
||||
config.mode = 'development'
|
||||
config.output.filename = `ripple-latest.js`
|
||||
config.output.filename = `xrpl-latest.js`
|
||||
return config
|
||||
},
|
||||
(env, argv) => {
|
||||
const config = getDefaultConfiguration()
|
||||
config.mode = 'production'
|
||||
config.output.filename = `ripple-latest-min.js`
|
||||
config.output.filename = `xrpl-latest-min.js`
|
||||
if (process.argv.includes('--analyze')) {
|
||||
config.plugins.push(new BundleAnalyzerPlugin())
|
||||
}
|
||||
return config
|
||||
},
|
||||
(env, argv) => webpackForTest('./test/integration/integration.ts')
|
||||
(env, argv) => webpackForTest('./test/integration/integration.ts'),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user