mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-06 22:05:48 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
823d93b86c | ||
|
|
7a42db99c9 | ||
|
|
f28ec27614 | ||
|
|
a36e23ebfa | ||
|
|
e978ef1888 | ||
|
|
9af3968508 | ||
|
|
86ce7b707c | ||
|
|
e0eb27ed8e | ||
|
|
2570e2a6d8 | ||
|
|
c71540e77a | ||
|
|
8eba827d11 |
42
HISTORY.md
42
HISTORY.md
@@ -1,5 +1,47 @@
|
||||
# ripple-lib Release History
|
||||
|
||||
## 0.22.0 (2018-05-10)
|
||||
|
||||
+ [`getOrderbook` - return raw order data](https://github.com/ripple/ripple-lib/pull/886). The full `BookOffer` data is now provided under `data`.
|
||||
|
||||
The SHA-256 checksums for the browser version of this release can be found
|
||||
below.
|
||||
```
|
||||
% shasum -a 256 *
|
||||
33f71b55c4adec4452826e44fe7809377364df04222b60f0fce01e7de2daff33 ripple-0.22.0-debug.js
|
||||
63232888a4ea77065e8e8eb8fdaa8ebfe3a785428fe935e2667c1ea54c837f29 ripple-0.22.0-min.js
|
||||
ab98026fabe296bd938297c48cb58e01dfdbe90f3c66c9617d6a3e1efd4c6b93 ripple-0.22.0.js
|
||||
```
|
||||
|
||||
## 0.21.0 (2018-04-11)
|
||||
|
||||
+ [Upgrade https-proxy-agent](https://github.com/ripple/ripple-lib/pull/883)
|
||||
+ [Add getAccountObjects](https://github.com/ripple/ripple-lib/pull/881)
|
||||
|
||||
The SHA-256 checksums for the browser version of this release can be found
|
||||
below.
|
||||
```
|
||||
% shasum -a 256 *
|
||||
3ab52209ad4a80393c8c08ef3f4aa9cfb47bc76c0ede2ee9fa7f5ca180ba4d67 ripple-0.21.0-debug.js
|
||||
3b1efccded347bed5f64757098a1ea6a513bb8932d922d00af47cd24e001dc14 ripple-0.21.0-min.js
|
||||
db08e5a3eab1f659b4c803543374398004d950ba720adc4b9a7658817cb5c94b ripple-0.21.0.js
|
||||
```
|
||||
|
||||
## 0.20.0 (2018-04-09)
|
||||
|
||||
+ [Add support for using a keypair with sign()](https://github.com/ripple/ripple-lib/pull/769)
|
||||
+ [Fix a bug caused by jsonschema v1.2.3 by pinning to v1.2.2](https://github.com/ripple/ripple-lib/pull/882)
|
||||
+ [Improve Payment Channel documentation](https://github.com/ripple/ripple-lib/pull/877)
|
||||
|
||||
The SHA-256 checksums for the browser version of this release can be found
|
||||
below.
|
||||
```
|
||||
% shasum -a 256 *
|
||||
389811a9baa72f77e2a43d0b48045762d29a6f616ed5fd2660ba76fc12a3ecc5 ripple-0.20.0-debug.js
|
||||
c1746ea0dd55318cb4e1ef3955ef14759d9d70861437c69abafc10169916f068 ripple-0.20.0-min.js
|
||||
17958b0e46395d2b2a35a003693c0babdfb5382513d3cc58a62f8648ad710b0e ripple-0.20.0.js
|
||||
```
|
||||
|
||||
## 0.19.1 (2018-03-22)
|
||||
|
||||
+ [Fix: Include TypeScript declarations in npm package](https://github.com/ripple/ripple-lib/pull/863)
|
||||
|
||||
940
docs/index.md
940
docs/index.md
File diff suppressed because it is too large
Load Diff
33
docs/src/getAccountObjects.md.ejs
Normal file
33
docs/src/getAccountObjects.md.ejs
Normal file
@@ -0,0 +1,33 @@
|
||||
## getAccountObjects
|
||||
|
||||
`getAccountObjects(address: string, options: object): Promise<AccountObjectsResponse>`
|
||||
|
||||
Returns objects owned by an account. For an account's trust lines and balances, see `getTrustlines` and `getBalances`.
|
||||
|
||||
### Parameters
|
||||
|
||||
<%- renderSchema('input/get-account-objects.json') %>
|
||||
|
||||
### Return Value
|
||||
|
||||
This method returns a promise that resolves with an object with the following structure:
|
||||
|
||||
<%- renderSchema('output/get-account-objects.json') %>
|
||||
|
||||
The types of objects that may be returned include:
|
||||
* Offer objects for orders that are currently live, unfunded, or expired but not yet removed.
|
||||
* RippleState objects for trust lines where this account's side is not in the default state.
|
||||
* A SignerList object if the account has multi-signing enabled.
|
||||
* Escrow objects for held payments that have not yet been executed or canceled.
|
||||
* PayChannel objects for open payment channels.
|
||||
* Check objects for pending checks.
|
||||
|
||||
### Example
|
||||
|
||||
```javascript
|
||||
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
|
||||
return api.getAccountObjects(address: address).then(objects =>
|
||||
{/* ... */});
|
||||
```
|
||||
|
||||
<%- renderFixture('responses/get-account-objects.json') %>
|
||||
@@ -14,6 +14,12 @@ This method returns a promise that resolves with an object with the following st
|
||||
|
||||
<%- renderSchema('output/get-orderbook.json') %>
|
||||
|
||||
### New in ripple-lib 0.22.0 and higher
|
||||
|
||||
The response includes a `data` property containing the raw order data. This may include `owner_funds`, `Flags`, and other fields.
|
||||
|
||||
For details, see the rippled method [book_offers](https://ripple.com/build/rippled-apis/#book-offers).
|
||||
|
||||
### Example
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<% include getOrderbook.md.ejs %>
|
||||
<% include getSettings.md.ejs %>
|
||||
<% include getAccountInfo.md.ejs %>
|
||||
<% include getAccountObjects.md.ejs %>
|
||||
<% include getPaymentChannel.md.ejs %>
|
||||
<% include getLedger.md.ejs %>
|
||||
<% include preparePayment.md.ejs %>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
## sign
|
||||
|
||||
`sign(txJSON: string, secret: string, options: Object): {signedTransaction: string, id: string}`
|
||||
```
|
||||
sign(txJSON: string, secret: string, options: Object): {signedTransaction: string, id: string}
|
||||
sign(txJSON: string, keypair: Object, options: Object): {signedTransaction: string, id: string}
|
||||
```
|
||||
|
||||
Sign a prepared transaction. The signed transaction must subsequently be [submitted](#submit).
|
||||
|
||||
@@ -19,7 +22,8 @@ This method returns an object with the following structure:
|
||||
```javascript
|
||||
const txJSON = '{"Flags":2147483648,"TransactionType":"AccountSet","Account":"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59","Domain":"726970706C652E636F6D","LastLedgerSequence":8820051,"Fee":"12","Sequence":23}';
|
||||
const secret = 'shsWGZcmZz6YsWWmcnpfr6fLTdtFV';
|
||||
return api.sign(txJSON, secret);
|
||||
const keypair = { privateKey: '00ACCD3309DB14D1A4FC9B1DAE608031F4408C85C73EE05E035B7DC8B25840107A', publicKey: '02F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D8' };
|
||||
return api.sign(txJSON, secret); // or: api.sign(txJSON, keypair);
|
||||
```
|
||||
|
||||
<%- renderFixture("responses/sign.json") %>
|
||||
|
||||
@@ -17,6 +17,9 @@ Type | Description
|
||||
[checkCreate](#check-create) | A `checkCreate` transaction creates a check on the ledger, which is a deferred payment that can be cashed by its intended destination.
|
||||
[checkCancel](#check-cancel) | A `checkCancel` transaction cancels an unreedemed Check, removing it from the ledger without sending any money.
|
||||
[checkCash](#check-cash) | A `checkCash` transaction redeems a Check to receive up to the amount authorized by the corresponding `checkCreate` transaction. Only the `destination` address of a Check can cash it.
|
||||
[paymentChannelCreate](#payment-channel-create) | A `paymentChannelCreate` transaction opens a payment channel between two addresses with XRP set aside for asynchronous payments.
|
||||
[paymentChannelFund](#payment-channel-fund) | A `paymentChannelFund` transaction adds XRP to a payment channel and optionally sets a new expiration for the channel.
|
||||
[paymentChannelClaim](#payment-channel-claim) | A `paymentChannelClaim` transaction withdraws XRP from a channel and optionally requests to close it.
|
||||
|
||||
## Transaction Flow
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ripple-lib",
|
||||
"version": "0.19.1",
|
||||
"version": "0.22.0",
|
||||
"license": "ISC",
|
||||
"description": "A JavaScript API for interacting with Ripple in Node.js and the browser",
|
||||
"files": [
|
||||
@@ -19,8 +19,8 @@
|
||||
"@types/lodash": "^4.14.85",
|
||||
"@types/ws": "^3.2.0",
|
||||
"bignumber.js": "^4.1.0",
|
||||
"https-proxy-agent": "^1.0.0",
|
||||
"jsonschema": "^1.1.1",
|
||||
"https-proxy-agent": "2.2.1",
|
||||
"jsonschema": "1.2.2",
|
||||
"lodash": "^4.17.4",
|
||||
"ripple-address-codec": "^2.0.1",
|
||||
"ripple-binary-codec": "^0.1.13",
|
||||
|
||||
31
src/api.ts
31
src/api.ts
@@ -20,6 +20,7 @@ import getOrders from './ledger/orders'
|
||||
import getOrderbook from './ledger/orderbook'
|
||||
import getSettings from './ledger/settings'
|
||||
import getAccountInfo from './ledger/accountinfo'
|
||||
import getAccountObjects from './ledger/accountobjects'
|
||||
import getPaymentChannel from './ledger/payment-channel'
|
||||
import preparePayment from './transaction/payment'
|
||||
import prepareTrustline from './transaction/trustline'
|
||||
@@ -45,6 +46,7 @@ import verifyPaymentChannelClaim from './offline/verify-payment-channel-claim'
|
||||
import getLedger from './ledger/ledger'
|
||||
|
||||
import {
|
||||
AccountObjectsRequest, AccountObjectsResponse,
|
||||
AccountOffersRequest, AccountOffersResponse,
|
||||
AccountInfoRequest, AccountInfoResponse,
|
||||
AccountLinesRequest, AccountLinesResponse,
|
||||
@@ -139,17 +141,20 @@ class RippleAPI extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a simple request to the API with the given command and any
|
||||
* additional request body parameters.
|
||||
*
|
||||
* NOTE: This command is under development and should not yet be relied
|
||||
* on by external consumers.
|
||||
*/
|
||||
|
||||
async _request(command: 'account_info', params: AccountInfoRequest):
|
||||
Promise<AccountInfoResponse>
|
||||
async _request(command: 'account_lines', params: AccountLinesRequest):
|
||||
Promise<AccountLinesResponse>
|
||||
|
||||
/**
|
||||
* Returns objects owned by an account.
|
||||
* For an account's trust lines and balances,
|
||||
* see `getTrustlines` and `getBalances`.
|
||||
*/
|
||||
async _request(command: 'account_objects', params: AccountObjectsRequest):
|
||||
Promise<AccountObjectsResponse>
|
||||
|
||||
async _request(command: 'account_offers', params: AccountOffersRequest):
|
||||
Promise<AccountOffersResponse>
|
||||
async _request(command: 'book_offers', params: BookOffersRequest):
|
||||
@@ -160,7 +165,14 @@ class RippleAPI extends EventEmitter {
|
||||
Promise<LedgerResponse>
|
||||
async _request(command: 'ledger_entry', params: LedgerEntryRequest):
|
||||
Promise<LedgerEntryResponse>
|
||||
async _request(command: string, params: any = {}) {
|
||||
|
||||
/**
|
||||
* Makes a request to the API with the given command and
|
||||
* additional request body parameters.
|
||||
*
|
||||
* NOTE: This command is under development.
|
||||
*/
|
||||
async _request(command: string, params: object = {}) {
|
||||
return this.connection.request({
|
||||
...params,
|
||||
command
|
||||
@@ -169,7 +181,7 @@ class RippleAPI extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Makes multiple paged requests to the API to return a given number of
|
||||
* resources. __requestAll() will make multiple requests until the `limit`
|
||||
* resources. _requestAll() will make multiple requests until the `limit`
|
||||
* number of resources is reached (if no `limit` is provided, a single request
|
||||
* will be made).
|
||||
*
|
||||
@@ -246,6 +258,7 @@ class RippleAPI extends EventEmitter {
|
||||
getOrderbook = getOrderbook
|
||||
getSettings = getSettings
|
||||
getAccountInfo = getAccountInfo
|
||||
getAccountObjects = getAccountObjects
|
||||
getPaymentChannel = getPaymentChannel
|
||||
getLedger = getLedger
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ function loadSchemas() {
|
||||
require('./schemas/objects/memo.json'),
|
||||
require('./schemas/objects/memos.json'),
|
||||
require('./schemas/objects/public-key.json'),
|
||||
require('./schemas/objects/private-key.json'),
|
||||
require('./schemas/objects/uint32.json'),
|
||||
require('./schemas/objects/value.json'),
|
||||
require('./schemas/objects/source-adjustment.json'),
|
||||
@@ -60,6 +61,7 @@ function loadSchemas() {
|
||||
require('./schemas/output/sign.json'),
|
||||
require('./schemas/output/submit.json'),
|
||||
require('./schemas/output/get-account-info.json'),
|
||||
require('./schemas/output/get-account-objects.json'),
|
||||
require('./schemas/output/get-balances.json'),
|
||||
require('./schemas/output/get-balance-sheet.json'),
|
||||
require('./schemas/output/get-ledger.json'),
|
||||
@@ -89,6 +91,7 @@ function loadSchemas() {
|
||||
require('./schemas/input/api-options.json'),
|
||||
require('./schemas/input/get-settings.json'),
|
||||
require('./schemas/input/get-account-info.json'),
|
||||
require('./schemas/input/get-account-objects.json'),
|
||||
require('./schemas/input/get-transaction.json'),
|
||||
require('./schemas/input/get-transactions.json'),
|
||||
require('./schemas/input/get-trustlines.json'),
|
||||
|
||||
56
src/common/schemas/input/get-account-objects.json
Normal file
56
src/common/schemas/input/get-account-objects.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "getAccountObjectsOptions",
|
||||
"description": "Request options for getAccountObjects",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"address": {
|
||||
"$ref": "address",
|
||||
"description": "The address of the account to get the account objects of."
|
||||
},
|
||||
"options": {
|
||||
"description": "Options that affect what to return.",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"check",
|
||||
"escrow",
|
||||
"offer",
|
||||
"payment_channel",
|
||||
"signer_list",
|
||||
"state"
|
||||
],
|
||||
"description":
|
||||
"(Optional) Filter results to include only this type of ledger object. The valid types are: `check`, `escrow`, `offer`, `payment_channel`, `signer_list`, and `state` (trust line)."
|
||||
},
|
||||
"ledgerHash": {
|
||||
"type": "string",
|
||||
"description":
|
||||
"(Optional) A 20-byte hex string for the ledger version to use."
|
||||
},
|
||||
"ledgerIndex": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "ledgerVersion"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"description":
|
||||
"(Optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically."
|
||||
},
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"description":
|
||||
"(Optional) The maximum number of objects to include in the results."
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["address"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -10,7 +10,23 @@
|
||||
"secret": {
|
||||
"type": "string",
|
||||
"format": "secret",
|
||||
"description": "The secret of the account that is initiating the transaction."
|
||||
"description": "The secret of the account that is initiating the transaction. (This field is exclusive with keypair)."
|
||||
},
|
||||
"keypair": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"privateKey": {
|
||||
"type": "privateKey",
|
||||
"description": "The uppercase hexadecimal representation of the secp256k1 or Ed25519 private key."
|
||||
},
|
||||
"publicKey": {
|
||||
"type": "publicKey",
|
||||
"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).",
|
||||
"required": ["privateKey", "publicKey"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"options": {
|
||||
"type": "object",
|
||||
@@ -25,5 +41,15 @@
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["txJSON", "secret"]
|
||||
"required": ["txJSON"],
|
||||
"oneOf": [
|
||||
{
|
||||
"required": ["secret"],
|
||||
"not": {"required": ["keypair"]}
|
||||
},
|
||||
{
|
||||
"required": ["keypair"],
|
||||
"not": {"required": ["secret"]}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "ledgerVersion",
|
||||
"description": "A ledger version number",
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": ["validated", "closed", "current"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
7
src/common/schemas/objects/private-key.json
Normal file
7
src/common/schemas/objects/private-key.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "privateKey",
|
||||
"description": "The hexadecimal representation of a secp256k1 or Ed25519 private key.",
|
||||
"type": "string",
|
||||
"pattern": "^[A-F0-9]+$"
|
||||
}
|
||||
48
src/common/schemas/output/get-account-objects.json
Normal file
48
src/common/schemas/output/get-account-objects.json
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "AccountObjectsResponse",
|
||||
"description": "Response format for account_objects",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"account": {
|
||||
"$ref": "address",
|
||||
"description":
|
||||
"Unique address of the account this request corresponds to."
|
||||
},
|
||||
"account_objects": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object"
|
||||
},
|
||||
"description":
|
||||
"Array of objects owned by this account. Each object is in its raw ledger format."
|
||||
},
|
||||
"ledger_hash": {
|
||||
"type": "string",
|
||||
"description":
|
||||
"(May be omitted) The identifying hash of the ledger that was used to generate this response."
|
||||
},
|
||||
"ledger_index": {
|
||||
"$ref": "ledgerVersion",
|
||||
"description":
|
||||
"(May be omitted) The sequence number of the ledger that was used to generate this response."
|
||||
},
|
||||
"ledger_current_index": {
|
||||
"$ref": "ledgerVersion",
|
||||
"description":
|
||||
"(May be omitted) The sequence number of the ledger that was used to generate this response."
|
||||
},
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"description":
|
||||
"(May be omitted) The limit that was used in this request, if any."
|
||||
},
|
||||
"validated": {
|
||||
"type": "boolean",
|
||||
"description":
|
||||
"If included and set to true, the information in this request comes from a validated ledger version. Otherwise, the information is subject to change."
|
||||
}
|
||||
},
|
||||
"required": ["account", "account_objects"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -45,9 +45,14 @@
|
||||
},
|
||||
"required": ["fundedAmount", "priceOfFundedAmount"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"data": {
|
||||
"description": "The raw order data. This may include `owner_funds`, `Flags`, and other fields.",
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"required": ["specification", "properties"],
|
||||
"required": ["specification", "properties", "data"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,19 +10,19 @@
|
||||
},
|
||||
"amount": {
|
||||
"$ref": "value",
|
||||
"description": "XRP balance of this channel after claim is processed."
|
||||
"description": "Amount of XRP authorized by this signature."
|
||||
},
|
||||
"balance": {
|
||||
"$ref": "value",
|
||||
"description": "Amount of XRP authorized by signature."
|
||||
"description": "Total XRP balance delivered by this channel after claim is processed."
|
||||
},
|
||||
"signature": {
|
||||
"$ref": "signature",
|
||||
"description": "Signature of this claim."
|
||||
"description": "Signed claim authorizing withdrawal of XRP from the channel. (Required except from the channel's source address.)"
|
||||
},
|
||||
"publicKey": {
|
||||
"$ref": "publicKey",
|
||||
"description": "Public key of the channel's sender"
|
||||
"description": "Public key of the channel. (For verifying the signature.)"
|
||||
},
|
||||
"renew": {
|
||||
"type": "boolean",
|
||||
@@ -30,7 +30,7 @@
|
||||
},
|
||||
"close": {
|
||||
"type": "boolean",
|
||||
"description": "Request to close the channel."
|
||||
"description": "Request to close the channel. If the channel has no XRP remaining or the destination address requests it, closes the channel immediately (returning unclaimed XRP to the source address). Otherwise, sets the channel to expire after settleDelay seconds have passed."
|
||||
}
|
||||
},
|
||||
"required": ["channel"],
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
},
|
||||
"publicKey": {
|
||||
"$ref": "publicKey",
|
||||
"description": "Public key of the key pair the source will use to sign claims against this channel."
|
||||
"description": "Public key of the key pair the source may use to sign claims against this channel."
|
||||
},
|
||||
"cancelAfter": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Time when this channel expires."
|
||||
"description": "Time when this channel expires. This expiration cannot be changed after creating the channel."
|
||||
},
|
||||
"sourceTag": {
|
||||
"$ref": "tag",
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"expiration": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "New expiration for this channel."
|
||||
"description": "New expiration for this channel. (This does not change the cancelAfter expiration, if the channel has one.) Cannot move the expiration sooner than settleDelay seconds from time of the request."
|
||||
}
|
||||
},
|
||||
"required": ["amount", "channel"],
|
||||
|
||||
72
src/common/types/commands/account_objects.ts
Normal file
72
src/common/types/commands/account_objects.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import {CheckLedgerEntry} from '../objects'
|
||||
|
||||
export interface GetAccountObjectsOptions {
|
||||
type?: string | (
|
||||
'check' |
|
||||
'escrow' |
|
||||
'offer' |
|
||||
'payment_channel' |
|
||||
'signer_list' |
|
||||
'state'
|
||||
),
|
||||
ledgerHash?: string,
|
||||
ledgerIndex?: number | ('validated' | 'closed' | 'current'),
|
||||
limit?: number,
|
||||
marker?: string
|
||||
}
|
||||
|
||||
export interface AccountObjectsRequest {
|
||||
account: string,
|
||||
|
||||
// (Optional) Filter results to include only this type of ledger object.
|
||||
type?: string | (
|
||||
'check' |
|
||||
'escrow' |
|
||||
'offer' |
|
||||
'payment_channel' |
|
||||
'signer_list' |
|
||||
'state'
|
||||
),
|
||||
|
||||
// (Optional) A 20-byte hex string for the ledger version to use.
|
||||
ledger_hash?: string,
|
||||
|
||||
// (Optional) The sequence number of the ledger to use,
|
||||
// or a shortcut string to choose a ledger automatically.
|
||||
ledger_index?: number | ('validated' | 'closed' | 'current'),
|
||||
|
||||
limit?: number,
|
||||
|
||||
marker?: string
|
||||
}
|
||||
|
||||
export interface AccountObjectsResponse {
|
||||
account: string,
|
||||
|
||||
// Array of objects owned by this account.
|
||||
account_objects: CheckLedgerEntry | object,
|
||||
|
||||
// (May be omitted) The identifying hash of the ledger
|
||||
// that was used to generate this response.
|
||||
ledger_hash?: string,
|
||||
|
||||
// (May be omitted) The sequence number of the ledger version
|
||||
// that was used to generate this response.
|
||||
ledger_index?: number,
|
||||
|
||||
// (May be omitted) The sequence number of the current in-progress ledger
|
||||
// version that was used to generate this response.
|
||||
ledger_current_index?: number,
|
||||
|
||||
// The limit that was used in this request, if any.
|
||||
limit?: number,
|
||||
|
||||
// Server-defined value indicating the response is paginated. Pass this
|
||||
// to the next call to resume where this call left off. Omitted when there
|
||||
// are no additional pages after this one.
|
||||
marker?: string,
|
||||
|
||||
// If true, this information comes from a ledger version
|
||||
// that has been validated by consensus.
|
||||
validated?: boolean
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
export * from './account_info'
|
||||
export * from './account_lines'
|
||||
export * from './account_objects'
|
||||
export * from './account_offers'
|
||||
export * from './book_offers'
|
||||
export * from './gateway_balances'
|
||||
|
||||
@@ -1,5 +1,49 @@
|
||||
import {SignerEntry} from './index'
|
||||
|
||||
export interface AccountRootLedgerEntry {
|
||||
LedgerEntryType: 'AccountRoot',
|
||||
Account: string,
|
||||
Balance: string,
|
||||
Flags: number,
|
||||
OwnerCount: number,
|
||||
PreviousTxnID: string,
|
||||
PreviousTxnLgrSeq: number,
|
||||
Sequence: number,
|
||||
AccountTxnID?: string,
|
||||
Domain?: string,
|
||||
EmailHash?: string,
|
||||
MessageKey?: string
|
||||
RegularKey?: string,
|
||||
TickSize?: number,
|
||||
TransferRate?: number,
|
||||
WalletLocator?: string, // DEPRECATED
|
||||
WalletSize?: number // DEPRECATED
|
||||
}
|
||||
|
||||
export interface AmendmentsLedgerEntry {
|
||||
LedgerEntryType: 'Amendments',
|
||||
Amendments?: string[],
|
||||
Majorities?: any[],
|
||||
Flags: 0
|
||||
}
|
||||
|
||||
export interface CheckLedgerEntry {
|
||||
LedgerEntryType: 'Check',
|
||||
Account: string,
|
||||
Destination, string,
|
||||
Flags: 0,
|
||||
OwnerNode: string,
|
||||
PreviousTxnID: string,
|
||||
PreviousTxnLgrSeq: number,
|
||||
SendMax: string | object,
|
||||
Sequence: number,
|
||||
DestinationNode: string,
|
||||
DestinationTag: number,
|
||||
Expiration: number,
|
||||
InvoiceID: string,
|
||||
SourceTag: number
|
||||
}
|
||||
|
||||
export interface PayChannelLedgerEntry {
|
||||
LedgerEntryType: 'PayChannel',
|
||||
Sequence: number,
|
||||
@@ -19,24 +63,6 @@ export interface PayChannelLedgerEntry {
|
||||
index: string
|
||||
}
|
||||
|
||||
export interface AccountRootLedgerEntry {
|
||||
LedgerEntryType: 'AccountRoot',
|
||||
Account: string,
|
||||
Flags: number,
|
||||
Sequence: number,
|
||||
Balance: string,
|
||||
OwnerCount: number,
|
||||
PreviousTxnID: string,
|
||||
PreviousTxnLgrSeq: number,
|
||||
AccountTxnID?: string,
|
||||
RegularKey?: string,
|
||||
EmailHash?: string,
|
||||
MessageKey?: string
|
||||
TickSize?: number,
|
||||
TransferRate?: number,
|
||||
Domain?: string
|
||||
}
|
||||
|
||||
export interface SignerListLedgerEntry {
|
||||
LedgerEntryType: 'SignerList',
|
||||
OwnerNode: string,
|
||||
@@ -50,7 +76,8 @@ export interface SignerListLedgerEntry {
|
||||
// TODO: Add the other ledger entry types, then remove the `any` fallback
|
||||
// see https://ripple.com/build/ledger-format/#ledger-object-types
|
||||
export type LedgerEntry =
|
||||
PayChannelLedgerEntry |
|
||||
AccountRootLedgerEntry |
|
||||
AmendmentsLedgerEntry |
|
||||
PayChannelLedgerEntry |
|
||||
SignerListLedgerEntry |
|
||||
any
|
||||
|
||||
27
src/ledger/accountobjects.ts
Normal file
27
src/ledger/accountobjects.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import {removeUndefined} from '../common'
|
||||
import {RippleAPI} from '../api'
|
||||
import {
|
||||
GetAccountObjectsOptions,
|
||||
AccountObjectsResponse
|
||||
} from '../common/types/commands/account_objects'
|
||||
|
||||
export default async function getAccountObjects(
|
||||
this: RippleAPI,
|
||||
address: string,
|
||||
options: GetAccountObjectsOptions = {}
|
||||
): Promise<AccountObjectsResponse> {
|
||||
// Don't validate the options so that new types can be passed
|
||||
// through to rippled. rippled validates requests.
|
||||
|
||||
// Make Request
|
||||
const response = await this._request('account_objects', removeUndefined({
|
||||
account: address,
|
||||
type: options.type,
|
||||
ledger_hash: options.ledgerHash,
|
||||
ledger_index: options.ledgerIndex,
|
||||
limit: options.limit,
|
||||
marker: options.marker
|
||||
}))
|
||||
// Return Response
|
||||
return response
|
||||
}
|
||||
@@ -73,7 +73,7 @@ async function makeRequest(
|
||||
ledger_index: options.ledgerVersion || 'validated',
|
||||
limit: options.limit,
|
||||
taker
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,15 +17,16 @@ export type FormattedOrderbookOrder = {
|
||||
state?: {
|
||||
fundedAmount: Amount,
|
||||
priceOfFundedAmount: Amount
|
||||
}
|
||||
},
|
||||
data: BookOffer
|
||||
}
|
||||
|
||||
export function parseOrderbookOrder(
|
||||
order: BookOffer
|
||||
data: BookOffer
|
||||
): FormattedOrderbookOrder {
|
||||
const direction = (order.Flags & orderFlags.Sell) === 0 ? 'buy' : 'sell'
|
||||
const takerGetsAmount = parseAmount(order.TakerGets)
|
||||
const takerPaysAmount = parseAmount(order.TakerPays)
|
||||
const direction = (data.Flags & orderFlags.Sell) === 0 ? 'buy' : 'sell'
|
||||
const takerGetsAmount = parseAmount(data.TakerGets)
|
||||
const takerPaysAmount = parseAmount(data.TakerPays)
|
||||
const quantity = (direction === 'buy') ? takerPaysAmount : takerGetsAmount
|
||||
const totalPrice = (direction === 'buy') ? takerGetsAmount : takerPaysAmount
|
||||
|
||||
@@ -35,25 +36,25 @@ export function parseOrderbookOrder(
|
||||
direction: direction,
|
||||
quantity: quantity,
|
||||
totalPrice: totalPrice,
|
||||
passive: ((order.Flags & orderFlags.Passive) !== 0) || undefined,
|
||||
expirationTime: parseTimestamp(order.Expiration)
|
||||
passive: ((data.Flags & orderFlags.Passive) !== 0) || undefined,
|
||||
expirationTime: parseTimestamp(data.Expiration)
|
||||
})
|
||||
|
||||
const properties = {
|
||||
maker: order.Account,
|
||||
sequence: order.Sequence,
|
||||
makerExchangeRate: adjustQualityForXRP(order.quality,
|
||||
maker: data.Account,
|
||||
sequence: data.Sequence,
|
||||
makerExchangeRate: adjustQualityForXRP(data.quality,
|
||||
takerGetsAmount.currency, takerPaysAmount.currency)
|
||||
}
|
||||
|
||||
const takerGetsFunded = order.taker_gets_funded ?
|
||||
parseAmount(order.taker_gets_funded) : undefined
|
||||
const takerPaysFunded = order.taker_pays_funded ?
|
||||
parseAmount(order.taker_pays_funded) : undefined
|
||||
const takerGetsFunded = data.taker_gets_funded ?
|
||||
parseAmount(data.taker_gets_funded) : undefined
|
||||
const takerPaysFunded = data.taker_pays_funded ?
|
||||
parseAmount(data.taker_pays_funded) : undefined
|
||||
const available = removeUndefined({
|
||||
fundedAmount: takerGetsFunded,
|
||||
priceOfFundedAmount: takerPaysFunded
|
||||
})
|
||||
const state = _.isEmpty(available) ? undefined : available
|
||||
return removeUndefined({specification, properties, state})
|
||||
return removeUndefined({specification, properties, state, data})
|
||||
}
|
||||
|
||||
@@ -2,27 +2,32 @@ import * as utils from './utils'
|
||||
import keypairs = require('ripple-keypairs')
|
||||
import binary = require('ripple-binary-codec')
|
||||
import {computeBinaryTransactionHash} from 'ripple-hashes'
|
||||
import {SignOptions, KeyPair} from './types'
|
||||
const validate = utils.common.validate
|
||||
|
||||
function computeSignature(tx: Object, privateKey: string, signAs?: string) {
|
||||
const signingData = signAs ?
|
||||
binary.encodeForMultisigning(tx, signAs) : binary.encodeForSigning(tx)
|
||||
const signingData = signAs
|
||||
? binary.encodeForMultisigning(tx, signAs)
|
||||
: binary.encodeForSigning(tx)
|
||||
return keypairs.sign(signingData, privateKey)
|
||||
}
|
||||
|
||||
function sign(txJSON: string, secret: string, options: {signAs?: string} = {}
|
||||
): {signedTransaction: string; id: string} {
|
||||
validate.sign({txJSON, secret})
|
||||
// we can't validate that the secret matches the account because
|
||||
// the secret could correspond to the regular key
|
||||
function signWithKeypair(
|
||||
txJSON: string,
|
||||
keypair: KeyPair,
|
||||
options: SignOptions = {
|
||||
signAs: ''
|
||||
}
|
||||
): { signedTransaction: string; id: string } {
|
||||
validate.sign({txJSON, keypair})
|
||||
|
||||
const tx = JSON.parse(txJSON)
|
||||
if (tx.TxnSignature || tx.Signers) {
|
||||
throw new utils.common.errors.ValidationError(
|
||||
'txJSON must not contain "TxnSignature" or "Signers" properties')
|
||||
'txJSON must not contain "TxnSignature" or "Signers" properties'
|
||||
)
|
||||
}
|
||||
|
||||
const keypair = keypairs.deriveKeypair(secret)
|
||||
tx.SigningPubKey = options.signAs ? '' : keypair.publicKey
|
||||
|
||||
if (options.signAs) {
|
||||
@@ -43,4 +48,20 @@ function sign(txJSON: string, secret: string, options: {signAs?: string} = {}
|
||||
}
|
||||
}
|
||||
|
||||
function sign(
|
||||
txJSON: string,
|
||||
secret?: any,
|
||||
options?: SignOptions,
|
||||
keypair?: KeyPair
|
||||
): { signedTransaction: string; id: string } {
|
||||
if (typeof secret === 'string') {
|
||||
// we can't validate that the secret matches the account because
|
||||
// the secret could correspond to the regular key
|
||||
validate.sign({txJSON, secret})
|
||||
return signWithKeypair(txJSON, keypairs.deriveKeypair(secret), options)
|
||||
} else {
|
||||
return signWithKeypair(txJSON, keypair ? keypair : secret, options)
|
||||
}
|
||||
}
|
||||
|
||||
export default sign
|
||||
|
||||
@@ -50,6 +50,15 @@ export interface OfferCreateTransaction {
|
||||
Memos: {Memo: ApiMemo}[]
|
||||
}
|
||||
|
||||
export type KeyPair = {
|
||||
publicKey: string,
|
||||
privateKey: string
|
||||
}
|
||||
|
||||
export type SignOptions = {
|
||||
signAs: string
|
||||
}
|
||||
|
||||
export type Outcome = {
|
||||
result: string,
|
||||
ledgerVersion: number,
|
||||
|
||||
@@ -503,6 +503,58 @@ describe('RippleAPI', function () {
|
||||
assert.deepEqual(signature, responses.sign.signAs);
|
||||
});
|
||||
|
||||
it('sign - withKeypair', function () {
|
||||
const keypair = {
|
||||
privateKey:
|
||||
'00ACCD3309DB14D1A4FC9B1DAE608031F4408C85C73EE05E035B7DC8B25840107A',
|
||||
publicKey:
|
||||
'02F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D8'
|
||||
};
|
||||
const result = this.api.sign(requests.sign.normal.txJSON, keypair);
|
||||
assert.deepEqual(result, responses.sign.normal);
|
||||
schemaValidator.schemaValidate('sign', result);
|
||||
});
|
||||
|
||||
it('sign - withKeypair already signed', function () {
|
||||
const keypair = {
|
||||
privateKey:
|
||||
'00ACCD3309DB14D1A4FC9B1DAE608031F4408C85C73EE05E035B7DC8B25840107A',
|
||||
publicKey:
|
||||
'02F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D8'
|
||||
};
|
||||
const result = this.api.sign(requests.sign.normal.txJSON, keypair);
|
||||
assert.throws(() => {
|
||||
const tx = JSON.stringify(binary.decode(result.signedTransaction));
|
||||
this.api.sign(tx, keypair);
|
||||
}, /txJSON must not contain "TxnSignature" or "Signers" properties/);
|
||||
});
|
||||
|
||||
it('sign - withKeypair EscrowExecution', function () {
|
||||
const keypair = {
|
||||
privateKey:
|
||||
'001ACAAEDECE405B2A958212629E16F2EB46B153EEE94CDD350FDEFF52795525B7',
|
||||
publicKey:
|
||||
'0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020'
|
||||
};
|
||||
const result = this.api.sign(requests.sign.escrow.txJSON, keypair);
|
||||
assert.deepEqual(result, responses.sign.escrow);
|
||||
schemaValidator.schemaValidate('sign', result);
|
||||
});
|
||||
|
||||
it('sign - withKeypair signAs', function () {
|
||||
const txJSON = requests.sign.signAs;
|
||||
const keypair = {
|
||||
privateKey:
|
||||
'001ACAAEDECE405B2A958212629E16F2EB46B153EEE94CDD350FDEFF52795525B7',
|
||||
publicKey:
|
||||
'0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020'
|
||||
};
|
||||
const signature = this.api.sign(JSON.stringify(txJSON), keypair, {
|
||||
signAs: 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh'
|
||||
});
|
||||
assert.deepEqual(signature, responses.sign.signAs);
|
||||
});
|
||||
|
||||
it('submit', function () {
|
||||
return this.api.submit(responses.sign.normal.signedTransaction).then(
|
||||
_.partial(checkResult, responses.submit, 'submit'));
|
||||
@@ -1149,6 +1201,33 @@ describe('RippleAPI', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('getAccountObjects', function () {
|
||||
return this.api.getAccountObjects(address).then(response =>
|
||||
checkResult(responses.getAccountObjects, 'AccountObjectsResponse', response));
|
||||
});
|
||||
|
||||
it('getAccountObjects - invalid options', function () {
|
||||
// Intentionally no local validation of these options
|
||||
return this.api.getAccountObjects(address, {invalid: 'options'}).then(response =>
|
||||
checkResult(responses.getAccountObjects, 'AccountObjectsResponse', response));
|
||||
});
|
||||
|
||||
it('request account_objects', function () {
|
||||
return this.api._request('account_objects', {
|
||||
account: address
|
||||
}).then(response =>
|
||||
checkResult(responses.getAccountObjects, 'AccountObjectsResponse', response));
|
||||
});
|
||||
|
||||
it('request account_objects - invalid options', function () {
|
||||
// Intentionally no local validation of these options
|
||||
return this.api._request('account_objects', {
|
||||
account: address,
|
||||
invalid: 'options'
|
||||
}).then(response =>
|
||||
checkResult(responses.getAccountObjects, 'AccountObjectsResponse', response));
|
||||
});
|
||||
|
||||
it('getOrders', function () {
|
||||
return this.api.getOrders(address).then(
|
||||
_.partial(checkResult, responses.getOrders, 'getOrders'));
|
||||
|
||||
269
test/fixtures/responses/get-account-objects.json
vendored
Normal file
269
test/fixtures/responses/get-account-objects.json
vendored
Normal file
@@ -0,0 +1,269 @@
|
||||
{
|
||||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"account_objects": [
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "ASP",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 65536,
|
||||
"HighLimit": {
|
||||
"currency": "ASP",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "ASP",
|
||||
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||||
"value": "10"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID":
|
||||
"BF7555B0F018E3C5E2A3FF9437A1A5092F32903BE246202F988181B9CED0D862",
|
||||
"PreviousTxnLgrSeq": 1438879,
|
||||
"index":
|
||||
"2243B0B630EA6F7330B654EFA53E27A7609D9484E535AB11B7F946DF3D247CE9"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "XAU",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 3342336,
|
||||
"HighLimit": {
|
||||
"currency": "XAU",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "XAU",
|
||||
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||||
"value": "0"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID":
|
||||
"79B26D7D34B950AC2C2F91A299A6888FABB376DD76CFF79D56E805BF439F6942",
|
||||
"PreviousTxnLgrSeq": 5982530,
|
||||
"index":
|
||||
"9ED4406351B7A511A012A9B5E7FE4059FA2F7650621379C0013492C315E25B97"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "USD",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 1114112,
|
||||
"HighLimit": {
|
||||
"currency": "USD",
|
||||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "USD",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "5"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID":
|
||||
"6FE8C824364FB1195BCFEDCB368DFEE3980F7F78D3BF4DC4174BB4C86CF8C5CE",
|
||||
"PreviousTxnLgrSeq": 10555014,
|
||||
"index":
|
||||
"2DECFAC23B77D5AEA6116C15F5C6D4669EBAEE9E7EE050A40FE2B1E47B6A9419"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "MXN",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "481.992867407479"
|
||||
},
|
||||
"Flags": 65536,
|
||||
"HighLimit": {
|
||||
"currency": "MXN",
|
||||
"issuer": "rHpXfibHgSb64n8kK9QWDpdbfqSpYbM9a4",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "MXN",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "1000"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID":
|
||||
"A467BACE5F183CDE1F075F72435FE86BAD8626ED1048EDEFF7562A4CC76FD1C5",
|
||||
"PreviousTxnLgrSeq": 3316170,
|
||||
"index":
|
||||
"EC8B9B6B364AF6CB6393A423FDD2DDBA96375EC772E6B50A3581E53BFBDFDD9A"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "EUR",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0.793598266778297"
|
||||
},
|
||||
"Flags": 1114112,
|
||||
"HighLimit": {
|
||||
"currency": "EUR",
|
||||
"issuer": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "EUR",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "1"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID":
|
||||
"E9345D44433EA368CFE1E00D84809C8E695C87FED18859248E13662D46A0EC46",
|
||||
"PreviousTxnLgrSeq": 5447146,
|
||||
"index":
|
||||
"4513749B30F4AF8DA11F077C448128D6486BF12854B760E4E5808714588AA915"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "CNY",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 2228224,
|
||||
"HighLimit": {
|
||||
"currency": "CNY",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "3"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "CNY",
|
||||
"issuer": "rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK",
|
||||
"value": "0"
|
||||
},
|
||||
"LowNode": "0000000000000008",
|
||||
"PreviousTxnID":
|
||||
"2FDDC81F4394695B01A47913BEC4281AC9A283CC8F903C14ADEA970F60E57FCF",
|
||||
"PreviousTxnLgrSeq": 5949673,
|
||||
"index":
|
||||
"578C327DA8944BDE2E10C9BA36AFA2F43E06C8D1E8819FB225D266CBBCFDE5CE"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "DYM",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "1.336889190631542"
|
||||
},
|
||||
"Flags": 65536,
|
||||
"HighLimit": {
|
||||
"currency": "DYM",
|
||||
"issuer": "rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "DYM",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "3"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID":
|
||||
"6DA2BD02DFB83FA4DAFC2651860B60071156171E9C021D9E0372A61A477FFBB1",
|
||||
"PreviousTxnLgrSeq": 8818732,
|
||||
"index":
|
||||
"5A2A5FF12E71AEE57564E624117BBA68DEF78CD564EF6259F92A011693E027C7"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "CHF",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "-0.3488146605801446"
|
||||
},
|
||||
"Flags": 131072,
|
||||
"HighLimit": {
|
||||
"currency": "CHF",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "CHF",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0"
|
||||
},
|
||||
"LowNode": "000000000000008C",
|
||||
"PreviousTxnID":
|
||||
"722394372525A13D1EAAB005642F50F05A93CF63F7F472E0F91CDD6D38EB5869",
|
||||
"PreviousTxnLgrSeq": 2687590,
|
||||
"index":
|
||||
"F2DBAD20072527F6AD02CE7F5A450DBC72BE2ABB91741A8A3ADD30D5AD7A99FB"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 131072,
|
||||
"HighLimit": {
|
||||
"currency": "BTC",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "3"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0"
|
||||
},
|
||||
"LowNode": "0000000000000043",
|
||||
"PreviousTxnID":
|
||||
"03EDF724397D2DEE70E49D512AECD619E9EA536BE6CFD48ED167AE2596055C9A",
|
||||
"PreviousTxnLgrSeq": 8317037,
|
||||
"index":
|
||||
"767C12AF647CDF5FEB9019B37018748A79C50EDAF87E8D4C7F39F78AA7CA9765"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "USD",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "-16.00534471983042"
|
||||
},
|
||||
"Flags": 131072,
|
||||
"HighLimit": {
|
||||
"currency": "USD",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "5000"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0"
|
||||
},
|
||||
"LowNode": "000000000000004A",
|
||||
"PreviousTxnID":
|
||||
"CFFF5CFE623C9543308C6529782B6A6532207D819795AAFE85555DB8BF390FE7",
|
||||
"PreviousTxnLgrSeq": 14365854,
|
||||
"index":
|
||||
"826CF5BFD28F3934B518D0BDF3231259CBD3FD0946E3C3CA0C97D2C75D2D1A09"
|
||||
}
|
||||
],
|
||||
"ledger_hash":
|
||||
"053DF17D2289D1C4971C22F235BC1FCA7D4B3AE966F842E5819D0749E0B8ECD3",
|
||||
"ledger_index": 14378733,
|
||||
"validated": true
|
||||
}
|
||||
@@ -17,6 +17,26 @@
|
||||
"maker": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"sequence": 5,
|
||||
"makerExchangeRate": "3.970260734451929e-8"
|
||||
},
|
||||
"data": {
|
||||
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"BookDirectory": "A118405CF7C2C89AB0CC084417187B86870DC14325C861A0470E1AEE5CBE20D9",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "9DD36CC7338FEB9E501A33EAAA4C00DBE4ED3A692704C62DDBD1848EE1F6E762",
|
||||
"PreviousTxnLgrSeq": 11,
|
||||
"Sequence": 5,
|
||||
"TakerGets": "254391353000000",
|
||||
"TakerPays": {
|
||||
"currency": "USD",
|
||||
"issuer": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
|
||||
"value": "10.1"
|
||||
},
|
||||
"index": "BF656DABDD84E6128A45039F8D557C9477D4DA31F5B00868F2191F0A11FE3798",
|
||||
"owner_funds": "99999998959999928",
|
||||
"quality": "3970260734451929e-29"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -38,6 +58,25 @@
|
||||
"maker": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"sequence": 6,
|
||||
"makerExchangeRate": "0.0000780093458738806"
|
||||
},
|
||||
"data": {
|
||||
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"BookDirectory": "A118405CF7C2C89AB0CC084417187B86870DC14325C861A0561BB6E89EFF509C",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 131072,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "CFB5786459E568DFC504E7319C515658DED657A7F4EFB5957B33E5E3BD9A1353",
|
||||
"PreviousTxnLgrSeq": 13,
|
||||
"Sequence": 6,
|
||||
"TakerPays": "134000000",
|
||||
"TakerGets": {
|
||||
"currency": "USD",
|
||||
"issuer": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
|
||||
"value": "10453252347.1"
|
||||
},
|
||||
"index": "C72CDC1BA4DA529B062871F22C6D175A4D97D4F1160D0D7E646E60699278B5B5",
|
||||
"quality": "78.0093458738806"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
542
test/fixtures/responses/get-orderbook.json
vendored
542
test/fixtures/responses/get-orderbook.json
vendored
@@ -18,6 +18,30 @@
|
||||
"maker": "rwBYyfufTzk77zUSKEu4MvixfarC35av1J",
|
||||
"sequence": 386940,
|
||||
"makerExchangeRate": "326.5003614141928"
|
||||
},
|
||||
"data": {
|
||||
"Account": "rwBYyfufTzk77zUSKEu4MvixfarC35av1J",
|
||||
"BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC98570B9980E49C7DE8",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000008",
|
||||
"PreviousTxnID": "92DBA0BE18B331AC61FB277211477A255D3B5EA9C5FE689171DE689FB45FE18A",
|
||||
"PreviousTxnLgrSeq": 10714030,
|
||||
"Sequence": 386940,
|
||||
"TakerGets": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.2849323720855092"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "93.030522464522"
|
||||
},
|
||||
"index": "8092033091034D94219BC1131AF7A6B469D790D81831CB479AB6F67A32BE4E13",
|
||||
"owner_funds": "31.77682120227525",
|
||||
"quality": "326.5003614141928"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -38,6 +62,30 @@
|
||||
"maker": "rwjsRktX1eguUr1pHTffyHnC4uyrvX58V1",
|
||||
"sequence": 207855,
|
||||
"makerExchangeRate": "330.6364334177034"
|
||||
},
|
||||
"data": {
|
||||
"Account": "rwjsRktX1eguUr1pHTffyHnC4uyrvX58V1",
|
||||
"BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC98570BBF1EEFA2FB0A",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "C6BDA152363E3CFE18688A6830B49F3DB2B05976110B5908EA4EB66D93DEEB1F",
|
||||
"PreviousTxnLgrSeq": 10714031,
|
||||
"Sequence": 207855,
|
||||
"TakerGets": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.00302447007930511"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "1"
|
||||
},
|
||||
"index": "8DB3520FF9CB16A0EA955056C49115F8CFB03A587D0A4AFC844F1D220EFCE0B9",
|
||||
"owner_funds": "0.0670537912615556",
|
||||
"quality": "330.6364334177034"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -59,6 +107,31 @@
|
||||
"maker": "raudnGKfTK23YKfnS7ixejHrqGERTYNFXk",
|
||||
"sequence": 110103,
|
||||
"makerExchangeRate": "331.1338298016111"
|
||||
},
|
||||
"data": {
|
||||
"Account": "raudnGKfTK23YKfnS7ixejHrqGERTYNFXk",
|
||||
"BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC98570BC3A506FC016F",
|
||||
"BookNode": "0000000000000000",
|
||||
"Expiration": 472785283,
|
||||
"Flags": 131072,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "00000000000008F0",
|
||||
"PreviousTxnID": "77E763F1D02F58965CD1AD94F557B37A582FAC7760B71F391B856959836C2F7B",
|
||||
"PreviousTxnLgrSeq": 10713576,
|
||||
"Sequence": 110103,
|
||||
"TakerGets": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.3"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "99.34014894048333"
|
||||
},
|
||||
"index": "9ECDFD31B28643FD3A54658398C5715D6DAD574F83F04529CB24765770F9084D",
|
||||
"owner_funds": "4.021116654525635",
|
||||
"quality": "331.1338298016111"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -91,6 +164,40 @@
|
||||
"value": "268.2219496064341",
|
||||
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"Account": "rPyYxUGK8L4dgEvjPs3aRc1B1jEiLr3Hx5",
|
||||
"BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC98570BCB85BCA78000",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 131072,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "D22993C68C94ACE3F2FCE4A334EBEA98CC46DCA92886C12B5E5B4780B5E17D4E",
|
||||
"PreviousTxnLgrSeq": 10711938,
|
||||
"Sequence": 392,
|
||||
"TakerGets": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.8095"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "268.754"
|
||||
},
|
||||
"index": "18B136E08EF50F0DEE8521EA22D16A950CD8B6DDF5F6E07C35F7FDDBBB09718D",
|
||||
"owner_funds": "0.8095132334507441",
|
||||
"quality": "332",
|
||||
"taker_gets_funded": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.8078974385735969"
|
||||
},
|
||||
"taker_pays_funded": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "268.2219496064341"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -112,6 +219,30 @@
|
||||
"maker": "raudnGKfTK23YKfnS7ixejHrqGERTYNFXk",
|
||||
"sequence": 110105,
|
||||
"makerExchangeRate": "337.7996295968016"
|
||||
},
|
||||
"data": {
|
||||
"Account": "raudnGKfTK23YKfnS7ixejHrqGERTYNFXk",
|
||||
"BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC98570C00450D461510",
|
||||
"BookNode": "0000000000000000",
|
||||
"Expiration": 472785284,
|
||||
"Flags": 131072,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "00000000000008F0",
|
||||
"PreviousTxnID": "1F4D9D859D9AABA888C0708A572B38919A3AEF2C8C1F5A13F58F44C92E5FF3FB",
|
||||
"PreviousTxnLgrSeq": 10713576,
|
||||
"Sequence": 110105,
|
||||
"TakerGets": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.4499999999999999"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "152.0098333185607"
|
||||
},
|
||||
"index": "9F380E0B39E2AF8AA9608C3E39A5A8628E6D0F44385C6D12BE06F4FEC8D83351",
|
||||
"quality": "337.7996295968016"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -132,6 +263,30 @@
|
||||
"maker": "rDbsCJr5m8gHDCNEHCZtFxcXHsD4S9jH83",
|
||||
"sequence": 110061,
|
||||
"makerExchangeRate": "347.2306949944844"
|
||||
},
|
||||
"data": {
|
||||
"Account": "rDbsCJr5m8gHDCNEHCZtFxcXHsD4S9jH83",
|
||||
"BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC98570C560B764D760C",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 131072,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000001",
|
||||
"PreviousTxnID": "9A0B6B76F0D86614F965A2FFCC8859D8607F4E424351D4CFE2FBE24510F93F25",
|
||||
"PreviousTxnLgrSeq": 10708382,
|
||||
"Sequence": 110061,
|
||||
"TakerGets": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.003768001830745216"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "1.308365894430151"
|
||||
},
|
||||
"index": "B971769686CE1B9139502770158A4E7C011CFF8E865E5AAE5428E23AAA0E146D",
|
||||
"owner_funds": "0.2229210189326514",
|
||||
"quality": "347.2306949944844"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -153,6 +308,31 @@
|
||||
"maker": "rDVBvAQScXrGRGnzrxRrcJPeNLeLeUTAqE",
|
||||
"sequence": 35788,
|
||||
"makerExchangeRate": "352.7092203179974"
|
||||
},
|
||||
"data": {
|
||||
"Account": "rDVBvAQScXrGRGnzrxRrcJPeNLeLeUTAqE",
|
||||
"BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC98570C87DF25DC4FC6",
|
||||
"BookNode": "0000000000000000",
|
||||
"Expiration": 472783298,
|
||||
"Flags": 131072,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "00000000000003D2",
|
||||
"PreviousTxnID": "E5F9A10F29A4BB3634D5A84FC96931E17267B58E0D2D5ADE24FFB751E52ADB9E",
|
||||
"PreviousTxnLgrSeq": 10713533,
|
||||
"Sequence": 35788,
|
||||
"TakerGets": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.5"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "176.3546101589987"
|
||||
},
|
||||
"index": "D2CB71038AD0ECAF4B5FF0A953AD1257225D0071E6F3AF9ADE67F05590B45C6E",
|
||||
"owner_funds": "6.617688680663627",
|
||||
"quality": "352.7092203179974"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -185,6 +365,40 @@
|
||||
"value": "179.1217564870259",
|
||||
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"Account": "rN6jbxx4H6NxcnmkzBxQnbCWLECNKrgSSf",
|
||||
"BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC98570CC0B8E0E2C000",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 131072,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "2E16ACFEAC2306E3B3483D445787F3496FACF9504F7A5E909620C1A73E2EDE54",
|
||||
"PreviousTxnLgrSeq": 10558020,
|
||||
"Sequence": 491,
|
||||
"TakerGets": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.5"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "179.48"
|
||||
},
|
||||
"index": "DA853913C8013C9471957349EDAEE4DF4846833B8CCB92008E2A8994E37BEF0D",
|
||||
"owner_funds": "0.5",
|
||||
"quality": "358.96",
|
||||
"taker_gets_funded": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.499001996007984"
|
||||
},
|
||||
"taker_pays_funded": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "179.1217564870259"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -206,6 +420,30 @@
|
||||
"maker": "rDVBvAQScXrGRGnzrxRrcJPeNLeLeUTAqE",
|
||||
"sequence": 35789,
|
||||
"makerExchangeRate": "360.9637829743709"
|
||||
},
|
||||
"data": {
|
||||
"Account": "rDVBvAQScXrGRGnzrxRrcJPeNLeLeUTAqE",
|
||||
"BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC98570CD2F24C9C145D",
|
||||
"BookNode": "0000000000000000",
|
||||
"Expiration": 472783299,
|
||||
"Flags": 131072,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "00000000000003D2",
|
||||
"PreviousTxnID": "B1B12E47043B4260223A2C4240D19E93526B55B1DB38DEED335DACE7C04FEB23",
|
||||
"PreviousTxnLgrSeq": 10713534,
|
||||
"Sequence": 35789,
|
||||
"TakerGets": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.8"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "288.7710263794967"
|
||||
},
|
||||
"index": "B89AD580E908F7337CCBB47A0BAAC6417EF13AC3465E34E8B7DD3BED016EA833",
|
||||
"quality": "360.9637829743709"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -238,6 +476,40 @@
|
||||
"value": "82.50309772176658",
|
||||
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"Account": "rUeCeioKJkbYhv4mRGuAbZpPcqkMCoYq6N",
|
||||
"BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC98570D0069F50EA028",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000012",
|
||||
"PreviousTxnID": "F0E8ABF07F83DF0B5EF5B417E8E29A45A5503BA8F26FBC86447CC6B1FAD6A1C4",
|
||||
"PreviousTxnLgrSeq": 10447672,
|
||||
"Sequence": 5255,
|
||||
"TakerGets": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.5"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "182.9814890090516"
|
||||
},
|
||||
"index": "D652DCE4B19C6CB43912651D3A975371D3B2A16A034EDF07BC11BF721AEF94A4",
|
||||
"owner_funds": "0.225891986027944",
|
||||
"quality": "365.9629780181032",
|
||||
"taker_gets_funded": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.2254411038203033"
|
||||
},
|
||||
"taker_pays_funded": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "82.50309772176658"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -260,6 +532,30 @@
|
||||
"maker": "r49y2xKuKVG2dPkNHgWQAV61cjxk8gryjQ",
|
||||
"sequence": 434,
|
||||
"makerExchangeRate": "0.003120027456241615"
|
||||
},
|
||||
"data": {
|
||||
"Account": "r49y2xKuKVG2dPkNHgWQAV61cjxk8gryjQ",
|
||||
"BookDirectory": "20294C923E80A51B487EB9547B3835FD483748B170D2D0A4520B15A60037FFCF",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "544932DC56D72E845AF2B738821FE07865E32EC196270678AB0D947F54E9F49F",
|
||||
"PreviousTxnLgrSeq": 10679000,
|
||||
"Sequence": 434,
|
||||
"TakerGets": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "3205.1"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "10"
|
||||
},
|
||||
"index": "CE457115A4ADCC8CB351B3E35A0851E48DE16605C23E305017A9B697B156DE5A",
|
||||
"owner_funds": "41952.95917199965",
|
||||
"quality": "0.003120027456241615"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -280,6 +576,30 @@
|
||||
"maker": "rDYCRhpahKEhCFV25xScg67Bwf4W9sTYAm",
|
||||
"sequence": 233,
|
||||
"makerExchangeRate": "0.003125"
|
||||
},
|
||||
"data": {
|
||||
"Account": "rDYCRhpahKEhCFV25xScg67Bwf4W9sTYAm",
|
||||
"BookDirectory": "20294C923E80A51B487EB9547B3835FD483748B170D2D0A4520B1A2BC2EC5000",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "F68F9658AB3D462FEB027E6C380F054BC6D2514B43EC3C6AD46EE19C59BF1CC3",
|
||||
"PreviousTxnLgrSeq": 10704238,
|
||||
"Sequence": 233,
|
||||
"TakerGets": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "1599.063669386278"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "4.99707396683212"
|
||||
},
|
||||
"index": "BF14FBB305159DBCAEA91B7E848408F5B559A91B160EBCB6D244958A6A16EA6B",
|
||||
"owner_funds": "3169.910902910102",
|
||||
"quality": "0.003125"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -313,6 +633,41 @@
|
||||
"value": "0",
|
||||
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"Account": "raudnGKfTK23YKfnS7ixejHrqGERTYNFXk",
|
||||
"BookDirectory": "20294C923E80A51B487EB9547B3835FD483748B170D2D0A4520B2BF1C2F4D4C9",
|
||||
"BookNode": "0000000000000000",
|
||||
"Expiration": 472785284,
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "00000000000008F0",
|
||||
"PreviousTxnID": "446410E1CD718AC01929DD16B558FCF6B3A7B8BF208C420E67A280C089C5C59B",
|
||||
"PreviousTxnLgrSeq": 10713576,
|
||||
"Sequence": 110104,
|
||||
"TakerGets": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "143.1050962074379"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.4499999999999999"
|
||||
},
|
||||
"index": "67924B0EAA15784CC00CCD5FDD655EE2D6D2AE40341776B5F14E52341E7FC73E",
|
||||
"owner_funds": "0",
|
||||
"quality": "0.003144542101755081",
|
||||
"taker_gets_funded": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0"
|
||||
},
|
||||
"taker_pays_funded": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -346,6 +701,41 @@
|
||||
"value": "0",
|
||||
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"Account": "rDVBvAQScXrGRGnzrxRrcJPeNLeLeUTAqE",
|
||||
"BookDirectory": "20294C923E80A51B487EB9547B3835FD483748B170D2D0A4520B2CD7A2BFBB75",
|
||||
"BookNode": "0000000000000000",
|
||||
"Expiration": 472772651,
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "00000000000003CD",
|
||||
"PreviousTxnID": "D49164AB68DDA3AEC9DFCC69A35685C4F532B5C231D3C1D25FEA7D5D0224FB84",
|
||||
"PreviousTxnLgrSeq": 10711128,
|
||||
"Sequence": 35625,
|
||||
"TakerGets": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "254.329207354604"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.8"
|
||||
},
|
||||
"index": "567BF2825173E3FB28FC94E436B6EB30D9A415FC2335E6D25CDE1BE47B25D120",
|
||||
"owner_funds": "0",
|
||||
"quality": "0.003145529403882357",
|
||||
"taker_gets_funded": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0"
|
||||
},
|
||||
"taker_pays_funded": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -366,6 +756,30 @@
|
||||
"maker": "rwBYyfufTzk77zUSKEu4MvixfarC35av1J",
|
||||
"sequence": 387756,
|
||||
"makerExchangeRate": "0.003155743848271834"
|
||||
},
|
||||
"data": {
|
||||
"Account": "rwBYyfufTzk77zUSKEu4MvixfarC35av1J",
|
||||
"BookDirectory": "20294C923E80A51B487EB9547B3835FD483748B170D2D0A4520B3621DF140FDA",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000008",
|
||||
"PreviousTxnID": "2E371E2B287C8A9FBB3424E4204B17AD9FA1BAA9F3B33C7D2261E3B038AFF083",
|
||||
"PreviousTxnLgrSeq": 10716291,
|
||||
"Sequence": 387756,
|
||||
"TakerGets": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "390.4979"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "1.23231134568807"
|
||||
},
|
||||
"index": "8CA23E55BF9F46AC7E803D3DB40FD03225EFCA66650D4CF0CBDD28A7CCDC8400",
|
||||
"owner_funds": "5704.824764087842",
|
||||
"quality": "0.003155743848271834"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -386,6 +800,30 @@
|
||||
"maker": "rwjsRktX1eguUr1pHTffyHnC4uyrvX58V1",
|
||||
"sequence": 208927,
|
||||
"makerExchangeRate": "0.003160328237957649"
|
||||
},
|
||||
"data": {
|
||||
"Account": "rwjsRktX1eguUr1pHTffyHnC4uyrvX58V1",
|
||||
"BookDirectory": "20294C923E80A51B487EB9547B3835FD483748B170D2D0A4520B3A4D41FF4211",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "91763FA7089C63CC4D5D14CBA6A5A5BF7ECE949B0D34F00FD35E733AF9F05AF1",
|
||||
"PreviousTxnLgrSeq": 10716292,
|
||||
"Sequence": 208927,
|
||||
"TakerGets": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "1"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.003160328237957649"
|
||||
},
|
||||
"index": "7206866E39D9843623EE79E570242753DEE3C597F3856AEFB4631DD5AD8B0557",
|
||||
"owner_funds": "45.55665106096075",
|
||||
"quality": "0.003160328237957649"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -406,6 +844,29 @@
|
||||
"maker": "r49y2xKuKVG2dPkNHgWQAV61cjxk8gryjQ",
|
||||
"sequence": 429,
|
||||
"makerExchangeRate": "0.003174603174603175"
|
||||
},
|
||||
"data": {
|
||||
"Account": "r49y2xKuKVG2dPkNHgWQAV61cjxk8gryjQ",
|
||||
"BookDirectory": "20294C923E80A51B487EB9547B3835FD483748B170D2D0A4520B4748E68669A7",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "3B3CF6FF1A336335E78513CF77AFD3A784ACDD7B1B4D3F1F16E22957A060BFAE",
|
||||
"PreviousTxnLgrSeq": 10639969,
|
||||
"Sequence": 429,
|
||||
"TakerGets": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "4725"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "15"
|
||||
},
|
||||
"index": "42894809370C7E6B23498EF8E22AD4B05F02B94F08E6983357A51EA96A95FF7F",
|
||||
"quality": "0.003174603174603175"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -426,6 +887,30 @@
|
||||
"maker": "rDbsCJr5m8gHDCNEHCZtFxcXHsD4S9jH83",
|
||||
"sequence": 110099,
|
||||
"makerExchangeRate": "0.003193013959408667"
|
||||
},
|
||||
"data": {
|
||||
"Account": "rDbsCJr5m8gHDCNEHCZtFxcXHsD4S9jH83",
|
||||
"BookDirectory": "20294C923E80A51B487EB9547B3835FD483748B170D2D0A4520B58077ED03C1B",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 131072,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000001",
|
||||
"PreviousTxnID": "98F3F2D02D3BB0AEAC09EECCF2F24BBE5E1AB2C71C40D7BD0A5199E12541B6E2",
|
||||
"PreviousTxnLgrSeq": 10715839,
|
||||
"Sequence": 110099,
|
||||
"TakerGets": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "1.24252537879871"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0.003967400879423823"
|
||||
},
|
||||
"index": "F4404D6547149419D3607F81D7080979FBB3AFE2661F9A933E2F6C07AC1D1F6D",
|
||||
"owner_funds": "73.52163803897041",
|
||||
"quality": "0.003193013959408667"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -459,6 +944,40 @@
|
||||
"value": "0",
|
||||
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"Account": "rDVBvAQScXrGRGnzrxRrcJPeNLeLeUTAqE",
|
||||
"BookDirectory": "20294C923E80A51B487EB9547B3835FD483748B170D2D0A4520B72A555B981A3",
|
||||
"BookNode": "0000000000000000",
|
||||
"Expiration": 472772652,
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "00000000000003CD",
|
||||
"PreviousTxnID": "146C8DBB047BAAFAE5B8C8DECCCDACD9DFCD7A464E5AB273230FF975E9B83CF7",
|
||||
"PreviousTxnLgrSeq": 10711128,
|
||||
"Sequence": 35627,
|
||||
"TakerGets": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "496.5429474010489"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "1.6"
|
||||
},
|
||||
"index": "50CAA04E81D0009115B61C132FC9887FA9E5336E0CB8A2E7D3280ADBF6ABC043",
|
||||
"quality": "0.003222279177208227",
|
||||
"taker_gets_funded": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0"
|
||||
},
|
||||
"taker_pays_funded": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -479,6 +998,29 @@
|
||||
"maker": "r49y2xKuKVG2dPkNHgWQAV61cjxk8gryjQ",
|
||||
"sequence": 431,
|
||||
"makerExchangeRate": "0.003222687721559781"
|
||||
},
|
||||
"data": {
|
||||
"Account": "r49y2xKuKVG2dPkNHgWQAV61cjxk8gryjQ",
|
||||
"BookDirectory": "20294C923E80A51B487EB9547B3835FD483748B170D2D0A4520B730474DD96E5",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "624F9ADA85EC3BE845EAC075B47E01E4F89288EAF27823C715777B3DFFB21F24",
|
||||
"PreviousTxnLgrSeq": 10639989,
|
||||
"Sequence": 431,
|
||||
"TakerGets": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "3103"
|
||||
},
|
||||
"TakerPays": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "10"
|
||||
},
|
||||
"index": "8A319A496288228AD9CAD74375E32FA81805C56A9AD84798A26756A8B3F9EE23",
|
||||
"quality": "0.003222687721559781"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
1
test/fixtures/responses/index.js
vendored
1
test/fixtures/responses/index.js
vendored
@@ -7,6 +7,7 @@ function buildList(options) {
|
||||
module.exports = {
|
||||
generateAddress: require('./generate-address.json'),
|
||||
getAccountInfo: require('./get-account-info.json'),
|
||||
getAccountObjects: require('./get-account-objects.json'),
|
||||
getBalances: require('./get-balances.json'),
|
||||
getBalanceSheet: require('./get-balance-sheet.json'),
|
||||
getOrderbook: {
|
||||
|
||||
274
test/fixtures/rippled/account-objects-normal.json
vendored
Normal file
274
test/fixtures/rippled/account-objects-normal.json
vendored
Normal file
@@ -0,0 +1,274 @@
|
||||
{
|
||||
"id": 1,
|
||||
"status": "success",
|
||||
"type": "response",
|
||||
"result": {
|
||||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"account_objects": [
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "ASP",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 65536,
|
||||
"HighLimit": {
|
||||
"currency": "ASP",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "ASP",
|
||||
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||||
"value": "10"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID":
|
||||
"BF7555B0F018E3C5E2A3FF9437A1A5092F32903BE246202F988181B9CED0D862",
|
||||
"PreviousTxnLgrSeq": 1438879,
|
||||
"index":
|
||||
"2243B0B630EA6F7330B654EFA53E27A7609D9484E535AB11B7F946DF3D247CE9"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "XAU",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 3342336,
|
||||
"HighLimit": {
|
||||
"currency": "XAU",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "XAU",
|
||||
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||||
"value": "0"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID":
|
||||
"79B26D7D34B950AC2C2F91A299A6888FABB376DD76CFF79D56E805BF439F6942",
|
||||
"PreviousTxnLgrSeq": 5982530,
|
||||
"index":
|
||||
"9ED4406351B7A511A012A9B5E7FE4059FA2F7650621379C0013492C315E25B97"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "USD",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 1114112,
|
||||
"HighLimit": {
|
||||
"currency": "USD",
|
||||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "USD",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "5"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID":
|
||||
"6FE8C824364FB1195BCFEDCB368DFEE3980F7F78D3BF4DC4174BB4C86CF8C5CE",
|
||||
"PreviousTxnLgrSeq": 10555014,
|
||||
"index":
|
||||
"2DECFAC23B77D5AEA6116C15F5C6D4669EBAEE9E7EE050A40FE2B1E47B6A9419"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "MXN",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "481.992867407479"
|
||||
},
|
||||
"Flags": 65536,
|
||||
"HighLimit": {
|
||||
"currency": "MXN",
|
||||
"issuer": "rHpXfibHgSb64n8kK9QWDpdbfqSpYbM9a4",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "MXN",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "1000"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID":
|
||||
"A467BACE5F183CDE1F075F72435FE86BAD8626ED1048EDEFF7562A4CC76FD1C5",
|
||||
"PreviousTxnLgrSeq": 3316170,
|
||||
"index":
|
||||
"EC8B9B6B364AF6CB6393A423FDD2DDBA96375EC772E6B50A3581E53BFBDFDD9A"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "EUR",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0.793598266778297"
|
||||
},
|
||||
"Flags": 1114112,
|
||||
"HighLimit": {
|
||||
"currency": "EUR",
|
||||
"issuer": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "EUR",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "1"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID":
|
||||
"E9345D44433EA368CFE1E00D84809C8E695C87FED18859248E13662D46A0EC46",
|
||||
"PreviousTxnLgrSeq": 5447146,
|
||||
"index":
|
||||
"4513749B30F4AF8DA11F077C448128D6486BF12854B760E4E5808714588AA915"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "CNY",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 2228224,
|
||||
"HighLimit": {
|
||||
"currency": "CNY",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "3"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "CNY",
|
||||
"issuer": "rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK",
|
||||
"value": "0"
|
||||
},
|
||||
"LowNode": "0000000000000008",
|
||||
"PreviousTxnID":
|
||||
"2FDDC81F4394695B01A47913BEC4281AC9A283CC8F903C14ADEA970F60E57FCF",
|
||||
"PreviousTxnLgrSeq": 5949673,
|
||||
"index":
|
||||
"578C327DA8944BDE2E10C9BA36AFA2F43E06C8D1E8819FB225D266CBBCFDE5CE"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "DYM",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "1.336889190631542"
|
||||
},
|
||||
"Flags": 65536,
|
||||
"HighLimit": {
|
||||
"currency": "DYM",
|
||||
"issuer": "rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "DYM",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "3"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID":
|
||||
"6DA2BD02DFB83FA4DAFC2651860B60071156171E9C021D9E0372A61A477FFBB1",
|
||||
"PreviousTxnLgrSeq": 8818732,
|
||||
"index":
|
||||
"5A2A5FF12E71AEE57564E624117BBA68DEF78CD564EF6259F92A011693E027C7"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "CHF",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "-0.3488146605801446"
|
||||
},
|
||||
"Flags": 131072,
|
||||
"HighLimit": {
|
||||
"currency": "CHF",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "CHF",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0"
|
||||
},
|
||||
"LowNode": "000000000000008C",
|
||||
"PreviousTxnID":
|
||||
"722394372525A13D1EAAB005642F50F05A93CF63F7F472E0F91CDD6D38EB5869",
|
||||
"PreviousTxnLgrSeq": 2687590,
|
||||
"index":
|
||||
"F2DBAD20072527F6AD02CE7F5A450DBC72BE2ABB91741A8A3ADD30D5AD7A99FB"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 131072,
|
||||
"HighLimit": {
|
||||
"currency": "BTC",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "3"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0"
|
||||
},
|
||||
"LowNode": "0000000000000043",
|
||||
"PreviousTxnID":
|
||||
"03EDF724397D2DEE70E49D512AECD619E9EA536BE6CFD48ED167AE2596055C9A",
|
||||
"PreviousTxnLgrSeq": 8317037,
|
||||
"index":
|
||||
"767C12AF647CDF5FEB9019B37018748A79C50EDAF87E8D4C7F39F78AA7CA9765"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "USD",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "-16.00534471983042"
|
||||
},
|
||||
"Flags": 131072,
|
||||
"HighLimit": {
|
||||
"currency": "USD",
|
||||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"value": "5000"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0"
|
||||
},
|
||||
"LowNode": "000000000000004A",
|
||||
"PreviousTxnID":
|
||||
"CFFF5CFE623C9543308C6529782B6A6532207D819795AAFE85555DB8BF390FE7",
|
||||
"PreviousTxnLgrSeq": 14365854,
|
||||
"index":
|
||||
"826CF5BFD28F3934B518D0BDF3231259CBD3FD0946E3C3CA0C97D2C75D2D1A09"
|
||||
}
|
||||
],
|
||||
"ledger_hash":
|
||||
"053DF17D2289D1C4971C22F235BC1FCA7D4B3AE966F842E5819D0749E0B8ECD3",
|
||||
"ledger_index": 14378733,
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
7
test/fixtures/rippled/account-objects.js
vendored
Normal file
7
test/fixtures/rippled/account-objects.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
const accountObjectsNormal = require('./account-objects-normal')
|
||||
|
||||
module.exports = function(request, options = {}) {
|
||||
return JSON.stringify(Object.assign({}, accountObjectsNormal, {id: request.id}))
|
||||
}
|
||||
4
test/fixtures/rippled/index.js
vendored
4
test/fixtures/rippled/index.js
vendored
@@ -17,6 +17,10 @@ module.exports = {
|
||||
empty: require('./empty'),
|
||||
subscribe: require('./subscribe'),
|
||||
unsubscribe: require('./unsubscribe'),
|
||||
account_objects: {
|
||||
normal: require('./account-objects'),
|
||||
// notfound: require('./account-objects-not-found')
|
||||
},
|
||||
account_info: {
|
||||
normal: require('./account-info'),
|
||||
notfound: require('./account-info-not-found')
|
||||
|
||||
@@ -167,6 +167,15 @@ describe('http server integration tests', function() {
|
||||
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()}}],
|
||||
|
||||
@@ -8,6 +8,7 @@ const addresses = require('./fixtures/addresses');
|
||||
const hashes = require('./fixtures/hashes');
|
||||
const transactionsResponse = require('./fixtures/rippled/account-tx');
|
||||
const accountLinesResponse = require('./fixtures/rippled/account-lines');
|
||||
const accountObjectsResponse = require('./fixtures/rippled/account-objects');
|
||||
const fullLedger = require('./fixtures/rippled/ledger-full-38129.json');
|
||||
const { getFreePort } = require('./utils/net-utils');
|
||||
|
||||
@@ -80,8 +81,13 @@ module.exports = function createMockRippled(port) {
|
||||
this.socket = conn;
|
||||
conn.config = {};
|
||||
conn.on('message', function (requestJSON) {
|
||||
const request = JSON.parse(requestJSON);
|
||||
mock.emit('request_' + request.command, request, conn);
|
||||
try {
|
||||
const request = JSON.parse(requestJSON);
|
||||
mock.emit('request_' + request.command, request, conn);
|
||||
} catch(err) {
|
||||
console.error('Error: ' + err.message);
|
||||
assert(false, err.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -181,6 +187,15 @@ module.exports = function createMockRippled(port) {
|
||||
conn.send(createResponse(request, fixtures.unsubscribe));
|
||||
});
|
||||
|
||||
mock.on('request_account_objects', function (request, conn) {
|
||||
assert.strictEqual(request.command, 'account_objects');
|
||||
if (request.account === addresses.ACCOUNT) {
|
||||
conn.send(accountObjectsResponse(request));
|
||||
} else {
|
||||
assert(false, 'Unrecognized account address: ' + request.account);
|
||||
}
|
||||
});
|
||||
|
||||
mock.on('request_account_info', function (request, conn) {
|
||||
assert.strictEqual(request.command, 'account_info');
|
||||
if (request.account === addresses.ACCOUNT) {
|
||||
|
||||
Reference in New Issue
Block a user