Switches from yarn to npm (#1591)

* remove yarn.lock

* reinstall with npm

* fix package.json

* update xrplf eslint

* fix all other instances of yarn
This commit is contained in:
Mayukha Vadari
2021-09-01 16:34:58 -04:00
parent 91cc9e0461
commit 62538a75b1
49 changed files with 15924 additions and 4811 deletions

View File

@@ -23,9 +23,9 @@ jobs:
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
# - run: yarn install
# - run: yarn lint
# - run: yarn build
# - run: npm run install
# - run: npm run lint
# - run: npm run build
unit:
runs-on: ubuntu-latest
@@ -41,8 +41,8 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --ignore-engines
- run: yarn test
- run: npm install --ignore-engines
- run: npm test
integration:
runs-on: ubuntu-latest
@@ -65,8 +65,8 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --ignore-engines
- run: yarn test:integration
- run: npm install --ignore-engines
- run: npm run test:integration
env:
HOST: localhost
PORT: ${{ job.services.rippled.ports['6006'] }}
@@ -92,5 +92,5 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: yarn test:browser
- run: npm install
- run: npm run test:browser

6
.gitignore vendored
View File

@@ -1,7 +1,7 @@
# .gitignore
# Ignore package locks other than Yarn.
package-lock.json
# Ignore package locks other than npm.
yarn.lock
npm-shrinkwrap.json
# Ignore vim swap files.
@@ -70,4 +70,4 @@ scripts/cache
.nyc_output
# browser tests
testCompiledForWeb
testCompiledForWeb

View File

@@ -4,6 +4,6 @@ node_js:
- 12
- 13
script:
- yarn test
- yarn build
- yarn lint
- npm test
- npm build
- npm lint

View File

@@ -25,7 +25,7 @@ What is ripple-lib used for? The applications on the list linked above use `ripp
### Requirements
+ **[Node.js v14](https://nodejs.org/)** is recommended. Other versions may work but are not frequently tested.
+ **[Yarn](https://yarnpkg.com/)** is recommended. `npm` may work but we use `yarn.lock`.
+ **[npm](https://www.npmjs.com/)** is recommended. `yarn` may work but we use `package-lock.json`.
## Getting Started
@@ -33,7 +33,7 @@ See also: [RippleAPI Beginners Guide](https://xrpl.org/get-started-with-rippleap
In an existing project (with `package.json`), install `ripple-lib`:
```
$ yarn add ripple-lib
$ npm install ripple-lib
```
Then see the [documentation](#documentation).
@@ -45,12 +45,12 @@ If you want to use `ripple-lib` with React Native you will need to have some of
1. Install dependencies (you can use `npm` as well):
```shell
yarn add react-native-crypto
yarn add ripple-lib
npm install react-native-crypto
npm install ripple-lib
# install peer deps
yarn add react-native-randombytes
npm install react-native-randombytes
# install latest rn-nodeify
yarn add rn-nodeify@latest --dev
npm install rn-nodeify@latest --dev
```
2. After that, run the following command:
@@ -118,7 +118,7 @@ If you're using the XRP Ledger in production, you should run a [rippled server](
To build the library for Node.js and the browser:
```
$ yarn build
$ npm run build
```
The TypeScript compiler will [output](./tsconfig.json#L7) the resulting JS files in `./dist/npm/`.
@@ -132,12 +132,12 @@ For details, see the `scripts` in `package.json`.
### Unit Tests
1. Clone the repository
2. `cd` into the repository and install dependencies with `yarn install`
3. `yarn test`
2. `cd` into the repository and install dependencies with `npm install`
3. `npm test`
### Linting
Run `yarn lint` to lint the code with `eslint`.
Run `npm run lint` to lint the code with `eslint`.
## Generating Documentation
@@ -145,7 +145,7 @@ Do not edit `./docs/index.md` directly because it is a generated file.
Instead, edit the appropriate `.md.ejs` files in `./docs/src/`.
If you make changes to the JSON schemas, fixtures, or documentation sources, update the documentation by running `yarn run docgen`.
If you make changes to the JSON schemas, fixtures, or documentation sources, update the documentation by running `npm run docgen`.
## More Information

View File

@@ -196,9 +196,9 @@ If you omit the `server` parameter, RippleAPI operates [offline](#offline-functi
### Installation ###
1. Install [Node.js](https://nodejs.org) and [Yarn](https://yarnpkg.com/en/docs/install). Most Linux distros have a package for Node.js; check that it's the version you want.
2. Use yarn to install RippleAPI:
`yarn add ripple-lib`
1. Install [Node.js](https://nodejs.org) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm). Most Linux distros have a package for Node.js; check that it's the version you want.
2. Use npm to install RippleAPI:
`npm install ripple-lib`
After you have installed ripple-lib, you can create scripts using the [boilerplate](#boilerplate) and run them using the Node.js executable, typically named `node`:
@@ -364,7 +364,7 @@ Transaction instructions indicate how to execute a transaction, complementary wi
Name | Type | Description
---- | ---- | -----------
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`, use `maxFeeXRP` instead. See [Transaction Fees](#transaction-fees) for more information.
maxFee | [value](#value) | *Optional* Deprecated: Use `maxFeeXRP` in the Client constructor instead. The maximum fee to pay for this transaction. If this exceeds `maxFeeXRP`, use `maxFeeXRP` 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 default is 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 default is 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.
@@ -1570,27 +1570,27 @@ return api.getServerInfo().then(info => {/* ... */});
```json
{
"buildVersion": "0.24.0-rc1",
"completeLedgers": "32570-6595042",
"hostID": "ARTS",
"ioLatencyMs": 1,
"lastClose": {
"convergeTimeS": 2.007,
"build_version": "0.24.0-rc1",
"complete_ledgers": "32570-6595042",
"hostid": "ARTS",
"io_latency_ms": 1,
"last_close": {
"converge_time_s": 2.007,
"proposers": 4
},
"loadFactor": 1,
"load_factor": 1,
"peers": 53,
"pubkeyNode": "n94wWvFUmaKGYrKUGgpv1DyYgDeXRGdACkNQaSe7zJiy5Znio7UC",
"serverState": "full",
"validatedLedger": {
"pubkey_node": "n94wWvFUmaKGYrKUGgpv1DyYgDeXRGdACkNQaSe7zJiy5Znio7UC",
"server_state": "full",
"validated_ledger": {
"age": 5,
"baseFeeXRP": "0.00001",
"base_fee_xrp": 0.00001,
"hash": "4482DEE5362332F54A4036ED57EE1767C9F33CF7CE5A6670355C16CECE381D46",
"reserveBaseXRP": "20",
"reserveIncrementXRP": "5",
"ledgerVersion": 6595042
"reserve_base_xrp": 20,
"reserve_inc_xrp": 5,
"seq": 6595042
},
"validationQuorum": 3
"validation_quorum": 3
}
```
@@ -1607,7 +1607,7 @@ This uses the [feeCushion parameter](#parameters) provided to the RippleAPI cons
Name | Type | Description
---- | ---- | -----------
cushion | number | *Optional* The fee is the product of the base fee, the `load_factor`, and this cushion. Default is provided by the `RippleAPI` constructor's `feeCushion`.
cushion | number | *Optional* The fee is the product of the base fee, the `load_factor`, and this cushion. Default is provided by the `Client` constructor's `feeCushion`.
### Return Value
@@ -6124,6 +6124,7 @@ const wallet = await api.generateFaucetWallet()
}
```
## signPaymentChannelClaim
`signPaymentChannelClaim(channel: string, amount: string, privateKey: string): string`

View File

@@ -51,9 +51,9 @@ If you omit the `server` parameter, RippleAPI operates [offline](#offline-functi
### Installation ###
1. Install [Node.js](https://nodejs.org) and [Yarn](https://yarnpkg.com/en/docs/install). Most Linux distros have a package for Node.js; check that it's the version you want.
2. Use yarn to install RippleAPI:
`yarn add ripple-lib`
1. Install [Node.js](https://nodejs.org) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm). Most Linux distros have a package for Node.js; check that it's the version you want.
2. Use npm to install RippleAPI:
`npm install ripple-lib`
After you have installed ripple-lib, you can create scripts using the [boilerplate](#boilerplate) and run them using the Node.js executable, typically named `node`:

View File

@@ -19,7 +19,7 @@ This method returns an uppercase hexadecimal string representing the hash of the
### Example
```javascript
const ledger = <%- importFile('test/fixtures/requests/compute-ledger-hash.json') %>;
const ledger = <%- importFile('test/fixtures/requests/computeLedgerHash.json') %>;
return api.computeLedgerHash(ledger);
```

View File

@@ -16,7 +16,7 @@ api.on('ledger', ledger => {
});
```
<%- renderFixture('responses/ledger-event.json') %>
<%- renderFixture('responses/ledgerEvent.json') %>
## error

View File

@@ -22,4 +22,4 @@ This method returns an object with the following structure:
return api.generateAddress();
```
<%- renderFixture('responses/generate-address.json') %>
<%- renderFixture('responses/generateAddress.json') %>

View File

@@ -16,4 +16,4 @@ const wallet = await api.generateFaucetWallet()
**Response**
<%- renderFixture('responses/generate-faucet-wallet.json') %>
<%- renderFixture('responses/generateFaucetWallet.json') %>

View File

@@ -20,4 +20,4 @@ This method returns an object with the following structure:
return api.generateXAddress();
```
<%- renderFixture('responses/generate-x-address.json') %>
<%- renderFixture('responses/generateXAddress.json') %>

View File

@@ -22,4 +22,4 @@ return api.getAccountInfo(address).then(info =>
{/* ... */});
```
<%- renderFixture('responses/get-account-info.json') %>
<%- renderFixture('responses/getAccountInfo.json') %>

View File

@@ -31,4 +31,4 @@ return api.getAccountObjects(address: address).then(objects =>
{/* ... */});
```
<%- renderFixture('responses/get-account-objects.json') %>
<%- renderFixture('responses/getAccountObjects.json') %>

View File

@@ -22,4 +22,4 @@ return api.getBalanceSheet(address).then(balanceSheet =>
{/* ... */});
```
<%- renderFixture('responses/get-balance-sheet.json') %>
<%- renderFixture('responses/getBalanceSheet.json') %>

View File

@@ -22,4 +22,4 @@ return api.getBalances(address).then(balances =>
{/* ... */});
```
<%- renderFixture('responses/get-balances.json') %>
<%- renderFixture('responses/getBalances.json') %>

View File

@@ -21,4 +21,4 @@ return api.getLedger()
.then(ledger => {/* ... */});
```
<%- renderFixture('responses/get-ledger.json') %>
<%- renderFixture('responses/getLedger.json') %>

View File

@@ -26,9 +26,9 @@ For details, see the `rippled` [book_offers method](https://xrpl.org/book_offers
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const orderbook = <%- importFile('test/fixtures/requests/get-orderbook.json') %>;
const orderbook = <%- importFile('test/fixtures/requests/getOrderbook.json') %>;
return api.getOrderbook(address, orderbook)
.then(orderbook => {/* ... */});
```
<%- renderFixture('responses/get-orderbook.json') %>
<%- renderFixture('responses/getOrderbook.json') %>

View File

@@ -22,4 +22,4 @@ return api.getOrders(address).then(orders =>
{/* ... */});
```
<%- renderFixture('responses/get-orders.json') %>
<%- renderFixture('responses/getOrders.json') %>

View File

@@ -22,4 +22,4 @@ return api.getPaths(pathfind)
.then(paths => {/* ... */});
```
<%- renderFixture("responses/get-paths.json") %>
<%- renderFixture("responses/getPaths.json") %>

View File

@@ -23,4 +23,4 @@ return api.getPaymentChannel(channelId).then(channel =>
{/* ... */});
```
<%- renderFixture('responses/get-payment-channel.json') %>
<%- renderFixture('responses/getPaymentChannel.json') %>

View File

@@ -20,4 +20,4 @@ This method returns a promise that resolves with an object with the following st
return api.getServerInfo().then(info => {/* ... */});
```
<%- renderFixture('responses/get-server-info.json') %>
<%- renderFixture('responses/getServerInfo.json') %>

View File

@@ -22,4 +22,4 @@ return api.getSettings(address).then(settings =>
{/* ... */});
```
<%- renderFixture('responses/get-settings.json') %>
<%- renderFixture('responses/getSettings.json') %>

View File

@@ -23,4 +23,4 @@ return api.getTransaction(id).then(transaction => {
});
```
<%- renderFixture('responses/get-transaction-payment.json') %>
<%- renderFixture('responses/getTransactionPayment.json') %>

View File

@@ -21,4 +21,4 @@ return api.getTransactions(address).then(transaction => {
});
```
<%- renderFixture('responses/get-transactions.json') %>
<%- renderFixture('responses/getTransactions.json') %>

View File

@@ -22,4 +22,4 @@ return api.getTrustlines(address).then(trustlines =>
{/* ... */});
```
<%- renderFixture("responses/get-trustlines.json") %>
<%- renderFixture("responses/getTrustlines.json") %>

View File

@@ -22,9 +22,9 @@ All "prepare*" methods have the same return type.
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const checkCancel = <%- importFile('test/fixtures/requests/prepare-check-cancel.json') %>;
const checkCancel = <%- importFile('test/fixtures/requests/prepareCheckCancel.json') %>;
return api.prepareCheckCancel(address, checkCancel).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-check-cancel.json') %>
<%- renderFixture('responses/prepareCheckCancel.json') %>

View File

@@ -22,9 +22,9 @@ All "prepare*" methods have the same return type.
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const checkCash = <%- importFile('test/fixtures/requests/prepare-check-cash-amount.json') %>;
const checkCash = <%- importFile('test/fixtures/requests/prepareCheckCashAmount.json') %>;
return api.prepareCheckCash(address, checkCash).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-check-cash-amount.json') %>
<%- renderFixture('responses/prepareCheckCashAmount.json') %>

View File

@@ -22,9 +22,9 @@ All "prepare*" methods have the same return type.
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const checkCreate = <%- importFile('test/fixtures/requests/prepare-check-create.json') %>;
const checkCreate = <%- importFile('test/fixtures/requests/prepareCheckCreate.json') %>;
return api.prepareCheckCreate(address, checkCreate).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-check-create.json') %>
<%- renderFixture('responses/prepareCheckCreate.json') %>

View File

@@ -22,9 +22,9 @@ All "prepare*" methods have the same return type.
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const escrowCancellation = <%- importFile('test/fixtures/requests/prepare-escrow-cancellation.json') %>;
const escrowCancellation = <%- importFile('test/fixtures/requests/prepareEscrowCancellation.json') %>;
return api.prepareEscrowCancellation(address, escrowCancellation).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-escrow-cancellation.json') %>
<%- renderFixture('responses/prepareEscrowCancellation.json') %>

View File

@@ -28,9 +28,9 @@ All "prepare*" methods have the same return type.
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const escrowCreation = <%- importFile('test/fixtures/requests/prepare-escrow-creation.json') %>;
const escrowCreation = <%- importFile('test/fixtures/requests/prepareEscrowCreation.json') %>;
return api.prepareEscrowCreation(address, escrowCreation).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-escrow-creation.json') %>
<%- renderFixture('responses/prepareEscrowCreation.json') %>

View File

@@ -22,9 +22,9 @@ All "prepare*" methods have the same return type.
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const escrowExecution = <%- importFile('test/fixtures/requests/prepare-escrow-execution.json') %>;
const escrowExecution = <%- importFile('test/fixtures/requests/prepareEscrowExecution.json') %>;
return api.prepareEscrowExecution(address, escrowExecution).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-escrow-execution.json') %>
<%- renderFixture('responses/prepareEscrowExecution.json') %>

View File

@@ -24,9 +24,9 @@ All "prepare*" methods have the same return type.
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
// Buy 10.10 USD (of the specified issuer) for 2.0 XRP (2000000 drops), fill or kill.
const order = <%- importFile('test/fixtures/requests/prepare-order.json') %>;
const order = <%- importFile('test/fixtures/requests/prepareOrder.json') %>;
return api.prepareOrder(address, order)
.then(prepared => {/* ... */});
```
<%- renderFixture('responses/prepare-order.json') %>
<%- renderFixture('responses/prepareOrder.json') %>

View File

@@ -27,4 +27,4 @@ return api.prepareOrderCancellation(address, orderCancellation)
.then(prepared => {/* ... */});
```
<%- renderFixture("responses/prepare-order-cancellation.json") %>
<%- renderFixture("responses/prepareOrderCancellation.json") %>

View File

@@ -22,7 +22,7 @@ All "prepare*" methods have the same return type.
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const payment = <%- importFile('test/fixtures/requests/prepare-payment.json') %>;
const payment = <%- importFile('test/fixtures/requests/preparePayment.json') %>;
return api.preparePayment(address, payment).then(prepared => {
/* ... */
}).catch(error => {
@@ -30,4 +30,4 @@ return api.preparePayment(address, payment).then(prepared => {
})
```
<%- renderFixture("responses/prepare-payment.json") %>
<%- renderFixture("responses/preparePayment.json") %>

View File

@@ -22,9 +22,9 @@ All "prepare*" methods have the same return type.
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const paymentChannelClaim = <%- importFile('test/fixtures/requests/prepare-payment-channel-claim.json') %>;
const paymentChannelClaim = <%- importFile('test/fixtures/requests/preparePaymentChannelClaim.json') %>;
return api.preparePaymentChannelClaim(address, paymentChannelClaim).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-payment-channel-claim.json') %>
<%- renderFixture('responses/preparePaymentChannelClaim.json') %>

View File

@@ -22,9 +22,9 @@ All "prepare*" methods have the same return type.
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const paymentChannelCreate = <%- importFile('test/fixtures/requests/prepare-payment-channel-create.json') %>;
const paymentChannelCreate = <%- importFile('test/fixtures/requests/preparePaymentChannelCreate.json') %>;
return api.preparePaymentChannelCreate(address, paymentChannelCreate).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-payment-channel-create.json') %>
<%- renderFixture('responses/preparePaymentChannelCreate.json') %>

View File

@@ -22,9 +22,9 @@ All "prepare*" methods have the same return type.
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const paymentChannelFund = <%- importFile('test/fixtures/requests/prepare-payment-channel-fund.json') %>;
const paymentChannelFund = <%- importFile('test/fixtures/requests/preparePaymentChannelFund.json') %>;
return api.preparePaymentChannelFund(address, paymentChannelFund).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-payment-channel-fund.json') %>
<%- renderFixture('responses/preparePaymentChannelFund.json') %>

View File

@@ -22,9 +22,9 @@ All "prepare*" methods have the same return type.
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const settings = <%- importFile('test/fixtures/requests/prepare-settings.json') %>;
const settings = <%- importFile('test/fixtures/requests/prepareSettings.json') %>;
return api.prepareSettings(address, settings)
.then(prepared => {/* ... */});
```
<%- renderFixture('requests/prepare-settings.json') %>
<%- renderFixture('requests/prepareSettings.json') %>

View File

@@ -31,4 +31,4 @@ return api.prepareTicketCreate(address, 2).then(prepared => {
})
```
<%- renderFixture("responses/prepare-ticket-create.json") %>
<%- renderFixture("responses/prepareTicketCreate.json") %>

View File

@@ -22,9 +22,9 @@ All "prepare*" methods have the same return type.
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const trustline = <%- importFile('test/fixtures/requests/prepare-trustline.json') %>;
const trustline = <%- importFile('test/fixtures/requests/prepareTrustline.json') %>;
return api.prepareTrustline(address, trustline).then(prepared =>
{/* ... */});
```
<%- renderFixture("responses/prepare-trustline.json") %>
<%- renderFixture("responses/prepareTrustline.json") %>

View File

@@ -25,4 +25,4 @@ const privateKey =
return api.signPaymentChannelClaim(channel, amount, privateKey);
```
<%- renderFixture("responses/sign-payment-channel-claim.json") %>
<%- renderFixture("responses/signPaymentChannelClaim.json") %>

View File

@@ -18,7 +18,7 @@ Cancel a Check that has not been redeemed. (Native transaction type: [CheckCance
#### Example
<%- renderFixture('requests/prepare-check-cancel.json') %>
<%- renderFixture('requests/prepareCheckCancel.json') %>
## Check Cash
@@ -29,7 +29,7 @@ Redeem a Check for up to its stated value. (Native transaction type: [CheckCash]
#### Example
<%- renderFixture('requests/prepare-check-cash-amount.json') %>
<%- renderFixture('requests/prepareCheckCashAmount.json') %>
## Check Create
@@ -40,7 +40,7 @@ Create a Check, a deferred payment that can be redeemed by the destination. (Nat
#### Example
<%- renderFixture('requests/prepare-check-create.json') %>
<%- renderFixture('requests/prepareCheckCreate.json') %>
## Deposit Preauth
@@ -60,7 +60,7 @@ Cancel an Escrow that has passed its expiration. (Native transaction type: [Escr
#### Example
<%- renderFixture('requests/prepare-escrow-cancellation.json') %>
<%- renderFixture('requests/prepareEscrowCancellation.json') %>
## Escrow Creation
@@ -71,7 +71,7 @@ Create an Escrow that locks up XRP until a given time or condition is met. (Nati
#### Example
<%- renderFixture('requests/prepare-escrow-creation.json') %>
<%- renderFixture('requests/prepareEscrowCreation.json') %>
## Escrow Execution
@@ -82,7 +82,7 @@ Deliver XRP from an Escrow after its conditions have been met. (Native transacti
#### Example
<%- renderFixture('requests/prepare-escrow-execution.json') %>
<%- renderFixture('requests/prepareEscrowExecution.json') %>
## Order
@@ -95,7 +95,7 @@ The following invalid flag combination causes a `ValidationError`: `immediateOrC
#### Example
<%- renderFixture('requests/prepare-order.json') %>
<%- renderFixture('requests/prepareOrder.json') %>
## Order Cancellation
@@ -106,7 +106,7 @@ Cancel an order in the decentralized exchange. (Native transaction type: [OfferC
#### Example
<%- renderFixture('requests/prepare-order-cancellation.json') %>
<%- renderFixture('requests/prepareOrderCancellation.json') %>
## Payment
@@ -117,7 +117,7 @@ Send value from one account to another. (Native transaction type: [Payment](http
#### Example
<%- renderFixture('requests/prepare-payment.json') %>
<%- renderFixture('requests/preparePayment.json') %>
## Payment Channel Claim
@@ -128,7 +128,7 @@ Redeem XRP from a Payment Channel. (Native transaction type: [PaymentChannelClai
#### Example
<%- renderFixture('requests/prepare-payment-channel-claim.json') %>
<%- renderFixture('requests/preparePaymentChannelClaim.json') %>
## Payment Channel Create
@@ -139,7 +139,7 @@ Create a Payment Channel with XRP set aside for asynchronous payments. (Native t
#### Example
<%- renderFixture('requests/prepare-payment-channel-create.json') %>
<%- renderFixture('requests/preparePaymentChannelCreate.json') %>
## Payment Channel Fund
@@ -150,7 +150,7 @@ Add XRP to a Payment Channel. (Native transaction type: [PaymentChannelFund](htt
#### Example
<%- renderFixture('requests/prepare-payment-channel-fund.json') %>
<%- renderFixture('requests/preparePaymentChannelFund.json') %>
@@ -162,7 +162,7 @@ Change account settings. (Native transaction types: [AccountSet](https://xrpl.or
#### Example
<%- renderFixture('requests/prepare-settings.json') %>
<%- renderFixture('requests/prepareSettings.json') %>
## Ticket Create
@@ -182,4 +182,4 @@ Create or modify a trust line between two accounts, for an issued currency. (Nat
#### Example
<%- renderFixture('requests/prepare-trustline.json') %>
<%- renderFixture('requests/prepareTrustline.json') %>

View File

@@ -20,7 +20,7 @@ This method returns `true` if the claim signature is valid.
const channel =
'3E18C05AD40319B809520F1A136370C4075321B285217323396D6FD9EE1E9037';
const amount = '.00001';
const signature = <%- importFile("test/fixtures/responses/sign-payment-channel-claim.json") %>;
const signature = <%- importFile("test/fixtures/responses/signPaymentChannelClaim.json") %>;
const publicKey =
'02F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D8';
return api.verifyPaymentChannelClaim(channel, amount, signature, publicKey);

15788
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -38,9 +38,9 @@
"@types/mocha": "^9.0.0",
"@types/node": "^16.4.3",
"@types/puppeteer": "5.4.4",
"@typescript-eslint/eslint-plugin": "^3.7.0",
"@typescript-eslint/parser": "^3.7.0",
"@xrplf/eslint-config": "^1.1.0",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.0.0",
"@xrplf/eslint-config": "^1.2.2",
"assert": "^2.0.0",
"buffer": "^6.0.2",
"chai": "^4.3.4",
@@ -51,15 +51,16 @@
"eslint-plugin-array-func": "^3.1.7",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.24.1",
"eslint-plugin-jsdoc": "^29.0.0",
"eslint-plugin-jsdoc": "^36.0.0",
"eslint-plugin-mocha": "^9.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-tsdoc": "^0.2.14",
"eventemitter2": "^6.0.0",
"https-browserify": "^1.0.0",
"json-schema-to-markdown-table": "^0.4.0",
"mocha": "^9",
"npm-run-all": "^4.1.5",
"nyc": "^15",
"path-browserify": "1.0.1",
"prettier": "^2.3.2",
@@ -76,17 +77,17 @@
"webpack-cli": "^4.2.0"
},
"scripts": {
"build": "run-s build:schemas build:lib build:snippets build:web",
"build:schemas": "mkdir -p dist/npm/common && cp -r src/common/schemas dist/npm/common/",
"build:snippets": "tsc --build ./snippets/tsconfig.json",
"build:lib": "tsc --build tsconfig.build.json",
"build:web": "webpack",
"build": "yarn build:schemas && yarn build:lib && yarn build:snippets && yarn build:web",
"analyze": "yarn build:web --analyze",
"watch": "yarn build:lib --watch",
"analyze": "run-s build:web --analyze",
"watch": "run-s build:lib --watch",
"clean": "rm -rf dist",
"doctoc": "doctoc docs/index.md --title '# RippleAPI Reference' --github --maxlevel 2",
"docgen": "node --harmony scripts/build_docs.js",
"prepublish": "yarn clean && yarn build",
"prepublish": "run-s clean build",
"test": "nyc mocha --config=test/.mocharc.json --exit",
"test:integration": "TS_NODE_PROJECT=tsconfig.build.json nyc mocha ./test/integration/*.ts",
"test:browser": "TS_NODE_PROJECT=tsconfig.build.json nyc mocha ./test/browser/*.ts",
@@ -105,6 +106,6 @@
"readmeFilename": "README.md",
"engines": {
"node": ">=10.13.0",
"yarn": "^1.15.2"
"npm": ">=7.14.0 <8.0.0"
}
}

View File

@@ -9,7 +9,7 @@ function checkEOL {
lint() {
echo "tslint $(node_modules/.bin/tslint --version)"
yarn lint
npm run lint
}
unittest() {
@@ -18,8 +18,8 @@ unittest() {
# TODO: replace/upgrade mocha-junit-reporter
#mocha test --reporter mocha-junit-reporter --reporter-options mochaFile=$CIRCLE_TEST_REPORTS/test-results.xml
yarn test --coverage
#yarn run coveralls
npm test --coverage
#npm run coveralls
# test compiled version in "dist/npm"
$(npm bin)/babel -D --optional runtime --ignore "**/node_modules/**" -d test-compiled/ test/
@@ -39,7 +39,7 @@ unittest() {
#echo "Running tests in SauceLabs"
#http-server &
#yarn run sauce
#npm run sauce
#pkill -f mocked-server.js
#pkill -f http-server
@@ -57,7 +57,7 @@ integrationtest() {
doctest() {
mv docs/index.md docs/index.md.save
yarn run docgen
npm run docgen
mv docs/index.md docs/index.md.test
mv docs/index.md.save docs/index.md
cmp docs/index.md docs/index.md.test

View File

@@ -7,12 +7,12 @@ function exit_on_error {
rm -rf build
yarn install
npm install
gulp
yarn test
npm test
exit_on_error
echo ""
echo "publish to npm"
yarn publish
npm publish
exit_on_error

View File

@@ -7,12 +7,12 @@ function exit_on_error {
rm -rf build
yarn install
npm install
gulp
yarn test
npm test
exit_on_error
echo ""
echo "publish rc to npm"
yarn publish --tag beta
npm publish --tag beta
exit_on_error

4677
yarn.lock

File diff suppressed because it is too large Load Diff