Compare commits

...

45 Commits
1.6.1 ... 1.6.4

Author SHA1 Message Date
Elliot Lee
80b96d9bc9 Release 1.6.4 2020-02-18 11:19:03 -08:00
dependabot-preview[bot]
8fa30f71eb Bump @typescript-eslint/eslint-plugin from 2.19.2 to 2.20.0 (#1212)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.19.2 to 2.20.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.20.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-18 11:14:57 -08:00
Elliot Lee
804094b1ce Fix generateXAddress() and generateXAddress() with no entropy (#1211)
Fix #1209

Calling: Uint8Array.from(undefined)
Throws:
  TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at Function.from (<anonymous>)

* generateSeed: Pass only entropy and algorithm

* Update typescript and ripple-keypairs

* Improve unit tests

* Rename [Original Address] to [Classic Address] in test output
2020-02-18 11:14:09 -08:00
dependabot-preview[bot]
9caf077b58 Bump @typescript-eslint/eslint-plugin from 2.19.0 to 2.19.2 (#1205)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.19.0 to 2.19.2.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.19.2/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 10:30:19 -08:00
dependabot-preview[bot]
1a5ba06ca3 Bump webpack from 4.41.4 to 4.41.6 (#1206)
Bumps [webpack](https://github.com/webpack/webpack) from 4.41.4 to 4.41.6.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.41.4...v4.41.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 10:30:05 -08:00
dependabot-preview[bot]
657cad9ffd Bump @types/node from 13.7.0 to 13.7.1 (#1207)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.7.0 to 13.7.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 10:29:46 -08:00
dependabot-preview[bot]
a338a936db Bump webpack-cli from 3.3.10 to 3.3.11 (#1208)
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 3.3.10 to 3.3.11.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/next/CHANGELOG_v3.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/v3.3.10...v3.3.11)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 10:29:33 -08:00
Elliot Lee
226e10bca2 Release 1.6.3 2020-02-05 22:19:47 -08:00
dependabot-preview[bot]
3a5a989011 Bump ripple-keypairs from 1.0.0-beta.6 to 1.0.0 (#1203)
Bumps [ripple-keypairs](https://github.com/ripple/ripple-keypairs) from 1.0.0-beta.6 to 1.0.0.
- [Release notes](https://github.com/ripple/ripple-keypairs/releases)
- [Changelog](https://github.com/ripple/ripple-keypairs/blob/master/HISTORY.md)
- [Commits](https://github.com/ripple/ripple-keypairs/commits/1.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-05 18:36:50 -08:00
dependabot-preview[bot]
c9720ef061 Bump @types/node from 13.5.3 to 13.7.0 (#1201)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.5.3 to 13.7.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-05 10:33:54 -08:00
dependabot-preview[bot]
b6927f178f Bump @typescript-eslint/eslint-plugin from 2.18.0 to 2.19.0 (#1202)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.18.0 to 2.19.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.19.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-05 10:33:42 -08:00
Elliot Lee
6b40e4fe9d Release 1.6.3-beta.1 (#1195)
* Update ripple-keypairs and fix types
2020-02-02 15:14:44 -08:00
Elliot Lee
59ec56db4c Update README.md 2020-01-31 13:59:11 -08:00
dependabot-preview[bot]
a8119d678a Bump @types/node from 13.5.2 to 13.5.3 (#1200)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.5.2 to 13.5.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-31 10:51:36 -08:00
dependabot-preview[bot]
8e38e313b2 Bump @types/ws from 7.2.0 to 7.2.1 (#1197)
Bumps [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 7.2.0 to 7.2.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-31 00:40:07 -08:00
dependabot-preview[bot]
b7b75d78ae Bump @types/node from 13.5.1 to 13.5.2 (#1198)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.5.1 to 13.5.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-31 00:39:52 -08:00
dependabot-preview[bot]
824efb6b59 Bump @types/mocha from 5.2.7 to 7.0.1 (#1199)
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 5.2.7 to 7.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-31 00:39:41 -08:00
dependabot-preview[bot]
c151ca202c Bump ripple-address-codec from 4.0.0 to 4.1.0 (#1184)
Bumps [ripple-address-codec](https://github.com/ripple/ripple-address-codec) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/ripple/ripple-address-codec/releases)
- [Changelog](https://github.com/ripple/ripple-address-codec/blob/master/HISTORY.md)
- [Commits](https://github.com/ripple/ripple-address-codec/compare/4.0.0...4.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-29 10:00:09 -08:00
dependabot-preview[bot]
b9a64c92e7 Bump @typescript-eslint/eslint-plugin from 2.16.0 to 2.18.0 (#1189)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.16.0 to 2.18.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.18.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-29 09:59:51 -08:00
dependabot-preview[bot]
bcaa06721a Bump ripple-keypairs from 0.11.0 to 0.11.1 (#1190)
Bumps [ripple-keypairs](https://github.com/ripple/ripple-keypairs) from 0.11.0 to 0.11.1.
- [Release notes](https://github.com/ripple/ripple-keypairs/releases)
- [Changelog](https://github.com/ripple/ripple-keypairs/blob/0.11.1/HISTORY.md)
- [Commits](https://github.com/ripple/ripple-keypairs/compare/0.11.0...0.11.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-29 09:58:35 -08:00
dependabot-preview[bot]
06227ef12b Bump @types/node from 13.5.0 to 13.5.1 (#1193)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.5.0 to 13.5.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-29 09:57:21 -08:00
Nicholas Smith
c17827e030 Assign event listener to socket close event on open before attempting post-open logic (#1186)
* Assign event listener to socket close event on open before attempting to execute post-connection logic, prottects possible unhandled rejection in disconnect
* Remove try/catch for linting failure
* Up timeout for CI failure
* Feedback emit error for disconnection failure on connect failure
* Feedback ignore error on disconnect, propagate root cause
* Feedback add extra test check for expected error on connect
* Feedback remove setTimeout for await reconnect
2020-01-28 09:08:47 -05:00
dependabot-preview[bot]
97ca0f0b21 Bump @types/node from 13.1.8 to 13.5.0 (#1187)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.1.8 to 13.5.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-28 02:23:50 -08:00
dependabot-preview[bot]
e4e6419e50 Bump mocha from 7.0.0 to 7.0.1 (#1188)
Bumps [mocha](https://github.com/mochajs/mocha) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v7.0.0...v7.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-28 02:23:35 -08:00
Elliot Lee
fd8c883cf4 Update tsconfig-base.json - remove comments 2020-01-21 13:52:53 -08:00
FKSRipple
6b66a59673 Merge pull request #1180 from ripple/dependabot/npm_and_yarn/mocha-junit-reporter-1.23.3
Bump mocha-junit-reporter from 1.23.2 to 1.23.3
2020-01-20 20:55:40 -08:00
FKSRipple
46177338c2 Merge pull request #1182 from ripple/dependabot/npm_and_yarn/types/node-13.1.8
Bump @types/node from 13.1.7 to 13.1.8
2020-01-20 20:55:28 -08:00
dependabot-preview[bot]
6fcff9b106 Bump @types/node from 13.1.7 to 13.1.8
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.1.7 to 13.1.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-20 13:27:16 +00:00
Elliot Lee
208f5f6c5c Release 1.6.2 2020-01-17 15:30:21 -08:00
Elliot Lee
de3e2a9867 Docs: Fix whitespace
Do not use newline-trimming ending tag

Fix #1175 (bug introduced in #1153)
2020-01-17 15:24:23 -08:00
dependabot-preview[bot]
40eea3c659 Bump typescript from 3.7.4 to 3.7.5 (#1181)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.7.4 to 3.7.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.7.4...v3.7.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-17 14:45:33 -05:00
dependabot-preview[bot]
4f9b6b9186 Bump mocha-junit-reporter from 1.23.2 to 1.23.3
Bumps [mocha-junit-reporter](https://github.com/michaelleeallen/mocha-junit-reporter) from 1.23.2 to 1.23.3.
- [Release notes](https://github.com/michaelleeallen/mocha-junit-reporter/releases)
- [Commits](https://github.com/michaelleeallen/mocha-junit-reporter/compare/v1.23.2...v1.23.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-17 13:26:35 +00:00
FKSRipple
4a848ec527 Merge pull request #1179 from nickewansmith/fix-unhandled-rejection-warning-on-heartbeat
Catch possible error in reconnect() on _heartbeat(), emit reconnect error
2020-01-16 08:32:37 -08:00
FKSRipple
10414e169c Merge pull request #1171 from ripple/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-2.16.0
Bump @typescript-eslint/eslint-plugin from 2.13.0 to 2.16.0
2020-01-16 08:22:42 -08:00
FKSRipple
1a6c68d028 Merge pull request #1173 from ripple/FKSRipple-patch-1-1
Add Update note to HISTORY.md
2020-01-16 08:22:21 -08:00
FKSRipple
9156734ced Update HISTORY.md 2020-01-16 08:22:00 -08:00
FKSRipple
0dfe3ff4ac Merge pull request #1177 from ripple/dependabot/npm_and_yarn/types/ws-7.2.0
Bump @types/ws from 6.0.4 to 7.2.0
2020-01-16 08:21:12 -08:00
FKSRipple
3a8c7f02cc Merge pull request #1176 from ripple/dependabot/npm_and_yarn/types/node-13.1.7
Bump @types/node from 13.1.6 to 13.1.7
2020-01-16 08:20:53 -08:00
Nicholas Smith
e03b192fcc Catch possible error in reconnect() on _heartbeat(), emit reconnect error 2020-01-15 12:36:39 -05:00
dependabot-preview[bot]
cf40bd2c30 Bump @types/ws from 6.0.4 to 7.2.0
Bumps [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 6.0.4 to 7.2.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-15 13:40:35 +00:00
dependabot-preview[bot]
4082e88416 Bump @types/node from 13.1.6 to 13.1.7
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.1.6 to 13.1.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-15 13:40:09 +00:00
FKSRipple
27abc10d93 Merge pull request #1172 from ripple/dependabot/npm_and_yarn/ts-node-8.6.2
Bump ts-node from 8.5.4 to 8.6.2
2020-01-14 11:27:39 -08:00
FKSRipple
d6474d71f2 Update HISTORY.md 2020-01-14 11:26:35 -08:00
dependabot-preview[bot]
d57603e854 Bump ts-node from 8.5.4 to 8.6.2
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 8.5.4 to 8.6.2.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v8.5.4...v8.6.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-14 13:41:19 +00:00
dependabot-preview[bot]
ac92584678 Bump @typescript-eslint/eslint-plugin from 2.13.0 to 2.16.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.13.0 to 2.16.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.16.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-14 13:40:55 +00:00
14 changed files with 672 additions and 237 deletions

View File

@@ -1,7 +1,36 @@
# ripple-lib Release History # ripple-lib Release History
## 1.6.4 (2020-02-18)
* Fix generateXAddress() and generateAddress() with no entropy (#1211, #1209)
* Internal
* Improve unit tests
* Dependencies
* Update webpack-cli, @types/node, webpack, @typescript-eslint/eslint-plugin,
typescript, ripple-keypairs
## 1.6.3 (2020-02-05)
* Update ripple-keypairs to 1.0.0
* Bug fix: Assign event listener to socket close event on open before attempting post-open logic (#1186)
* Protects against possible unhandled rejection in disconnect
* Adds the Connection `_ws.close` event listener post `_ws.open` before executing any post `_ws.open` logic, i.e. `Connection._subscribeToLedger`
* This prevents a reconnection error loop that occurs if `Connection._ws` is never cleaned up by the unreachable `_ws.close` event listener
* Also ensures that a possible disconnect() promise rejection is not unhandled if any `_ws.open` logic in `Connection.connect()` throws
* Dependencies
* Update mocha-junit-reporter, @types/node, mocha, @typescript-eslint/eslint-plugin, ripple-address-codec
## 1.6.2 (2020-01-17)
* Bug fix: Catch possible error in reconnect() on _heartbeat(), emit reconnect error (#1179)
* Docs: Fix whitespace
* Dependencies
* Update @typescript-eslint/eslint-plugin, ts-node, @types/node, @types/ws, typescript
## 1.6.1 (2020-01-14) ## 1.6.1 (2020-01-14)
> **Update Note:** In this release we refactored the internal connection logic of ripple-lib to improve resiliency across dropped messages and reconnects. The external interface remains the same, with zero changes to public methods/properties. However, If you experience any problems around connections, requests, and request retries, please [file an issue]( https://github.com/ripple/ripple-lib/issues/new) with the repo (and be sure to test against v1.6.0 to confirm that the problem was introduced in this version).
* Documentation * Documentation
* Document message type 'path_find' (#1121) (thanks @r0bertz) * Document message type 'path_find' (#1121) (thanks @r0bertz)
* Improve documentation for address generation; functions that can be called offline; generateXAddress() (#1158, #1159, #1169) (thanks @hbergren) * Improve documentation for address generation; functions that can be called offline; generateXAddress() (#1158, #1159, #1169) (thanks @hbergren)

View File

@@ -6,7 +6,13 @@ 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. 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.
**What is ripple-lib used for?** Here's a [list of applications](APPLICATIONS.md) that use `ripple-lib`. Open a PR to add your app or project to the list! ## [➡️ Reference Documentation](https://xrpl.org/rippleapi-reference.html)
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!
### Features ### Features

View File

@@ -119,6 +119,7 @@ Using RippleAPI, you can:
This page contains documentation for ripple-lib. To use ripple-lib with npm/yarn, begin with the [Getting Started](https://github.com/ripple/ripple-lib#getting-started) steps. This page contains documentation for ripple-lib. To use ripple-lib with npm/yarn, begin with the [Getting Started](https://github.com/ripple/ripple-lib#getting-started) steps.
**What is ripple-lib used for?** Here's a [list of applications that use `ripple-lib`](https://github.com/ripple/ripple-lib/blob/develop/APPLICATIONS.md). Open a PR to add your app or project to the list! **What is ripple-lib used for?** Here's a [list of applications that use `ripple-lib`](https://github.com/ripple/ripple-lib/blob/develop/APPLICATIONS.md). Open a PR to add your app or project to the list!
## Boilerplate ## Boilerplate
Use the following [boilerplate code](https://en.wikipedia.org/wiki/Boilerplate_code) to wrap your custom code using RippleAPI. Use the following [boilerplate code](https://en.wikipedia.org/wiki/Boilerplate_code) to wrap your custom code using RippleAPI.
@@ -194,6 +195,7 @@ If you omit the `server` parameter, RippleAPI operates [offline](#offline-functi
After you have installed ripple-lib, you can create scripts using the [boilerplate](#boilerplate) and run them using the Node.js executable, typically named `node`: After you have installed ripple-lib, you can create scripts using the [boilerplate](#boilerplate) and run them using the Node.js executable, typically named `node`:
`node script.js` `node script.js`
## Offline functionality ## Offline functionality
RippleAPI can also function without internet connectivity. This can be useful in order to generate secrets and sign transactions from a secure, isolated machine. RippleAPI can also function without internet connectivity. This can be useful in order to generate secrets and sign transactions from a secure, isolated machine.
@@ -221,6 +223,7 @@ Methods that depend on the state of the XRP Ledger are unavailable in offline mo
* [generateAddress](#generateaddress) * [generateAddress](#generateaddress)
* [generateXAddress](#generatexaddress) * [generateXAddress](#generatexaddress)
* [computeLedgerHash](#computeledgerhash) * [computeLedgerHash](#computeledgerhash)
# Basic Types # Basic Types
## Address ## Address
@@ -292,6 +295,7 @@ Name | Type | Description
currency | [currency](#currency) | The three-character code or hexadecimal string used to denote currencies, or "drops" for the smallest unit of XRP. currency | [currency](#currency) | The three-character code or hexadecimal string used to denote currencies, or "drops" for the smallest unit of XRP.
counterparty | [address](#address) | *Optional* The XRP Ledger address of the account that owes or is owed the funds (omitted if `currency` is "XRP" or "drops") counterparty | [address](#address) | *Optional* The XRP Ledger address of the account that owes or is owed the funds (omitted if `currency` is "XRP" or "drops")
value | [value](#value) | *Optional* The quantity of the currency, denoted as a string to retain floating point precision value | [value](#value) | *Optional* The quantity of the currency, denoted as a string to retain floating point precision
# Transaction Overview # Transaction Overview
## Transaction Types ## Transaction Types
@@ -378,6 +382,7 @@ Name | Type | Description
data | string | *Optional* Arbitrary string, conventionally containing the content of the memo. data | string | *Optional* Arbitrary string, conventionally containing the content of the memo.
format | string | *Optional* Conventionally containing information on how the memo is encoded, for example as a [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml). Only characters allowed in URLs are permitted. format | string | *Optional* Conventionally containing information on how the memo is encoded, for example as a [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml). Only characters allowed in URLs are permitted.
type | string | *Optional* Conventionally, a unique relation (according to [RFC 5988](http://tools.ietf.org/html/rfc5988#section-4)) that defines the format of this memo. Only characters allowed in URLs are permitted. type | string | *Optional* Conventionally, a unique relation (according to [RFC 5988](http://tools.ietf.org/html/rfc5988#section-4)) that defines the format of this memo. Only characters allowed in URLs are permitted.
# Transaction Specifications # Transaction Specifications
A *transaction specification* specifies what a transaction should do. Each [Transaction Type](#transaction-types) has its own type of specification. A *transaction specification* specifies what a transaction should do. Each [Transaction Type](#transaction-types) has its own type of specification.
@@ -788,6 +793,7 @@ signature | string | *Optional* Signed claim authorizing withdrawal of XRP from
} }
``` ```
# rippled APIs # rippled APIs
ripple-lib relies on [rippled APIs](https://ripple.com/build/rippled-apis/) for online functionality. In addition to ripple-lib's own methods, you can also access rippled APIs through ripple-lib. Use the `request()`, `hasNextPage()`, and `requestNextPage()` methods: ripple-lib relies on [rippled APIs](https://ripple.com/build/rippled-apis/) for online functionality. In addition to ripple-lib's own methods, you can also access rippled APIs through ripple-lib. Use the `request()`, `hasNextPage()`, and `requestNextPage()` methods:
@@ -860,6 +866,7 @@ api.connect().then(() => { // Omit this if you are already connected
The subscription ends when you unsubscribe or the WebSocket connection is closed. The subscription ends when you unsubscribe or the WebSocket connection is closed.
For full details, see [rippled Subscriptions](https://ripple.com/build/rippled-apis/#subscriptions). For full details, see [rippled Subscriptions](https://ripple.com/build/rippled-apis/#subscriptions).
## request ## request
`request(command: string, options: object): Promise<object>` `request(command: string, options: object): Promise<object>`
@@ -913,6 +920,7 @@ return api.request('ledger', {
} }
``` ```
## hasNextPage ## hasNextPage
`hasNextPage(currentResponse): boolean` `hasNextPage(currentResponse): boolean`
@@ -940,6 +948,7 @@ return api.request('ledger_data', {
} }
}).catch(console.error); }).catch(console.error);
``` ```
## requestNextPage ## requestNextPage
`requestNextPage(command: string, params: object = {}, currentResponse: object): Promise<object>` `requestNextPage(command: string, params: object = {}, currentResponse: object): Promise<object>`
@@ -970,7 +979,9 @@ return api.request(command, params).then(response => {
}).catch(console.error); }).catch(console.error);
``` ```
# Static Methods # Static Methods
## renameCounterpartyToIssuer ## renameCounterpartyToIssuer
`renameCounterpartyToIssuer(issue: {currency: string, counterparty: address}): {currency: string, issuer: address}` `renameCounterpartyToIssuer(issue: {currency: string, counterparty: address}): {currency: string, issuer: address}`
@@ -1008,6 +1019,7 @@ console.log(RippleAPI.renameCounterpartyToIssuer(orderbookInfo.counter))
{ currency: 'USD', issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B' } { currency: 'USD', issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B' }
{ currency: 'BTC', issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B' } { currency: 'BTC', issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B' }
``` ```
## formatBidsAndAsks ## formatBidsAndAsks
`formatBidsAndAsks(orderbookInfo: {base: Issue, counter: Issue}, offers: BookOffer[]): orderbook` `formatBidsAndAsks(orderbookInfo: {base: Issue, counter: Issue}, offers: BookOffer[]): orderbook`
@@ -1286,7 +1298,9 @@ return Promise.all(
} }
``` ```
# API Methods # API Methods
## connect ## connect
`connect(): Promise<void>` `connect(): Promise<void>`
@@ -1304,6 +1318,7 @@ This method returns a promise that resolves with a void value when a connection
### Example ### Example
See [Boilerplate](#boilerplate) for code sample. See [Boilerplate](#boilerplate) for code sample.
## disconnect ## disconnect
`disconnect(): Promise<void>` `disconnect(): Promise<void>`
@@ -1321,6 +1336,7 @@ This method returns a promise that resolves with a void value when a connection
### Example ### Example
See [Boilerplate](#boilerplate) for code sample See [Boilerplate](#boilerplate) for code sample
## isConnected ## isConnected
`isConnected(): boolean` `isConnected(): boolean`
@@ -1344,6 +1360,7 @@ return api.isConnected();
```json ```json
true true
``` ```
## getServerInfo ## getServerInfo
`getServerInfo(): Promise<object>` `getServerInfo(): Promise<object>`
@@ -1417,6 +1434,7 @@ return api.getServerInfo().then(info => {/* ... */});
} }
``` ```
## getFee ## getFee
`getFee(): Promise<string>` `getFee(): Promise<string>`
@@ -1444,6 +1462,7 @@ return api.getFee().then(fee => {/* ... */});
```json ```json
"0.000012" "0.000012"
``` ```
## getLedgerVersion ## getLedgerVersion
`getLedgerVersion(): Promise<number>` `getLedgerVersion(): Promise<number>`
@@ -1470,6 +1489,7 @@ return api.getLedgerVersion().then(ledgerVersion => {
16869039 16869039
``` ```
## getTransaction ## getTransaction
`getTransaction(id: string, options: object): Promise<object>` `getTransaction(id: string, options: object): Promise<object>`
@@ -1621,6 +1641,7 @@ return api.getTransaction(id).then(transaction => {
} }
``` ```
## getTransactions ## getTransactions
`getTransactions(address: string, options: object): Promise<Array<object>>` `getTransactions(address: string, options: object): Promise<Array<object>>`
@@ -1854,6 +1875,7 @@ return api.getTransactions(address).then(transaction => {
] ]
``` ```
## getTrustlines ## getTrustlines
`getTrustlines(address: string, options: object): Promise<Array<object>>` `getTrustlines(address: string, options: object): Promise<Array<object>>`
@@ -1998,6 +2020,7 @@ return api.getTrustlines(address).then(trustlines =>
] ]
``` ```
## getBalances ## getBalances
`getBalances(address: string, options: object): Promise<Array<object>>` `getBalances(address: string, options: object): Promise<Array<object>>`
@@ -2164,6 +2187,7 @@ return api.getBalances(address).then(balances =>
] ]
``` ```
## getBalanceSheet ## getBalanceSheet
`getBalanceSheet(address: string, options: object): Promise<object>` `getBalanceSheet(address: string, options: object): Promise<object>`
@@ -2259,6 +2283,7 @@ return api.getBalanceSheet(address).then(balanceSheet =>
} }
``` ```
## getPaths ## getPaths
`getPaths(pathfind: object): Promise<Array<object>>` `getPaths(pathfind: object): Promise<Array<object>>`
@@ -2379,6 +2404,7 @@ return api.getPaths(pathfind)
] ]
``` ```
## getOrders ## getOrders
`getOrders(address: string, options: object): Promise<Array<object>>` `getOrders(address: string, options: object): Promise<Array<object>>`
@@ -2759,6 +2785,7 @@ return api.getOrders(address).then(orders =>
] ]
``` ```
## getOrderbook ## getOrderbook
`getOrderbook(address: string, orderbook: object, options: object): Promise<object>` `getOrderbook(address: string, orderbook: object, options: object): Promise<object>`
@@ -3864,6 +3891,7 @@ return api.getOrderbook(address, orderbook)
} }
``` ```
## getSettings ## getSettings
`getSettings(address: string, options: object): Promise<object>` `getSettings(address: string, options: object): Promise<object>`
@@ -3946,6 +3974,7 @@ return api.getSettings(address).then(settings =>
} }
``` ```
## getAccountInfo ## getAccountInfo
`getAccountInfo(address: string, options: object): Promise<object>` `getAccountInfo(address: string, options: object): Promise<object>`
@@ -3994,6 +4023,7 @@ return api.getAccountInfo(address).then(info =>
} }
``` ```
## getAccountObjects ## getAccountObjects
`getAccountObjects(address: string, options: object): Promise<AccountObjectsResponse>` `getAccountObjects(address: string, options: object): Promise<AccountObjectsResponse>`
@@ -4318,6 +4348,7 @@ return api.getAccountObjects(address: address).then(objects =>
} }
``` ```
## getPaymentChannel ## getPaymentChannel
`getPaymentChannel(id: string): Promise<object>` `getPaymentChannel(id: string): Promise<object>`
@@ -4373,6 +4404,7 @@ return api.getPaymentChannel(channelId).then(channel =>
} }
``` ```
## getLedger ## getLedger
`getLedger(options: object): Promise<object>` `getLedger(options: object): Promise<object>`
@@ -4436,6 +4468,7 @@ return api.getLedger()
} }
``` ```
## parseAccountFlags ## parseAccountFlags
`parseAccountFlags(Flags: number): object` `parseAccountFlags(Flags: number): object`
@@ -4471,6 +4504,7 @@ console.log(JSON.stringify(flags, null, 2))
"defaultRipple": false "defaultRipple": false
} }
``` ```
## prepareTransaction ## prepareTransaction
`prepareTransaction(transaction: object, instructions: object): Promise<object>` `prepareTransaction(transaction: object, instructions: object): Promise<object>`
@@ -4528,6 +4562,7 @@ async function preparedPreauth() {
} }
} }
``` ```
## preparePayment ## preparePayment
`preparePayment(address: string, payment: object, instructions: object): Promise<object>` `preparePayment(address: string, payment: object, instructions: object): Promise<object>`
@@ -4600,6 +4635,7 @@ return api.preparePayment(address, payment).then(prepared => {
} }
``` ```
## prepareTrustline ## prepareTrustline
`prepareTrustline(address: string, trustline: object, instructions: object): Promise<object>` `prepareTrustline(address: string, trustline: object, instructions: object): Promise<object>`
@@ -4667,6 +4703,7 @@ return api.prepareTrustline(address, trustline).then(prepared =>
} }
``` ```
## prepareOrder ## prepareOrder
`prepareOrder(address: string, order: object, instructions: object): Promise<object>` `prepareOrder(address: string, order: object, instructions: object): Promise<object>`
@@ -4734,6 +4771,7 @@ return api.prepareOrder(address, order)
} }
``` ```
## prepareOrderCancellation ## prepareOrderCancellation
`prepareOrderCancellation(address: string, orderCancellation: object, instructions: object): Promise<object>` `prepareOrderCancellation(address: string, orderCancellation: object, instructions: object): Promise<object>`
@@ -4786,6 +4824,7 @@ return api.prepareOrderCancellation(address, orderCancellation)
} }
``` ```
## prepareSettings ## prepareSettings
`prepareSettings(address: string, settings: object, instructions: object): Promise<object>` `prepareSettings(address: string, settings: object, instructions: object): Promise<object>`
@@ -4849,6 +4888,7 @@ return api.prepareSettings(address, settings)
} }
``` ```
## prepareEscrowCreation ## prepareEscrowCreation
`prepareEscrowCreation(address: string, escrowCreation: object, instructions: object): Promise<object>` `prepareEscrowCreation(address: string, escrowCreation: object, instructions: object): Promise<object>`
@@ -4912,6 +4952,7 @@ return api.prepareEscrowCreation(address, escrowCreation).then(prepared =>
} }
``` ```
## prepareEscrowCancellation ## prepareEscrowCancellation
`prepareEscrowCancellation(address: string, escrowCancellation: object, instructions: object): Promise<object>` `prepareEscrowCancellation(address: string, escrowCancellation: object, instructions: object): Promise<object>`
@@ -4967,6 +5008,7 @@ return api.prepareEscrowCancellation(address, escrowCancellation).then(prepared
} }
``` ```
## prepareEscrowExecution ## prepareEscrowExecution
`prepareEscrowExecution(address: string, escrowExecution: object, instructions: object): Promise<object>` `prepareEscrowExecution(address: string, escrowExecution: object, instructions: object): Promise<object>`
@@ -5024,6 +5066,7 @@ return api.prepareEscrowExecution(address, escrowExecution).then(prepared =>
} }
``` ```
## preparePaymentChannelCreate ## preparePaymentChannelCreate
`preparePaymentChannelCreate(address: string, paymentChannelCreate: object, instructions: object): Promise<object>` `preparePaymentChannelCreate(address: string, paymentChannelCreate: object, instructions: object): Promise<object>`
@@ -5081,6 +5124,7 @@ return api.preparePaymentChannelCreate(address, paymentChannelCreate).then(prepa
} }
``` ```
## preparePaymentChannelClaim ## preparePaymentChannelClaim
`preparePaymentChannelClaim(address: string, paymentChannelClaim: object, instructions: object): Promise<object>` `preparePaymentChannelClaim(address: string, paymentChannelClaim: object, instructions: object): Promise<object>`
@@ -5135,6 +5179,7 @@ return api.preparePaymentChannelClaim(address, paymentChannelClaim).then(prepare
} }
``` ```
## preparePaymentChannelFund ## preparePaymentChannelFund
`preparePaymentChannelFund(address: string, paymentChannelFund: object, instructions: object): Promise<object>` `preparePaymentChannelFund(address: string, paymentChannelFund: object, instructions: object): Promise<object>`
@@ -5190,6 +5235,7 @@ return api.preparePaymentChannelFund(address, paymentChannelFund).then(prepared
} }
``` ```
## prepareCheckCreate ## prepareCheckCreate
`prepareCheckCreate(address: string, checkCreate: object, instructions: object): Promise<object>` `prepareCheckCreate(address: string, checkCreate: object, instructions: object): Promise<object>`
@@ -5248,6 +5294,7 @@ return api.prepareCheckCreate(address, checkCreate).then(prepared =>
} }
``` ```
## prepareCheckCancel ## prepareCheckCancel
`prepareCheckCancel(address: string, checkCancel: object, instructions: object): Promise<object>` `prepareCheckCancel(address: string, checkCancel: object, instructions: object): Promise<object>`
@@ -5302,6 +5349,7 @@ return api.prepareCheckCancel(address, checkCancel).then(prepared =>
} }
``` ```
## prepareCheckCash ## prepareCheckCash
`prepareCheckCash(address: string, checkCash: object, instructions: object): Promise<object>` `prepareCheckCash(address: string, checkCash: object, instructions: object): Promise<object>`
@@ -5360,6 +5408,7 @@ return api.prepareCheckCash(address, checkCash).then(prepared =>
} }
``` ```
## sign ## sign
``` ```
@@ -5501,6 +5550,7 @@ If any of `{signAs: some_address}` options were missing the code will return a v
``` ```
[ValidationError(txJSON is not the same for all signedTransactions)] [ValidationError(txJSON is not the same for all signedTransactions)]
``` ```
## combine ## combine
`combine(signedTransactions: Array<string>): {signedTransaction: string, id: string}` `combine(signedTransactions: Array<string>): {signedTransaction: string, id: string}`
@@ -5538,6 +5588,7 @@ return api.combine(signedTransactions);
} }
``` ```
## submit ## submit
`submit(signedTransaction: string): Promise<object>` `submit(signedTransaction: string): Promise<object>`
@@ -5600,6 +5651,7 @@ return api.submit(signedTransaction)
} }
``` ```
## generateXAddress ## generateXAddress
`generateXAddress(options?: object): {address: string, secret: string}` `generateXAddress(options?: object): {address: string, secret: string}`
@@ -5639,6 +5691,7 @@ return api.generateAddress();
} }
``` ```
## generateAddress ## generateAddress
`generateAddress(options?: object): {address: string, secret: string}` `generateAddress(options?: object): {address: string, secret: string}`
@@ -5684,6 +5737,7 @@ return api.generateAddress();
} }
``` ```
## isValidAddress ## isValidAddress
`isValidAddress(address: string): boolean` `isValidAddress(address: string): boolean`
@@ -5703,6 +5757,7 @@ This method returns `true` if the address is valid and `false` if it is not.
```javascript ```javascript
return api.isValidAddress("address") return api.isValidAddress("address")
``` ```
## isValidSecret ## isValidSecret
`isValidSecret(secret: string): boolean` `isValidSecret(secret: string): boolean`
@@ -5722,6 +5777,7 @@ This method returns `true` if the secret is valid and `false` if it is not.
```javascript ```javascript
return api.isValidSecret("secret") return api.isValidSecret("secret")
``` ```
## deriveKeypair ## deriveKeypair
`deriveKeypair(seed: string): {privateKey: string, publicKey: string}` `deriveKeypair(seed: string): {privateKey: string, publicKey: string}`
@@ -5743,6 +5799,7 @@ var keypair = api.deriveKeypair(seed)
var public_key = keypair.publicKey; var public_key = keypair.publicKey;
var private_key = keypair.privateKey; var private_key = keypair.privateKey;
``` ```
## deriveAddress ## deriveAddress
`deriveAddress(publicKey: string): string` `deriveAddress(publicKey: string): string`
@@ -5762,6 +5819,7 @@ This method returns a string corresponding to the address derived from the publi
```javascript ```javascript
var address = api.deriveAddress(public_key); var address = api.deriveAddress(public_key);
``` ```
## signPaymentChannelClaim ## signPaymentChannelClaim
`signPaymentChannelClaim(channel: string, amount: string, privateKey: string): string` `signPaymentChannelClaim(channel: string, amount: string, privateKey: string): string`
@@ -5800,6 +5858,7 @@ return api.signPaymentChannelClaim(channel, amount, privateKey);
"3045022100B5C54654221F154347679B97AE7791CBEF5E6772A3F894F9C781B8F1B400F89F022021E466D29DC5AEB5DFAFC76E8A88D2E388EBD25A84143B6AC3B647F479CB89B7" "3045022100B5C54654221F154347679B97AE7791CBEF5E6772A3F894F9C781B8F1B400F89F022021E466D29DC5AEB5DFAFC76E8A88D2E388EBD25A84143B6AC3B647F479CB89B7"
``` ```
## verifyPaymentChannelClaim ## verifyPaymentChannelClaim
`verifyPaymentChannelClaim(channel: string, amount: string, signature: string, publicKey: string): boolean` `verifyPaymentChannelClaim(channel: string, amount: string, signature: string, publicKey: string): boolean`
@@ -5838,6 +5897,7 @@ return api.verifyPaymentChannelClaim(channel, amount, signature, publicKey);
```json ```json
true true
``` ```
## computeLedgerHash ## computeLedgerHash
`computeLedgerHash(ledger: object): string` `computeLedgerHash(ledger: object): string`
@@ -5893,6 +5953,7 @@ return api.computeLedgerHash(ledger);
```json ```json
"F4D865D83EB88C1A1911B9E90641919A1314F36E1B099F8E95FE3B7C77BE3349" "F4D865D83EB88C1A1911B9E90641919A1314F36E1B099F8E95FE3B7C77BE3349"
``` ```
## xrpToDrops ## xrpToDrops
`xrpToDrops(xrp: string | BigNumber): string` `xrpToDrops(xrp: string | BigNumber): string`
@@ -5940,6 +6001,7 @@ return api.dropsToXrp('1');
```json ```json
'0.000001' '0.000001'
``` ```
## iso8601ToRippleTime ## iso8601ToRippleTime
`iso8601ToRippleTime(iso8601: string): number` `iso8601ToRippleTime(iso8601: string): number`
@@ -5967,6 +6029,7 @@ api.iso8601ToRippleTime('2017-02-17T15:04:57Z');
```json ```json
540659097 540659097
``` ```
## rippleTimeToISO8601 ## rippleTimeToISO8601
`rippleTimeToISO8601(rippleTime: number): string` `rippleTimeToISO8601(rippleTime: number): string`
@@ -5994,6 +6057,7 @@ api.rippleTimeToISO8601(540659097);
```json ```json
'2017-02-17T15:04:57.000Z' '2017-02-17T15:04:57.000Z'
``` ```
## txFlags ## txFlags
`txFlags.TRANSACTION_TYPE.FLAG` `txFlags.TRANSACTION_TYPE.FLAG`
@@ -6075,6 +6139,7 @@ The remaining transaction types do not have any flags at this time.
* EscrowCancel * EscrowCancel
* PaymentChannelCreate * PaymentChannelCreate
* PaymentChannelFund * PaymentChannelFund
## schemaValidator ## schemaValidator
Unlike the rest of the ripple-lib API, schemaValidator is a static object on RippleAPI. It provides utility methods that do not use a server. Unlike the rest of the ripple-lib API, schemaValidator is a static object on RippleAPI. It provides utility methods that do not use a server.
@@ -6110,6 +6175,7 @@ RippleAPI.schemaValidator.schemaValidate('sign', {
``` ```
[ValidationError(instance.id does not match pattern "^[A-F0-9]{64}$")] [ValidationError(instance.id does not match pattern "^[A-F0-9]{64}$")]
``` ```
# API Events # API Events
## ledger ## ledger
@@ -6214,3 +6280,4 @@ api.on('disconnected', (code) => {
} }
}); });
``` ```

View File

@@ -1,69 +1,69 @@
<%- include('introduction.md.ejs') -%> <%- include('introduction.md.ejs') %>
<%- include('boilerplate.md.ejs') -%> <%- include('boilerplate.md.ejs') %>
<%- include('offline.md.ejs') -%> <%- include('offline.md.ejs') %>
<%- include('basictypes.md.ejs') -%> <%- include('basictypes.md.ejs') %>
<%- include('transactions.md.ejs') -%> <%- include('transactions.md.ejs') %>
<%- include('specifications.md.ejs') -%> <%- include('specifications.md.ejs') %>
<%- include('rippledAPIs.md.ejs') -%> <%- include('rippledAPIs.md.ejs') %>
<%- include('request.md.ejs') -%> <%- include('request.md.ejs') %>
<%- include('hasNextPage.md.ejs') -%> <%- include('hasNextPage.md.ejs') %>
<%- include('requestNextPage.md.ejs') -%> <%- include('requestNextPage.md.ejs') %>
<%- include('staticMethods.md.ejs') -%> <%- include('staticMethods.md.ejs') %>
<%- include('renameCounterpartyToIssuer.md.ejs') -%> <%- include('renameCounterpartyToIssuer.md.ejs') %>
<%- include('formatBidsAndAsks.md.ejs') -%> <%- include('formatBidsAndAsks.md.ejs') %>
<%- include('methods.md.ejs') -%> <%- include('methods.md.ejs') %>
<%- include('connect.md.ejs') -%> <%- include('connect.md.ejs') %>
<%- include('disconnect.md.ejs') -%> <%- include('disconnect.md.ejs') %>
<%- include('isConnected.md.ejs') -%> <%- include('isConnected.md.ejs') %>
<%- include('getServerInfo.md.ejs') -%> <%- include('getServerInfo.md.ejs') %>
<%- include('getFee.md.ejs') -%> <%- include('getFee.md.ejs') %>
<%- include('getLedgerVersion.md.ejs') -%> <%- include('getLedgerVersion.md.ejs') %>
<%- include('getTransaction.md.ejs') -%> <%- include('getTransaction.md.ejs') %>
<%- include('getTransactions.md.ejs') -%> <%- include('getTransactions.md.ejs') %>
<%- include('getTrustlines.md.ejs') -%> <%- include('getTrustlines.md.ejs') %>
<%- include('getBalances.md.ejs') -%> <%- include('getBalances.md.ejs') %>
<%- include('getBalanceSheet.md.ejs') -%> <%- include('getBalanceSheet.md.ejs') %>
<%- include('getPaths.md.ejs') -%> <%- include('getPaths.md.ejs') %>
<%- include('getOrders.md.ejs') -%> <%- include('getOrders.md.ejs') %>
<%- include('getOrderbook.md.ejs') -%> <%- include('getOrderbook.md.ejs') %>
<%- include('getSettings.md.ejs') -%> <%- include('getSettings.md.ejs') %>
<%- include('getAccountInfo.md.ejs') -%> <%- include('getAccountInfo.md.ejs') %>
<%- include('getAccountObjects.md.ejs') -%> <%- include('getAccountObjects.md.ejs') %>
<%- include('getPaymentChannel.md.ejs') -%> <%- include('getPaymentChannel.md.ejs') %>
<%- include('getLedger.md.ejs') -%> <%- include('getLedger.md.ejs') %>
<%- include('parseAccountFlags.md.ejs') -%> <%- include('parseAccountFlags.md.ejs') %>
<%- include('prepareTransaction.md.ejs') -%> <%- include('prepareTransaction.md.ejs') %>
<%- include('preparePayment.md.ejs') -%> <%- include('preparePayment.md.ejs') %>
<%- include('prepareTrustline.md.ejs') -%> <%- include('prepareTrustline.md.ejs') %>
<%- include('prepareOrder.md.ejs') -%> <%- include('prepareOrder.md.ejs') %>
<%- include('prepareOrderCancellation.md.ejs') -%> <%- include('prepareOrderCancellation.md.ejs') %>
<%- include('prepareSettings.md.ejs') -%> <%- include('prepareSettings.md.ejs') %>
<%- include('prepareEscrowCreation.md.ejs') -%> <%- include('prepareEscrowCreation.md.ejs') %>
<%- include('prepareEscrowCancellation.md.ejs') -%> <%- include('prepareEscrowCancellation.md.ejs') %>
<%- include('prepareEscrowExecution.md.ejs') -%> <%- include('prepareEscrowExecution.md.ejs') %>
<%- include('preparePaymentChannelCreate.md.ejs') -%> <%- include('preparePaymentChannelCreate.md.ejs') %>
<%- include('preparePaymentChannelClaim.md.ejs') -%> <%- include('preparePaymentChannelClaim.md.ejs') %>
<%- include('preparePaymentChannelFund.md.ejs') -%> <%- include('preparePaymentChannelFund.md.ejs') %>
<%- include('prepareCheckCreate.md.ejs') -%> <%- include('prepareCheckCreate.md.ejs') %>
<%- include('prepareCheckCancel.md.ejs') -%> <%- include('prepareCheckCancel.md.ejs') %>
<%- include('prepareCheckCash.md.ejs') -%> <%- include('prepareCheckCash.md.ejs') %>
<%- include('sign.md.ejs') -%> <%- include('sign.md.ejs') %>
<%- include('combine.md.ejs') -%> <%- include('combine.md.ejs') %>
<%- include('submit.md.ejs') -%> <%- include('submit.md.ejs') %>
<%- include('generateXAddress.md.ejs') -%> <%- include('generateXAddress.md.ejs') %>
<%- include('generateAddress.md.ejs') -%> <%- include('generateAddress.md.ejs') %>
<%- include('isValidAddress.md.ejs') -%> <%- include('isValidAddress.md.ejs') %>
<%- include('isValidSecret.md.ejs') -%> <%- include('isValidSecret.md.ejs') %>
<%- include('deriveKeypair.md.ejs') -%> <%- include('deriveKeypair.md.ejs') %>
<%- include('deriveAddress.md.ejs') -%> <%- include('deriveAddress.md.ejs') %>
<%- include('signPaymentChannelClaim.md.ejs') -%> <%- include('signPaymentChannelClaim.md.ejs') %>
<%- include('verifyPaymentChannelClaim.md.ejs') -%> <%- include('verifyPaymentChannelClaim.md.ejs') %>
<%- include('computeLedgerHash.md.ejs') -%> <%- include('computeLedgerHash.md.ejs') %>
<%- include('xrpToDropsAndDropsToXrp.md.ejs') -%> <%- include('xrpToDropsAndDropsToXrp.md.ejs') %>
<%- include('iso8601ToRippleTime.md.ejs') -%> <%- include('iso8601ToRippleTime.md.ejs') %>
<%- include('rippleTimeToISO8601.md.ejs') -%> <%- include('rippleTimeToISO8601.md.ejs') %>
<%- include('txFlags.md.ejs') -%> <%- include('txFlags.md.ejs') %>
<%- include('schemaValidator.md.ejs') -%> <%- include('schemaValidator.md.ejs') %>
<%- include('events.md.ejs') -%> <%- include('events.md.ejs') %>

View File

@@ -1,6 +1,6 @@
{ {
"name": "ripple-lib", "name": "ripple-lib",
"version": "1.6.1", "version": "1.6.4",
"license": "ISC", "license": "ISC",
"description": "A TypeScript/JavaScript API for interacting with the XRP Ledger in Node.js and the browser", "description": "A TypeScript/JavaScript API for interacting with the XRP Ledger in Node.js and the browser",
"files": [ "files": [
@@ -21,7 +21,7 @@
}, },
"dependencies": { "dependencies": {
"@types/lodash": "^4.14.136", "@types/lodash": "^4.14.136",
"@types/ws": "^6.0.3", "@types/ws": "^7.2.0",
"bignumber.js": "^9.0.0", "bignumber.js": "^9.0.0",
"https-proxy-agent": "^4.0.0", "https-proxy-agent": "^4.0.0",
"jsonschema": "1.2.2", "jsonschema": "1.2.2",
@@ -29,12 +29,12 @@
"lodash.isequal": "^4.5.0", "lodash.isequal": "^4.5.0",
"ripple-address-codec": "^4.0.0", "ripple-address-codec": "^4.0.0",
"ripple-binary-codec": "^0.2.5", "ripple-binary-codec": "^0.2.5",
"ripple-keypairs": "^0.11.0", "ripple-keypairs": "^1.0.0",
"ripple-lib-transactionparser": "0.8.2", "ripple-lib-transactionparser": "0.8.2",
"ws": "^7.2.0" "ws": "^7.2.0"
}, },
"devDependencies": { "devDependencies": {
"@types/mocha": "^5.2.7", "@types/mocha": "^7.0.1",
"@types/node": "^13.1.1", "@types/node": "^13.1.1",
"@typescript-eslint/eslint-plugin": "^2.3.3", "@typescript-eslint/eslint-plugin": "^2.3.3",
"@typescript-eslint/parser": "^2.3.3", "@typescript-eslint/parser": "^2.3.3",
@@ -44,12 +44,12 @@
"eslint": "^6.5.1", "eslint": "^6.5.1",
"eventemitter2": "^6.0.0", "eventemitter2": "^6.0.0",
"json-schema-to-markdown-table": "^0.4.0", "json-schema-to-markdown-table": "^0.4.0",
"mocha": "7.0.0", "mocha": "7.0.1",
"mocha-junit-reporter": "^1.9.1", "mocha-junit-reporter": "^1.9.1",
"nyc": "^15.0.0", "nyc": "^15.0.0",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"ts-node": "^8.4.1", "ts-node": "^8.4.1",
"typescript": "^3.6.4", "typescript": "^3.7.5",
"webpack": "^4.41.2", "webpack": "^4.41.2",
"webpack-bundle-analyzer": "^3.6.0", "webpack-bundle-analyzer": "^3.6.0",
"webpack-cli": "^3.3.9" "webpack-cli": "^3.3.9"

View File

@@ -371,7 +371,11 @@ export class Connection extends EventEmitter {
* If this succeeds, we're good. If it fails, disconnect so that the consumer can reconnect, if desired. * If this succeeds, we're good. If it fails, disconnect so that the consumer can reconnect, if desired.
*/ */
private _heartbeat = () => { private _heartbeat = () => {
return this.request({command: 'ping'}).catch(() => this.reconnect()) return this.request({command: 'ping'}).catch(() => {
this.reconnect().catch((error) => {
this.emit('error', 'reconnect', error.message, error)
})
})
} }
/** /**
@@ -485,18 +489,6 @@ export class Connection extends EventEmitter {
this._ws.on('error', error => this._ws.on('error', error =>
this.emit('error', 'websocket', error.message, error) this.emit('error', 'websocket', error.message, error)
) )
// Finalize the connection and resolve all awaiting connect() requests
try {
this._retryConnectionBackoff.reset()
await this._subscribeToLedger()
this._startHeartbeatInterval()
this._connectionManager.resolveAllAwaiting()
this.emit('connected')
} catch (error) {
this._connectionManager.rejectAllAwaiting(error)
this.disconnect()
return
}
// Handle a closed connection: reconnect if it was unexpected // Handle a closed connection: reconnect if it was unexpected
this._ws.once('close', code => { this._ws.once('close', code => {
this._clearHeartbeatInterval() this._clearHeartbeatInterval()
@@ -520,6 +512,17 @@ export class Connection extends EventEmitter {
}, retryTimeout) }, retryTimeout)
} }
}) })
// Finalize the connection and resolve all awaiting connect() requests
try {
this._retryConnectionBackoff.reset()
await this._subscribeToLedger()
this._startHeartbeatInterval()
this._connectionManager.resolveAllAwaiting()
this.emit('connected')
} catch (error) {
this._connectionManager.rejectAllAwaiting(error)
await this.disconnect().catch(() => {}) // Ignore this error, propagate the root cause.
}
}) })
return this._connectionManager.awaitConnection() return this._connectionManager.awaitConnection()
} }

View File

@@ -28,7 +28,13 @@ export interface GenerateAddressOptions {
function generateAddressAPI(options: GenerateAddressOptions): GeneratedAddress { function generateAddressAPI(options: GenerateAddressOptions): GeneratedAddress {
validate.generateAddress({options}) validate.generateAddress({options})
try { try {
const secret = keypairs.generateSeed(options) const generateSeedOptions: { entropy?: Uint8Array; algorithm?: "ecdsa-secp256k1" | "ed25519"; } = {
algorithm: options.algorithm
}
if (options.entropy) {
generateSeedOptions.entropy = Uint8Array.from(options.entropy)
}
const secret = keypairs.generateSeed(generateSeedOptions)
const keypair = keypairs.deriveKeypair(secret) const keypair = keypairs.deriveKeypair(secret)
const classicAddress = keypairs.deriveAddress(keypair.publicKey) const classicAddress = keypairs.deriveAddress(keypair.publicKey)
const returnValue: any = { const returnValue: any = {

View File

@@ -7,7 +7,7 @@ function verifyPaymentChannelClaim(
amount: string, amount: string,
signature: string, signature: string,
publicKey: string publicKey: string
): string { ): boolean {
validate.verifyPaymentChannelClaim({channel, amount, signature, publicKey}) validate.verifyPaymentChannelClaim({channel, amount, signature, publicKey})
const signingData = binary.encodeForSigningClaim({ const signingData = binary.encodeForSigningClaim({

View File

@@ -1,6 +1,7 @@
import assert from 'assert-diff' import assert from 'assert-diff'
import responses from '../../fixtures/responses' import responses from '../../fixtures/responses'
import {TestSuite} from '../../utils' import {TestSuite} from '../../utils'
import { GenerateAddressOptions } from '../../../src/offline/generate-address'
const {generateAddress: RESPONSE_FIXTURES} = responses const {generateAddress: RESPONSE_FIXTURES} = responses
/** /**
@@ -9,22 +10,192 @@ const {generateAddress: RESPONSE_FIXTURES} = responses
* - Check out "test/api/index.ts" for more information about the test runner. * - Check out "test/api/index.ts" for more information about the test runner.
*/ */
export default <TestSuite>{ export default <TestSuite>{
'generateAddress': async (api, address) => { 'generateAddress': async (api) => {
function random(): number[] { // GIVEN entropy of all zeros
function random() {
return new Array(16).fill(0) return new Array(16).fill(0)
} }
assert.deepEqual( assert.deepEqual(
// WHEN generating an address
api.generateAddress({entropy: random()}), api.generateAddress({entropy: random()}),
// THEN we get the expected return value
RESPONSE_FIXTURES RESPONSE_FIXTURES
) )
}, },
'generateAddress invalid': async (api, address) => { 'generateAddress invalid entropy': async (api) => {
assert.throws(() => { assert.throws(() => {
// GIVEN entropy of 1 byte
function random() { function random() {
return new Array(1).fill(0) return new Array(1).fill(0)
} }
// WHEN generating an address
api.generateAddress({entropy: random()}) api.generateAddress({entropy: random()})
// THEN an UnexpectedError is thrown
// because 16 bytes of entropy are required
}, api.errors.UnexpectedError) }, api.errors.UnexpectedError)
},
'generateAddress with no options object': async (api) => {
// GIVEN no options
// WHEN generating an address
const account = api.generateAddress()
// THEN we get an object with an address starting with 'r' and a secret starting with 's'
assert(account.address.startsWith('r'), 'Address must start with `r`')
assert(account.secret.startsWith('s'), 'Secret must start with `s`')
},
'generateAddress with empty options object': async (api) => {
// GIVEN an empty options object
const options = {}
// WHEN generating an address
const account = api.generateAddress(options)
// THEN we get an object with an address starting with 'r' and a secret starting with 's'
assert(account.address.startsWith('r'), 'Address must start with `r`')
assert(account.secret.startsWith('s'), 'Secret must start with `s`')
},
'generateAddress with algorithm `ecdsa-secp256k1`': async (api) => {
// GIVEN we want to use 'ecdsa-secp256k1'
const options: GenerateAddressOptions = {algorithm: 'ecdsa-secp256k1'}
// WHEN generating an address
const account = api.generateAddress(options)
// THEN we get an object with an address starting with 'r' and a secret starting with 's' (not 'sEd')
assert(account.address.startsWith('r'), 'Address must start with `r`')
assert.deepEqual(account.secret.slice(0, 1), 's', `Secret ${account.secret} must start with 's'`)
assert.notStrictEqual(account.secret.slice(0, 3), 'sEd', `secp256k1 secret ${account.secret} must not start with 'sEd'`)
},
'generateAddress with algorithm `ed25519`': async (api) => {
// GIVEN we want to use 'ed25519'
const options: GenerateAddressOptions = {algorithm: 'ed25519'}
// WHEN generating an address
const account = api.generateAddress(options)
// THEN we get an object with an address starting with 'r' and a secret starting with 'sEd'
assert(account.address.startsWith('r'), 'Address must start with `r`')
assert.deepEqual(account.secret.slice(0, 3), 'sEd', `Ed25519 secret ${account.secret} must start with 'sEd'`)
},
'generateAddress with algorithm `ecdsa-secp256k1` and given entropy': async (api) => {
// GIVEN we want to use 'ecdsa-secp256k1' with entropy of zero
const options: GenerateAddressOptions = {algorithm: 'ecdsa-secp256k1', entropy: new Array(16).fill(0)}
// WHEN generating an address
const account = api.generateAddress(options)
// THEN we get the expected return value
assert.deepEqual(account, responses.generateAddress)
},
'generateAddress with algorithm `ed25519` and given entropy': async (api) => {
// GIVEN we want to use 'ed25519' with entropy of zero
const options: GenerateAddressOptions = {algorithm: 'ed25519', entropy: new Array(16).fill(0)}
// WHEN generating an address
const account = api.generateAddress(options)
// THEN we get the expected return value
assert.deepEqual(account, {
// generateAddress return value always includes xAddress to encourage X-address adoption
xAddress: 'X7xq1YJ4xmLSGGLhuakFQB9CebWYthQkgsvFC4LGFH871HB',
classicAddress: "r9zRhGr7b6xPekLvT6wP4qNdWMryaumZS7",
address: "r9zRhGr7b6xPekLvT6wP4qNdWMryaumZS7",
secret: 'sEdSJHS4oiAdz7w2X2ni1gFiqtbJHqE'
})
},
'generateAddress with algorithm `ecdsa-secp256k1` and given entropy; include classic address': async (api) => {
// GIVEN we want to use 'ecdsa-secp256k1' with entropy of zero
const options: GenerateAddressOptions = {algorithm: 'ecdsa-secp256k1', entropy: new Array(16).fill(0), includeClassicAddress: true}
// WHEN generating an address
const account = api.generateAddress(options)
// THEN we get the expected return value
assert.deepEqual(account, responses.generateAddress)
},
'generateAddress with algorithm `ed25519` and given entropy; include classic address': async (api) => {
// GIVEN we want to use 'ed25519' with entropy of zero
const options: GenerateAddressOptions = {algorithm: 'ed25519', entropy: new Array(16).fill(0), includeClassicAddress: true}
// WHEN generating an address
const account = api.generateAddress(options)
// THEN we get the expected return value
assert.deepEqual(account, {
// generateAddress return value always includes xAddress to encourage X-address adoption
xAddress: 'X7xq1YJ4xmLSGGLhuakFQB9CebWYthQkgsvFC4LGFH871HB',
secret: 'sEdSJHS4oiAdz7w2X2ni1gFiqtbJHqE',
classicAddress: "r9zRhGr7b6xPekLvT6wP4qNdWMryaumZS7",
address: "r9zRhGr7b6xPekLvT6wP4qNdWMryaumZS7"
})
},
'generateAddress with algorithm `ecdsa-secp256k1` and given entropy; include classic address; for test network use': async (api) => {
// GIVEN we want to use 'ecdsa-secp256k1' with entropy of zero
const options: GenerateAddressOptions = {algorithm: 'ecdsa-secp256k1', entropy: new Array(16).fill(0), includeClassicAddress: true, test: true}
// WHEN generating an address
const account = api.generateAddress(options)
// THEN we get the expected return value
const response = Object.assign({}, responses.generateAddress, {
// generateAddress return value always includes xAddress to encourage X-address adoption
xAddress: 'TVG3TcCD58BD6MZqsNuTihdrhZwR8SzvYS8U87zvHsAcNw4'
})
assert.deepEqual(account, response)
},
'generateAddress with algorithm `ed25519` and given entropy; include classic address; for test network use': async (api) => {
// GIVEN we want to use 'ed25519' with entropy of zero
const options: GenerateAddressOptions = {algorithm: 'ed25519', entropy: new Array(16).fill(0), includeClassicAddress: true, test: true}
// WHEN generating an address
const account = api.generateAddress(options)
// THEN we get the expected return value
assert.deepEqual(account, {
// generateAddress return value always includes xAddress to encourage X-address adoption
xAddress: 'T7t4HeTMF5tT68agwuVbJwu23ssMPeh8dDtGysZoQiij1oo',
secret: 'sEdSJHS4oiAdz7w2X2ni1gFiqtbJHqE',
classicAddress: "r9zRhGr7b6xPekLvT6wP4qNdWMryaumZS7",
address: "r9zRhGr7b6xPekLvT6wP4qNdWMryaumZS7"
})
},
'generateAddress for test network use': async (api) => {
// GIVEN we want an address for test network use
const options: GenerateAddressOptions = {test: true}
// WHEN generating an address
const account = api.generateAddress(options)
// THEN we get an object with xAddress starting with 'T' and a secret starting with 's'
// generateAddress return value always includes xAddress to encourage X-address adoption
assert.deepEqual(account.xAddress.slice(0, 1), 'T', 'Test addresses start with T')
assert.deepEqual(account.secret.slice(0, 1), 's', `Secret ${account.secret} must start with 's'`)
} }
} }

View File

@@ -1,6 +1,7 @@
import assert from 'assert-diff' import assert from 'assert-diff'
import responses from '../../fixtures/responses' import responses from '../../fixtures/responses'
import {TestSuite} from '../../utils' import {TestSuite} from '../../utils'
import { GenerateAddressOptions } from '../../../src/offline/generate-address'
/** /**
* Every test suite exports their tests in the default object. * Every test suite exports their tests in the default object.
@@ -8,22 +9,175 @@ import {TestSuite} from '../../utils'
* - Check out "test/api/index.ts" for more information about the test runner. * - Check out "test/api/index.ts" for more information about the test runner.
*/ */
export default <TestSuite>{ export default <TestSuite>{
'generateXAddress': async (api, address) => { 'generateXAddress': async (api) => {
// GIVEN entropy of all zeros
function random() { function random() {
return new Array(16).fill(0) return new Array(16).fill(0)
} }
assert.deepEqual( assert.deepEqual(
// WHEN generating an X-address
api.generateXAddress({entropy: random()}), api.generateXAddress({entropy: random()}),
// THEN we get the expected return value
responses.generateXAddress responses.generateXAddress
) )
}, },
'generateXAddress invalid': async (api, address) => { 'generateXAddress invalid entropy': async (api) => {
assert.throws(() => { assert.throws(() => {
// GIVEN entropy of 1 byte
function random() { function random() {
return new Array(1).fill(0) return new Array(1).fill(0)
} }
// WHEN generating an X-address
api.generateXAddress({entropy: random()}) api.generateXAddress({entropy: random()})
// THEN an UnexpectedError is thrown
// because 16 bytes of entropy are required
}, api.errors.UnexpectedError) }, api.errors.UnexpectedError)
},
'generateXAddress with no options object': async (api) => {
// GIVEN no options
// WHEN generating an X-address
const account = api.generateXAddress()
// THEN we get an object with an xAddress starting with 'X' and a secret starting with 's'
assert(account.xAddress.startsWith('X'), 'By default X-addresses start with X')
assert(account.secret.startsWith('s'), 'Secrets start with s')
},
'generateXAddress with empty options object': async (api) => {
// GIVEN an empty options object
const options = {}
// WHEN generating an X-address
const account = api.generateXAddress(options)
// THEN we get an object with an xAddress starting with 'X' and a secret starting with 's'
assert(account.xAddress.startsWith('X'), 'By default X-addresses start with X')
assert(account.secret.startsWith('s'), 'Secrets start with s')
},
'generateXAddress with algorithm `ecdsa-secp256k1`': async (api) => {
// GIVEN we want to use 'ecdsa-secp256k1'
const options: GenerateAddressOptions = {algorithm: 'ecdsa-secp256k1'}
// WHEN generating an X-address
const account = api.generateXAddress(options)
// THEN we get an object with an xAddress starting with 'X' and a secret starting with 's'
assert(account.xAddress.startsWith('X'), 'By default X-addresses start with X')
assert.deepEqual(account.secret.slice(0, 1), 's', `Secret ${account.secret} must start with 's'`)
assert.notStrictEqual(account.secret.slice(0, 3), 'sEd', `secp256k1 secret ${account.secret} must not start with 'sEd'`)
},
'generateXAddress with algorithm `ed25519`': async (api) => {
// GIVEN we want to use 'ed25519'
const options: GenerateAddressOptions = {algorithm: 'ed25519'}
// WHEN generating an X-address
const account = api.generateXAddress(options)
// THEN we get an object with an xAddress starting with 'X' and a secret starting with 'sEd'
assert(account.xAddress.startsWith('X'), 'By default X-addresses start with X')
assert.deepEqual(account.secret.slice(0, 3), 'sEd', `Ed25519 secret ${account.secret} must start with 'sEd'`)
},
'generateXAddress with algorithm `ecdsa-secp256k1` and given entropy': async (api) => {
// GIVEN we want to use 'ecdsa-secp256k1' with entropy of zero
const options: GenerateAddressOptions = {algorithm: 'ecdsa-secp256k1', entropy: new Array(16).fill(0)}
// WHEN generating an X-address
const account = api.generateXAddress(options)
// THEN we get the expected return value
assert.deepEqual(account, responses.generateXAddress)
},
'generateXAddress with algorithm `ed25519` and given entropy': async (api) => {
// GIVEN we want to use 'ed25519' with entropy of zero
const options: GenerateAddressOptions = {algorithm: 'ed25519', entropy: new Array(16).fill(0)}
// WHEN generating an X-address
const account = api.generateXAddress(options)
// THEN we get the expected return value
assert.deepEqual(account, {
xAddress: 'X7xq1YJ4xmLSGGLhuakFQB9CebWYthQkgsvFC4LGFH871HB',
secret: 'sEdSJHS4oiAdz7w2X2ni1gFiqtbJHqE'
})
},
'generateXAddress with algorithm `ecdsa-secp256k1` and given entropy; include classic address': async (api) => {
// GIVEN we want to use 'ecdsa-secp256k1' with entropy of zero
const options: GenerateAddressOptions = {algorithm: 'ecdsa-secp256k1', entropy: new Array(16).fill(0), includeClassicAddress: true}
// WHEN generating an X-address
const account = api.generateXAddress(options)
// THEN we get the expected return value
assert.deepEqual(account, responses.generateAddress)
},
'generateXAddress with algorithm `ed25519` and given entropy; include classic address': async (api) => {
// GIVEN we want to use 'ed25519' with entropy of zero
const options: GenerateAddressOptions = {algorithm: 'ed25519', entropy: new Array(16).fill(0), includeClassicAddress: true}
// WHEN generating an X-address
const account = api.generateXAddress(options)
// THEN we get the expected return value
assert.deepEqual(account, {
xAddress: 'X7xq1YJ4xmLSGGLhuakFQB9CebWYthQkgsvFC4LGFH871HB',
secret: 'sEdSJHS4oiAdz7w2X2ni1gFiqtbJHqE',
classicAddress: "r9zRhGr7b6xPekLvT6wP4qNdWMryaumZS7",
address: "r9zRhGr7b6xPekLvT6wP4qNdWMryaumZS7"
})
},
'generateXAddress with algorithm `ecdsa-secp256k1` and given entropy; include classic address; for test network use': async (api) => {
// GIVEN we want to use 'ecdsa-secp256k1' with entropy of zero
const options: GenerateAddressOptions = {algorithm: 'ecdsa-secp256k1', entropy: new Array(16).fill(0), includeClassicAddress: true, test: true}
// WHEN generating an X-address
const account = api.generateXAddress(options)
// THEN we get the expected return value
const response = Object.assign({}, responses.generateAddress, {
xAddress: 'TVG3TcCD58BD6MZqsNuTihdrhZwR8SzvYS8U87zvHsAcNw4'
})
assert.deepEqual(account, response)
},
'generateXAddress with algorithm `ed25519` and given entropy; include classic address; for test network use': async (api) => {
// GIVEN we want to use 'ed25519' with entropy of zero
const options: GenerateAddressOptions = {algorithm: 'ed25519', entropy: new Array(16).fill(0), includeClassicAddress: true, test: true}
// WHEN generating an X-address
const account = api.generateXAddress(options)
// THEN we get the expected return value
assert.deepEqual(account, {
xAddress: 'T7t4HeTMF5tT68agwuVbJwu23ssMPeh8dDtGysZoQiij1oo',
secret: 'sEdSJHS4oiAdz7w2X2ni1gFiqtbJHqE',
classicAddress: "r9zRhGr7b6xPekLvT6wP4qNdWMryaumZS7",
address: "r9zRhGr7b6xPekLvT6wP4qNdWMryaumZS7"
})
},
'generateXAddress for test network use': async (api) => {
// GIVEN we want an X-address for test network use
const options: GenerateAddressOptions = {test: true}
// WHEN generating an X-address
const account = api.generateXAddress(options)
// THEN we get an object with xAddress starting with 'T' and a secret starting with 's'
assert.deepEqual(account.xAddress.slice(0, 1), 'T', 'Test X-addresses start with T')
assert.deepEqual(account.secret.slice(0, 1), 's', `Secret ${account.secret} must start with 's'`)
} }
} }

View File

@@ -360,6 +360,34 @@ describe('Connection', function() {
}) })
}) })
it('heartbeat failure and reconnect failure', function(done) {
if (isBrowser) {
const phantomTest = /PhantomJS/
if (phantomTest.test(navigator.userAgent)) {
// inside PhantomJS this one just hangs, so skip as not very relevant
done()
return
}
}
// Set the heartbeat to less than the 1 second ping response
this.api.connection._config.timeout = 500
// Drop the test runner timeout, since this should be a quick test
this.timeout(5000)
// fail on reconnect/connection
this.api.connection.reconnect = async () => {
throw new Error('error on reconnect')
}
// Hook up a listener for the reconnect error event
this.api.on('error', (error, message) => {
if(error === 'reconnect' && message === 'error on reconnect') {
return done()
}
return done(new Error('Expected error on reconnect'))
})
// Trigger a heartbeat
this.api.connection._heartbeat()
})
it('should emit disconnected event with code 1000 (CLOSE_NORMAL)', function(done) { it('should emit disconnected event with code 1000 (CLOSE_NORMAL)', function(done) {
this.api.once('disconnected', code => { this.api.once('disconnected', code => {
assert.strictEqual(code, 1000) assert.strictEqual(code, 1000)
@@ -562,6 +590,24 @@ describe('Connection', function() {
} }
) )
it('should clean up websocket connection if error after websocket is opened', async function() {
await this.api.disconnect();
// fail on connection
this.api.connection._subscribeToLedger = async () => {
throw new Error('error on _subscribeToLedger')
}
try {
await this.api.connect();
throw new Error('expected connect() to reject, but it resolved')
} catch (err) {
assert(err.message === 'error on _subscribeToLedger');
// _ws.close event listener should have cleaned up the socket when disconnect _ws.close is run on connection error
// do not fail on connection anymore
this.api.connection._subscribeToLedger = async () => {}
await this.api.connection.reconnect();
}
})
it('should try to reconnect on empty subscribe response on reconnect', function(done) { it('should try to reconnect on empty subscribe response on reconnect', function(done) {
this.timeout(23000) this.timeout(23000)
this.api.on('error', error => { this.api.on('error', error => {

View File

@@ -32,21 +32,33 @@ describe('RippleAPI [Test Runner]', function() {
// Run all the tests: // Run all the tests:
for (const {name: methodName, tests, config} of allTestSuites) { for (const {name: methodName, tests, config} of allTestSuites) {
describe(`api.${methodName}`, () => { describe(`api.${methodName}`, () => {
// Run each test with the original-style address. // Run each test that does not use an address.
describe(`[Original Address]`, () => { for (const [testName, fn] of tests) {
for (const [testName, fn] of tests) { if (fn.length === 1) {
it(testName, function() { it(testName, function() {
return fn(this.api, addresses.ACCOUNT) return fn(this.api, addresses.ACCOUNT)
}) })
} }
}
// Run each test with a classic address.
describe(`[Classic Address]`, () => {
for (const [testName, fn] of tests) {
if (fn.length === 2) {
it(testName, function() {
return fn(this.api, addresses.ACCOUNT)
})
}
}
}) })
// Run each test with the newer, x-address style. // Run each test with an X-address.
if (!config.skipXAddress) { if (!config.skipXAddress) {
describe(`[X-address]`, () => { describe(`[X-address]`, () => {
for (const [testName, fn] of tests) { for (const [testName, fn] of tests) {
it(testName, function() { if (fn.length === 2) {
return fn(this.api, addresses.ACCOUNT_X) it(testName, function() {
}) return fn(this.api, addresses.ACCOUNT_X)
})
}
} }
}) })
} }

View File

@@ -6,10 +6,10 @@
"moduleResolution": "node", "moduleResolution": "node",
"declaration": true, "declaration": true,
"declarationMap": true /* Added 2019-04-13 */, "declarationMap": true,
"sourceMap": true, "sourceMap": true,
"strict": true /* Enable all strict type-checking options. */, "strict": true,
"strictNullChecks": false, "strictNullChecks": false,
"noImplicitAny": false, "noImplicitAny": false,
"noUnusedLocals": true, "noUnusedLocals": true,

209
yarn.lock
View File

@@ -151,13 +151,6 @@
traverse "^0.6.6" traverse "^0.6.6"
unified "^6.1.6" unified "^6.1.6"
"@types/base-x@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@types/base-x/-/base-x-3.0.0.tgz#a1365259d1d3fa3ff973ab543192a6bdd4cb2f90"
integrity sha512-vnqSlpsv9uFX5/z8GyKWAfWHhLGJDBkrgRRsnxlsX23DHOlNyqP/eHQiv4TwnYcZULzQIxaWA/xRWU9Dyy4qzw==
dependencies:
"@types/node" "*"
"@types/color-name@^1.1.1": "@types/color-name@^1.1.1":
version "1.1.1" version "1.1.1"
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
@@ -178,43 +171,34 @@
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.149.tgz#1342d63d948c6062838fbf961012f74d4e638440" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.149.tgz#1342d63d948c6062838fbf961012f74d4e638440"
integrity sha512-ijGqzZt/b7BfzcK9vTrS6MFljQRPn5BFWOx8oE0GYxribu6uV+aA9zZuXI1zc/etK9E8nrgdoF2+LgUw7+9tJQ== integrity sha512-ijGqzZt/b7BfzcK9vTrS6MFljQRPn5BFWOx8oE0GYxribu6uV+aA9zZuXI1zc/etK9E8nrgdoF2+LgUw7+9tJQ==
"@types/mocha@^5.2.7": "@types/mocha@^7.0.1":
version "5.2.7" version "7.0.1"
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-7.0.1.tgz#5d7ec2a789a1f77c59b7ad071b9d50bf1abbfc9e"
integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ== integrity sha512-L/Nw/2e5KUaprNJoRA33oly+M8X8n0K+FwLTbYqwTcR14wdPWeRkigBLfSFpN/Asf9ENZTMZwLxjtjeYucAA4Q==
"@types/node@*", "@types/node@^13.1.1": "@types/node@*", "@types/node@^13.1.1":
version "13.1.6" version "13.7.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.1.6.tgz#076028d0b0400be8105b89a0a55550c86684ffec" resolved "https://registry.yarnpkg.com/@types/node/-/node-13.7.1.tgz#238eb34a66431b71d2aaddeaa7db166f25971a0d"
integrity sha512-Jg1F+bmxcpENHP23sVKkNuU3uaxPnsBMW0cLjleiikFKomJQbsn0Cqk2yDvQArqzZN6ABfBkZ0To7pQ8sLdWDg== integrity sha512-Zq8gcQGmn4txQEJeiXo/KiLpon8TzAl0kmKH4zdWctPj05nWwp1ClMdAVEloqrQKfaC48PNLdgN/aVaLqUrluA==
"@types/ws@^6.0.3": "@types/ws@^7.2.0":
version "6.0.4" version "7.2.1"
resolved "https://registry.yarnpkg.com/@types/ws/-/ws-6.0.4.tgz#7797707c8acce8f76d8c34b370d4645b70421ff1" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.2.1.tgz#b800f2b8aee694e2b581113643e20d79dd3b8556"
integrity sha512-PpPrX7SZW9re6+Ha8ojZG4Se8AZXgf0GK6zmfqEuCsY49LFDNXO3SByp44X3dFEqtB73lkCDAdUazhAjVPiNwg== integrity sha512-UEmRNbXFGvfs/sLncf01GuVv6U1mZP3Df0iXWx4kUlikJxbFyFADp95mDn1XDTE2mXpzzoHcKlfFcbytLq4vaA==
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
"@typescript-eslint/eslint-plugin@^2.3.3": "@typescript-eslint/eslint-plugin@^2.3.3":
version "2.13.0" version "2.20.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.13.0.tgz#57e933fe16a2fc66dbac059af0d6d85d921d748e" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.20.0.tgz#a522d0e1e4898f7c9c6a8e1ed3579b60867693fa"
integrity sha512-QoiANo0MMGNa8ej/yX3BrW5dZj5d8HYcKiM2fyYUlezECqn8Xc7T/e4EUdiGinn8jhBrn+9X47E9TWaaup3u1g== integrity sha512-cimIdVDV3MakiGJqMXw51Xci6oEDEoPkvh8ggJe2IIzcc0fYqAxOXN6Vbeanahz6dLZq64W+40iUEc9g32FLDQ==
dependencies: dependencies:
"@typescript-eslint/experimental-utils" "2.13.0" "@typescript-eslint/experimental-utils" "2.20.0"
eslint-utils "^1.4.3" eslint-utils "^1.4.3"
functional-red-black-tree "^1.0.1" functional-red-black-tree "^1.0.1"
regexpp "^3.0.0" regexpp "^3.0.0"
tsutils "^3.17.1" tsutils "^3.17.1"
"@typescript-eslint/experimental-utils@2.13.0":
version "2.13.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.13.0.tgz#958614faa6f77599ee2b241740e0ea402482533d"
integrity sha512-+Hss3clwa6aNiC8ZjA45wEm4FutDV5HsVXPl/rDug1THq6gEtOYRGLqS3JlTk7mSnL5TbJz0LpEbzbPnKvY6sw==
dependencies:
"@types/json-schema" "^7.0.3"
"@typescript-eslint/typescript-estree" "2.13.0"
eslint-scope "^5.0.0"
"@typescript-eslint/experimental-utils@2.14.0": "@typescript-eslint/experimental-utils@2.14.0":
version "2.14.0" version "2.14.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.14.0.tgz#e9179fa3c44e00b3106b85d7b69342901fb43e3b" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.14.0.tgz#e9179fa3c44e00b3106b85d7b69342901fb43e3b"
@@ -224,6 +208,15 @@
"@typescript-eslint/typescript-estree" "2.14.0" "@typescript-eslint/typescript-estree" "2.14.0"
eslint-scope "^5.0.0" eslint-scope "^5.0.0"
"@typescript-eslint/experimental-utils@2.20.0":
version "2.20.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.20.0.tgz#3b6fa5a6b8885f126d5a4280e0d44f0f41e73e32"
integrity sha512-fEBy9xYrwG9hfBLFEwGW2lKwDRTmYzH3DwTmYbT+SMycmxAoPl0eGretnBFj/s+NfYBG63w/5c3lsvqqz5mYag==
dependencies:
"@types/json-schema" "^7.0.3"
"@typescript-eslint/typescript-estree" "2.20.0"
eslint-scope "^5.0.0"
"@typescript-eslint/parser@^2.3.3": "@typescript-eslint/parser@^2.3.3":
version "2.14.0" version "2.14.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.14.0.tgz#30fa0523d86d74172a5e32274558404ba4262cd6" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.14.0.tgz#30fa0523d86d74172a5e32274558404ba4262cd6"
@@ -234,19 +227,6 @@
"@typescript-eslint/typescript-estree" "2.14.0" "@typescript-eslint/typescript-estree" "2.14.0"
eslint-visitor-keys "^1.1.0" eslint-visitor-keys "^1.1.0"
"@typescript-eslint/typescript-estree@2.13.0":
version "2.13.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.13.0.tgz#a2e746867da772c857c13853219fced10d2566bc"
integrity sha512-t21Mg5cc8T3ADEUGwDisHLIubgXKjuNRbkpzDMLb7/JMmgCe/gHM9FaaujokLey+gwTuLF5ndSQ7/EfQqrQx4g==
dependencies:
debug "^4.1.1"
eslint-visitor-keys "^1.1.0"
glob "^7.1.6"
is-glob "^4.0.1"
lodash.unescape "4.0.1"
semver "^6.3.0"
tsutils "^3.17.1"
"@typescript-eslint/typescript-estree@2.14.0": "@typescript-eslint/typescript-estree@2.14.0":
version "2.14.0" version "2.14.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.14.0.tgz#c67698acdc14547f095eeefe908958d93e1a648d" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.14.0.tgz#c67698acdc14547f095eeefe908958d93e1a648d"
@@ -260,6 +240,19 @@
semver "^6.3.0" semver "^6.3.0"
tsutils "^3.17.1" tsutils "^3.17.1"
"@typescript-eslint/typescript-estree@2.20.0":
version "2.20.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.20.0.tgz#90a0f5598826b35b966ca83483b1a621b1a4d0c9"
integrity sha512-WlFk8QtI8pPaE7JGQGxU7nGcnk1ccKAJkhbVookv94ZcAef3m6oCE/jEDL6dGte3JcD7reKrA0o55XhBRiVT3A==
dependencies:
debug "^4.1.1"
eslint-visitor-keys "^1.1.0"
glob "^7.1.6"
is-glob "^4.0.1"
lodash "^4.17.15"
semver "^6.3.0"
tsutils "^3.17.1"
"@webassemblyjs/ast@1.8.5": "@webassemblyjs/ast@1.8.5":
version "1.8.5" version "1.8.5"
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359"
@@ -651,13 +644,6 @@ atob@^2.1.1:
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
babel-runtime@^5.8.20:
version "5.8.38"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-5.8.38.tgz#1c0b02eb63312f5f087ff20450827b425c9d4c19"
integrity sha1-HAsC62MxL18If/IEUIJ7QlydTBk=
dependencies:
core-js "^1.0.0"
babel-runtime@^6.6.1: babel-runtime@^6.6.1:
version "6.26.0" version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
@@ -676,18 +662,13 @@ balanced-match@^1.0.0:
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
base-x@3.0.4: base-x@3.0.7:
version "3.0.4" version "3.0.7"
resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.4.tgz#94c1788736da065edb1d68808869e357c977fa77" resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.7.tgz#1c5a7fafe8f66b4114063e8da102799d4e7c408f"
integrity sha512-UYOadoSIkEI/VrRGSG6qp93rp2WdokiAiNYDfGW5qURAY8GiAQkvMbwNNSDYiVJopqv4gCna7xqf4rrNGp+5AA== integrity sha512-zAKJGuQPihXW22fkrfOclUUZXM2g92z5GzlSMHxhO6r6Qj+Nm0ccaGNBzDZojzwOMkpjAv4J0fOv1U4go+a4iw==
dependencies: dependencies:
safe-buffer "^5.0.1" safe-buffer "^5.0.1"
base-x@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/base-x/-/base-x-1.1.0.tgz#42d3d717474f9ea02207f6d1aa1f426913eeb7ac"
integrity sha1-QtPXF0dPnqAiB/bRqh9CaRPut6w=
base64-js@^1.0.2: base64-js@^1.0.2:
version "1.3.1" version "1.3.1"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1"
@@ -748,11 +729,6 @@ bluebird@^3.5.5:
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
bn.js@^3.1.1:
version "3.3.0"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-3.3.0.tgz#1138e577889fdc97bbdab51844f2190dfc0ae3d7"
integrity sha1-ETjld4if3Je72rUYRPIZDfwK49c=
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:
version "4.11.8" version "4.11.8"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
@@ -1237,11 +1213,6 @@ copy-descriptor@^0.1.0:
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=
core-js@^1.0.0:
version "1.2.7"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=
core-js@^2.4.0: core-js@^2.4.0:
version "2.6.11" version "2.6.11"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c"
@@ -1550,7 +1521,7 @@ ejs@^3.0.1:
resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.0.1.tgz#30c8f6ee9948502cc32e85c37a3f8b39b5a614a5" resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.0.1.tgz#30c8f6ee9948502cc32e85c37a3f8b39b5a614a5"
integrity sha512-cuIMtJwxvzumSAkqaaoGY/L6Fc/t6YvoP9/VIaK0V/CyqKLEQ8sqODmYfy/cjXEdZ9+OOL8TecbJu+1RsofGDw== integrity sha512-cuIMtJwxvzumSAkqaaoGY/L6Fc/t6YvoP9/VIaK0V/CyqKLEQ8sqODmYfy/cjXEdZ9+OOL8TecbJu+1RsofGDw==
elliptic@^6.0.0: elliptic@^6.0.0, elliptic@^6.5.2:
version "6.5.2" version "6.5.2"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762"
integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw== integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==
@@ -1563,19 +1534,6 @@ elliptic@^6.0.0:
minimalistic-assert "^1.0.0" minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.0" minimalistic-crypto-utils "^1.0.0"
elliptic@^6.4.0:
version "6.5.1"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.1.tgz#c380f5f909bf1b9b4428d028cd18d3b0efd6b52b"
integrity sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==
dependencies:
bn.js "^4.4.0"
brorand "^1.0.1"
hash.js "^1.0.0"
hmac-drbg "^1.0.0"
inherits "^2.0.1"
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.0"
emoji-regex@^7.0.1: emoji-regex@^7.0.1:
version "7.0.3" version "7.0.3"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
@@ -3259,9 +3217,9 @@ mkdirp@0.5.1, mkdirp@^0.5.1, mkdirp@~0.5.1:
minimist "0.0.8" minimist "0.0.8"
mocha-junit-reporter@^1.9.1: mocha-junit-reporter@^1.9.1:
version "1.23.2" version "1.23.3"
resolved "https://registry.yarnpkg.com/mocha-junit-reporter/-/mocha-junit-reporter-1.23.2.tgz#268f47856677d5ae3d7a24afb5cc198ab74bc586" resolved "https://registry.yarnpkg.com/mocha-junit-reporter/-/mocha-junit-reporter-1.23.3.tgz#941e219dd759ed732f8641e165918aa8b167c981"
integrity sha512-ro39KUheimNkqdtjk1qXNw4B8b/REkCjlNYAsZ5Eso7tsVIX5BoQzA24vWSnWBdP/KNEKDoMoldzYyCwHuHZlw== integrity sha512-ed8LqbRj1RxZfjt/oC9t12sfrWsjZ3gNnbhV1nuj9R/Jb5/P3Xb4duv2eCfCDMYH+fEu0mqca7m4wsiVjsxsvA==
dependencies: dependencies:
debug "^2.2.0" debug "^2.2.0"
md5 "^2.1.0" md5 "^2.1.0"
@@ -3269,10 +3227,10 @@ mocha-junit-reporter@^1.9.1:
strip-ansi "^4.0.0" strip-ansi "^4.0.0"
xml "^1.0.0" xml "^1.0.0"
mocha@7.0.0: mocha@7.0.1:
version "7.0.0" version "7.0.1"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.0.0.tgz#c60d14bf3de9601f549b3ff5be657eb8381c54bf" resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.0.1.tgz#276186d35a4852f6249808c6dd4a1376cbf6c6ce"
integrity sha512-CirsOPbO3jU86YKjjMzFLcXIb5YiGLUrjrXFHoJ3e2z9vWiaZVCZQ2+gtRGMPWF+nFhN6AWwLM/juzAQ6KRkbA== integrity sha512-9eWmWTdHLXh72rGrdZjNbG3aa1/3NRPpul1z0D979QpEnFdCG0Q5tv834N+94QEN2cysfV72YocQ3fn87s70fg==
dependencies: dependencies:
ansi-colors "3.2.3" ansi-colors "3.2.3"
browser-stdout "1.3.1" browser-stdout "1.3.1"
@@ -4142,21 +4100,12 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
hash-base "^3.0.0" hash-base "^3.0.0"
inherits "^2.0.1" inherits "^2.0.1"
ripple-address-codec@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/ripple-address-codec/-/ripple-address-codec-2.0.1.tgz#eddbe3a7960d2e02c5c1c74fb9a9fa0d2dfb6571"
integrity sha1-7dvjp5YNLgLFwcdPuan6DS37ZXE=
dependencies:
hash.js "^1.0.3"
x-address-codec "^0.7.0"
ripple-address-codec@^4.0.0: ripple-address-codec@^4.0.0:
version "4.0.0" version "4.1.0"
resolved "https://registry.yarnpkg.com/ripple-address-codec/-/ripple-address-codec-4.0.0.tgz#c20f39eea38def43d2379462e47bff4adabece30" resolved "https://registry.yarnpkg.com/ripple-address-codec/-/ripple-address-codec-4.1.0.tgz#7a119638527f1ccf1eb4aea3d4a8886bc9ccd5c5"
integrity sha512-PsKl9aytg6fZG2F4RtfPT0c1gj42suAQY9VvJVGz+DfQTdXQaTT9V/StVhaJ6jhVpl7oCd981BB9p2Kq+Kyrng== integrity sha512-C72gJpwvDagaOUiHyh67otqNqFduB4hjvJFiiPz/8I3FCiUYuvFLXeLhb29CEkoAEdoN9p7pPreLgoHUvwzt9w==
dependencies: dependencies:
"@types/base-x" "^3.0.0" base-x "3.0.7"
base-x "3.0.4"
create-hash "^1.1.2" create-hash "^1.1.2"
ripple-binary-codec@^0.2.5: ripple-binary-codec@^0.2.5:
@@ -4172,17 +4121,16 @@ ripple-binary-codec@^0.2.5:
lodash "^4.17.15" lodash "^4.17.15"
ripple-address-codec "^4.0.0" ripple-address-codec "^4.0.0"
ripple-keypairs@^0.11.0: ripple-keypairs@^1.0.0:
version "0.11.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/ripple-keypairs/-/ripple-keypairs-0.11.0.tgz#ee9f4172d615106f4d3c0af15805960742dab045" resolved "https://registry.yarnpkg.com/ripple-keypairs/-/ripple-keypairs-1.0.0.tgz#8f1c604f89daeac5e61b7eebbbca2da99da2bacf"
integrity sha512-kzYwlWaLu1fl+StJdfZuEmcooJI18QuWxatII+Rcd3QeWXne16ml7N1e4HpYI/aJ69Cn4npsJef7kHSaA83Fgg== integrity sha512-MQ3d6fU3D+Cqu5ma4dfkfa+KakN2sKpVVVN0FeJyAYPVIGXu8Rcvd1g028TdwYAZcSYk0tGn5UhHxd0gUG3T8g==
dependencies: dependencies:
babel-runtime "^5.8.20" bn.js "^5.1.1"
bn.js "^3.1.1"
brorand "^1.0.5" brorand "^1.0.5"
elliptic "^6.4.0" elliptic "^6.5.2"
hash.js "^1.0.3" hash.js "^1.0.3"
ripple-address-codec "^2.0.1" ripple-address-codec "^4.0.0"
ripple-lib-transactionparser@0.8.2: ripple-lib-transactionparser@0.8.2:
version "0.8.2" version "0.8.2"
@@ -4794,15 +4742,15 @@ tryer@^1.0.1:
integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA== integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==
ts-node@^8.4.1: ts-node@^8.4.1:
version "8.5.4" version "8.6.2"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.5.4.tgz#a152add11fa19c221d0b48962c210cf467262ab2" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.6.2.tgz#7419a01391a818fbafa6f826a33c1a13e9464e35"
integrity sha512-izbVCRV68EasEPQ8MSIGBNK9dc/4sYJJKYA+IarMQct1RtEot6Xp0bXuClsbUSnKpg50ho+aOAx8en5c+y4OFw== integrity sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==
dependencies: dependencies:
arg "^4.1.0" arg "^4.1.0"
diff "^4.0.1" diff "^4.0.1"
make-error "^1.1.1" make-error "^1.1.1"
source-map-support "^0.5.6" source-map-support "^0.5.6"
yn "^3.0.0" yn "3.1.1"
tslib@^1.8.1, tslib@^1.9.0: tslib@^1.8.1, tslib@^1.9.0:
version "1.10.0" version "1.10.0"
@@ -4853,10 +4801,10 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
typescript@^3.6.4: typescript@^3.7.5:
version "3.7.4" version "3.7.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.4.tgz#1743a5ec5fef6a1fa9f3e4708e33c81c73876c19" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae"
integrity sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw== integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==
underscore@~1.8.3: underscore@~1.8.3:
version "1.8.3" version "1.8.3"
@@ -5086,9 +5034,9 @@ webpack-bundle-analyzer@^3.6.0:
ws "^6.0.0" ws "^6.0.0"
webpack-cli@^3.3.9: webpack-cli@^3.3.9:
version "3.3.10" version "3.3.11"
resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.10.tgz#17b279267e9b4fb549023fae170da8e6e766da13" resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.11.tgz#3bf21889bf597b5d82c38f215135a411edfdc631"
integrity sha512-u1dgND9+MXaEt74sJR4PR7qkPxXUSQ0RXYq8x1L6Jg1MYVEmGPrH6Ah6C4arD4r0J1P5HKjRqpab36k0eIzPqg== integrity sha512-dXlfuml7xvAFwYUPsrtQAA9e4DOe58gnzSxhgrO/ZM/gyXTBowrsYeubyN4mqGhYdpXMFNyQ6emjJS9M7OBd4g==
dependencies: dependencies:
chalk "2.4.2" chalk "2.4.2"
cross-spawn "6.0.5" cross-spawn "6.0.5"
@@ -5111,9 +5059,9 @@ webpack-sources@^1.4.0, webpack-sources@^1.4.1:
source-map "~0.6.1" source-map "~0.6.1"
webpack@^4.41.2: webpack@^4.41.2:
version "4.41.4" version "4.41.6"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.41.4.tgz#4bec4125224bdf50efa8be6226c19047599cd034" resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.41.6.tgz#12f2f804bf6542ef166755050d4afbc8f66ba7e1"
integrity sha512-Lc+2uB6NjpCWsHI3trkoISOI64h9QYIXenbEWj3bn3oyjfB1lEBXjWAfAyY2sM0rZn41oD5V91OLwKRwS6Wp8Q== integrity sha512-yxXfV0Zv9WMGRD+QexkZzmGIh54bsvEs+9aRWxnN8erLWEOehAKUTeNBoUbA6HPEZPlRo7KDi2ZcNveoZgK9MA==
dependencies: dependencies:
"@webassemblyjs/ast" "1.8.5" "@webassemblyjs/ast" "1.8.5"
"@webassemblyjs/helper-module-context" "1.8.5" "@webassemblyjs/helper-module-context" "1.8.5"
@@ -5234,13 +5182,6 @@ ws@^7.2.0:
resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.1.tgz#03ed52423cd744084b2cf42ed197c8b65a936b8e" resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.1.tgz#03ed52423cd744084b2cf42ed197c8b65a936b8e"
integrity sha512-sucePNSafamSKoOqoNfBd8V0StlkzJKL2ZAhGQinCfNQ+oacw+Pk7lcdAElecBF2VkLNZRiIb5Oi1Q5lVUVt2A== integrity sha512-sucePNSafamSKoOqoNfBd8V0StlkzJKL2ZAhGQinCfNQ+oacw+Pk7lcdAElecBF2VkLNZRiIb5Oi1Q5lVUVt2A==
x-address-codec@^0.7.0:
version "0.7.2"
resolved "https://registry.yarnpkg.com/x-address-codec/-/x-address-codec-0.7.2.tgz#2a2f7bb00278520bd13733a7959a05443d6802e0"
integrity sha1-Ki97sAJ4UgvRNzOnlZoFRD1oAuA=
dependencies:
base-x "^1.0.1"
x-is-string@^0.1.0: x-is-string@^0.1.0:
version "0.1.0" version "0.1.0"
resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82"
@@ -5341,7 +5282,7 @@ yargs@^15.0.2:
y18n "^4.0.0" y18n "^4.0.0"
yargs-parser "^16.1.0" yargs-parser "^16.1.0"
yn@^3.0.0: yn@3.1.1:
version "3.1.1" version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==