Compare commits

...

38 Commits
1.2.0 ... 1.3.2

Author SHA1 Message Date
Elliot Lee
ebb64ba177 v1.3.2 2019-09-03 16:43:31 -07:00
Elliot Lee
1a685e2b68 Fix #1032 (#1033)
* Update ripple-address-codec@latest

* Export and document rippleTimeToISO8601
2019-09-03 16:38:56 -07:00
Rome Reginelli
9c561885a1 Docs: update recommended Node ver. (#1031) 2019-08-29 20:34:25 -07:00
Elliot Lee
612e98b198 Release 1.3.1 2019-08-26 13:58:09 -07:00
Elliot Lee
0a41d5ccf1 Upgrade to gulp 4; remove http server (#1030)
* Update gulp version to ^4.0.2 and Gulpfile.js

* Remove http server
2019-08-26 13:50:36 -07:00
Elliot Lee
ba8fe1f32c Update HISTORY - rippled 1.3.1 2019-08-16 21:28:32 -07:00
Elliot Lee
0f840876a5 Update HISTORY 2019-08-16 21:11:02 -07:00
Elliot Lee
ac3900b6f4 Release 1.2.5 and 1.3.0 2019-08-16 21:09:08 -07:00
Elliot Lee
5e138b9937 Sign method - verify accurate encoding (#1026)
* Decode signed transactions and check field integrity

* Add tests (including signing a tx without Flags)

* Update tests to output more descriptive errors on failure

* Update ripple-binary-codec to 0.2.2
2019-08-16 16:22:25 -07:00
Elliot Lee
82d50cd903 Document setCanonicalFlag and export from src/transaction/utils 2019-08-09 10:16:33 -07:00
Elliot Lee
c5b1d4daac Update lodash to ^4.14.136, fix docs typo, update HISTORY.md 2019-08-07 12:20:56 -07:00
Namrata
b4a30d49d8 Support removing a signer list (#1021)
* Make weights an optional field
* Fix #971
2019-07-30 16:48:30 -07:00
Elliot Lee
229360d1b9 README - Update link 2019-07-18 21:50:58 -07:00
Rome Reginelli
d627d362af Merge pull request #1023 from mDuo13/doc_cleanup
Phrasing cleanup in schema descriptions
2019-07-16 15:11:01 -07:00
mDuo13
7ca7a07942 Phrasing cleanup in schema descriptions
- Change 'Ripple address'→'XRP Ledger address'
- Change 'is exclusive with'→'cannot be used with'
2019-07-15 14:26:43 -07:00
dependabot[bot]
09f81fa3cd Bump lodash from 4.17.11 to 4.17.13
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.13.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.13)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-13 13:26:48 -07:00
The XRP Scan Project
b03bf9c7f1 Updated APPLICATIONS.md and added xrpscan
Added xrpscan.com under Data and Visualization section.
2019-06-24 02:03:21 -07:00
Elliot Lee
4d696369fe APIOptions: extend ConnectionOptions (#1018)
Fix #1017
2019-06-21 01:45:47 -07:00
Elliot Lee
bcb80ea5f5 Fix getServerInfo (#1012)
* Return array for serverInfo.load.jobTypes

* Include start/end in invalid range assertion error
2019-06-14 14:57:36 -07:00
Elliot Lee
1be2ee5875 Docs: fix #574 (#1011)
destination.address
2019-06-14 14:57:14 -07:00
Elliot Lee
3554e807df Release 1.2.4 2019-06-06 16:01:24 -07:00
Elliot Lee
5ffbd6e86d Update dependencies (#1007)
* Update dependencies: @types/lodash@4.14.133, mocha-junit-reporter@1.22.0, tslint@5.17.0, nyc

Fix type errors
2019-06-06 15:56:29 -07:00
Elliot Lee
e2572c61cf Add details about transaction fees, master keys, and multi-signing 2019-06-05 00:27:25 -07:00
Elliot Lee
7df2b74d43 Update get-server-info.json 2019-05-27 14:37:38 -07:00
Elliot Lee
f51a69f080 Fix typo 2019-05-22 10:04:43 -07:00
Elliot Lee
c0a2d9fc2b Update README.md 2019-05-16 22:51:22 -07:00
Elliot Lee
51dad19f88 Release 1.2.3 2019-04-30 15:01:54 -07:00
Elliot Lee
3d1a530796 Fix browser builds (#1006)
tsconfig:
- Must set composite: false
- Must set declarationMap: false in order to use declaration: false

json-loader:
- Not needed with webpack >= v2.0.0 and in fact does not work

https-proxy-agent cannot be used in the browser
2019-04-29 23:19:05 -07:00
Elliot Lee
f6a22d2121 No working browser version for 1.2.2
Using `"noEmitOnError": true` in `tsconfig.json` prevents the browser build from being created
2019-04-18 00:53:28 -07:00
Elliot Lee
6f2d448059 Release 1.2.2 2019-04-15 12:30:20 -07:00
Elliot Lee
0d5103a3f3 Use TypeScript project reference (#1002)
* Add *.tsbuildinfo to .gitignore

* Bump versions of dependencies, nyc and yargs

* Drop support for node 9 (EOL 2018-06-30)

https://github.com/nodejs/Release

* Add getTransaction snippet
2019-04-15 11:06:31 -07:00
Elliot Lee
4da80028bf Prevent prepareTransaction from overwriting values in txJSON (#1000)
Fix #997
2019-04-13 11:33:16 -07:00
Daniel Chan
bb40dbde9d Add deliveredAmount as optional field for type Outcome (#996) 2019-04-11 17:13:42 -07:00
Elliot Lee
50fc36ec3e Add "strict": true to tsconfig.json (#994)
- Remove process.browser
2019-04-11 15:48:23 -07:00
Elliot Lee
1abcef73a0 Merge pull request #993 from adrianhopebailie/patch-1
fix: build fails with strict checks
2019-04-08 13:04:27 -07:00
Adrian Hope-Bailie
0d7879b25c fix: build fails with strict checks 2019-03-29 11:48:13 +02:00
Elliot Lee
8278dc5b5b Release 1.2.1 2019-03-23 15:50:26 -07:00
Elliot Lee
c90d486454 Update ripple-binary-codec to 0.2.1 to support tecKILLED 2019-03-23 15:12:22 -07:00
87 changed files with 4773 additions and 2914 deletions

3
.gitignore vendored
View File

@@ -58,6 +58,9 @@ npm-debug.log
# Ignore dist folder, built from tsc
dist/
# TypeScript incremental compilation cache
*.tsbuildinfo
# Ignore perf test cache
scripts/cache

View File

@@ -2,8 +2,8 @@ language: node_js
node_js:
- 6
- 8
- 9
- 10
- 11
script:
- yarn compile
- yarn test

View File

@@ -36,6 +36,10 @@ Warning: Use at your own risk.
List of XRPL validators, nodes, and testnet validators.
- **[XRP Scan - XRP Ledger explorer](https://http://xrpscan.com)**
XRP Ledger explorer, metrics and analytics.
## Send and request payments
- **[XRP Tip Bot](https://www.xrptipbot.com/)**

View File

@@ -6,15 +6,12 @@ const fs = require('fs');
const path = require('path');
const assert = require('assert');
const gulp = require('gulp');
const rename = require('gulp-rename');
const webpack = require('webpack');
const bump = require('gulp-bump');
const argv = require('yargs').argv;
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
var pkg = require('./package.json');
const pkg = require('./package.json');
var uglifyOptions = {
const uglifyOptions = {
mangle: {
reserved: ['_', 'RippleError', 'RippledError', 'UnexpectedError',
'LedgerVersionError', 'ConnectionError', 'NotConnectedError',
@@ -36,7 +33,7 @@ function getWebpackConfig(extension, overrides) {
output: {
library: 'ripple',
path: path.join(__dirname, 'build/'),
filename: ['ripple-', extension].join(pkg.version)
filename: `ripple-${pkg.version}${extension}`
},
plugins: [
new webpack.NormalModuleReplacementPlugin(/^ws$/, './wswrapper'),
@@ -53,12 +50,13 @@ function getWebpackConfig(extension, overrides) {
use: [{
loader: 'ts-loader',
options: {
compilerOptions: {declaration: false}
compilerOptions: {
composite: false,
declaration: false,
declarationMap: false
}
},
}],
}, {
test: /\.json/,
use: 'json-loader',
}]
},
resolve: {
@@ -68,7 +66,7 @@ function getWebpackConfig(extension, overrides) {
return _.assign({}, defaults, overrides);
}
function webpackConfigForWebTest(testFileName, path) {
function webpackConfigForWebTest(testFileName) {
var match = testFileName.match(/\/?([^\/]*)-test.js$/);
if (!match) {
assert(false, 'wrong filename:' + testFileName);
@@ -82,28 +80,13 @@ function webpackConfigForWebTest(testFileName, path) {
entry: testFileName,
output: {
library: match[1].replace(/-/g, '_'),
path: './test-compiled-for-web/' + (path ? path : ''),
path: path.join(__dirname, 'test-compiled-for-web/'),
filename: match[1] + '-test.js'
}
};
return getWebpackConfig('.js', configOverrides);
}
gulp.task('build-tests', function(callback) {
var times = 0;
function done() {
if (++times >= 5) {
callback();
}
}
webpack(webpackConfigForWebTest('./test/rangeset-test.js'), done);
webpack(webpackConfigForWebTest('./test/connection-test.js'), done);
webpack(webpackConfigForWebTest('./test/api-test.js'), done);
webpack(webpackConfigForWebTest('./test/broadcast-api-test.js'), done);
webpack(webpackConfigForWebTest('./test/integration/integration-test.js',
'integration/'), done);
});
function createLink(from, to) {
if (fs.existsSync(to)) {
fs.unlinkSync(to);
@@ -119,11 +102,22 @@ function createBuildLink(callback) {
};
}
gulp.task('build', function(callback) {
webpack(getWebpackConfig('.js'), createBuildLink(callback));
});
function watch(callback) {
gulp.watch('src/*', gulp.series(buildDebug));
callback();
}
gulp.task('build-min', function(callback) {
function build(callback) {
webpack(getWebpackConfig('.js'), createBuildLink(callback));
}
function buildDebug(callback) {
const webpackConfig = getWebpackConfig('-debug.js', {devtool: 'eval'});
webpackConfig.plugins.unshift(new webpack.LoaderOptionsPlugin({debug: true}));
webpack(webpackConfig, callback);
}
function buildMin(callback) {
const webpackConfig = getWebpackConfig('-min.js');
webpackConfig.plugins.push(new UglifyJsPlugin({uglifyOptions}));
webpack(webpackConfig, function() {
@@ -131,86 +125,27 @@ gulp.task('build-min', function(callback) {
'./build/ripple-latest-min.js');
callback();
});
});
gulp.task('build-debug', function(callback) {
const webpackConfig = getWebpackConfig('-debug.js', {devtool: 'eval'});
webpackConfig.plugins.unshift(new webpack.LoaderOptionsPlugin({debug: true}));
webpack(webpackConfig, callback);
});
/**
* Generate a WebPack external for a given unavailable module which replaces
* that module's constructor with an error-thrower
*/
function buildUseError(cons) {
return ('var {<CONS>:function(){throw new Error('
+ '"Class is unavailable in this build: <CONS>")}}')
.replace(new RegExp('<CONS>', 'g'), cons);
}
gulp.task('build-core', function(callback) {
var configOverrides = {
cache: false,
entry: './src/remote.ts',
externals: [{
'./transaction': buildUseError('Transaction'),
'./orderbook': buildUseError('OrderBook'),
'./account': buildUseError('Account'),
'./serializedobject': buildUseError('SerializedObject')
}],
plugins: [
new UglifyJsPlugin()
]
};
webpack(getWebpackConfig('-core.js', configOverrides), callback);
});
gulp.task('bower-build', ['build'], function() {
return gulp.src(['./build/ripple-', '.js'].join(pkg.version))
.pipe(rename('ripple.js'))
.pipe(gulp.dest('./dist/bower'));
});
gulp.task('bower-build-min', ['build-min'], function() {
return gulp.src(['./build/ripple-', '-min.js'].join(pkg.version))
.pipe(rename('ripple-min.js'))
.pipe(gulp.dest('./dist/bower'));
});
gulp.task('bower-build-debug', ['build-debug'], function() {
return gulp.src(['./build/ripple-', '-debug.js'].join(pkg.version))
.pipe(rename('ripple-debug.js'))
.pipe(gulp.dest('./dist/bower'));
});
gulp.task('bower-version', function() {
gulp.src('./dist/bower/bower.json')
.pipe(bump({version: pkg.version}))
.pipe(gulp.dest('./dist/bower'));
});
gulp.task('bower', ['bower-build', 'bower-build-min', 'bower-build-debug',
'bower-version']);
gulp.task('watch', function() {
gulp.watch('src/*', ['build-debug']);
});
gulp.task('version-bump', function() {
if (!argv.type) {
throw new Error('No type found, pass it in using the --type argument');
function buildTests(callback) {
var times = 0;
function done() {
if (++times >= 5) {
callback();
}
}
webpack(webpackConfigForWebTest('./test/rangeset-test.js'), done);
webpack(webpackConfigForWebTest('./test/connection-test.js'), done);
webpack(webpackConfigForWebTest('./test/api-test.js'), done);
webpack(webpackConfigForWebTest('./test/broadcast-api-test.js'), done);
webpack(webpackConfigForWebTest('./test/integration/integration-test.js',
'integration/'), done);
}
gulp.src('./package.json')
.pipe(bump({type: argv.type}))
.pipe(gulp.dest('./'));
});
exports.watch = watch;
exports.build = build;
exports.buildDebug = buildDebug;
exports.buildMin = buildMin;
exports.buildTests = buildTests;
gulp.task('version-beta', function() {
gulp.src('./package.json')
.pipe(bump({version: pkg.version + '-beta'}))
.pipe(gulp.dest('./'));
});
gulp.task('default', ['build', 'build-debug', 'build-min']);
exports.default = gulp.parallel(build, buildDebug, buildMin);

View File

@@ -1,5 +1,160 @@
# ripple-lib Release History
## 1.3.2 (2019-09-03)
* Export and document `rippleTimeToISO8601()` method
* Add type for isValidAddress (fixes error TS7016, #1032)
* Docs: update recommended Node.js version (#1031)
When using this release with [rippled](https://github.com/ripple/rippled), we recommend using [rippled version 1.3.1](https://github.com/ripple/rippled/releases/tag/1.3.1) or later.
## 1.3.1 (2019-08-26)
* Upgrade to gulp 4 (#1030)
* Remove http server (unused)
* Update dependencies
There are no changes in the browser version with this release. The npm package for Node.js should be slightly smaller.
When using this release with [rippled](https://github.com/ripple/rippled), we recommend using [rippled version 1.3.1](https://github.com/ripple/rippled/releases/tag/1.3.1).
## 1.3.0 (2019-08-16)
### Bug fixes:
* Breaking change: Fix `getServerInfo` (#1012)
Before:
```
{
// ...
"load": {
"jobTypes": {
"0": {"jobType": "untrustedValidation", "perSecond": 10},
"1": {"jobType": "ledgerData", "peakTime": 2, "perSecond": 2},
"2": {"inProgress": 1, "jobType": "clientCommand", "perSecond": 1},
"3": {"jobType": "transaction", "perSecond": 1},
// ...
},
"threads": 6
},
// ...
}
```
After:
```
{
// ...
"load": {
"jobTypes": [
{
"jobType": "untrustedValidation",
"perSecond": 8
},
{
"avgTime": 2,
"jobType": "ledgerData",
"peakTime": 72,
"perSecond": 2
},
{
"inProgress": 1,
"jobType": "clientCommand",
"perSecond": 1
},
{
"jobType": "transaction",
"perSecond": 1
},
// ...
],
"threads": 6
},
// ...
}
```
* Sign method - verify accurate encoding (#1026)
* In previous versions, the following could be encoded incorrectly:
* Amounts of XRP with more than 6 decimal places
* Amounts of XRP drops with any decimal places
* In versions 1.2.5 and 1.3.0, amounts that are invalid in this way will throw an error
* Expand `APIOptions` by extending `ConnectionOptions` (#1018, fixes #1017)
* Fix docs for destination.address (#1011)
### New features:
* Support removing a signer list (#1021)
* Export `setCanonicalFlag` method from `src/transaction/utils`
### Improvements:
* Clean up phrasing in schema descriptions (#1023)
* Improve docs
* Update dependencies
Since this release fixes a bug that could cause transactions to be serialized incorrectly during the signing process, it has also been simultaneously released as version 1.2.5 (patch release).
When using this release with [rippled](https://github.com/ripple/rippled), we recommend using [rippled version 1.3.1](https://github.com/ripple/rippled/releases/tag/1.3.1).
## 1.2.4 (2019-06-06)
* Update README.md
* Clarify docs
* Update dependencies
* Fix typos
The SHA-256 checksums for the browser version of this release can be found
below.
```
% shasum -a 256 *
4f09c056ccc51bc6cf17b128b559112e9c5adf19cc96ac8f9a06faee185697a7 ripple-1.2.4-debug.js
5da1c75a02d76b0b105d98355ee4561f5d5036e8d5d0237efd5960812dcaa1fd ripple-1.2.4-min.js
e147f303e880a65db149d2a5b9183b75814bd8145cd00740bcc4679d867192c8 ripple-1.2.4.js
```
## 1.2.3 (2019-04-30)
* Fix browser builds
The SHA-256 checksums for the browser version of this release can be found
below.
```
% shasum -a 256 *
efb0f29cde94534a015d8a2171abb11b9a4345ba01418bf5b6ab6042a6d51dde ripple-1.2.3-debug.js
b86145c0e30099b966ed8d3830ba25988d72877f1f87044d9954d6707be098ac ripple-1.2.3-min.js
e027d91c7321d41ba94bb1bdc77dcff0107a5fd9eb833c6dbd06f1bbedef3900 ripple-1.2.3.js
```
## 1.2.2 (2019-04-15)
* Prevent `prepareTransaction` from overwriting `Fee` and/or `LastLedgerSequence` (#997)
* Add `deliveredAmount` as optional field for type `Outcome` (#996)
* Fix build failure with TS strict checks (#993)
Minor changes:
* Use TypeScript project references
* Travis: Drop node 9 and add node 11 for testing
* Bump versions of devDependencies
Note: There is no browser version of this release.
## 1.2.1 (2019-03-23)
* Update `ripple-binary-codec` to 0.2.1 to support `tecKILLED`
The SHA-256 checksums for the browser version of this release can be found
below.
```
% shasum -a 256 *
531c2a8f4bf6d6b5bd4afe6a40b6a68a77179a343902cfa4210d7e35b5697af0 ripple-1.2.1-debug.js
201ee99922b16b7e32afb5317ef4bb9facc23b20c272bb5c4ed7010f5d996cab ripple-1.2.1-min.js
c1b984581299bf00e0e3c8ac4e62eadfc9b190bd78a2458a76e59ceb56046148 ripple-1.2.1.js
```
## 1.2.0 (2019-03-19)
This release:

View File

@@ -14,7 +14,7 @@ A JavaScript API for interacting with the XRP Ledger
## Getting Started
See also: [RippleAPI Beginners Guide](https://ripple.com/build/rippleapi-beginners-guide/)
See also: [RippleAPI Beginners Guide](https://xrpl.org/get-started-with-rippleapi-for-javascript.html)
### Requirements
@@ -74,4 +74,5 @@ The continuous integration tests require that the documentation stays up-to-date
## More Information
+ [Ripple Developer Center](https://ripple.com/build/)
+ [RippleAPI Reference](https://developers.ripple.com/rippleapi-reference.html) - XRP Ledger Dev Portal
+ [XRP Ledger Dev Portal](https://developers.ripple.com/)

View File

@@ -1,9 +0,0 @@
/**
* This is an extension of Node's `process` object to include the browser
* property, which is added by webpack.
*/
interface AmbiguousProcess extends NodeJS.Process {
browser?: true
}
declare var process: AmbiguousProcess;

View File

@@ -91,6 +91,7 @@
- [xrpToDrops](#xrptodrops)
- [dropsToXrp](#dropstoxrp)
- [iso8601ToRippleTime](#iso8601torippletime)
- [rippleTimeToISO8601](#rippletimetoiso8601)
- [txFlags](#txflags)
- [schemaValidator](#schemavalidator)
- [schemaValidate](#schemavalidate)
@@ -141,7 +142,7 @@ api.connect().then(() => {
}).catch(console.error);
```
RippleAPI is designed to work in [Node.js](https://nodejs.org) version **6.11.3**. RippleAPI may work on older Node.js versions if you use [Babel](https://babeljs.io/) for [ECMAScript 6](https://babeljs.io/docs/learn-es2015/) support.
RippleAPI is designed to work in [Node.js](https://nodejs.org) version 6 or higher. Ripple recommends Node.js v10 LTS.
The code samples in this documentation are written with ECMAScript 6 (ES6) features, but `RippleAPI` also works with ECMAScript 5 (ES5). Regardless of whether you use ES5 or ES6, the methods that return Promises return [ES6-style promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
@@ -273,7 +274,7 @@ A *balance* is an amount than can have a negative value.
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.
counterparty | [address](#address) | *Optional* The Ripple 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
# Transaction Overview
@@ -321,20 +322,22 @@ Executing a transaction with `RippleAPI` requires the following four steps:
## Transaction Fees
Every transaction must destroy a small amount of XRP as a cost to send the transaction. This is also called a *transaction fee*. The transaction cost is designed to increase along with the load on the XRP Ledger, making it very expensive to deliberately or inadvertently overload the peer-to-peer network that powers the XRP Ledger.
Every transaction must destroy a small amount of XRP as a cost to apply the transaction to the ledger. This is also called a *transaction fee*. The transaction cost is designed to increase along with the load on the XRP Ledger, making it very expensive to deliberately or inadvertently overload the peer-to-peer network that powers the XRP Ledger.
You can choose the size of the fee you want to pay or let a default be used. You can get an estimate of the fee required to be included in the next ledger closing with the [getFee](#getfee) method.
For a multi-signed transaction, ripple-lib automatically multiplies the `fee` by (1 + Number of Signatures Provided). For example, if you set `instructions.fee = '0.000020'` and `instructions.signersCount = 2`, the prepared transaction's `Fee` will be 20 drops × (1 + 2 Signatures) = 60 drops. See [Transaction Cost](https://developers.ripple.com/transaction-cost.html).
## Transaction Instructions
Transaction instructions indicate how to execute a transaction, complementary with the [transaction specification](#transaction-specifications).
Name | Type | Description
---- | ---- | -----------
fee | [value](#value) | *Optional* An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
fee | [value](#value) | *Optional* An exact fee to pay for the transaction, before multiplying for multi-signed transactions. See [Transaction Fees](#transaction-fees) for more information.
maxFee | [value](#value) | *Optional* Deprecated: Use `maxFeeXRP` in the RippleAPI constructor instead. The maximum fee to pay for this transaction. If this exceeds `maxFeeXRP`, `maxFeeXRP` will be used instead. See [Transaction Fees](#transaction-fees) for more information.
maxLedgerVersion | integer,null | *Optional* The highest ledger version that the transaction can be included in. If this option and `maxLedgerVersionOffset` are both omitted, the `maxLedgerVersion` option will default to 3 greater than the current validated ledger version (equivalent to `maxLedgerVersionOffset=3`). Use `null` to not set a maximum ledger version.
maxLedgerVersion | string,null | *Optional* The highest ledger version that the transaction can be included in. If this option and `maxLedgerVersionOffset` are both omitted, the `maxLedgerVersion` option will default to 3 greater than the current validated ledger version (equivalent to `maxLedgerVersionOffset=3`). Use `null` to not set a maximum ledger version.
maxLedgerVersion | integer,null | *Optional* The highest ledger version that the transaction can be included in. If this option and `maxLedgerVersionOffset` are both omitted, the `maxLedgerVersion` option will default to 3 greater than the current validated ledger version (equivalent to `maxLedgerVersionOffset=3`). Use `null` to not set a maximum ledger version. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
maxLedgerVersion | string,null | *Optional* The highest ledger version that the transaction can be included in. If this option and `maxLedgerVersionOffset` are both omitted, the `maxLedgerVersion` option will default to 3 greater than the current validated ledger version (equivalent to `maxLedgerVersionOffset=3`). Use `null` to not set a maximum ledger version. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
maxLedgerVersionOffset | integer | *Optional* Offset from current validated ledger version to highest ledger version that the transaction can be included in.
sequence | [sequence](#account-sequence-number) | *Optional* The initiating account's sequence number for this transaction.
signersCount | integer | *Optional* Number of signers that will be signing this transaction.
@@ -373,15 +376,14 @@ Name | Type | Description
---- | ---- | -----------
source | object | The source of the funds to be sent.
*source.* address | [address](#address) | The address to send from.
*source.* amount | [laxAmount](#amount) | An exact amount to send. If the counterparty is not specified, amounts with any counterparty may be used. (This field is exclusive with source.maxAmount)
*source.* amount | [laxAmount](#amount) | An exact amount to send. If the counterparty is not specified, amounts with any counterparty may be used. (This field cannot be used with source.maxAmount)
*source.* tag | integer | *Optional* An arbitrary unsigned 32-bit integer that identifies a reason for payment or a non-Ripple account.
*source.* maxAmount | [laxAmount](#amount) | The maximum amount to send. (This field is exclusive with source.amount)
*source.* maxAmount | [laxAmount](#amount) | The maximum amount to send. (This field cannot be used with source.amount)
destination | object | The destination of the funds to be sent.
*destination.* address | [address](#address) | The address to receive at.
*destination.* address | [address](#address) | An address representing the destination of the transaction.
*destination.* amount | [laxAmount](#amount) | An exact amount to deliver to the recipient. If the counterparty is not specified, amounts with any counterparty may be used. (This field cannot be used with `destination.minAmount`.)
*destination.* tag | integer | *Optional* An arbitrary unsigned 32-bit integer that identifies a reason for payment or a non-Ripple account.
*destination.* address | [address](#address) | The address to send to.
*destination.* minAmount | [laxAmount](#amount) | The minimum amount to be delivered. (This field is exclusive with destination.amount)
*destination.* minAmount | [laxAmount](#amount) | The minimum amount to be delivered. (This field cannot be used with destination.amount)
allowPartialPayment | boolean | *Optional* If true, this payment should proceed even if the whole amount cannot be delivered due to a lack of liquidity or a lack of funds in the source account.
invoiceID | string | *Optional* A 256-bit hash that can be used to identify a particular payment.
limitQuality | boolean | *Optional* Only take paths where all the conversions have an input:output ratio that is equal or better than the ratio of destination.amount:source.maxAmount.
@@ -519,7 +521,7 @@ Name | Type | Description
---- | ---- | -----------
defaultRipple | boolean | *Optional* Enable [rippling](https://ripple.com/build/understanding-the-noripple-flag/) on this accounts trust lines by default. (New in [rippled 0.27.3](https://github.com/ripple/rippled/releases/tag/0.27.3))
depositAuth | boolean | *Optional* Enable [Deposit Authorization](https://ripple.com/build/deposit-authorization/) on this account. If set, transactions cannot send value of any kind to this account unless the sender of those transactions is the account itself. (Requires the [DepositAuth amendment](https://ripple.com/build/known-amendments/#depositauth))
disableMasterKey | boolean | *Optional* Disallows use of the master key to sign transactions for this account.
disableMasterKey | boolean | *Optional* Disallows use of the master key to sign transactions for this account. To disable the master key, you must authorize the transaction by signing it with the master key pair. You cannot use a regular key pair or a multi-signature. You can re-enable the master key pair using a regular key pair or multi-signature. See [AccountSet](https://developers.ripple.com/accountset.html).
disallowIncomingXRP | boolean | *Optional* Indicates that client applications should not send XRP to this account. Not enforced by rippled.
domain | string | *Optional* The domain that owns this account, as a hexadecimal string representing the ASCII for the domain in lowercase.
emailHash | string,null | *Optional* Hash of an email address to be used for generating an avatar image. Conventionally, clients use Gravatar to display this image. Use `null` to clear.
@@ -534,7 +536,7 @@ requireAuthorization | boolean | *Optional* If set, this account must individual
requireDestinationTag | boolean | *Optional* Requires incoming payments to specify a destination tag.
signers | object | *Optional* Settings that determine what sets of accounts can be used to sign a transaction on behalf of this account using multisigning.
*signers.* threshold | integer | A target number for the signer weights. A multi-signature from this list is valid only if the sum weights of the signatures provided is equal or greater than this value. To delete the signers setting, use the value `0`.
*signers.* weights | array | Weights of signatures for each signer.
*signers.* weights | array | *Optional* Weights of signatures for each signer.
*signers.* weights[] | object | An association of an address and a weight.
*signers.weights[].* address | [address](#address) | A Ripple account address
*signers.weights[].* weight | integer | The weight that the signature of this account counts as towards the threshold.
@@ -1361,7 +1363,7 @@ lastClose | object | Information about the last time the server closed a ledger.
loadFactor | number | The load factor the server is currently enforcing, as a multiplier on the base transaction fee. The load factor is determined by the highest of the individual servers load factor, clusters load factor, and the overall networks load factor.
peers | integer | How many other rippled servers the node is currently connected to.
pubkeyNode | string | Public key used to verify this node for internal communications; this key is automatically generated by the server the first time it starts up. (If deleted, the node can just create a new pair of keys.)
serverState | string | A string indicating to what extent the server is participating in the network. See [Possible Server States](https://ripple.com/build/rippled-apis/#possible-server-states) for more details.
serverState | string | A string indicating to what extent the server is participating in the network. See [Possible Server States](https://developers.ripple.com/rippled-server-states.html) for more details.
validatedLedger | object | Information about the fully-validated ledger with the highest sequence number (the most recent).
*validatedLedger.* age | integer | The time since the ledger was closed, in seconds.
*validatedLedger.* baseFeeXRP | [value](#value) | Base fee, in XRP. This may be represented in scientific notation such as 1e-05 for 0.00005.
@@ -1372,7 +1374,7 @@ validatedLedger | object | Information about the fully-validated ledger with the
validationQuorum | number | Minimum number of trusted validations required in order to validate a ledger version. Some circumstances may cause the server to require more validations.
load | object | *Optional* *(Admin only)* Detailed information about the current load state of the server.
*load.* jobTypes | array\<object\> | *(Admin only)* Information about the rate of different types of jobs being performed by the server and how much time it spends on each.
*load.* threads | number | *(Admin only)* The number of threads in the servers main job pool, performing various Ripple Network operations.
*load.* threads | number | *(Admin only)* The number of threads in the servers main job pool, performing various operations.
pubkeyValidator | string | *Optional* *(Admin only)* Public key used by this node to sign ledger validations.
### Example
@@ -1476,11 +1478,11 @@ Name | Type | Description
---- | ---- | -----------
id | [transactionHash](#transaction-id) | A hash of a transaction used to identify the transaction, represented in hexadecimal.
options | object | *Optional* Options to limit the ledger versions to search and/or to include raw transaction data.
*options.* includeRawTransaction | object | *Optional* Include raw transaction data. For advanced users; exercise caution when interpreting this data.
*options.* maxLedgerVersion | integer | *Optional* The highest ledger version to search
*options.* maxLedgerVersion | string | *Optional* The highest ledger version to search
*options.* minLedgerVersion | integer | *Optional* The lowest ledger version to search.
*options.* minLedgerVersion | string | *Optional* The lowest ledger version to search.
*options.* includeRawTransaction | object | *Optional* Include raw transaction data. For advanced users; exercise caution when interpreting this data.
*options.* maxLedgerVersion | integer | *Optional* The highest ledger version to search. This must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*options.* maxLedgerVersion | string | *Optional* The highest ledger version to search. This must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*options.* minLedgerVersion | integer | *Optional* The lowest ledger version to search. This must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*options.* minLedgerVersion | string | *Optional* The lowest ledger version to search. This must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Return Value
@@ -1637,8 +1639,8 @@ options | object | *Optional* Options to filter the resulting transactions.
*options.* limit | integer | *Optional* If specified, return at most this many transactions.
*options.* maxLedgerVersion | integer | *Optional* Return only transactions in this ledger version or lower.
*options.* maxLedgerVersion | string | *Optional* Return only transactions in this ledger version or lower.
*options.* minLedgerVersion | integer | *Optional* Return only transactions in this ledger verion or higher.
*options.* minLedgerVersion | string | *Optional* Return only transactions in this ledger verion or higher.
*options.* minLedgerVersion | integer | *Optional* Return only transactions in this ledger version or higher.
*options.* minLedgerVersion | string | *Optional* Return only transactions in this ledger version or higher.
*options.* start | string | *Optional* If specified, this transaction will be the first transaction in the result. You cannot use `start` with `minLedgerVersion` or `maxLedgerVersion`. When `start` is specified, these ledger versions will be determined internally.
*options.* types | array\<[transactionType](#transaction-types)\> | *Optional* Only return transactions of the specified [Transaction Types](#transaction-types).
@@ -2019,7 +2021,7 @@ Name | Type | Description
---- | ---- | -----------
currency | [currency](#currency) | The three-character code or hexadecimal string used to denote currencies
value | [signedValue](#value) | The balance on the trustline
counterparty | [address](#address) | *Optional* The Ripple address of the account that owes or is owed the funds.
counterparty | [address](#address) | *Optional* The XRP Ledger address of the account that owes or is owed the funds.
### Example
@@ -2170,7 +2172,7 @@ Returns aggregate balances by currency plus a breakdown of assets and obligation
Name | Type | Description
---- | ---- | -----------
address | [address](#address) | The Ripple address of the account to get the balance sheet of.
address | [address](#address) | The XRP Ledger address of the account to get the balance sheet of.
options | object | *Optional* Options to determine how the balances will be calculated.
*options.* excludeAddresses | array\<[address](#address)\> | *Optional* Addresses to exclude from the balance totals.
*options.* ledgerVersion | integer | *Optional* Get the balance sheet as of this historical ledger version.
@@ -2268,14 +2270,14 @@ Name | Type | Description
---- | ---- | -----------
pathfind | object | Specification of a pathfind request.
*pathfind.* source | object | Properties of the source of funds.
*pathfind.source.* address | [address](#address) | The Ripple address of the account where funds will come from.
*pathfind.source.* address | [address](#address) | The XRP Ledger address of the account where funds will come from.
*pathfind.source.* amount | [laxAmount](#amount) | *Optional* The amount of funds to send.
*pathfind.source.* currencies | array | *Optional* An array of currencies (with optional counterparty) that may be used in the payment paths.
*pathfind.source.* currencies[] | object | A currency with optional counterparty.
*pathfind.source.currencies[].* currency | [currency](#currency) | The three-character code or hexadecimal string used to denote currencies
*pathfind.source.currencies[].* counterparty | [address](#address) | *Optional* The counterparty for the currency; if omitted any counterparty may be used.
*pathfind.* destination | object | Properties of the destination of funds.
*pathfind.destination.* address | [address](#address) | The address to send to.
*pathfind.destination.* address | [address](#address) | An address representing the destination of the transaction.
*pathfind.destination.* amount | [laxLaxAmount](#amount) | The amount to be received by the receiver (`value` may be ommitted if a source amount is specified).
### Return Value
@@ -2286,15 +2288,14 @@ Name | Type | Description
---- | ---- | -----------
source | object | Properties of the source of the payment.
*source.* address | [address](#address) | The address to send from.
*source.* amount | [laxAmount](#amount) | An exact amount to send. If the counterparty is not specified, amounts with any counterparty may be used. (This field is exclusive with source.maxAmount)
*source.* amount | [laxAmount](#amount) | An exact amount to send. If the counterparty is not specified, amounts with any counterparty may be used. (This field cannot be used with source.maxAmount)
*source.* tag | integer | *Optional* An arbitrary unsigned 32-bit integer that identifies a reason for payment or a non-Ripple account.
*source.* maxAmount | [laxAmount](#amount) | The maximum amount to send. (This field is exclusive with source.amount)
*source.* maxAmount | [laxAmount](#amount) | The maximum amount to send. (This field cannot be used with source.amount)
destination | object | Properties of the destination of the payment.
*destination.* address | [address](#address) | The address to receive at.
*destination.* address | [address](#address) | An address representing the destination of the transaction.
*destination.* amount | [laxAmount](#amount) | An exact amount to deliver to the recipient. If the counterparty is not specified, amounts with any counterparty may be used. (This field cannot be used with `destination.minAmount`.)
*destination.* tag | integer | *Optional* An arbitrary unsigned 32-bit integer that identifies a reason for payment or a non-Ripple account.
*destination.* address | [address](#address) | The address to send to.
*destination.* minAmount | [laxAmount](#amount) | The minimum amount to be delivered. (This field is exclusive with destination.amount)
*destination.* minAmount | [laxAmount](#amount) | The minimum amount to be delivered. (This field cannot be used with destination.amount)
paths | string | The paths of trustlines and orders to use in executing the payment.
### Example
@@ -2388,7 +2389,7 @@ Returns open orders for the specified account. Open orders are orders that have
Name | Type | Description
---- | ---- | -----------
address | [address](#address) | The Ripple address of the account to get open orders for.
address | [address](#address) | The XRP Ledger address of the account to get open orders for.
options | object | *Optional* Options that determine what orders will be returned.
*options.* ledgerVersion | integer | *Optional* Return orders as of this historical ledger version.
*options.* ledgerVersion | string | *Optional* Return orders as of this historical ledger version.
@@ -3888,7 +3889,7 @@ Name | Type | Description
---- | ---- | -----------
defaultRipple | boolean | *Optional* Enable [rippling](https://ripple.com/build/understanding-the-noripple-flag/) on this accounts trust lines by default. (New in [rippled 0.27.3](https://github.com/ripple/rippled/releases/tag/0.27.3))
depositAuth | boolean | *Optional* Enable [Deposit Authorization](https://ripple.com/build/deposit-authorization/) on this account. If set, transactions cannot send value of any kind to this account unless the sender of those transactions is the account itself. (Requires the [DepositAuth amendment](https://ripple.com/build/known-amendments/#depositauth))
disableMasterKey | boolean | *Optional* Disallows use of the master key to sign transactions for this account.
disableMasterKey | boolean | *Optional* Disallows use of the master key to sign transactions for this account. To disable the master key, you must authorize the transaction by signing it with the master key pair. You cannot use a regular key pair or a multi-signature. You can re-enable the master key pair using a regular key pair or multi-signature. See [AccountSet](https://developers.ripple.com/accountset.html).
disallowIncomingXRP | boolean | *Optional* Indicates that client applications should not send XRP to this account. Not enforced by rippled.
domain | string | *Optional* The domain that owns this account, as a hexadecimal string representing the ASCII for the domain in lowercase.
emailHash | string,null | *Optional* Hash of an email address to be used for generating an avatar image. Conventionally, clients use Gravatar to display this image. Use `null` to clear.
@@ -3903,7 +3904,7 @@ requireAuthorization | boolean | *Optional* If set, this account must individual
requireDestinationTag | boolean | *Optional* Requires incoming payments to specify a destination tag.
signers | object | *Optional* Settings that determine what sets of accounts can be used to sign a transaction on behalf of this account using multisigning.
*signers.* threshold | integer | A target number for the signer weights. A multi-signature from this list is valid only if the sum weights of the signatures provided is equal or greater than this value. To delete the signers setting, use the value `0`.
*signers.* weights | array | Weights of signatures for each signer.
*signers.* weights | array | *Optional* Weights of signatures for each signer.
*signers.* weights[] | object | An association of an address and a weight.
*signers.weights[].* address | [address](#address) | A Ripple account address
*signers.weights[].* weight | integer | The weight that the signature of this account counts as towards the threshold.
@@ -4502,10 +4503,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -4557,10 +4558,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -4630,10 +4631,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -4698,10 +4699,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -4766,10 +4767,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -4819,10 +4820,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -4889,10 +4890,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -4947,10 +4948,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -5003,10 +5004,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -5061,10 +5062,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -5119,10 +5120,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -5174,10 +5175,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -5230,10 +5231,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -5289,10 +5290,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -5344,10 +5345,10 @@ Name | Type | Description
---- | ---- | -----------
txJSON | string | The prepared transaction in rippled JSON format.
instructions | object | The instructions for how to execute the transaction after adding automatic defaults.
*instructions.* fee | [value](#value) | An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.
*instructions.* fee | [value](#value) | The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide.
*instructions.* sequence | [sequence](#account-sequence-number) | The initiating account's sequence number for this transaction.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum.
*instructions.* maxLedgerVersion | integer,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
*instructions.* maxLedgerVersion | string,null | The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.
### Example
@@ -5395,12 +5396,12 @@ This method can sign any of [the transaction types supported by ripple-binary-co
Name | Type | Description
---- | ---- | -----------
txJSON | string | Transaction represented as a JSON string in rippled format.
keypair | object | *Optional* The private and public key of the account that is initiating the transaction. (This field is exclusive with secret).
keypair | object | *Optional* The private and public key of the account that is initiating the transaction. (This field cannot be used with secret).
*keypair.* privateKey | privateKey | The uppercase hexadecimal representation of the secp256k1 or Ed25519 private key.
*keypair.* publicKey | publicKey | The uppercase hexadecimal representation of the secp256k1 or Ed25519 public key.
options | object | *Optional* Options that control the type of signature that will be generated.
*options.* signAs | [address](#address) | *Optional* The account that the signature should count for in multisigning.
secret | secret string | *Optional* The secret of the account that is initiating the transaction. (This field is exclusive with keypair).
secret | secret string | *Optional* The secret of the account that is initiating the transaction. (This field cannot be used with keypair).
### Return Value
@@ -5860,6 +5861,34 @@ api.iso8601ToRippleTime('2017-02-17T15:04:57Z');
540659097
```
## rippleTimeToISO8601
`rippleTimeToISO8601(rippleTime: number): string`
This method takes the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC) and returns a string representation of a date.
The Ripple Epoch is 946684800 seconds after the Unix Epoch.
This method is useful for interpreting timestamps returned by the rippled APIs. The rippled APIs represent time as an unsigned integer of the number of seconds since the Ripple Epoch.
### Parameters
`rippleTime`: A number of seconds since the Ripple Epoch.
### Return Value
A string representing a date and time, created by calling a `Date` object's `toISOString()` method.
### Example
```javascript
api.rippleTimeToISO8601(540659097);
```
```json
'2017-02-17T15:04:57.000Z'
```
## txFlags
`txFlags.TRANSACTION_TYPE.FLAG`

View File

@@ -26,7 +26,7 @@ api.connect().then(() => {
}).catch(console.error);
```
RippleAPI is designed to work in [Node.js](https://nodejs.org) version **6.11.3**. RippleAPI may work on older Node.js versions if you use [Babel](https://babeljs.io/) for [ECMAScript 6](https://babeljs.io/docs/learn-es2015/) support.
RippleAPI is designed to work in [Node.js](https://nodejs.org) version 6 or higher. Ripple recommends Node.js v10 LTS.
The code samples in this documentation are written with ECMAScript 6 (ES6) features, but `RippleAPI` also works with ECMAScript 5 (ES5). Regardless of whether you use ES5 or ES6, the methods that return Promises return [ES6-style promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

View File

@@ -62,6 +62,7 @@
<% include computeLedgerHash.md.ejs %>
<% include xrpToDropsAndDropsToXrp.md.ejs %>
<% include iso8601ToRippleTime.md.ejs %>
<% include rippleTimeToISO8601.md.ejs %>
<% include txFlags.md.ejs %>
<% include schemaValidator.md.ejs %>
<% include events.md.ejs %>

View File

@@ -43,10 +43,12 @@ Executing a transaction with `RippleAPI` requires the following four steps:
## Transaction Fees
Every transaction must destroy a small amount of XRP as a cost to send the transaction. This is also called a *transaction fee*. The transaction cost is designed to increase along with the load on the XRP Ledger, making it very expensive to deliberately or inadvertently overload the peer-to-peer network that powers the XRP Ledger.
Every transaction must destroy a small amount of XRP as a cost to apply the transaction to the ledger. This is also called a *transaction fee*. The transaction cost is designed to increase along with the load on the XRP Ledger, making it very expensive to deliberately or inadvertently overload the peer-to-peer network that powers the XRP Ledger.
You can choose the size of the fee you want to pay or let a default be used. You can get an estimate of the fee required to be included in the next ledger closing with the [getFee](#getfee) method.
For a multi-signed transaction, ripple-lib automatically multiplies the `fee` by (1 + Number of Signatures Provided). For example, if you set `instructions.fee = '0.000020'` and `instructions.signersCount = 2`, the prepared transaction's `Fee` will be 20 drops × (1 + 2 Signatures) = 60 drops. See [Transaction Cost](https://developers.ripple.com/transaction-cost.html).
## Transaction Instructions
Transaction instructions indicate how to execute a transaction, complementary with the [transaction specification](#transaction-specifications).

View File

@@ -1,6 +1,6 @@
{
"name": "ripple-lib",
"version": "1.2.0",
"version": "1.3.2",
"license": "ISC",
"description": "A JavaScript API for interacting with Ripple in Node.js and the browser",
"files": [
@@ -10,64 +10,60 @@
"main": "dist/npm/",
"types": "dist/npm/index.d.ts",
"browser": {
"ws": "./dist/npm/common/wswrapper.js"
"ws": "./dist/npm/common/wswrapper.js",
"https-proxy-agent": false
},
"directories": {
"test": "test"
},
"dependencies": {
"@types/lodash": "^4.14.85",
"@types/lodash": "^4.14.136",
"@types/ws": "^3.2.0",
"bignumber.js": "^4.1.0",
"https-proxy-agent": "2.2.1",
"jsonschema": "1.2.2",
"lodash": "^4.17.4",
"ripple-address-codec": "^2.0.1",
"ripple-binary-codec": "0.2.0",
"ripple-hashes": "^0.3.1",
"ripple-address-codec": "^3.0.4",
"ripple-binary-codec": "0.2.2",
"ripple-hashes": "0.3.2",
"ripple-keypairs": "^0.10.1",
"ripple-lib-transactionparser": "0.7.1",
"ws": "^3.3.1"
},
"devDependencies": {
"@types/node": "^8.0.53",
"@types/node": "11.13.0",
"assert-diff": "^1.0.1",
"doctoc": "^0.15.0",
"ejs": "^2.3.4",
"eventemitter2": "^0.4.14",
"gulp": "^3.8.10",
"gulp-bump": "^0.1.13",
"gulp-rename": "^1.2.0",
"jayson": "^1.2.2",
"gulp": "^4.0.2",
"json-loader": "^0.5.2",
"json-schema-to-markdown-table": "^0.4.0",
"mocha": "6.0.2",
"mocha": "6.1.3",
"mocha-junit-reporter": "^1.9.1",
"null-loader": "^0.1.1",
"nyc": "^11.3.0",
"source-map-support": "^0.5.0",
"nyc": "^14.1.1",
"source-map-support": "0.5.12",
"ts-loader": "^3.2.0",
"ts-node": "^3.3.0",
"ts-node": "8.0.3",
"tslint": "^5.8.0",
"tslint-eslint-rules": "^4.1.1",
"typescript": "2.9.2",
"typescript": "3.4.2",
"uglifyjs-webpack-plugin": "^1.1.4",
"webpack": "3.12.0",
"yargs": "^8.0.2"
"webpack": "3.12.0"
},
"scripts": {
"build": "gulp",
"doctoc": "doctoc docs/index.md --title '# RippleAPI Reference' --github --maxlevel 2",
"docgen": "node --harmony scripts/build_docs.js",
"clean": "rm -rf dist/npm",
"compile": "mkdir -p dist/npm/common && cp -r src/common/schemas dist/npm/common/ && tsc",
"compile": "mkdir -p dist/npm/common/js && cp -r src/common/js/ dist/npm/common/js/ && mkdir -p dist/npm/common && cp -r src/common/schemas dist/npm/common/ && tsc --build",
"watch": "tsc -w",
"prepublish": "npm run clean && npm run compile && npm run build",
"test": "nyc mocha --exit",
"test": "TS_NODE_PROJECT=src/tsconfig.json nyc mocha --exit",
"lint": "tslint -p ./",
"perf": "./scripts/perf_test.sh",
"start": "node scripts/http.js",
"sauce": "node scripts/sauce-runner.js"
"start": "node scripts/http.js"
},
"repository": {
"type": "git",

View File

@@ -45,7 +45,6 @@ unittest() {
integrationtest() {
mocha test/integration/integration-test.js
mocha test/integration/http-integration-test.js
# run integration tests in PhantomJS
#gulp build-tests build-min

View File

@@ -1,16 +0,0 @@
'use strict';
const createHTTPServer = require('../dist/npm/http').createHTTPServer;
const port = 5990;
const serverUrl = 'wss://s1.ripple.com';
function main() {
const server = createHTTPServer({server: serverUrl}, port);
server.start().then(() => {
console.log('Server started on port ' + String(port));
});
}
main();

View File

@@ -0,0 +1,17 @@
import {RippleAPI} from '../../dist/npm'
const api = new RippleAPI({
server: 'wss://s.altnet.rippletest.net:51233'
})
getTransaction()
async function getTransaction() {
await api.connect()
const ledger = await api.getLedger({includeTransactions: true})
console.log(ledger)
const tx = await api.getTransaction(ledger.transactionHashes[0])
console.log(tx)
console.log('deliveredAmount:', tx.outcome.deliveredAmount)
process.exit(0)
}

View File

@@ -1,4 +1,5 @@
const RippleAPI = require('../dist/npm').RippleAPI
import {RippleAPI} from '../../dist/npm'
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
parseAccountFlags()
@@ -8,4 +9,5 @@ async function parseAccountFlags() {
const account_info = await api.request('account_info', {account: 'rKsdkGhyZH6b2Zzd5hNnEqSv2wpznn4n6N'})
const flags = api.parseAccountFlags(account_info.account_data.Flags)
console.log(JSON.stringify(flags, null, 2))
process.exit(0)
}

13
snippets/tsconfig.json Normal file
View File

@@ -0,0 +1,13 @@
{
"extends": "../tsconfig-base",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
"references": [
{ "path": "../src" }
],
"include": [
"./src/**/*.ts"
]
}

View File

@@ -5,6 +5,7 @@ import {
validate,
xrpToDrops,
dropsToXrp,
rippleTimeToISO8601,
iso8601ToRippleTime,
txFlags
} from './common'
@@ -72,8 +73,9 @@ import * as schemaValidator from './common/schema-validator'
import {getServerInfo, getFee} from './common/serverinfo'
import {clamp, renameCounterpartyToIssuer} from './ledger/utils'
import {TransactionJSON, Instructions, Prepare} from './transaction/types'
import {ConnectionOptions} from './common/connection'
export type APIOptions = {
export interface APIOptions extends ConnectionOptions {
server?: string,
feeCushion?: number,
maxFeeXRP?: string,
@@ -336,6 +338,7 @@ class RippleAPI extends EventEmitter {
xrpToDrops = xrpToDrops
dropsToXrp = dropsToXrp
rippleTimeToISO8601 = rippleTimeToISO8601
iso8601ToRippleTime = iso8601ToRippleTime
txFlags = txFlags

View File

@@ -202,16 +202,10 @@ class Connection extends EventEmitter {
this._updateLedgerVersions(data)
this._updateFees(data)
this._rebindOnUnxpectedClose()
this._rebindOnUnexpectedClose()
this._retry = 0
this._ws.on('error', error => {
// TODO: "type" does not exist on official error type, safe to remove?
if (process.browser && error && (<any>error).type === 'error') {
// we are in browser, ignore error - `close` event will be fired
// after error
return
}
this.emit('error', 'websocket', error.message, error)
})
@@ -222,7 +216,7 @@ class Connection extends EventEmitter {
})
}
_rebindOnUnxpectedClose() {
_rebindOnUnexpectedClose() {
if (this._onUnexpectedCloseBound) {
this._ws.removeListener('close', this._onUnexpectedCloseBound)
}
@@ -231,7 +225,7 @@ class Connection extends EventEmitter {
this._ws.once('close', this._onUnexpectedCloseBound)
}
_unbindOnUnxpectedClose() {
_unbindOnUnexpectedClose() {
if (this._onUnexpectedCloseBound) {
this._ws.removeListener('close', this._onUnexpectedCloseBound)
}
@@ -240,7 +234,7 @@ class Connection extends EventEmitter {
_onOpenError(reject, error) {
this._onOpenErrorBound = null
this._unbindOnUnxpectedClose()
this._unbindOnUnexpectedClose()
reject(new NotConnectedError(error.message, error))
}
@@ -287,7 +281,7 @@ class Connection extends EventEmitter {
return websocket
}
connect() {
connect(): Promise<void> {
this._clearReconnectTimer()
return new Promise((resolve, reject) => {
if (!this._url) {
@@ -322,11 +316,11 @@ class Connection extends EventEmitter {
})
}
disconnect() {
disconnect(): Promise<void> {
return this._disconnect(true)
}
_disconnect(calledByUser) {
_disconnect(calledByUser): Promise<void> {
if (calledByUser) {
this._clearReconnectTimer()
this._retry = 0

File diff suppressed because it is too large Load Diff

View File

@@ -35,7 +35,7 @@ class RangeSet {
}
addRange(start: number, end: number) {
assert(start <= end, 'invalid range')
assert(start <= end, `invalid range ${start} <= ${end}`)
this.ranges = mergeIntervals(this.ranges.concat([[start, end]]))
}

View File

@@ -6,7 +6,7 @@
"properties": {
"address": {
"$ref": "address",
"description": "The Ripple address of the account to get the balance sheet of."
"description": "The XRP Ledger address of the account to get the balance sheet of."
},
"options": {
"properties": {

View File

@@ -6,7 +6,7 @@
"properties": {
"address": {
"$ref": "address",
"description": "The Ripple address of the account to get open orders for."
"description": "The XRP Ledger address of the account to get open orders for."
},
"options": {
"description": "Options that determine what orders will be returned.",

View File

@@ -12,7 +12,7 @@
"properties": {
"address": {
"$ref": "address",
"description": "The Ripple address of the account where funds will come from."
"description": "The XRP Ledger address of the account where funds will come from."
},
"amount": {
"$ref": "laxAmount",
@@ -49,7 +49,7 @@
"properties": {
"address": {
"$ref": "address",
"description": "The address to send to."
"description": "An address representing the destination of the transaction."
},
"amount": {
"$ref": "laxLaxAmount",

View File

@@ -10,14 +10,14 @@
"properties": {
"minLedgerVersion": {
"$ref": "ledgerVersion",
"description": "The lowest ledger version to search."
"description": "The lowest ledger version to search. This must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'."
},
"maxLedgerVersion": {
"$ref": "ledgerVersion",
"description": "The highest ledger version to search"
"description": "The highest ledger version to search. This must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'."
},
"includeRawTransaction": {
"description": "Include raw transaction data. For advanced users; exercise caution when interpreting this data. "
"description": "Include raw transaction data. For advanced users; exercise caution when interpreting this data."
}
},
"additionalProperties": false

View File

@@ -22,7 +22,7 @@
},
"minLedgerVersion": {
"$ref": "ledgerVersion",
"description": "Return only transactions in this ledger verion or higher."
"description": "Return only transactions in this ledger version or higher."
},
"maxLedgerVersion": {
"$ref": "ledgerVersion",

View File

@@ -10,7 +10,7 @@
"secret": {
"type": "string",
"format": "secret",
"description": "The secret of the account that is initiating the transaction. (This field is exclusive with keypair)."
"description": "The secret of the account that is initiating the transaction. (This field cannot be used with keypair)."
},
"keypair": {
"type": "object",
@@ -24,7 +24,7 @@
"description": "The uppercase hexadecimal representation of the secp256k1 or Ed25519 public key."
}
},
"description": "The private and public key of the account that is initiating the transaction. (This field is exclusive with secret).",
"description": "The private and public key of the account that is initiating the transaction. (This field cannot be used with secret).",
"required": ["privateKey", "publicKey"],
"additionalProperties": false
},

View File

@@ -13,7 +13,7 @@
"$ref": "currency"
},
"counterparty": {
"description": "The Ripple address of the account that owes or is owed the funds (omitted if `currency` is \"XRP\" or \"drops\")",
"description": "The XRP Ledger address of the account that owes or is owed the funds (omitted if `currency` is \"XRP\" or \"drops\")",
"$ref": "address"
}
},

View File

@@ -14,7 +14,7 @@
"$ref": "currency"
},
"counterparty": {
"description": "The Ripple address of the account that owes or is owed the funds.",
"description": "The XRP Ledger address of the account that owes or is owed the funds.",
"$ref": "address"
}
},

View File

@@ -6,7 +6,7 @@
"properties": {
"address": {
"$ref": "address",
"description": "The address to receive at."
"description": "An address representing the destination of the transaction."
},
"tag": {"$ref": "tag"}
},

View File

@@ -5,7 +5,7 @@
"properties": {
"address": {
"$ref": "address",
"description": "The address to receive at."
"description": "An address representing the destination of the transaction."
},
"amount": {
"$ref": "laxAmount",

View File

@@ -10,7 +10,7 @@
"$ref": "sequence"
},
"fee": {
"description": "An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information.",
"description": "An exact fee to pay for the transaction, before multiplying for multi-signed transactions. See [Transaction Fees](#transaction-fees) for more information.",
"$ref": "value"
},
"maxFee": {
@@ -18,7 +18,7 @@
"$ref": "value"
},
"maxLedgerVersion": {
"description": "The highest ledger version that the transaction can be included in. If this option and `maxLedgerVersionOffset` are both omitted, the `maxLedgerVersion` option will default to 3 greater than the current validated ledger version (equivalent to `maxLedgerVersionOffset=3`). Use `null` to not set a maximum ledger version.",
"description": "The highest ledger version that the transaction can be included in. If this option and `maxLedgerVersionOffset` are both omitted, the `maxLedgerVersion` option will default to 3 greater than the current validated ledger version (equivalent to `maxLedgerVersionOffset=3`). Use `null` to not set a maximum ledger version. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'.",
"oneOf": [
{"$ref": "ledgerVersion"},
{"type": "null"}

View File

@@ -9,7 +9,7 @@
},
"maxAmount": {
"$ref": "laxAmount",
"description": "The maximum amount to send. (This field is exclusive with source.amount)"
"description": "The maximum amount to send. (This field cannot be used with source.amount)"
},
"tag": {"$ref": "tag"}
},

View File

@@ -5,11 +5,11 @@
"properties": {
"address": {
"$ref": "address",
"description": "The address to send to."
"description": "An address representing the destination of the transaction."
},
"minAmount": {
"$ref": "laxAmount",
"description": "The minimum amount to be delivered. (This field is exclusive with destination.amount)"
"description": "The minimum amount to be delivered. (This field cannot be used with destination.amount)"
},
"tag": {"$ref": "tag"}
},

View File

@@ -13,7 +13,7 @@
},
"disableMasterKey": {
"type": "boolean",
"description": "Disallows use of the master key to sign transactions for this account."
"description": "Disallows use of the master key to sign transactions for this account. To disable the master key, you must authorize the transaction by signing it with the master key pair. You cannot use a regular key pair or a multi-signature. You can re-enable the master key pair using a regular key pair or multi-signature. See [AccountSet](https://developers.ripple.com/accountset.html)."
},
"disallowIncomingXRP": {
"type": "boolean",
@@ -94,7 +94,7 @@
"maxItems": 8
}
},
"required": ["threshold", "weights"],
"required": ["threshold"],
"additionalProperties": false
},
"transferRate": {

View File

@@ -9,7 +9,7 @@
},
"amount": {
"$ref": "laxAmount",
"description": "An exact amount to send. If the counterparty is not specified, amounts with any counterparty may be used. (This field is exclusive with source.maxAmount)"
"description": "An exact amount to send. If the counterparty is not specified, amounts with any counterparty may be used. (This field cannot be used with source.maxAmount)"
},
"tag": {"$ref": "tag"}
},

View File

@@ -31,7 +31,7 @@
},
"threads": {
"type": "number",
"description": "*(Admin only)* The number of threads in the servers main job pool, performing various Ripple Network operations."
"description": "*(Admin only)* The number of threads in the servers main job pool, performing various operations."
}
},
"required": ["jobTypes", "threads"]
@@ -70,7 +70,7 @@
},
"serverState": {
"type": "string",
"description": "A string indicating to what extent the server is participating in the network. See [Possible Server States](https://ripple.com/build/rippled-apis/#possible-server-states) for more details.",
"description": "A string indicating to what extent the server is participating in the network. See [Possible Server States](https://developers.ripple.com/rippled-server-states.html) for more details.",
"enum": ["disconnected", "connected", "syncing", "tracking", "full", "validating", "proposing"]
},
"validatedLedger": {

View File

@@ -14,7 +14,7 @@
"properties": {
"fee": {
"$ref": "value",
"description": "An exact fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information."
"description": "The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee will be multiplied by (N+1), where N is the number of signatures you plan to provide."
},
"sequence": {
"$ref": "sequence",
@@ -25,7 +25,7 @@
{"$ref": "ledgerVersion"},
{"type": "null"}
],
"description": "The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum."
"description": "The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: 'validated', 'closed', 'current'."
}
},
"additionalProperties": false,

View File

@@ -1,7 +1,7 @@
import * as _ from 'lodash'
import {convertKeysFromSnakeCaseToCamelCase} from './utils'
import BigNumber from 'bignumber.js'
import {RippleAPI} from '../index'
import {RippleAPI} from '..'
export type GetServerInfoResponse = {
buildVersion: string,

View File

@@ -1,8 +1,5 @@
export type Amount = {
value: string,
currency: string,
issuer?: string,
counterparty?: string
export interface Amount extends Issue {
value: string
}
@@ -21,8 +18,8 @@ export interface TakerRequestAmount {
/**
* A currency-counterparty pair, or just currency if it's XRP.
*/
export type Issue = {
currency: string,
issuer?: string,
export interface Issue {
currency: string
issuer?: string
counterparty?: string
}

View File

@@ -103,6 +103,7 @@ function toRippledAmount(amount: Amount): RippledAmount {
function convertKeysFromSnakeCaseToCamelCase(obj: any): any {
if (typeof obj === 'object') {
const accumulator = Array.isArray(obj) ? [] : {}
let newKey
return _.reduce(obj, (result, value, key) => {
newKey = key
@@ -113,7 +114,7 @@ function convertKeysFromSnakeCaseToCamelCase(obj: any): any {
}
result[newKey] = convertKeysFromSnakeCaseToCamelCase(value)
return result
}, {})
}, accumulator)
}
return obj
}

View File

@@ -1,84 +0,0 @@
/* eslint-disable new-cap */
import * as assert from 'assert'
import * as _ from 'lodash'
import * as jayson from 'jayson'
import {RippleAPI} from './api'
/* istanbul ignore next */
function createHTTPServer(options, httpPort) {
const rippleAPI = new RippleAPI(options)
const methodNames = _.filter(_.keys(RippleAPI.prototype), k => {
return typeof RippleAPI.prototype[k] === 'function'
&& k !== 'connect'
&& k !== 'disconnect'
&& k !== 'constructor'
&& k !== 'RippleAPI'
})
function applyPromiseWithCallback(fnName, callback, args_) {
try {
let args = args_
if (!_.isArray(args_)) {
const fnParameters = jayson.Utils.getParameterNames(rippleAPI[fnName])
args = fnParameters.map(name => args_[name])
const defaultArgs = _.omit(args_, fnParameters)
assert(_.size(defaultArgs) <= 1,
'Function must have no more than one default argument')
if (_.size(defaultArgs) > 0) {
args.push(defaultArgs[_.keys(defaultArgs)[0]])
}
}
Promise.resolve(rippleAPI[fnName](...args))
.then(res => callback(null, res))
.catch(err => {
callback({code: 99, message: err.message, data: {name: err.name}})
})
} catch (err) {
callback({code: 99, message: err.message, data: {name: err.name}})
}
}
const methods = {}
_.forEach(methodNames, fn => {
methods[fn] = jayson.Method((args, cb) => {
applyPromiseWithCallback(fn, cb, args)
}, {collect: true})
})
const server = jayson.server(methods)
let httpServer = null
return {
server: server,
start: function() {
if (httpServer !== null) {
return Promise.reject('Already started')
}
return new Promise(resolve => {
rippleAPI.connect().then(() => {
httpServer = server.http()
httpServer.listen(httpPort, resolve)
})
})
},
stop: function() {
if (httpServer === null) {
return Promise.reject('Not started')
}
return new Promise(resolve => {
rippleAPI.disconnect()
httpServer.close(() => {
httpServer = null
resolve()
})
})
}
}
}
export {
createHTTPServer
}

View File

@@ -1,5 +1,5 @@
import {validate, removeUndefined, dropsToXrp} from '../common'
import {RippleAPI} from '../api'
import {RippleAPI} from '..'
import {AccountInfoResponse} from '../common/types/commands/account_info'
export type GetAccountInfoOptions = {

View File

@@ -1,5 +1,5 @@
import {removeUndefined} from '../common'
import {RippleAPI} from '../api'
import {RippleAPI} from '..'
import {
GetAccountObjectsOptions,
AccountObjectsResponse

View File

@@ -2,7 +2,7 @@ import * as _ from 'lodash'
import {validate} from '../common'
import {Amount} from '../common/types/objects'
import {ensureLedgerVersion} from './utils'
import {RippleAPI} from '../api'
import {RippleAPI} from '..'
export type BalanceSheetOptions = {
excludeAddresses?: Array<string>,

View File

@@ -3,6 +3,7 @@ import {validate} from '../common'
import {Connection} from '../common'
import {GetTrustlinesOptions} from './trustlines'
import {FormattedTrustline} from '../common/types/objects/trustlines'
import {RippleAPI} from '..'
export type Balance = {
@@ -47,7 +48,7 @@ function getLedgerVersionHelper(connection: Connection, optionValue?: number
return connection.getLedgerVersion()
}
function getBalances(address: string, options: GetTrustlinesOptions = {}
function getBalances(this: RippleAPI, address: string, options: GetTrustlinesOptions = {}
): Promise<GetBalances> {
validate.getTrustlines({address, options})

View File

@@ -1,6 +1,6 @@
import {validate} from '../common'
import {FormattedLedger, parseLedger} from './parse/ledger'
import {RippleAPI} from '../api'
import {RippleAPI} from '..'
export type GetLedgerOptions = {
ledgerHash?: string,

View File

@@ -5,9 +5,9 @@ import {
FormattedOrderbookOrder
} from './parse/orderbook-order'
import {validate} from '../common'
import {Amount, Issue} from '../common/types/objects'
import {Issue} from '../common/types/objects'
import {BookOffer} from '../common/types/commands'
import {RippleAPI} from '../api'
import {RippleAPI} from '..'
import BigNumber from 'bignumber.js'
export type FormattedOrderbook = {
@@ -15,7 +15,7 @@ export type FormattedOrderbook = {
asks: FormattedOrderbookOrder[]
}
function isSameIssue(a: Amount, b: Amount) {
function isSameIssue(a: Issue, b: Issue) {
return a.currency === b.currency && a.counterparty === b.counterparty
}
@@ -34,7 +34,7 @@ function flipOrder(order: FormattedOrderbookOrder) {
return _.merge({}, order, {specification: newSpecification})
}
function alignOrder(base: Amount, order: FormattedOrderbookOrder) {
function alignOrder(base: Issue, order: FormattedOrderbookOrder): FormattedOrderbookOrder {
const quantity = order.specification.quantity
return isSameIssue(quantity, base) ? order : flipOrder(order)
}

View File

@@ -1,7 +1,7 @@
import * as _ from 'lodash'
import {validate} from '../common'
import {FormattedAccountOrder, parseAccountOrder} from './parse/account-order'
import {RippleAPI} from '../api'
import {RippleAPI} from '..'
import {AccountOffersResponse} from '../common/types/commands'
export type GetOrdersOptions = {

View File

@@ -14,6 +14,7 @@ import {RippledAmount, Amount} from '../common/types/objects'
import {
GetPaths, PathFind, RippledPathsResponse, PathFindRequest
} from './pathfind-types'
import {RippleAPI} from '..'
const NotFoundError = errors.NotFoundError
const ValidationError = errors.ValidationError
@@ -147,7 +148,7 @@ function formatResponse(pathfind: PathFind, paths: RippledPathsResponse) {
}
}
function getPaths(pathfind: PathFind): Promise<GetPaths> {
function getPaths(this: RippleAPI, pathfind: PathFind): Promise<GetPaths> {
validate.getPaths({pathfind})
const address = pathfind.source.address

View File

@@ -3,7 +3,7 @@ import {
FormattedPaymentChannel
} from './parse/payment-channel'
import {validate, errors} from '../common'
import {RippleAPI} from '../api'
import {RippleAPI} from '..'
import {LedgerEntryResponse} from '../common/types/commands'
const NotFoundError = errors.NotFoundError

View File

@@ -3,7 +3,7 @@ import parseFields from './parse/fields'
import {validate, constants} from '../common'
import {FormattedSettings} from '../common/types/objects'
import {AccountInfoResponse} from '../common/types/commands'
import {RippleAPI} from '../api'
import {RippleAPI} from '..'
const AccountFlags = constants.AccountFlags
export type SettingsOptions = {

View File

@@ -5,6 +5,7 @@ import {validate, errors} from '../common'
import {Connection} from '../common'
import {FormattedTransactionType} from '../transaction/types'
import {RippledError} from '../common/errors'
import {RippleAPI} from '..'
export type TransactionOptions = {
minLedgerVersion?: number,
@@ -96,7 +97,7 @@ function formatResponse(options: TransactionOptions, tx: TransactionResponse
return parseTransaction(tx, options.includeRawTransaction)
}
async function getTransaction(id: string, options: TransactionOptions = {}
async function getTransaction(this: RippleAPI, id: string, options: TransactionOptions = {}
): Promise<FormattedTransactionType> {
validate.getTransaction({id, options})
const _options = await utils.ensureLedgerVersion.call(this, options)

View File

@@ -6,6 +6,7 @@ import parseTransaction from './parse/transaction'
import getTransaction from './transaction'
import {validate, errors, Connection} from '../common'
import {FormattedTransactionType} from '../transaction/types'
import {RippleAPI} from '..'
export type TransactionsOptions = {
@@ -162,7 +163,7 @@ function getTransactionsInternal(connection: Connection, address: string,
return utils.getRecursive(getter, options.limit).then(format)
}
function getTransactions(address: string, options: TransactionsOptions = {}
function getTransactions(this: RippleAPI, address: string, options: TransactionsOptions = {}
): Promise<GetTransactionsResponse> {
validate.getTransactions({address, options})

View File

@@ -1,7 +1,7 @@
import * as _ from 'lodash'
import {validate} from '../common'
import parseAccountTrustline from './parse/account-trustline'
import {RippleAPI} from '../api'
import {RippleAPI} from '..'
import {FormattedTrustline} from '../common/types/objects/trustlines'
export type GetTrustlinesOptions = {

View File

@@ -4,6 +4,7 @@ import * as common from '../common'
import {Connection} from '../common'
import {FormattedTransactionType} from '../transaction/types'
import {Issue} from '../common/types/objects'
import {RippleAPI} from '..'
export type RecursiveData = {
marker: string,
@@ -105,7 +106,7 @@ function isPendingLedgerVersion(connection: Connection,
ledgerVersion < (maxLedgerVersion || 0))
}
function ensureLedgerVersion(options: any
function ensureLedgerVersion(this: RippleAPI, options: any
): Promise<object> {
if (Boolean(options) && options.ledgerVersion !== undefined &&
options.ledgerVersion !== null

View File

@@ -1,18 +1,19 @@
import * as common from '../common'
import {RippleAPI} from '..'
function isConnected(): boolean {
function isConnected(this: RippleAPI): boolean {
return this.connection.isConnected()
}
function getLedgerVersion(): Promise<number> {
function getLedgerVersion(this: RippleAPI): Promise<number> {
return this.connection.getLedgerVersion()
}
function connect(): Promise<void> {
function connect(this: RippleAPI): Promise<void> {
return this.connection.connect()
}
function disconnect(): Promise<void> {
function disconnect(this: RippleAPI): Promise<void> {
return this.connection.disconnect()
}

View File

@@ -1,6 +1,7 @@
import {TransactionJSON, prepareTransaction} from './utils'
import {validate} from '../common'
import {Instructions, Prepare} from './types'
import {RippleAPI} from '..'
export type CheckCancelParameters = {
checkID: string
@@ -18,7 +19,7 @@ function createCheckCancelTransaction(account: string,
return txJSON
}
function prepareCheckCancel(address: string,
function prepareCheckCancel(this: RippleAPI, address: string,
checkCancel: CheckCancelParameters,
instructions: Instructions = {}
): Promise<Prepare> {

View File

@@ -4,6 +4,7 @@ const toRippledAmount = utils.common.toRippledAmount
import {validate} from '../common'
import {Instructions, Prepare, TransactionJSON} from './types'
import {Amount} from '../common/types/objects'
import {RippleAPI} from '..'
export type CheckCashParameters = {
checkID: string,
@@ -36,7 +37,7 @@ function createCheckCashTransaction(account: string,
return txJSON
}
function prepareCheckCash(address: string,
function prepareCheckCash(this: RippleAPI, address: string,
checkCash: CheckCashParameters,
instructions: Instructions = {}
): Promise<Prepare> {

View File

@@ -3,6 +3,7 @@ const toRippledAmount = utils.common.toRippledAmount
import {validate, iso8601ToRippleTime} from '../common'
import {Instructions, Prepare, TransactionJSON} from './types'
import {Amount} from '../common/types/objects'
import {RippleAPI} from '..'
export type CheckCreateParameters = {
destination: string,
@@ -37,7 +38,7 @@ function createCheckCreateTransaction(account: string,
return txJSON
}
function prepareCheckCreate(address: string,
function prepareCheckCreate(this: RippleAPI, address: string,
checkCreate: CheckCreateParameters,
instructions: Instructions = {}
): Promise<Prepare> {

View File

@@ -2,6 +2,7 @@ import * as utils from './utils'
const validate = utils.common.validate
import {Instructions, Prepare, TransactionJSON} from './types'
import {Memo} from '../common/types/objects'
import {RippleAPI} from '..'
export type EscrowCancellation = {
owner: string,
@@ -27,7 +28,7 @@ function createEscrowCancellationTransaction(account: string,
return txJSON
}
function prepareEscrowCancellation(address: string,
function prepareEscrowCancellation(this: RippleAPI, address: string,
escrowCancellation: EscrowCancellation,
instructions: Instructions = {}
): Promise<Prepare> {

View File

@@ -3,6 +3,7 @@ import {validate, iso8601ToRippleTime, xrpToDrops} from '../common'
const ValidationError = utils.common.errors.ValidationError
import {Instructions, Prepare, TransactionJSON} from './types'
import {Memo} from '../common/types/objects'
import {RippleAPI} from '..'
export type EscrowCreation = {
amount: string,
@@ -51,7 +52,7 @@ function createEscrowCreationTransaction(account: string,
return txJSON
}
function prepareEscrowCreation(address: string,
function prepareEscrowCreation(this: RippleAPI, address: string,
escrowCreation: EscrowCreation,
instructions: Instructions = {}
): Promise<Prepare> {

View File

@@ -3,6 +3,7 @@ const validate = utils.common.validate
const ValidationError = utils.common.errors.ValidationError
import {Instructions, Prepare} from './types'
import {Memo} from '../common/types/objects'
import {RippleAPI} from '..'
export type EscrowExecution = {
owner: string,
@@ -39,7 +40,7 @@ function createEscrowExecutionTransaction(account: string,
return txJSON
}
function prepareEscrowExecution(address: string,
function prepareEscrowExecution(this: RippleAPI, address: string,
escrowExecution: EscrowExecution,
instructions: Instructions = {}
): Promise<Prepare> {

View File

@@ -3,6 +3,7 @@ const offerFlags = utils.common.txFlags.OfferCreate
import {validate, iso8601ToRippleTime} from '../common'
import {Instructions, Prepare, OfferCreateTransaction} from './types'
import {FormattedOrderSpecification} from '../common/types/objects/index'
import {RippleAPI} from '..'
function createOrderTransaction(
account: string, order: FormattedOrderSpecification
@@ -43,7 +44,7 @@ function createOrderTransaction(
return txJSON as OfferCreateTransaction
}
function prepareOrder(address: string, order: FormattedOrderSpecification,
function prepareOrder(this: RippleAPI, address: string, order: FormattedOrderSpecification,
instructions: Instructions = {}
): Promise<Prepare> {
try {

View File

@@ -1,6 +1,7 @@
import * as utils from './utils'
const validate = utils.common.validate
import {Instructions, Prepare, TransactionJSON} from './types'
import {RippleAPI} from '..'
function createOrderCancellationTransaction(account: string,
orderCancellation: any
@@ -16,7 +17,7 @@ function createOrderCancellationTransaction(account: string,
return txJSON
}
function prepareOrderCancellation(address: string, orderCancellation: object,
function prepareOrderCancellation(this: RippleAPI, address: string, orderCancellation: object,
instructions: Instructions = {}
): Promise<Prepare> {
try {

View File

@@ -3,6 +3,7 @@ const ValidationError = utils.common.errors.ValidationError
const claimFlags = utils.common.txFlags.PaymentChannelClaim
import {validate, xrpToDrops} from '../common'
import {Instructions, Prepare} from './types'
import {RippleAPI} from '..'
export type PaymentChannelClaim = {
channel: string,
@@ -58,7 +59,7 @@ function createPaymentChannelClaimTransaction(account: string,
return txJSON
}
function preparePaymentChannelClaim(address: string,
function preparePaymentChannelClaim(this: RippleAPI, address: string,
paymentChannelClaim: PaymentChannelClaim,
instructions: Instructions = {}
): Promise<Prepare> {

View File

@@ -1,6 +1,7 @@
import * as utils from './utils'
import {validate, iso8601ToRippleTime, xrpToDrops} from '../common'
import {Instructions, Prepare} from './types'
import {RippleAPI} from '..'
export type PaymentChannelCreate = {
amount: string,
@@ -37,7 +38,7 @@ function createPaymentChannelCreateTransaction(account: string,
return txJSON
}
function preparePaymentChannelCreate(address: string,
function preparePaymentChannelCreate(this: RippleAPI, address: string,
paymentChannelCreate: PaymentChannelCreate,
instructions: Instructions = {}
): Promise<Prepare> {

View File

@@ -1,6 +1,7 @@
import * as utils from './utils'
import {validate, iso8601ToRippleTime, xrpToDrops} from '../common'
import {Instructions, Prepare} from './types'
import {RippleAPI} from '..'
export type PaymentChannelFund = {
channel: string,
@@ -25,7 +26,7 @@ function createPaymentChannelFundTransaction(account: string,
return txJSON
}
function preparePaymentChannelFund(address: string,
function preparePaymentChannelFund(this: RippleAPI, address: string,
paymentChannelFund: PaymentChannelFund,
instructions: Instructions = {}
): Promise<Prepare> {

View File

@@ -8,6 +8,7 @@ import {Instructions, Prepare, TransactionJSON} from './types'
import {Amount, Adjustment, MaxAdjustment,
MinAdjustment, Memo} from '../common/types/objects'
import {xrpToDrops} from '../common'
import {RippleAPI} from '..'
export interface Payment {
@@ -167,7 +168,7 @@ function createPaymentTransaction(address: string, paymentArgument: Payment
return txJSON
}
function preparePayment(address: string, payment: Payment,
function preparePayment(this: RippleAPI, address: string, payment: Payment,
instructions: Instructions = {}
): Promise<Prepare> {
try {

View File

@@ -6,6 +6,7 @@ const AccountFlagIndices = utils.common.constants.AccountFlagIndices
const AccountFields = utils.common.constants.AccountFields
import {Instructions, Prepare, SettingsTransaction} from './types'
import {FormattedSettings, WeightedSigner} from '../common/types/objects'
import {RippleAPI} from '..'
function setTransactionFlags(txJSON: utils.TransactionJSON, values: FormattedSettings) {
const keys = Object.keys(values)
@@ -88,12 +89,17 @@ function createSettingsTransactionWithoutMemos(
}
if (settings.signers !== undefined) {
return {
const setSignerList = {
TransactionType: 'SignerListSet',
Account: account,
SignerQuorum: settings.signers.threshold,
SignerEntries: settings.signers.weights.map(formatSignerEntry)
SignerEntries: [],
SignerQuorum: settings.signers.threshold
};
if (settings.signers.weights !== undefined) {
setSignerList.SignerEntries = settings.signers.weights.map(formatSignerEntry);
}
return setSignerList;
}
const txJSON: SettingsTransaction = {
@@ -121,7 +127,7 @@ function createSettingsTransaction(account: string, settings: FormattedSettings
return txJSON
}
function prepareSettings(address: string, settings: FormattedSettings,
function prepareSettings(this: RippleAPI, address: string, settings: FormattedSettings,
instructions: Instructions = {}
): Promise<Prepare> {
try {

View File

@@ -1,17 +1,18 @@
import * as isEqual from '../common/js/lodash.isequal'
import * as utils from './utils'
import keypairs = require('ripple-keypairs')
import binary = require('ripple-binary-codec')
import binaryCodec = require('ripple-binary-codec')
import {computeBinaryTransactionHash} from 'ripple-hashes'
import {SignOptions, KeyPair} from './types'
import {BigNumber} from 'bignumber.js'
import {xrpToDrops} from '../common'
import {RippleAPI} from '../api'
import {RippleAPI} from '..'
const validate = utils.common.validate
function computeSignature(tx: object, privateKey: string, signAs?: string) {
const signingData = signAs
? binary.encodeForMultisigning(tx, signAs)
: binary.encodeForSigning(tx)
? binaryCodec.encodeForMultisigning(tx, signAs)
: binaryCodec.encodeForSigning(tx)
return keypairs.sign(signingData, privateKey)
}
@@ -32,7 +33,88 @@ function signWithKeypair(
)
}
const fee = new BigNumber(tx.Fee)
checkFee(api, tx.Fee)
const txToSignAndEncode = Object.assign({}, tx)
txToSignAndEncode.SigningPubKey = options.signAs ? '' : keypair.publicKey
if (options.signAs) {
const signer = {
Account: options.signAs,
SigningPubKey: keypair.publicKey,
TxnSignature: computeSignature(txToSignAndEncode, keypair.privateKey, options.signAs)
}
txToSignAndEncode.Signers = [{Signer: signer}]
} else {
txToSignAndEncode.TxnSignature = computeSignature(txToSignAndEncode, keypair.privateKey)
}
const serialized = binaryCodec.encode(txToSignAndEncode)
checkTxSerialization(serialized, tx)
return {
signedTransaction: serialized,
id: computeBinaryTransactionHash(serialized)
}
}
/**
* Decode a serialized transaction, remove the fields that are added during the signing process,
* and verify that it matches the transaction prior to signing.
*
* @param {string} serialized A signed and serialized transaction.
* @param {utils.TransactionJSON} tx The transaction prior to signing.
*
* @returns {void} This method does not return a value, but throws an error if the check fails.
*/
function checkTxSerialization(serialized: string, tx: utils.TransactionJSON): void {
// Decode the serialized transaction:
const decoded = binaryCodec.decode(serialized)
// ...And ensure it is equal to the original tx, except:
// - It must have a TxnSignature or Signers (multisign).
if (!decoded.TxnSignature && !decoded.Signers) {
throw new utils.common.errors.ValidationError(
'Serialized transaction must have a TxnSignature or Signers property'
)
}
// - We know that the original tx did not have TxnSignature, so we should delete it:
delete decoded.TxnSignature
// - We know that the original tx did not have Signers, so if it exists, we should delete it:
delete decoded.Signers
// - If SigningPubKey was not in the original tx, then we should delete it.
// But if it was in the original tx, then we should ensure that it has not been changed.
if (!tx.SigningPubKey) {
delete decoded.SigningPubKey
}
if (!isEqual(decoded, tx)) {
const error = new utils.common.errors.ValidationError(
'Serialized transaction does not match original txJSON'
)
error.data = {
decoded,
tx
}
throw error
}
}
/**
* Check that a given transaction fee does not exceed maxFeeXRP (in drops).
*
* See https://xrpl.org/rippleapi-reference.html#parameters
*
* @param {RippleAPI} api A RippleAPI instance.
* @param {string} txFee The transaction fee in drops, encoded as a string.
*
* @returns {void} This method does not return a value, but throws an error if the check fails.
*/
function checkFee(api: RippleAPI, txFee: string): void {
const fee = new BigNumber(txFee)
const maxFeeDrops = xrpToDrops(api._maxFeeXRP)
if (fee.greaterThan(maxFeeDrops)) {
throw new utils.common.errors.ValidationError(
@@ -40,25 +122,6 @@ function signWithKeypair(
'To use a higher fee, set `maxFeeXRP` in the RippleAPI constructor.'
)
}
tx.SigningPubKey = options.signAs ? '' : keypair.publicKey
if (options.signAs) {
const signer = {
Account: options.signAs,
SigningPubKey: keypair.publicKey,
TxnSignature: computeSignature(tx, keypair.privateKey, options.signAs)
}
tx.Signers = [{Signer: signer}]
} else {
tx.TxnSignature = computeSignature(tx, keypair.privateKey)
}
const serialized = binary.encode(tx)
return {
signedTransaction: serialized,
id: computeBinaryTransactionHash(serialized)
}
}
function sign(

View File

@@ -6,6 +6,7 @@ import {Instructions, Prepare, TransactionJSON} from './types'
import {
FormattedTrustlineSpecification
} from '../common/types/objects/trustlines'
import {RippleAPI} from '..'
function convertQuality(quality) {
return (new BigNumber(quality)).shift(9).truncated().toNumber()
@@ -49,7 +50,7 @@ function createTrustlineTransaction(account: string,
return txJSON
}
function prepareTrustline(address: string,
function prepareTrustline(this: RippleAPI, address: string,
trustline: FormattedTrustlineSpecification, instructions: Instructions = {}
): Promise<Prepare> {
try {

View File

@@ -82,6 +82,11 @@ export type Outcome = {
}[]
},
orderbookChanges: object,
deliveredAmount?: {
currency: string,
counterparty?: string,
value: string
},
timestamp?: string
}

View File

@@ -3,7 +3,7 @@ import * as common from '../common'
import {Memo, RippledAmount} from '../common/types/objects'
const txFlags = common.txFlags
import {Instructions, Prepare} from './types'
import {RippleAPI} from '../api'
import {RippleAPI} from '..'
import {ValidationError} from '../common/errors'
export type ApiMemo = {
@@ -18,7 +18,7 @@ export type TransactionJSON = {
Memos?: {Memo: ApiMemo}[],
Flags?: number,
Fulfillment?: string,
[Field: string]: string | number | Array<any> | RippledAmount
[Field: string]: string | number | Array<any> | RippledAmount | undefined
}
function formatPrepareResponse(txJSON: any): Prepare {
@@ -34,7 +34,17 @@ function formatPrepareResponse(txJSON: any): Prepare {
}
}
function setCanonicalFlag(txJSON) {
/**
* Set the `tfFullyCanonicalSig` flag on a transaction.
*
* See https://xrpl.org/transaction-malleability.html
*
* @param {TransactionJSON} txJSON The transaction object to modify.
* This method will modify object's `Flags` property, or add it if it does not exist.
*
* @returns {void} This method mutates the original txJSON and does not return a value.
*/
function setCanonicalFlag(txJSON: TransactionJSON): void {
txJSON.Flags |= txFlags.Universal.FullyCanonicalSig
// JavaScript converts operands to 32-bit signed ints before doing bitwise
@@ -51,11 +61,37 @@ function prepareTransaction(txJSON: TransactionJSON, api: RippleAPI,
): Promise<Prepare> {
common.validate.instructions(instructions)
common.validate.tx_json(txJSON)
const disallowedFieldsInTxJSON = ['maxLedgerVersion', 'maxLedgerVersionOffset', 'fee', 'sequence']
const badFields = disallowedFieldsInTxJSON.filter(field => txJSON[field])
if (badFields.length) {
return Promise.reject(new ValidationError('txJSON additionalProperty "' + badFields[0] +
'" exists in instance when not allowed'))
}
// To remove the signer list, SignerEntries field should be omitted.
if (txJSON['SignerQuorum'] === 0) {
delete txJSON.SignerEntries;
}
const account = txJSON.Account
setCanonicalFlag(txJSON)
function prepareMaxLedgerVersion(): Promise<object> {
function prepareMaxLedgerVersion(): Promise<TransactionJSON> {
// Up to one of the following is allowed:
// txJSON.LastLedgerSequence
// instructions.maxLedgerVersion
// instructions.maxLedgerVersionOffset
if (txJSON.LastLedgerSequence && instructions.maxLedgerVersion) {
return Promise.reject(new ValidationError('`LastLedgerSequence` in txJSON and `maxLedgerVersion`' +
' in `instructions` cannot both be set'))
}
if (txJSON.LastLedgerSequence && instructions.maxLedgerVersionOffset) {
return Promise.reject(new ValidationError('`LastLedgerSequence` in txJSON and `maxLedgerVersionOffset`' +
' in `instructions` cannot both be set'))
}
if (txJSON.LastLedgerSequence) {
return Promise.resolve(txJSON)
}
if (instructions.maxLedgerVersion !== undefined) {
if (instructions.maxLedgerVersion !== null) {
txJSON.LastLedgerSequence = instructions.maxLedgerVersion
@@ -70,16 +106,27 @@ function prepareTransaction(txJSON: TransactionJSON, api: RippleAPI,
})
}
function prepareFee(): Promise<object> {
function prepareFee(): Promise<TransactionJSON> {
// instructions.fee is scaled (for multi-signed transactions) while txJSON.Fee is not.
// Due to this difference, we do NOT allow both to be set, as the behavior would be complex and
// potentially ambiguous.
// Furthermore, txJSON.Fee is in drops while instructions.fee is in XRP, which would just add to
// the confusion. It is simpler to require that only one is used.
if (txJSON.Fee && instructions.fee) {
return Promise.reject(new ValidationError('`Fee` in txJSON and `fee` in `instructions` cannot both be set'))
}
if (txJSON.Fee) {
// txJSON.Fee is set. Use this value and do not scale it.
return Promise.resolve(txJSON)
}
const multiplier = instructions.signersCount === undefined ? 1 :
instructions.signersCount + 1
if (instructions.fee !== undefined) {
const fee = new BigNumber(instructions.fee)
if (fee.greaterThan(api._maxFeeXRP)) {
const errorMessage = `Fee of ${fee.toString(10)} XRP exceeds ` +
return Promise.reject(new ValidationError(`Fee of ${fee.toString(10)} XRP exceeds ` +
`max of ${api._maxFeeXRP} XRP. To use this fee, increase ` +
'`maxFeeXRP` in the RippleAPI constructor.'
throw new ValidationError(errorMessage)
'`maxFeeXRP` in the RippleAPI constructor.'))
}
txJSON.Fee = scaleValue(common.xrpToDrops(instructions.fee), multiplier)
return Promise.resolve(txJSON)
@@ -104,14 +151,14 @@ function prepareTransaction(txJSON: TransactionJSON, api: RippleAPI,
})
}
async function prepareSequence(): Promise<object> {
async function prepareSequence(): Promise<TransactionJSON> {
if (instructions.sequence !== undefined) {
if (txJSON.Sequence === undefined || instructions.sequence === txJSON.Sequence) {
txJSON.Sequence = instructions.sequence
return Promise.resolve(txJSON)
} else {
// Both txJSON.Sequence and instructions.sequence are defined, and they are NOT equal
return Promise.reject(new ValidationError('`Sequence` in txJSON must match `sequence` in Instructions'))
return Promise.reject(new ValidationError('`Sequence` in txJSON must match `sequence` in `instructions`'))
}
}
if (txJSON.Sequence !== undefined) {
@@ -155,5 +202,6 @@ export {
convertStringToHex,
convertMemo,
prepareTransaction,
common
common,
setCanonicalFlag
}

11
src/tsconfig.json Normal file
View File

@@ -0,0 +1,11 @@
{
"extends": "../tsconfig-base",
"compilerOptions": {
"outDir": "../dist/npm",
"rootDir": ".",
"composite": true
},
"include": [
"**/*.ts"
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@ const ledgerClosed = require('./fixtures/rippled/ledger-close');
const RippleAPI = require('ripple-api').RippleAPI;
const schemaValidator = RippleAPI._PRIVATE.schemaValidator;
const TIMEOUT = process.browser ? 25000 : 10000;
const TIMEOUT = 20000;
function checkResult(expected, schemaName, response) {
if (expected.txJSON) {
@@ -29,9 +29,7 @@ describe('RippleAPIBroadcast', function() {
it('base', function() {
const expected = {request_server_info: 1};
if (!process.browser) {
this.mocks.forEach(mock => mock.expect(_.assign({}, expected)));
}
this.mocks.forEach(mock => mock.expect(_.assign({}, expected)));
assert(this.api.isConnected());
return this.api.getServerInfo().then(
_.partial(checkResult, responses.getServerInfo, 'getServerInfo'));

View File

@@ -22,6 +22,7 @@ module.exports = {
},
prepareSettings: {
domain: require('./prepare-settings'),
noSignerEntries: require('./prepare-settings-no-signer-entries'),
signers: {
normal: require('./prepare-settings-signers'),
noThreshold: require('./prepare-settings-signers-no-threshold'),

View File

@@ -0,0 +1,5 @@
{
"signers": {
"threshold": 0
}
}

View File

@@ -122,7 +122,9 @@ module.exports = {
noInstructions: require('./prepare-settings-no-instructions.json'),
signed: require('./prepare-settings-signed.json'),
noMaxLedgerVersion: require('./prepare-settings-no-maxledgerversion.json'),
signers: require('./prepare-settings-signers.json')
signers: require('./prepare-settings-signers.json'),
noSignerList: require('./prepare-settings-no-signer-list.json'),
noWeights: require('./prepare-settings-no-weight.json')
},
prepareCheckCreate: {
normal: require('./prepare-check-create'),

View File

@@ -0,0 +1,8 @@
{
"txJSON": "{\"TransactionType\":\"SignerListSet\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"SignerQuorum\":0,\"Flags\":2147483648,\"LastLedgerSequence\":8820051,\"Fee\":\"24\",\"Sequence\":23}",
"instructions": {
"fee": "0.000024",
"sequence": 23,
"maxLedgerVersion": 8820051
}
}

View File

@@ -0,0 +1,8 @@
{
"txJSON": "{\"TransactionType\":\"SignerListSet\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"SignerQuorum\":2,\"SignerEntries\":[],\"Flags\":2147483648,\"LastLedgerSequence\":8820051,\"Fee\":\"24\",\"Sequence\":23}",
"instructions": {
"fee": "0.000024",
"sequence": 23,
"maxLedgerVersion": 8820051
}
}

View File

@@ -1,202 +0,0 @@
/* eslint-disable max-nested-callbacks */
'use strict';
const assert = require('assert-diff');
const _ = require('lodash');
const jayson = require('jayson');
const RippleAPI = require('../../src').RippleAPI;
const createHTTPServer = require('../../src/http').createHTTPServer;
const {payTo, ledgerAccept} = require('./utils');
const apiFixtures = require('../fixtures');
const apiRequests = apiFixtures.requests;
const apiResponses = apiFixtures.responses;
const TIMEOUT = 20000; // how long before each test case times out
const serverUri = 'ws://127.0.0.1:6006';
const apiOptions = {
server: serverUri
};
const httpPort = 3000;
function createClient() {
return jayson.client.http({port: httpPort, hostname: 'localhost'});
}
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
function makePositionalParams(params) {
return params.map(value => value[_.keys(value)[0]]);
}
function makeNamedParams(params) {
return _.reduce(params, _.assign, {});
}
function random() {
return _.fill(Array(16), 0);
}
describe('http server integration tests', function() {
this.timeout(TIMEOUT);
let server = null;
let client = null;
let paymentId = null;
let newWallet = null;
function createTestInternal(testName, methodName, params, testFunc, id) {
it(testName, function() {
return new Promise((resolve, reject) => {
client.request(methodName, params, id,
(err, result) => err ? reject(err) : resolve(testFunc(result)));
});
});
}
function createTest(name, params, testFunc, id) {
createTestInternal(name + ' - positional params', name,
makePositionalParams(params), testFunc, id);
createTestInternal(name + ' - named params', name,
makeNamedParams(params), testFunc, id);
}
before(() => {
this.api = new RippleAPI({server: serverUri});
console.log('CONNECTING...');
return this.api.connect().then(() => {
console.log('CONNECTED...');
})
.then(() => ledgerAccept(this.api))
.then(() => newWallet = this.api.generateAddress())
.then(() => ledgerAccept(this.api))
.then(() => payTo(this.api, newWallet.address))
.then(paymentId_ => {
paymentId = paymentId_;
});
});
beforeEach(function() {
server = createHTTPServer(apiOptions, httpPort);
return server.start().then(() => {
this.client = createClient();
client = this.client;
});
});
afterEach(function() {
return server.stop();
});
createTest(
'getLedgerVersion',
[],
result => assert(_.isNumber(result.result))
);
createTest(
'getServerInfo',
[],
result => assert(_.isNumber(result.result.validatedLedger.ledgerVersion))
);
it('getTransaction', function() {
const params = [{id: paymentId}];
return new Promise((resolve, reject) => {
client.request('getTransaction', makePositionalParams(params),
(err, result) => {
if (err) {
reject(err);
}
assert.strictEqual(result.result.id, paymentId);
const outcome = result.result.outcome;
assert.strictEqual(outcome.result, 'tesSUCCESS');
assert.strictEqual(outcome.balanceChanges
.rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh[0].value, '-4003218.000012');
resolve(result);
});
});
});
it('getTransactions', function() {
const params = [{address: newWallet.address}, {
options: {
binary: true,
limit: 1
}
}];
return new Promise((resolve, reject) => {
client.request('getTransactions', makeNamedParams(params),
(err, result) => {
if (err) {
reject(err);
}
assert.strictEqual(result.result.length, 1);
assert.strictEqual(result.result[0].id, paymentId);
resolve(result);
});
});
});
createTest(
'prepareSettings',
[
{address},
{settings: apiRequests.prepareSettings.domain},
{instructions: {
maxFee: '0.000012',
sequence: 23,
maxLedgerVersion: 8820051
}}
],
result => {
const got = JSON.parse(result.result.txJSON);
const expected = JSON.parse(apiResponses.prepareSettings.flags.txJSON);
assert.deepEqual(got, expected);
}
);
createTest(
'sign',
[{txJSON: apiRequests.sign.normal.txJSON},
{secret: 'shsWGZcmZz6YsWWmcnpfr6fLTdtFV'}],
result => assert.deepEqual(result.result, apiResponses.sign.normal)
);
createTest(
'sign',
[{txJSON: apiRequests.sign.normal.txJSON},
{keypair: {
privateKey: '00ACCD3309DB14D1A4FC9B1DAE608031F4408C85C73EE05E035B7DC8B25840107A',
publicKey: '02F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D8' }}],
result => assert.deepEqual(result.result, apiResponses.sign.normal)
);
createTest(
'generateAddress',
[{options: {entropy: random()}}],
result => assert.deepEqual(result.result, apiResponses.generateAddress)
);
createTest(
'computeLedgerHash',
[{ledger: _.assign({}, apiResponses.getLedger.full,
{parentCloseTime: apiResponses.getLedger.full.closeTime})
}],
result => {
assert.strictEqual(result.result,
'E6DB7365949BF9814D76BCC730B01818EB9136A89DB224F3F9F5AAE4569D758E');
}
);
createTest(
'isConnected',
[],
result => assert(result.result)
);
});

View File

@@ -13,7 +13,7 @@ const {payTo, ledgerAccept} = require('./utils');
// how long before each test case times out
const TIMEOUT = process.browser ? 25000 : 10000;
const TIMEOUT = 20000;
const INTERVAL = 1000; // how long to wait between checks for validated ledger
const serverUrl = 'ws://127.0.0.1:6006';

26
tsconfig-base.json Normal file
View File

@@ -0,0 +1,26 @@
{
"compilerOptions": {
"pretty": true,
"lib": [
"es2017"
],
"target": "es6",
"declaration": true,
"declarationMap": true /* Added 2019-04-13 */,
"sourceMap": true,
"noEmitOnError": true /* Added 2019-04-13 */,
"strictNullChecks": false,
"noImplicitAny": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"removeComments": true,
"strict": true /* Enable all strict type-checking options. */,
"preserveConstEnums": false,
"module": "commonjs",
"moduleResolution": "node",
"suppressImplicitAnyIndexErrors": false
}
}

View File

@@ -1,26 +1,8 @@
{
"compilerOptions": {
"target": "es6",
"lib": [
"es2017"
],
"outDir": "dist/npm",
"rootDir": "src",
"module": "commonjs",
"moduleResolution": "node",
"strictNullChecks": false,
"noImplicitAny": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"removeComments": false,
"preserveConstEnums": false,
"suppressImplicitAnyIndexErrors": false,
"declaration": true,
"sourceMap": true,
"skipLibCheck": true
},
"include": [
"custom_typings/**/*.ts",
"src/**/*.ts"
"files": [],
"include": [],
"references": [
{ "path": "./src" },
{ "path": "./snippets" }
]
}
}

3876
yarn.lock

File diff suppressed because it is too large Load Diff