From 181cfd69de74454f1024b77dffdeb1363cbc07c1 Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Thu, 23 Aug 2018 16:17:23 -0700 Subject: [PATCH] Prevent 'amount' from being misinterpreted (#924) The 'amount' field should almost never be used. With partial payments, the field can show an amount that is significantly less than the amount that the transaction actually delivered. This change sets amount to 0 XRP when it may be misleading. This change omits the `amount` when parsing payment transactions. See `HISTORY.md` for recommended alternatives. --- HISTORY.md | 12 + docs/index.md | 31 +- docs/src/rippledAPIs.md.ejs | 2 +- src/common/schema-validator.ts | 2 + src/common/schemas/input/get-transaction.json | 5 +- .../schemas/input/get-transactions.json | 3 + src/common/schemas/objects/amount.json | 2 +- .../objects/destination-address-tag.json | 15 + .../objects/destination-exact-adjustment.json | 2 +- .../schemas/output/get-transaction.json | 9 +- .../schemas/specifications/get-payment.json | 39 + src/ledger/parse/ledger.ts | 31 +- src/ledger/parse/payment.ts | 7 +- src/ledger/parse/transaction.ts | 5 +- src/ledger/transaction.ts | 7 +- src/ledger/transactions.ts | 9 +- test/api-test.js | 40 +- test/fixtures/responses/get-ledger-full.json | 6 +- .../get-ledger-pre2014-with-partial.json | 7 +- .../get-ledger-with-partial-payment.json | 524 +++++----- .../responses/get-transaction-no-meta.json | 6 +- ...ction-payment-include-raw-transaction.json | 89 ++ .../responses/get-transaction-payment.json | 6 +- ...transactions-include-raw-transactions.json | 190 ++++ test/fixtures/responses/get-transactions.json | 12 +- test/fixtures/responses/index.js | 2 + .../rippled/ledger-with-partial-payment.json | 967 ++++++++++-------- test/mock-rippled.js | 9 +- 28 files changed, 1301 insertions(+), 738 deletions(-) create mode 100644 src/common/schemas/objects/destination-address-tag.json create mode 100644 src/common/schemas/specifications/get-payment.json create mode 100644 test/fixtures/responses/get-transaction-payment-include-raw-transaction.json create mode 100644 test/fixtures/responses/get-transactions-include-raw-transactions.json diff --git a/HISTORY.md b/HISTORY.md index 45c6a461..6ce36b1e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,17 @@ # ripple-lib Release History +## UNRELEASED + +### Breaking Changes + ++ `getTransaction()` and `getTransactions()` + + The `specification.destination.amount` field has been removed from the parsed transaction response. + + To determine the amount that a transaction delivered, use `outcome.deliveredAmount`. + + If you require the provisional requested `Amount` from the original transaction: + + Use `getTransaction`'s `includeRawTransaction` option, or + + Use `getTransactions`'s `includeRawTransactions` option, or + + Use the rippled APIs directly with `request`. For example, call the API methods `tx`, `account_tx`, etc. + ## 1.0.0-beta.5 (2018-08-11) + [Fix a TypeScript error by importing the `Prepare` type](https://github.com/ripple/ripple-lib/commit/7cd517268bda5fe74b91dad02fedf8b51b7eae9b) diff --git a/docs/index.md b/docs/index.md index fe87576e..ded8a5b9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -363,7 +363,7 @@ source | object | The source of the funds to be sent. *source.* maxAmount | [laxAmount](#amount) | The maximum amount to send. (This field is exclusive with source.amount) destination | object | The destination of the funds to be sent. *destination.* address | [address](#address) | The address to receive at. -*destination.* amount | [laxAmount](#amount) | An exact amount to deliver to the recipient. If the counterparty is not specified, amounts with any counterparty may be used. (This field is exclusive with destination.minAmount). +*destination.* amount | [laxAmount](#amount) | An exact amount to deliver to the recipient. If the counterparty is not specified, amounts with any counterparty may be used. (This field cannot be used with `destination.minAmount`.) *destination.* tag | integer | *Optional* An arbitrary unsigned 32-bit integer that identifies a reason for payment or a non-Ripple account. *destination.* address | [address](#address) | The address to send to. *destination.* minAmount | [laxAmount](#amount) | The minimum amount to be delivered. (This field is exclusive with destination.amount) @@ -763,7 +763,7 @@ ripple-lib relies on [rippled APIs](https://ripple.com/build/rippled-apis/) for * Use `hasNextPage()` to determine whether a response has more pages. This is true when the response includes a [`marker` field](https://ripple.com/build/rippled-apis/#markers-and-pagination). * Use `requestNextPage()` to request the next page of data. -When using rippled APIs, [specify XRP amounts in drops](https://ripple.com/build/rippled-apis/#specifying-currency-amounts). 1 XRP = 1000000 drops. +When using rippled APIs, [specify XRP amounts in drops](https://developers.ripple.com/basic-data-types.html#specifying-currency-amounts) and [timestamps as the number of seconds since the "Ripple Epoch"](https://developers.ripple.com/basic-data-types.html#specifying-time). ## Listening to streams @@ -1137,7 +1137,8 @@ Retrieves a transaction by its [Transaction ID](#transaction-id). Name | Type | Description ---- | ---- | ----------- id | [transactionHash](#transaction-id) | A hash of a transaction used to identify the transaction, represented in hexadecimal. -options | object | *Optional* Options to limit the ledger versions to search. +options | object | *Optional* Options to limit the ledger versions to search and/or to include raw transaction data. +*options.* includeRawTransaction | object | *Optional* Include raw transaction data. For advanced users; exercise caution when interpreting this data. *options.* maxLedgerVersion | integer | *Optional* The highest ledger version to search *options.* maxLedgerVersion | string | *Optional* The highest ledger version to search *options.* minLedgerVersion | integer | *Optional* The lowest ledger version to search. @@ -1153,7 +1154,7 @@ id | [transactionHash](#transaction-id) | A hash of the transaction that can be address | [address](#address) | The address of the account that initiated the transaction. sequence | [sequence](#account-sequence-number) | The account sequence number of the transaction for the account that initiated it. type | [transactionType](#transaction-types) | The type of the transaction. -specification | object | A specification that would produce the same outcome as this transaction. The structure of the specification depends on the value of the `type` field (see [Transaction Types](#transaction-types) for details). *Note:* This is **not** necessarily the same as the original specification. +specification | object | A specification that would produce the same outcome as this transaction. *Exception:* For payment transactions, this omits the `destination.amount` field, to prevent misunderstanding. The structure of the specification depends on the value of the `type` field (see [Transaction Types](#transaction-types) for details). *Note:* This is **not** necessarily the same as the original specification. outcome | object | The outcome of the transaction (what effects it had). *outcome.* result | string | Result code returned by rippled. See [Transaction Results](https://ripple.com/build/transactions/#full-transaction-response-list) for a complete list. *outcome.* fee | [value](#value) | The XRP fee that was charged for the transaction. @@ -1173,6 +1174,7 @@ outcome | object | The outcome of the transaction (what effects it had). *outcome.* channelChanges | object | *Optional* Properties reflecting the details of the payment channel. *outcome.* deliveredAmount | [amount](#amount) | *Optional* For payment transactions, it is impossible to reliably compute the actual delivered amount from the balanceChanges due to fixed precision. If the payment is not a partial payment and the transaction succeeded, the deliveredAmount should always be considered to be the amount specified in the transaction. *outcome.* timestamp | date-time string | *Optional* The timestamp when the transaction was validated. (May be missing when requesting transactions in binary mode.) +rawTransaction | string | *Optional* The raw transaction data as a JSON string. For advanced users only; exercise caution when interpreting this data. ### Example @@ -1199,11 +1201,7 @@ return api.getTransaction(id).then(transaction => { } }, "destination": { - "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM", - "amount": { - "currency": "USD", - "value": "0.001" - } + "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" }, "paths": "[[{\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"type\":48,\"type_hex\":\"0000000000000030\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"type\":49,\"type_hex\":\"0000000000000031\"}]]" }, @@ -1296,6 +1294,7 @@ options | object | *Optional* Options to filter the resulting transactions. *options.* counterparty | [address](#address) | *Optional* If provided, only return transactions with this account as a counterparty to the transaction. *options.* earliestFirst | boolean | *Optional* If true, sort transactions so that the earliest ones come first. By default, the newest transactions will come first. *options.* excludeFailures | boolean | *Optional* If true, the result will omit transactions that did not succeed. +*options.* includeRawTransactions | object | *Optional* Include raw transaction data. For advanced users; exercise caution when interpreting this data. *options.* initiated | boolean | *Optional* If true, return only transactions initiated by the account specified by `address`. If false, return only transactions not initiated by the account specified by `address`. *options.* limit | integer | *Optional* If specified, return at most this many transactions. *options.* maxLedgerVersion | integer | *Optional* Return only transactions in this ledger version or lower. @@ -1341,11 +1340,7 @@ return api.getTransactions(address).then(transaction => { } }, "destination": { - "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM", - "amount": { - "currency": "USD", - "value": "0.001" - } + "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" }, "paths": "[[{\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"}]]" }, @@ -1438,11 +1433,7 @@ return api.getTransactions(address).then(transaction => { } }, "destination": { - "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM", - "amount": { - "currency": "USD", - "value": "0.001" - } + "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" }, "paths": "[[{\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"}]]" }, @@ -1962,7 +1953,7 @@ source | object | Properties of the source of the payment. *source.* maxAmount | [laxAmount](#amount) | The maximum amount to send. (This field is exclusive with source.amount) destination | object | Properties of the destination of the payment. *destination.* address | [address](#address) | The address to receive at. -*destination.* amount | [laxAmount](#amount) | An exact amount to deliver to the recipient. If the counterparty is not specified, amounts with any counterparty may be used. (This field is exclusive with destination.minAmount). +*destination.* amount | [laxAmount](#amount) | An exact amount to deliver to the recipient. If the counterparty is not specified, amounts with any counterparty may be used. (This field cannot be used with `destination.minAmount`.) *destination.* tag | integer | *Optional* An arbitrary unsigned 32-bit integer that identifies a reason for payment or a non-Ripple account. *destination.* address | [address](#address) | The address to send to. *destination.* minAmount | [laxAmount](#amount) | The minimum amount to be delivered. (This field is exclusive with destination.amount) diff --git a/docs/src/rippledAPIs.md.ejs b/docs/src/rippledAPIs.md.ejs index 223b7432..6a92acc7 100644 --- a/docs/src/rippledAPIs.md.ejs +++ b/docs/src/rippledAPIs.md.ejs @@ -5,7 +5,7 @@ ripple-lib relies on [rippled APIs](https://ripple.com/build/rippled-apis/) for * Use `hasNextPage()` to determine whether a response has more pages. This is true when the response includes a [`marker` field](https://ripple.com/build/rippled-apis/#markers-and-pagination). * Use `requestNextPage()` to request the next page of data. -When using rippled APIs, [specify XRP amounts in drops](https://ripple.com/build/rippled-apis/#specifying-currency-amounts). 1 XRP = 1000000 drops. +When using rippled APIs, [specify XRP amounts in drops](https://developers.ripple.com/basic-data-types.html#specifying-currency-amounts) and [timestamps as the number of seconds since the "Ripple Epoch"](https://developers.ripple.com/basic-data-types.html#specifying-time). ## Listening to streams diff --git a/src/common/schema-validator.ts b/src/common/schema-validator.ts index 2f22c71e..f8bea73b 100644 --- a/src/common/schema-validator.ts +++ b/src/common/schema-validator.ts @@ -31,6 +31,7 @@ function loadSchemas() { require('./schemas/objects/min-adjustment.json'), require('./schemas/objects/source-exact-adjustment.json'), require('./schemas/objects/destination-exact-adjustment.json'), + require('./schemas/objects/destination-address-tag.json'), require('./schemas/objects/transaction-hash.json'), require('./schemas/objects/address.json'), require('./schemas/objects/adjustment.json'), @@ -46,6 +47,7 @@ function loadSchemas() { require('./schemas/objects/settings-plus-memos.json'), require('./schemas/specifications/settings.json'), require('./schemas/specifications/payment.json'), + require('./schemas/specifications/get-payment.json'), require('./schemas/specifications/escrow-cancellation.json'), require('./schemas/specifications/order-cancellation.json'), require('./schemas/specifications/order.json'), diff --git a/src/common/schemas/input/get-transaction.json b/src/common/schemas/input/get-transaction.json index 53c991ac..7d39adb4 100644 --- a/src/common/schemas/input/get-transaction.json +++ b/src/common/schemas/input/get-transaction.json @@ -6,7 +6,7 @@ "properties": { "id": {"$ref": "transactionHash"}, "options": { - "description": "Options to limit the ledger versions to search.", + "description": "Options to limit the ledger versions to search and/or to include raw transaction data.", "properties": { "minLedgerVersion": { "$ref": "ledgerVersion", @@ -15,6 +15,9 @@ "maxLedgerVersion": { "$ref": "ledgerVersion", "description": "The highest ledger version to search" + }, + "includeRawTransaction": { + "description": "Include raw transaction data. For advanced users; exercise caution when interpreting this data. " } }, "additionalProperties": false diff --git a/src/common/schemas/input/get-transactions.json b/src/common/schemas/input/get-transactions.json index 93509683..10446762 100644 --- a/src/common/schemas/input/get-transactions.json +++ b/src/common/schemas/input/get-transactions.json @@ -49,6 +49,9 @@ "items": {"$ref": "transactionType"}, "description": "Only return transactions of the specified [Transaction Types](#transaction-types)." }, + "includeRawTransactions": { + "description": "Include raw transaction data. For advanced users; exercise caution when interpreting this data. " + }, "binary": { "type": "boolean", "description": "If true, the transactions will be sent from the server in a condensed binary format rather than JSON." diff --git a/src/common/schemas/objects/amount.json b/src/common/schemas/objects/amount.json index 633d25d7..a4cd5c23 100644 --- a/src/common/schemas/objects/amount.json +++ b/src/common/schemas/objects/amount.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-04/schema#", "title": "amount", "link": "amount", - "description": "An Amount on the Ripple Protocol", + "description": "An Amount on the XRP Ledger", "allOf": [ {"$ref": "amountbase"}, {"required": ["value"]} diff --git a/src/common/schemas/objects/destination-address-tag.json b/src/common/schemas/objects/destination-address-tag.json new file mode 100644 index 00000000..d04cc3b4 --- /dev/null +++ b/src/common/schemas/objects/destination-address-tag.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "destinationAddressTag", + "description": "A destination address and optional tag, with no amount included. When parsing an incoming transaction, the original specification's amount is hidden to prevent misinterpretation. For the amount that the transaction delivered, see `outcome.deliveredAmount`.", + "type": "object", + "properties": { + "address": { + "$ref": "address", + "description": "The address to receive at." + }, + "tag": {"$ref": "tag"} + }, + "required": ["address"], + "additionalProperties": false +} diff --git a/src/common/schemas/objects/destination-exact-adjustment.json b/src/common/schemas/objects/destination-exact-adjustment.json index 2be227ee..0bb104d6 100644 --- a/src/common/schemas/objects/destination-exact-adjustment.json +++ b/src/common/schemas/objects/destination-exact-adjustment.json @@ -9,7 +9,7 @@ }, "amount": { "$ref": "laxAmount", - "description": "An exact amount to deliver to the recipient. If the counterparty is not specified, amounts with any counterparty may be used. (This field is exclusive with destination.minAmount)." + "description": "An exact amount to deliver to the recipient. If the counterparty is not specified, amounts with any counterparty may be used. (This field cannot be used with `destination.minAmount`.)" }, "tag": {"$ref": "tag"} }, diff --git a/src/common/schemas/output/get-transaction.json b/src/common/schemas/output/get-transaction.json index 869762ae..dcf86139 100644 --- a/src/common/schemas/output/get-transaction.json +++ b/src/common/schemas/output/get-transaction.json @@ -1,13 +1,14 @@ { "$schema": "http://json-schema.org/draft-04/schema#", "title": "getTransaction", + "description": "getTransaction response", "link": "gettransaction", "properties": { "type": { "$ref": "transactionType" }, "specification": { - "description": "A specification that would produce the same outcome as this transaction. The structure of the specification depends on the value of the `type` field (see [Transaction Types](#transaction-types) for details). *Note:* This is **not** necessarily the same as the original specification." + "description": "A specification that would produce the same outcome as this transaction. *Exception:* For payment transactions, this omits the `destination.amount` field, to prevent misunderstanding. The structure of the specification depends on the value of the `type` field (see [Transaction Types](#transaction-types) for details). *Note:* This is **not** necessarily the same as the original specification." }, "outcome": { "$ref": "outcome", @@ -24,6 +25,10 @@ "sequence": { "$ref": "sequence", "description": "The account sequence number of the transaction for the account that initiated it." + }, + "rawTransaction": { + "description": "The raw transaction data as a JSON string. For advanced users only; exercise caution when interpreting this data.", + "type": "string" } }, "required": [ @@ -44,7 +49,7 @@ ] }, "specification": { - "$ref": "payment" + "$ref": "getPayment" } } }, diff --git a/src/common/schemas/specifications/get-payment.json b/src/common/schemas/specifications/get-payment.json new file mode 100644 index 00000000..45bd28d2 --- /dev/null +++ b/src/common/schemas/specifications/get-payment.json @@ -0,0 +1,39 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "getPayment", + "description": "A specification of a payment in a response for getTransaction or getTransactions.", + "type": "object", + "properties": { + "source": { + "$ref": "sourceAdjustment", + "description": "The source of the funds to be sent." + }, + "destination": { + "$ref": "destinationAddressTag", + "description": "The destination of the funds to be sent. Since this is a payment response, the amount is not shown here. For the amount that the transaction delivered, see `outcome.deliveredAmount`." + }, + "paths": { + "type": "string", + "description": "The paths of trustlines and orders to use in executing the payment." + }, + "memos": {"$ref": "memos"}, + "invoiceID": { + "description": "A 256-bit hash that can be used to identify a particular payment.", + "$ref": "hash256" + }, + "allowPartialPayment": { + "description": "If true, this payment should proceed even if the whole amount cannot be delivered due to a lack of liquidity or a lack of funds in the source account.", + "type": "boolean" + }, + "noDirectRipple": { + "description": "If true and paths are specified, the sender would like the XRP Ledger to disregard any direct paths from the source account to the destination account. This may be used to take advantage of an arbitrage opportunity or by gateways wishing to issue balances from a hot wallet to a user who has mistakenly set a trustline directly to the hot wallet.", + "type": "boolean" + }, + "limitQuality": { + "description": "Only take paths where all the conversions have an input:output ratio that is equal or better than the ratio of destination.amount:source.maxAmount.", + "type": "boolean" + } + }, + "required": ["source", "destination"], + "additionalProperties": false +} diff --git a/src/ledger/parse/ledger.ts b/src/ledger/parse/ledger.ts index 1d35b2c0..549e4d15 100644 --- a/src/ledger/parse/ledger.ts +++ b/src/ledger/parse/ledger.ts @@ -29,7 +29,7 @@ function parseTransactionWrapper(ledgerVersion, tx) { meta: tx.metaData, ledger_index: ledgerVersion }) - const result = parseTransaction(transaction) + const result = parseTransaction(transaction, false) if (!result.outcome.ledgerVersion) { result.outcome.ledgerVersion = ledgerVersion } @@ -62,19 +62,20 @@ function parseState(state) { export function parseLedger(ledger: Ledger): FormattedLedger { const ledgerVersion = parseInt(ledger.ledger_index || ledger.seqNum, 10) - return removeUndefined(Object.assign({ - stateHash: ledger.account_hash, - closeTime: rippleTimeToISO8601(ledger.close_time), - closeTimeResolution: ledger.close_time_resolution, - closeFlags: ledger.close_flags, - ledgerHash: ledger.hash || ledger.ledger_hash, - ledgerVersion: ledgerVersion, - parentLedgerHash: ledger.parent_hash, - parentCloseTime: rippleTimeToISO8601(ledger.parent_close_time), - totalDrops: ledger.total_coins || ledger.totalCoins, - transactionHash: ledger.transaction_hash - }, - parseTransactions(ledger.transactions, ledgerVersion), - parseState(ledger.accountState) + return removeUndefined(Object.assign( + { + stateHash: ledger.account_hash, + closeTime: rippleTimeToISO8601(ledger.close_time), + closeTimeResolution: ledger.close_time_resolution, + closeFlags: ledger.close_flags, + ledgerHash: ledger.hash || ledger.ledger_hash, + ledgerVersion: ledgerVersion, + parentLedgerHash: ledger.parent_hash, + parentCloseTime: rippleTimeToISO8601(ledger.parent_close_time), + totalDrops: ledger.total_coins || ledger.totalCoins, + transactionHash: ledger.transaction_hash + }, + parseTransactions(ledger.transactions, ledgerVersion), + parseState(ledger.accountState) )) } diff --git a/src/ledger/parse/payment.ts b/src/ledger/parse/payment.ts index b6b2764e..75c9a745 100644 --- a/src/ledger/parse/payment.ts +++ b/src/ledger/parse/payment.ts @@ -28,10 +28,13 @@ function parsePayment(tx: any): Object { tag: tx.SourceTag } - const destination = { + const destination: { + address: string, + tag: number | undefined + } = { address: tx.Destination, - amount: removeGenericCounterparty(parseAmount(tx.Amount), tx.Destination), tag: tx.DestinationTag + // Notice that `amount` is omitted to prevent misinterpretation } return removeUndefined({ diff --git a/src/ledger/parse/transaction.ts b/src/ledger/parse/transaction.ts index 7d19d3ba..c6b342cd 100644 --- a/src/ledger/parse/transaction.ts +++ b/src/ledger/parse/transaction.ts @@ -42,7 +42,7 @@ function parseTransactionType(type) { return mapping[type] || null } -function parseTransaction(tx: any): any { +function parseTransaction(tx: any, includeRawTransaction: boolean): any { const type = parseTransactionType(tx.TransactionType) const mapping = { 'payment': parsePayment, @@ -72,7 +72,8 @@ function parseTransaction(tx: any): any { sequence: tx.Sequence, id: tx.hash, specification: removeUndefined(specification), - outcome: outcome ? removeUndefined(outcome) : undefined + outcome: outcome ? removeUndefined(outcome) : undefined, + rawTransaction: includeRawTransaction ? JSON.stringify(tx) : undefined }) } diff --git a/src/ledger/transaction.ts b/src/ledger/transaction.ts index 7bb7e95e..ccacca96 100644 --- a/src/ledger/transaction.ts +++ b/src/ledger/transaction.ts @@ -7,7 +7,8 @@ import {FormattedTransactionType} from '../transaction/types' export type TransactionOptions = { minLedgerVersion?: number, - maxLedgerVersion?: number + maxLedgerVersion?: number, + includeRawTransaction?: boolean } type TransactionResponse = FormattedTransactionType & { hash: string, @@ -83,9 +84,9 @@ function convertError(connection: Connection, options: TransactionOptions, function formatResponse(options: TransactionOptions, tx: TransactionResponse ): FormattedTransactionType { if (tx.validated !== true || !isTransactionInRange(tx, options)) { - throw new errors.NotFoundError('Transaction not found') + throw new errors.NotFoundError('Transaction not found') } - return parseTransaction(tx) + return parseTransaction(tx, options.includeRawTransaction) } async function getTransaction(id: string, options: TransactionOptions = {} diff --git a/src/ledger/transactions.ts b/src/ledger/transactions.ts index 9c7af7c7..71104afe 100644 --- a/src/ledger/transactions.ts +++ b/src/ledger/transactions.ts @@ -18,6 +18,7 @@ export type TransactionsOptions = { initiated?: boolean, counterparty?: string, types?: Array, + includeRawTransactions?: boolean, binary?: boolean, startTx?: FormattedTransactionType } @@ -35,11 +36,11 @@ function parseBinaryTransaction(transaction) { } } -function parseAccountTxTransaction(tx) { +function parseAccountTxTransaction(tx, includeRawTransaction: boolean) { const _tx = tx.tx_blob ? parseBinaryTransaction(tx) : tx // rippled uses a different response format for 'account_tx' than 'tx' return parseTransaction(_.assign({}, _tx.tx, - {meta: _tx.meta, validated: _tx.validated})) + {meta: _tx.meta, validated: _tx.validated}), includeRawTransaction) } function counterpartyFilter(filters, tx: FormattedTransactionType) { @@ -87,11 +88,13 @@ function orderFilter( function formatPartialResponse(address: string, options: TransactionsOptions, data ) { + const parse = tx => + parseAccountTxTransaction(tx, options.includeRawTransactions) return { marker: data.marker, results: data.transactions .filter(tx => tx.validated) - .map(parseAccountTxTransaction) + .map(parse) .filter(_.partial(transactionFilter, address, options)) .filter(_.partial(orderFilter, options)) } diff --git a/test/api-test.js b/test/api-test.js index 6bd8ed0d..5f895f9f 100644 --- a/test/api-test.js +++ b/test/api-test.js @@ -1447,6 +1447,17 @@ describe('RippleAPI', function () { 'getTransaction')); }); + it('getTransaction - payment - include raw transaction', function () { + const options = { + includeRawTransaction: true + } + return this.api.getTransaction( + hashes.VALID_TRANSACTION_HASH, options + ).then( + _.partial(checkResult, responses.getTransaction.paymentIncludeRawTransaction, + 'getTransaction')); + }); + it('getTransaction - settings', function () { const hash = '4FB3ADF22F3C605E23FAEFAA185F3BD763C4692CAC490D9819D117CD33BFAA1B'; @@ -1455,6 +1466,19 @@ describe('RippleAPI', function () { 'getTransaction')); }); + it('getTransaction - settings - include raw transaction', function () { + const hash = + '4FB3ADF22F3C605E23FAEFAA185F3BD763C4692CAC490D9819D117CD33BFAA1B'; + const options = { + includeRawTransaction: true + } + const expected = responses.getTransaction.settings + expected.rawTransaction = "{\"Account\":\"rLVKsA4F9iJBbA6rX2x4wCmkj6drgtqpQe\",\"Fee\":\"10\",\"Flags\":2147483648,\"Sequence\":1,\"SetFlag\":2,\"SigningPubKey\":\"03EA3ADCA632F125EC2CC4F7F6A82DE0DCE2B65290CAC1F22242C5163F0DA9652D\",\"TransactionType\":\"AccountSet\",\"TxnSignature\":\"3045022100DE8B666B1A31EA65011B0F32130AB91A5747E32FA49B3054CEE8E8362DBAB98A022040CF0CF254677A8E5CD04C59CA2ED7F6F15F7E184641BAE169C561650967B226\",\"date\":460832270,\"hash\":\"4FB3ADF22F3C605E23FAEFAA185F3BD763C4692CAC490D9819D117CD33BFAA1B\",\"inLedger\":8206418,\"ledger_index\":8206418,\"meta\":{\"AffectedNodes\":[{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"rLVKsA4F9iJBbA6rX2x4wCmkj6drgtqpQe\",\"Balance\":\"29999990\",\"Flags\":786432,\"OwnerCount\":0,\"Sequence\":2},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"3F5072C4875F32ED770DAF3610A716600ED7C7BB0348FADC7A98E011BB2CD36F\",\"PreviousFields\":{\"Balance\":\"30000000\",\"Flags\":4194304,\"Sequence\":1},\"PreviousTxnID\":\"3FB0350A3742BBCC0D8AA3C5247D1AEC01177D0A24D9C34762BAA2FEA8AD88B3\",\"PreviousTxnLgrSeq\":8206397}}],\"TransactionIndex\":5,\"TransactionResult\":\"tesSUCCESS\"},\"validated\":true}" + return this.api.getTransaction(hash, options).then( + _.partial(checkResult, expected, + 'getTransaction')); + }); + it('getTransaction - order', function () { const hash = '10A6FB4A66EE80BED46AAE4815D7DC43B97E944984CCD5B93BCF3F8538CABC51'; @@ -1782,6 +1806,18 @@ describe('RippleAPI', function () { 'getTransactions')); }); + it('getTransactions - include raw transactions', function () { + const options = { + types: ['payment', 'order'], + initiated: true, + limit: 2, + includeRawTransactions: true + }; + return this.api.getTransactions(address, options).then( + _.partial(checkResult, responses.getTransactions.includeRawTransactions, + 'getTransactions')); + }); + it('getTransactions - earliest first', function () { const options = { types: ['payment', 'order'], initiated: true, limit: 2, @@ -2413,8 +2449,6 @@ describe('RippleAPI', function () { _.partial(checkResult, responses.getLedger.header, 'getLedger')); }); - // New in > 0.21.0 - // future ledger versions are allowed, and passed to rippled as-is. it('getLedger - future ledger version', function () { return this.api.getLedger({ ledgerVersion: 14661789 }).then(response => { assert(response) @@ -2447,7 +2481,7 @@ describe('RippleAPI', function () { const request = { includeTransactions: true, includeAllData: true, - ledgerVersion: 100000 + ledgerVersion: 22420574 }; return this.api.getLedger(request).then( _.partial(checkResult, responses.getLedger.withPartial, 'getLedger')); diff --git a/test/fixtures/responses/get-ledger-full.json b/test/fixtures/responses/get-ledger-full.json index f55c9346..59682290 100644 --- a/test/fixtures/responses/get-ledger-full.json +++ b/test/fixtures/responses/get-ledger-full.json @@ -24,11 +24,7 @@ } }, "destination": { - "address": "rLQBHVhFnaC5gLEkgr6HgBJJ3bgeZHg9cj", - "amount": { - "currency": "XRP", - "value": "10000" - } + "address": "rLQBHVhFnaC5gLEkgr6HgBJJ3bgeZHg9cj" } }, "outcome": { diff --git a/test/fixtures/responses/get-ledger-pre2014-with-partial.json b/test/fixtures/responses/get-ledger-pre2014-with-partial.json index 6dbf28a1..5f90bba3 100644 --- a/test/fixtures/responses/get-ledger-pre2014-with-partial.json +++ b/test/fixtures/responses/get-ledger-pre2014-with-partial.json @@ -25,12 +25,7 @@ } }, "destination": { - "address": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "amount": { - "currency": "USD", - "value": "10", - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - } + "address": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4" }, "allowPartialPayment": true }, diff --git a/test/fixtures/responses/get-ledger-with-partial-payment.json b/test/fixtures/responses/get-ledger-with-partial-payment.json index d77ef0ee..ee32e87f 100644 --- a/test/fixtures/responses/get-ledger-with-partial-payment.json +++ b/test/fixtures/responses/get-ledger-with-partial-payment.json @@ -11,134 +11,239 @@ "transactionHash": "C72A2BDCB471F3AEEB917ABC6019407CAE6DA4B858903A8AB2335A0EB077125D", "transactions": [ { - "type": "payment", - "address": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "sequence": 23295, - "id": "A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A", + "type": "orderCancellation", + "address": "rJXJEvVxWSG2xVp62AoE7rM3PKUF9S1GSR", + "sequence": 84384, + "id": "1257EB8C80DE5AF6ACE91E0C05407CC1329E7B6FFBBBFFE9F734682871BD7655", "specification": { - "source": { - "address": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "maxAmount": { - "currency": "USD", - "value": "10", - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - } - }, - "destination": { - "address": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "amount": { - "currency": "USD", - "value": "10", - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - } - }, - "allowPartialPayment": true + "orderSequence": 84383 }, "outcome": { "result": "tesSUCCESS", - "fee": "0.01", + "fee": "0.000015", "balanceChanges": { - "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX": [ + "rJXJEvVxWSG2xVp62AoE7rM3PKUF9S1GSR": [ { "currency": "XRP", - "value": "-0.01" - }, - { - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "currency": "USD", - "value": "-10" - } - ], - "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B": [ - { - "counterparty": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "currency": "USD", - "value": "-9.980039920159681" - }, - { - "counterparty": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "currency": "USD", - "value": "10" - } - ], - "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4": [ - { - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "currency": "USD", - "value": "9.980039920159681" + "value": "-0.000015" + } + ] + }, + "orderbookChanges": { + "rJXJEvVxWSG2xVp62AoE7rM3PKUF9S1GSR": [ + { + "direction": "buy", + "quantity": { + "currency": "XRP", + "value": "42843.541733" + }, + "totalPrice": { + "currency": "EUR", + "counterparty": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "243.16481874" + }, + "sequence": 84383, + "status": "cancelled", + "makerExchangeRate": "176.1913666417745" } ] }, - "orderbookChanges": {}, "ledgerVersion": 22420574, - "indexInLedger": 1, - "deliveredAmount": { - "currency": "USD", - "value": "9.980039920159681", - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - } + "indexInLedger": 4 } }, { - "type": "payment", - "address": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "sequence": 23295, - "id": "A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A", + "type": "order", + "address": "rUp8CvtneUUL6qYaxfZwUHg2cwYuo5jugG", + "sequence": 771390, + "id": "43A53F005AF1AE095B39244D3C56E49150C43D16D89B7DA8673937E142858D38", "specification": { - "source": { - "address": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "maxAmount": { - "currency": "USD", - "value": "10", - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - } + "direction": "buy", + "quantity": { + "currency": "USD", + "value": "3000", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" }, - "destination": { - "address": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "amount": { - "currency": "USD", - "value": "10", - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - } - }, - "allowPartialPayment": true + "totalPrice": { + "currency": "JPY", + "value": "302728.16600853", + "counterparty": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN" + } }, "outcome": { "result": "tesSUCCESS", "fee": "0.01", "balanceChanges": { - "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX": [ + "rUp8CvtneUUL6qYaxfZwUHg2cwYuo5jugG": [ { "currency": "XRP", "value": "-0.01" - }, - { - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "currency": "USD", - "value": "-10" - } - ], - "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B": [ - { - "counterparty": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "currency": "USD", - "value": "-9.980039920159681" - }, - { - "counterparty": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "currency": "USD", - "value": "10" - } - ], - "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4": [ - { - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "currency": "USD", - "value": "9.980039920159681" } ] }, - "orderbookChanges": {}, + "orderbookChanges": { + "rUp8CvtneUUL6qYaxfZwUHg2cwYuo5jugG": [ + { + "direction": "buy", + "quantity": { + "currency": "USD", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "3000" + }, + "totalPrice": { + "currency": "JPY", + "counterparty": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN", + "value": "302728.16600853" + }, + "sequence": 771390, + "status": "created", + "makerExchangeRate": "0.009909880668042856" + }, + { + "direction": "buy", + "quantity": { + "currency": "USD", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "3000" + }, + "totalPrice": { + "currency": "JPY", + "counterparty": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN", + "value": "304004.98984125" + }, + "sequence": 771388, + "status": "cancelled", + "makerExchangeRate": "0.009868259075505919" + } + ] + }, + "ledgerVersion": 22420574, + "indexInLedger": 0 + } + }, + { + "type": "order", + "address": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw", + "sequence": 15817540, + "id": "54DE214FAD77DB326E00100B0112612AC3D7BA3BE17C2AF3480CF919A13DA4A5", + "specification": { + "direction": "buy", + "quantity": { + "currency": "JPY", + "value": "22148.5780242286", + "counterparty": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN" + }, + "totalPrice": { + "currency": "USD", + "value": "214", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" + }, + "expirationTime": "2016-07-07T17:03:46.000Z" + }, + "outcome": { + "result": "tesSUCCESS", + "fee": "0.00003", + "balanceChanges": { + "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw": [ + { + "currency": "XRP", + "value": "-0.00003" + } + ] + }, + "orderbookChanges": { + "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw": [ + { + "direction": "buy", + "quantity": { + "currency": "JPY", + "counterparty": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN", + "value": "22148.5780242286" + }, + "totalPrice": { + "currency": "USD", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "214" + }, + "sequence": 15817540, + "status": "created", + "makerExchangeRate": "103.4980281506009", + "expirationTime": "2016-07-07T17:03:46.000Z" + } + ] + }, + "ledgerVersion": 22420574, + "indexInLedger": 1 + } + }, + { + "type": "order", + "address": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw", + "sequence": 15817541, + "id": "5B79A66B1FD0619159783A8A85F43E14B159D91D3ACB36AEB954A101026BB68E", + "specification": { + "direction": "buy", + "quantity": { + "currency": "USD", + "value": "2954.92952861701", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" + }, + "totalPrice": { + "currency": "BTC", + "value": "4.7", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" + }, + "expirationTime": "2016-07-07T17:03:46.000Z" + }, + "outcome": { + "result": "tesSUCCESS", + "fee": "0.00003", + "balanceChanges": { + "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw": [ + { + "currency": "XRP", + "value": "-0.00003" + } + ] + }, + "orderbookChanges": { + "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw": [ + { + "direction": "buy", + "quantity": { + "currency": "USD", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "2954.92952861701" + }, + "totalPrice": { + "currency": "BTC", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "4.7" + }, + "sequence": 15817541, + "status": "created", + "makerExchangeRate": "628.7084103440447", + "expirationTime": "2016-07-07T17:03:46.000Z" + }, + { + "direction": "buy", + "quantity": { + "currency": "USD", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "2955.46645977528" + }, + "totalPrice": { + "currency": "BTC", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "4.7" + }, + "sequence": 15817525, + "status": "cancelled", + "makerExchangeRate": "628.822651016017", + "expirationTime": "2016-07-07T17:03:34.000Z" + } + ] + }, "ledgerVersion": 22420574, "indexInLedger": 2 } @@ -158,152 +263,10 @@ } }, "destination": { - "address": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "amount": { - "currency": "USD", - "value": "10", - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - } + "address": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4" }, "allowPartialPayment": true }, - "outcome": { - "result": "tesSUCCESS", - "fee": "0.01", - "balanceChanges": { - "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX": [ - { - "currency": "XRP", - "value": "-0.01" - }, - { - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "currency": "USD", - "value": "-10" - } - ], - "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B": [ - { - "counterparty": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "currency": "USD", - "value": "-9.980039920159681" - }, - { - "counterparty": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "currency": "USD", - "value": "10" - } - ], - "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4": [ - { - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "currency": "USD", - "value": "9.980039920159681" - } - ] - }, - "orderbookChanges": {}, - "ledgerVersion": 22420574, - "indexInLedger": 3, - "deliveredAmount": { - "currency": "USD", - "value": "9.980039920159681", - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - } - } - }, - { - "type": "payment", - "address": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "sequence": 23295, - "id": "A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A", - "specification": { - "source": { - "address": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "maxAmount": { - "currency": "USD", - "value": "10", - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - } - }, - "destination": { - "address": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "amount": { - "currency": "USD", - "value": "10", - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - } - }, - "allowPartialPayment": true - }, - "outcome": { - "result": "tesSUCCESS", - "fee": "0.01", - "balanceChanges": { - "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX": [ - { - "currency": "XRP", - "value": "-0.01" - }, - { - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "currency": "USD", - "value": "-10" - } - ], - "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B": [ - { - "counterparty": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "currency": "USD", - "value": "-9.980039920159681" - }, - { - "counterparty": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "currency": "USD", - "value": "10" - } - ], - "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4": [ - { - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "currency": "USD", - "value": "9.980039920159681" - } - ] - }, - "orderbookChanges": {}, - "ledgerVersion": 22420574, - "indexInLedger": 4, - "deliveredAmount": { - "currency": "USD", - "value": "10", - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - } - } - }, - { - "type": "payment", - "address": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "sequence": 23295, - "id": "A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A", - "specification": { - "source": { - "address": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "maxAmount": { - "currency": "USD", - "value": "10", - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - } - }, - "destination": { - "address": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "amount": { - "currency": "USD", - "value": "10", - "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - } - } - }, "outcome": { "result": "tesSUCCESS", "fee": "0.01", @@ -344,11 +307,80 @@ "indexInLedger": 5, "deliveredAmount": { "currency": "USD", - "value": "10", + "value": "9.980039920159681", "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" } } + }, + { + "type": "order", + "address": "rMPJDVaiP1eY7QTy3qFKLyBJxry2vuD5Sp", + "sequence": 1294410, + "id": "B1B959CA2B3B46F07B2F1373C84E927C46B124E9728C79A2736F32AA3F2DB7FB", + "specification": { + "direction": "buy", + "quantity": { + "currency": "USD", + "value": "2500", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" + }, + "totalPrice": { + "currency": "JPY", + "value": "254121.4048342", + "counterparty": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN" + } + }, + "outcome": { + "result": "tesSUCCESS", + "fee": "0.01", + "balanceChanges": { + "rMPJDVaiP1eY7QTy3qFKLyBJxry2vuD5Sp": [ + { + "currency": "XRP", + "value": "-0.01" + } + ] + }, + "orderbookChanges": { + "rMPJDVaiP1eY7QTy3qFKLyBJxry2vuD5Sp": [ + { + "direction": "buy", + "quantity": { + "currency": "USD", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "2500" + }, + "totalPrice": { + "currency": "JPY", + "counterparty": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN", + "value": "255397.84578255" + }, + "sequence": 1294409, + "status": "cancelled", + "makerExchangeRate": "0.009788649517931102" + }, + { + "direction": "buy", + "quantity": { + "currency": "USD", + "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "2500" + }, + "totalPrice": { + "currency": "JPY", + "counterparty": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN", + "value": "254121.4048342" + }, + "sequence": 1294410, + "status": "created", + "makerExchangeRate": "0.009837817485823794" + } + ] + }, + "ledgerVersion": 22420574, + "indexInLedger": 3 + } } ], - "rawTransactions": "[{\"Account\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"Amount\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"10\"},\"Destination\":\"rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4\",\"Fee\":\"10000\",\"Flags\":131072,\"Sequence\":23295,\"SigningPubKey\":\"02B205F4B92351AC0EEB04254B636F4C49EF922CFA3CAAD03C6477DA1E04E94B53\",\"TransactionType\":\"Payment\",\"TxnSignature\":\"3045022100FAF247A836D601DE74A515B2AADE31186D8B0DA9C23DE489E09753F5CF4BB81F0220477C5B5BC3AC89F2347744F9E00CCA62267E198489D747578162C4C7D156211D\",\"hash\":\"A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A\",\"metaData\":{\"AffectedNodes\":[{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"Balance\":\"1930599790\",\"Flags\":0,\"OwnerCount\":2,\"Sequence\":23296},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"267C16D24EC42EEF8B03D5BE4E94266B1675FA54AFCE42DE795E02AB61031CBD\",\"PreviousFields\":{\"Balance\":\"1930609790\",\"Sequence\":23295},\"PreviousTxnID\":\"0F5396388E91D37BB26C8E24073A57E7C5D51E79AEE4CD855653B8499AE4E3DD\",\"PreviousTxnLgrSeq\":22419806}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-9.980959751659681\"},\"Flags\":2228224,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4\",\"value\":\"1000000\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"0\"},\"LowNode\":\"0000000000000423\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"C66957AF25229357F9C2D2BA17CE47D88169788EDA7610AD0F29AD5BCB225EE5\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-0.0009198315\"}},\"PreviousTxnID\":\"2A01E994D7000000B43DD63825A081B4440A44AB2F6FA0D506158AC9CA6B2869\",\"PreviousTxnLgrSeq\":22420532}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-276666.975959\"},\"Flags\":131072,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"value\":\"1000000\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"0\"},\"LowNode\":\"00000000000002D7\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"FFD710AE2074A98D920D00CC352F25744899F069A6C1B9E31DD32D2C6606E615\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-276676.975959\"}},\"PreviousTxnID\":\"BB9DFC87E9D4ED09CA2726DDFE83A4A396ED0D6545536322DE17CDACF45C0D5B\",\"PreviousTxnLgrSeq\":22419307}}],\"DeliveredAmount\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"9.980039920159681\"},\"TransactionIndex\":1,\"TransactionResult\":\"tesSUCCESS\"}},{\"Account\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"Amount\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"10\"},\"Destination\":\"rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4\",\"Fee\":\"10000\",\"Flags\":131072,\"Sequence\":23295,\"SigningPubKey\":\"02B205F4B92351AC0EEB04254B636F4C49EF922CFA3CAAD03C6477DA1E04E94B53\",\"TransactionType\":\"Payment\",\"TxnSignature\":\"3045022100FAF247A836D601DE74A515B2AADE31186D8B0DA9C23DE489E09753F5CF4BB81F0220477C5B5BC3AC89F2347744F9E00CCA62267E198489D747578162C4C7D156211D\",\"hash\":\"A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A\",\"metaData\":{\"AffectedNodes\":[{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"Balance\":\"1930599790\",\"Flags\":0,\"OwnerCount\":2,\"Sequence\":23296},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"267C16D24EC42EEF8B03D5BE4E94266B1675FA54AFCE42DE795E02AB61031CBD\",\"PreviousFields\":{\"Balance\":\"1930609790\",\"Sequence\":23295},\"PreviousTxnID\":\"0F5396388E91D37BB26C8E24073A57E7C5D51E79AEE4CD855653B8499AE4E3DD\",\"PreviousTxnLgrSeq\":22419806}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-9.980959751659681\"},\"Flags\":2228224,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4\",\"value\":\"1000000\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"0\"},\"LowNode\":\"0000000000000423\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"C66957AF25229357F9C2D2BA17CE47D88169788EDA7610AD0F29AD5BCB225EE5\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-0.0009198315\"}},\"PreviousTxnID\":\"2A01E994D7000000B43DD63825A081B4440A44AB2F6FA0D506158AC9CA6B2869\",\"PreviousTxnLgrSeq\":22420532}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-276666.975959\"},\"Flags\":131072,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"value\":\"1000000\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"0\"},\"LowNode\":\"00000000000002D7\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"FFD710AE2074A98D920D00CC352F25744899F069A6C1B9E31DD32D2C6606E615\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-276676.975959\"}},\"PreviousTxnID\":\"BB9DFC87E9D4ED09CA2726DDFE83A4A396ED0D6545536322DE17CDACF45C0D5B\",\"PreviousTxnLgrSeq\":22419307}}],\"delivered_amount\":\"unavailable\",\"TransactionIndex\":2,\"TransactionResult\":\"tesSUCCESS\"}},{\"Account\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"Amount\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"10\"},\"Destination\":\"rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4\",\"Fee\":\"10000\",\"Flags\":131072,\"Sequence\":23295,\"SigningPubKey\":\"02B205F4B92351AC0EEB04254B636F4C49EF922CFA3CAAD03C6477DA1E04E94B53\",\"TransactionType\":\"Payment\",\"TxnSignature\":\"3045022100FAF247A836D601DE74A515B2AADE31186D8B0DA9C23DE489E09753F5CF4BB81F0220477C5B5BC3AC89F2347744F9E00CCA62267E198489D747578162C4C7D156211D\",\"hash\":\"A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A\",\"metaData\":{\"AffectedNodes\":[{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"Balance\":\"1930599790\",\"Flags\":0,\"OwnerCount\":2,\"Sequence\":23296},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"267C16D24EC42EEF8B03D5BE4E94266B1675FA54AFCE42DE795E02AB61031CBD\",\"PreviousFields\":{\"Balance\":\"1930609790\",\"Sequence\":23295},\"PreviousTxnID\":\"0F5396388E91D37BB26C8E24073A57E7C5D51E79AEE4CD855653B8499AE4E3DD\",\"PreviousTxnLgrSeq\":22419806}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-9.980959751659681\"},\"Flags\":2228224,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4\",\"value\":\"1000000\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"0\"},\"LowNode\":\"0000000000000423\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"C66957AF25229357F9C2D2BA17CE47D88169788EDA7610AD0F29AD5BCB225EE5\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-0.0009198315\"}},\"PreviousTxnID\":\"2A01E994D7000000B43DD63825A081B4440A44AB2F6FA0D506158AC9CA6B2869\",\"PreviousTxnLgrSeq\":22420532}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-276666.975959\"},\"Flags\":131072,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"value\":\"1000000\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"0\"},\"LowNode\":\"00000000000002D7\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"FFD710AE2074A98D920D00CC352F25744899F069A6C1B9E31DD32D2C6606E615\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-276676.975959\"}},\"PreviousTxnID\":\"BB9DFC87E9D4ED09CA2726DDFE83A4A396ED0D6545536322DE17CDACF45C0D5B\",\"PreviousTxnLgrSeq\":22419307}}],\"DeliveredAmount\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"9.980039920159681\"},\"delivered_amount\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"9.980039920159681\"},\"TransactionIndex\":3,\"TransactionResult\":\"tesSUCCESS\"}},{\"Account\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"Amount\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"10\"},\"Destination\":\"rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4\",\"Fee\":\"10000\",\"Flags\":131072,\"Sequence\":23295,\"SigningPubKey\":\"02B205F4B92351AC0EEB04254B636F4C49EF922CFA3CAAD03C6477DA1E04E94B53\",\"TransactionType\":\"Payment\",\"TxnSignature\":\"3045022100FAF247A836D601DE74A515B2AADE31186D8B0DA9C23DE489E09753F5CF4BB81F0220477C5B5BC3AC89F2347744F9E00CCA62267E198489D747578162C4C7D156211D\",\"hash\":\"A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A\",\"metaData\":{\"AffectedNodes\":[{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"Balance\":\"1930599790\",\"Flags\":0,\"OwnerCount\":2,\"Sequence\":23296},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"267C16D24EC42EEF8B03D5BE4E94266B1675FA54AFCE42DE795E02AB61031CBD\",\"PreviousFields\":{\"Balance\":\"1930609790\",\"Sequence\":23295},\"PreviousTxnID\":\"0F5396388E91D37BB26C8E24073A57E7C5D51E79AEE4CD855653B8499AE4E3DD\",\"PreviousTxnLgrSeq\":22419806}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-9.980959751659681\"},\"Flags\":2228224,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4\",\"value\":\"1000000\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"0\"},\"LowNode\":\"0000000000000423\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"C66957AF25229357F9C2D2BA17CE47D88169788EDA7610AD0F29AD5BCB225EE5\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-0.0009198315\"}},\"PreviousTxnID\":\"2A01E994D7000000B43DD63825A081B4440A44AB2F6FA0D506158AC9CA6B2869\",\"PreviousTxnLgrSeq\":22420532}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-276666.975959\"},\"Flags\":131072,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"value\":\"1000000\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"0\"},\"LowNode\":\"00000000000002D7\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"FFD710AE2074A98D920D00CC352F25744899F069A6C1B9E31DD32D2C6606E615\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-276676.975959\"}},\"PreviousTxnID\":\"BB9DFC87E9D4ED09CA2726DDFE83A4A396ED0D6545536322DE17CDACF45C0D5B\",\"PreviousTxnLgrSeq\":22419307}}],\"TransactionIndex\":4,\"TransactionResult\":\"tesSUCCESS\"}},{\"Account\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"Amount\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"10\"},\"Destination\":\"rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4\",\"Fee\":\"10000\",\"Flags\":0,\"Sequence\":23295,\"SigningPubKey\":\"02B205F4B92351AC0EEB04254B636F4C49EF922CFA3CAAD03C6477DA1E04E94B53\",\"TransactionType\":\"Payment\",\"TxnSignature\":\"3045022100FAF247A836D601DE74A515B2AADE31186D8B0DA9C23DE489E09753F5CF4BB81F0220477C5B5BC3AC89F2347744F9E00CCA62267E198489D747578162C4C7D156211D\",\"hash\":\"A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A\",\"metaData\":{\"AffectedNodes\":[{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"Balance\":\"1930599790\",\"Flags\":0,\"OwnerCount\":2,\"Sequence\":23296},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"267C16D24EC42EEF8B03D5BE4E94266B1675FA54AFCE42DE795E02AB61031CBD\",\"PreviousFields\":{\"Balance\":\"1930609790\",\"Sequence\":23295},\"PreviousTxnID\":\"0F5396388E91D37BB26C8E24073A57E7C5D51E79AEE4CD855653B8499AE4E3DD\",\"PreviousTxnLgrSeq\":22419806}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-9.980959751659681\"},\"Flags\":2228224,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4\",\"value\":\"1000000\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"0\"},\"LowNode\":\"0000000000000423\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"C66957AF25229357F9C2D2BA17CE47D88169788EDA7610AD0F29AD5BCB225EE5\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-0.0009198315\"}},\"PreviousTxnID\":\"2A01E994D7000000B43DD63825A081B4440A44AB2F6FA0D506158AC9CA6B2869\",\"PreviousTxnLgrSeq\":22420532}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-276666.975959\"},\"Flags\":131072,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"value\":\"1000000\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"0\"},\"LowNode\":\"00000000000002D7\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"FFD710AE2074A98D920D00CC352F25744899F069A6C1B9E31DD32D2C6606E615\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-276676.975959\"}},\"PreviousTxnID\":\"BB9DFC87E9D4ED09CA2726DDFE83A4A396ED0D6545536322DE17CDACF45C0D5B\",\"PreviousTxnLgrSeq\":22419307}}],\"TransactionIndex\":5,\"TransactionResult\":\"tesSUCCESS\"}}]" + "rawTransactions": "[{\"Account\":\"rJXJEvVxWSG2xVp62AoE7rM3PKUF9S1GSR\",\"Fee\":\"15\",\"Flags\":2147483648,\"LastLedgerSequence\":22420576,\"OfferSequence\":84383,\"Sequence\":84384,\"SigningPubKey\":\"0219D7F97CA3C7BDF0982B0CCFE613761BE563C049A876596B5365A975C669D1A2\",\"TransactionType\":\"OfferCancel\",\"TxnSignature\":\"3045022100D270AC3BAB933C22E88DC557B86BF04BF2A101C2474E0FD6DA5991DB996010EB022071C6571C3031F2B1A0F91106CAFB5C8E766220CFC57676D467258A3A3B966F28\",\"hash\":\"1257EB8C80DE5AF6ACE91E0C05407CC1329E7B6FFBBBFFE9F734682871BD7655\",\"metaData\":{\"AffectedNodes\":[{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"rJXJEvVxWSG2xVp62AoE7rM3PKUF9S1GSR\",\"Balance\":\"170452281963\",\"Flags\":0,\"OwnerCount\":3,\"Sequence\":84385},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"4CC1921751937D88A7BFF74B5EA2C67673B349EA86C52CE918EED279075EB6E6\",\"PreviousFields\":{\"Balance\":\"170452281978\",\"OwnerCount\":4,\"Sequence\":84384},\"PreviousTxnID\":\"400E30CB98BF337449A69D221B7159484B6EC18002A9285AFB871D60326C81A9\",\"PreviousTxnLgrSeq\":22420562}},{\"DeletedNode\":{\"FinalFields\":{\"Account\":\"rJXJEvVxWSG2xVp62AoE7rM3PKUF9S1GSR\",\"BookDirectory\":\"CA462483C85A90DB76D8903681442394D8A5E2D0FFAC259C5D0642737E363451\",\"BookNode\":\"0000000000000000\",\"Flags\":0,\"OwnerNode\":\"0000000000000000\",\"PreviousTxnID\":\"400E30CB98BF337449A69D221B7159484B6EC18002A9285AFB871D60326C81A9\",\"PreviousTxnLgrSeq\":22420562,\"Sequence\":84383,\"TakerGets\":{\"currency\":\"EUR\",\"issuer\":\"rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq\",\"value\":\"243.16481874\"},\"TakerPays\":\"42843541733\"},\"LedgerEntryType\":\"Offer\",\"LedgerIndex\":\"86FFBBEC167E8E6D9540637C12BE2D28808F724B969631E00E506DE279389B8B\"}},{\"DeletedNode\":{\"FinalFields\":{\"ExchangeRate\":\"5D0642737E363451\",\"Flags\":0,\"RootIndex\":\"CA462483C85A90DB76D8903681442394D8A5E2D0FFAC259C5D0642737E363451\",\"TakerGetsCurrency\":\"0000000000000000000000004555520000000000\",\"TakerGetsIssuer\":\"2ADB0B3959D60A6E6991F729E1918B7163925230\",\"TakerPaysCurrency\":\"0000000000000000000000000000000000000000\",\"TakerPaysIssuer\":\"0000000000000000000000000000000000000000\"},\"LedgerEntryType\":\"DirectoryNode\",\"LedgerIndex\":\"CA462483C85A90DB76D8903681442394D8A5E2D0FFAC259C5D0642737E363451\"}},{\"ModifiedNode\":{\"FinalFields\":{\"Flags\":0,\"Owner\":\"rJXJEvVxWSG2xVp62AoE7rM3PKUF9S1GSR\",\"RootIndex\":\"D84063896F704906662E7D93637D579485E19914088FA6F4F929D93CD2163B18\"},\"LedgerEntryType\":\"DirectoryNode\",\"LedgerIndex\":\"D84063896F704906662E7D93637D579485E19914088FA6F4F929D93CD2163B18\"}}],\"TransactionIndex\":4,\"TransactionResult\":\"tesSUCCESS\"}},{\"Account\":\"rUp8CvtneUUL6qYaxfZwUHg2cwYuo5jugG\",\"Fee\":\"10000\",\"LastLedgerSequence\":22420577,\"Memos\":[{\"Memo\":{\"MemoData\":\"535F72665F6A70795F7573645F746F6B796F5F6269745F676623715F726970706C65\",\"MemoType\":\"6F666665725F636F6D6D656E74\"}}],\"OfferSequence\":771388,\"Sequence\":771390,\"SigningPubKey\":\"02CEC39D51583C89A46804CAA7956503E41919022BF4BC842D4FA9CF076783AFCE\",\"TakerGets\":{\"currency\":\"JPY\",\"issuer\":\"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN\",\"value\":\"302728.16600853\"},\"TakerPays\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"3000\"},\"TransactionType\":\"OfferCreate\",\"TxnSignature\":\"3045022100CAE6228D3D6729E60222B2453DE13C35CAB7049FB430543BB819161F059511E60220371FD55EDF0396A207E57C40114C004B92F6697A260A0CFBC2704E85B255CCEE\",\"hash\":\"43A53F005AF1AE095B39244D3C56E49150C43D16D89B7DA8673937E142858D38\",\"metaData\":{\"AffectedNodes\":[{\"CreatedNode\":{\"LedgerEntryType\":\"Offer\",\"LedgerIndex\":\"1FB6961BD982103CBFD57FA73F30110CE1ED31C85A35A8FB987591CAD1A28C6C\",\"NewFields\":{\"Account\":\"rUp8CvtneUUL6qYaxfZwUHg2cwYuo5jugG\",\"BookDirectory\":\"95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF4522334FBE4FC3668\",\"Sequence\":771390,\"TakerGets\":{\"currency\":\"JPY\",\"issuer\":\"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN\",\"value\":\"302728.16600853\"},\"TakerPays\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"3000\"}}}},{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"rUp8CvtneUUL6qYaxfZwUHg2cwYuo5jugG\",\"Balance\":\"2048885453\",\"Flags\":0,\"OwnerCount\":22,\"RegularKey\":\"rNXYnXu27dPzQyXxVV6iNBNrJwSz8y5Wzc\",\"Sequence\":771391},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"7118386A4D8C55902FD814D62E2F4D7CE90E3B4F44E6B23CAD4C874B9A5771C9\",\"PreviousFields\":{\"Balance\":\"2048895453\",\"Sequence\":771390},\"PreviousTxnID\":\"19EB03F21D86C9B225FB6ADACF489BF66C1482C3B05DAAD59C114965FB13A59C\",\"PreviousTxnLgrSeq\":22420570}},{\"DeletedNode\":{\"FinalFields\":{\"ExchangeRate\":\"52230F211CBF3EFF\",\"Flags\":0,\"RootIndex\":\"95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF452230F211CBF3EFF\",\"TakerGetsCurrency\":\"0000000000000000000000004A50590000000000\",\"TakerGetsIssuer\":\"5BBC0F22F61D9224A110650CFE21CC0C4BE13098\",\"TakerPaysCurrency\":\"0000000000000000000000005553440000000000\",\"TakerPaysIssuer\":\"0A20B3C85F482532A9578DBB3950B85CA06594D1\"},\"LedgerEntryType\":\"DirectoryNode\",\"LedgerIndex\":\"95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF452230F211CBF3EFF\"}},{\"CreatedNode\":{\"LedgerEntryType\":\"DirectoryNode\",\"LedgerIndex\":\"95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF4522334FBE4FC3668\",\"NewFields\":{\"ExchangeRate\":\"522334FBE4FC3668\",\"RootIndex\":\"95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF4522334FBE4FC3668\",\"TakerGetsCurrency\":\"0000000000000000000000004A50590000000000\",\"TakerGetsIssuer\":\"5BBC0F22F61D9224A110650CFE21CC0C4BE13098\",\"TakerPaysCurrency\":\"0000000000000000000000005553440000000000\",\"TakerPaysIssuer\":\"0A20B3C85F482532A9578DBB3950B85CA06594D1\"}}},{\"ModifiedNode\":{\"FinalFields\":{\"Flags\":0,\"Owner\":\"rUp8CvtneUUL6qYaxfZwUHg2cwYuo5jugG\",\"RootIndex\":\"A187A05FE957F5953846DF21A742F20FBFFACF3196D8FFEA85C3E062EA3B7A69\"},\"LedgerEntryType\":\"DirectoryNode\",\"LedgerIndex\":\"A187A05FE957F5953846DF21A742F20FBFFACF3196D8FFEA85C3E062EA3B7A69\"}},{\"DeletedNode\":{\"FinalFields\":{\"Account\":\"rUp8CvtneUUL6qYaxfZwUHg2cwYuo5jugG\",\"BookDirectory\":\"95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF452230F211CBF3EFF\",\"BookNode\":\"0000000000000000\",\"Flags\":0,\"OwnerNode\":\"0000000000000000\",\"PreviousTxnID\":\"2073CD805F40D44BADD32EF138FE9782A5D9DF1E9C0700EA41C4D45163ED1FE6\",\"PreviousTxnLgrSeq\":22420569,\"Sequence\":771388,\"TakerGets\":{\"currency\":\"JPY\",\"issuer\":\"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN\",\"value\":\"304004.98984125\"},\"TakerPays\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"3000\"}},\"LedgerEntryType\":\"Offer\",\"LedgerIndex\":\"F5ACC7F4D8253666AB5AF39E812107E7CFC5B7A686E7C24F560F84AA3150BDF0\"}}],\"TransactionIndex\":0,\"TransactionResult\":\"tesSUCCESS\"}},{\"Account\":\"rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw\",\"Expiration\":521226226,\"Fee\":\"30\",\"Flags\":2147483648,\"LastLedgerSequence\":22420575,\"Sequence\":15817540,\"SigningPubKey\":\"034841BF24BD72C7CC371EBD87CCBF258D8ADB05C18DE207130364A97D8A3EA524\",\"TakerGets\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"214\"},\"TakerPays\":{\"currency\":\"JPY\",\"issuer\":\"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN\",\"value\":\"22148.5780242286\"},\"TransactionType\":\"OfferCreate\",\"TxnSignature\":\"304402204DF95ADF23D6F5727E573BA085DDE08FB5B7AE9A23CF5709708FE190D87B851A02200C0D7F21C4F989C2B81171B11CE3224F7DB594A413C45CCA5E505ED86ED91418\",\"hash\":\"54DE214FAD77DB326E00100B0112612AC3D7BA3BE17C2AF3480CF919A13DA4A5\",\"metaData\":{\"AffectedNodes\":[{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw\",\"AccountTxnID\":\"54DE214FAD77DB326E00100B0112612AC3D7BA3BE17C2AF3480CF919A13DA4A5\",\"Balance\":\"2690753645214\",\"Flags\":0,\"OwnerCount\":25,\"RegularKey\":\"r9S56zu6QeJD5d8A7QMfLAeYavgB9dhaX4\",\"Sequence\":15817541},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"2880A9B4FB90A306B576C2D532BFE390AB3904642647DCF739492AA244EF46D1\",\"PreviousFields\":{\"AccountTxnID\":\"05408DE689A1D9454DE31BFE586F210C1AB78FBB71D5A096CDA7B453F9E8733C\",\"Balance\":\"2690753645244\",\"OwnerCount\":24,\"Sequence\":15817540},\"PreviousTxnID\":\"05408DE689A1D9454DE31BFE586F210C1AB78FBB71D5A096CDA7B453F9E8733C\",\"PreviousTxnLgrSeq\":22420573}},{\"ModifiedNode\":{\"FinalFields\":{\"Flags\":0,\"IndexPrevious\":\"00000000000022F7\",\"Owner\":\"rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw\",\"RootIndex\":\"F435FBBEC9654204D7151A01E686BAA8CB325A472D7B61C7916EA58B59355767\"},\"LedgerEntryType\":\"DirectoryNode\",\"LedgerIndex\":\"88048321517F5E225D2963BC749F9F9853D348679406839659056E67D2D374C9\"}},{\"CreatedNode\":{\"LedgerEntryType\":\"Offer\",\"LedgerIndex\":\"9422BBC577CBDD1ED2C13D4C7CC6581BB10EAC3E968D44C2D7FB98E15B2B37F3\",\"NewFields\":{\"Account\":\"rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw\",\"BookDirectory\":\"FB9B9ED334DD7AFC1145AE485D86FB101C07F583CDE55EB95703AD4F200758D9\",\"Expiration\":521226226,\"OwnerNode\":\"00000000000024CB\",\"Sequence\":15817540,\"TakerGets\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"214\"},\"TakerPays\":{\"currency\":\"JPY\",\"issuer\":\"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN\",\"value\":\"22148.5780242286\"}}}},{\"CreatedNode\":{\"LedgerEntryType\":\"DirectoryNode\",\"LedgerIndex\":\"FB9B9ED334DD7AFC1145AE485D86FB101C07F583CDE55EB95703AD4F200758D9\",\"NewFields\":{\"ExchangeRate\":\"5703AD4F200758D9\",\"RootIndex\":\"FB9B9ED334DD7AFC1145AE485D86FB101C07F583CDE55EB95703AD4F200758D9\",\"TakerGetsCurrency\":\"0000000000000000000000005553440000000000\",\"TakerGetsIssuer\":\"0A20B3C85F482532A9578DBB3950B85CA06594D1\",\"TakerPaysCurrency\":\"0000000000000000000000004A50590000000000\",\"TakerPaysIssuer\":\"5BBC0F22F61D9224A110650CFE21CC0C4BE13098\"}}}],\"TransactionIndex\":1,\"TransactionResult\":\"tesSUCCESS\"}},{\"Account\":\"rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw\",\"Expiration\":521226226,\"Fee\":\"30\",\"Flags\":2147483648,\"LastLedgerSequence\":22420575,\"OfferSequence\":15817525,\"Sequence\":15817541,\"SigningPubKey\":\"034841BF24BD72C7CC371EBD87CCBF258D8ADB05C18DE207130364A97D8A3EA524\",\"TakerGets\":{\"currency\":\"BTC\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"4.7\"},\"TakerPays\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"2954.92952861701\"},\"TransactionType\":\"OfferCreate\",\"TxnSignature\":\"3045022100C63DFE5D3A27D42DC87439948C6692C0015B6891FC531F27A58ECA319D388FCF02202CE4E60D940E168250E612A45331134937AD71911DFF8C042FEBB91833332F94\",\"hash\":\"5B79A66B1FD0619159783A8A85F43E14B159D91D3ACB36AEB954A101026BB68E\",\"metaData\":{\"AffectedNodes\":[{\"CreatedNode\":{\"LedgerEntryType\":\"Offer\",\"LedgerIndex\":\"20046290D68FFFC3AC8DB8B725F2BF0FD4CBAF45C719C76245F247E9C7EDCBFE\",\"NewFields\":{\"Account\":\"rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw\",\"BookDirectory\":\"6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC9857165611D6A8983F\",\"Expiration\":521226226,\"OwnerNode\":\"00000000000024CB\",\"Sequence\":15817541,\"TakerGets\":{\"currency\":\"BTC\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"4.7\"},\"TakerPays\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"2954.92952861701\"}}}},{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw\",\"AccountTxnID\":\"5B79A66B1FD0619159783A8A85F43E14B159D91D3ACB36AEB954A101026BB68E\",\"Balance\":\"2690753645184\",\"Flags\":0,\"OwnerCount\":25,\"RegularKey\":\"r9S56zu6QeJD5d8A7QMfLAeYavgB9dhaX4\",\"Sequence\":15817542},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"2880A9B4FB90A306B576C2D532BFE390AB3904642647DCF739492AA244EF46D1\",\"PreviousFields\":{\"AccountTxnID\":\"54DE214FAD77DB326E00100B0112612AC3D7BA3BE17C2AF3480CF919A13DA4A5\",\"Balance\":\"2690753645214\",\"Sequence\":15817541},\"PreviousTxnID\":\"54DE214FAD77DB326E00100B0112612AC3D7BA3BE17C2AF3480CF919A13DA4A5\",\"PreviousTxnLgrSeq\":22420574}},{\"DeletedNode\":{\"FinalFields\":{\"Account\":\"rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw\",\"BookDirectory\":\"6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC985716571BD367C12A\",\"BookNode\":\"0000000000000000\",\"Expiration\":521226214,\"Flags\":0,\"OwnerNode\":\"00000000000024CB\",\"PreviousTxnID\":\"EB843063BD289BBFBD376602780A83F5CBA07AAADF65392683B9DE90E43B59C7\",\"PreviousTxnLgrSeq\":22420570,\"Sequence\":15817525,\"TakerGets\":{\"currency\":\"BTC\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"4.7\"},\"TakerPays\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"2955.46645977528\"}},\"LedgerEntryType\":\"Offer\",\"LedgerIndex\":\"3E26BB816F8D8FE43F01D10284AAC2A2E340AF8B20AD37B125C098A8BCAEF601\"}},{\"CreatedNode\":{\"LedgerEntryType\":\"DirectoryNode\",\"LedgerIndex\":\"6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC9857165611D6A8983F\",\"NewFields\":{\"ExchangeRate\":\"57165611D6A8983F\",\"RootIndex\":\"6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC9857165611D6A8983F\",\"TakerGetsCurrency\":\"0000000000000000000000004254430000000000\",\"TakerGetsIssuer\":\"0A20B3C85F482532A9578DBB3950B85CA06594D1\",\"TakerPaysCurrency\":\"0000000000000000000000005553440000000000\",\"TakerPaysIssuer\":\"0A20B3C85F482532A9578DBB3950B85CA06594D1\"}}},{\"DeletedNode\":{\"FinalFields\":{\"ExchangeRate\":\"5716571BD367C12A\",\"Flags\":0,\"RootIndex\":\"6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC985716571BD367C12A\",\"TakerGetsCurrency\":\"0000000000000000000000004254430000000000\",\"TakerGetsIssuer\":\"0A20B3C85F482532A9578DBB3950B85CA06594D1\",\"TakerPaysCurrency\":\"0000000000000000000000005553440000000000\",\"TakerPaysIssuer\":\"0A20B3C85F482532A9578DBB3950B85CA06594D1\"},\"LedgerEntryType\":\"DirectoryNode\",\"LedgerIndex\":\"6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC985716571BD367C12A\"}},{\"ModifiedNode\":{\"FinalFields\":{\"Flags\":0,\"IndexPrevious\":\"00000000000022F7\",\"Owner\":\"rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw\",\"RootIndex\":\"F435FBBEC9654204D7151A01E686BAA8CB325A472D7B61C7916EA58B59355767\"},\"LedgerEntryType\":\"DirectoryNode\",\"LedgerIndex\":\"88048321517F5E225D2963BC749F9F9853D348679406839659056E67D2D374C9\"}}],\"TransactionIndex\":2,\"TransactionResult\":\"tesSUCCESS\"}},{\"Account\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"Amount\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"10\"},\"Destination\":\"rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4\",\"Fee\":\"10000\",\"Flags\":131072,\"Sequence\":23295,\"SigningPubKey\":\"02B205F4B92351AC0EEB04254B636F4C49EF922CFA3CAAD03C6477DA1E04E94B53\",\"TransactionType\":\"Payment\",\"TxnSignature\":\"3045022100FAF247A836D601DE74A515B2AADE31186D8B0DA9C23DE489E09753F5CF4BB81F0220477C5B5BC3AC89F2347744F9E00CCA62267E198489D747578162C4C7D156211D\",\"hash\":\"A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A\",\"metaData\":{\"AffectedNodes\":[{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"Balance\":\"1930599790\",\"Flags\":0,\"OwnerCount\":2,\"Sequence\":23296},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"267C16D24EC42EEF8B03D5BE4E94266B1675FA54AFCE42DE795E02AB61031CBD\",\"PreviousFields\":{\"Balance\":\"1930609790\",\"Sequence\":23295},\"PreviousTxnID\":\"0F5396388E91D37BB26C8E24073A57E7C5D51E79AEE4CD855653B8499AE4E3DD\",\"PreviousTxnLgrSeq\":22419806}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-9.980959751659681\"},\"Flags\":2228224,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4\",\"value\":\"1000000\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"0\"},\"LowNode\":\"0000000000000423\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"C66957AF25229357F9C2D2BA17CE47D88169788EDA7610AD0F29AD5BCB225EE5\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-0.0009198315\"}},\"PreviousTxnID\":\"2A01E994D7000000B43DD63825A081B4440A44AB2F6FA0D506158AC9CA6B2869\",\"PreviousTxnLgrSeq\":22420532}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-276666.975959\"},\"Flags\":131072,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX\",\"value\":\"1000000\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"0\"},\"LowNode\":\"00000000000002D7\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"FFD710AE2074A98D920D00CC352F25744899F069A6C1B9E31DD32D2C6606E615\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-276676.975959\"}},\"PreviousTxnID\":\"BB9DFC87E9D4ED09CA2726DDFE83A4A396ED0D6545536322DE17CDACF45C0D5B\",\"PreviousTxnLgrSeq\":22419307}}],\"DeliveredAmount\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"9.980039920159681\"},\"TransactionIndex\":5,\"TransactionResult\":\"tesSUCCESS\"}},{\"Account\":\"rMPJDVaiP1eY7QTy3qFKLyBJxry2vuD5Sp\",\"Fee\":\"10000\",\"LastLedgerSequence\":22420577,\"Memos\":[{\"Memo\":{\"MemoData\":\"535F72665F6A70795F7573645F746F6B796F5F6269745F6D6178696D23715F726970706C65\",\"MemoType\":\"6F666665725F636F6D6D656E74\"}}],\"OfferSequence\":1294409,\"Sequence\":1294410,\"SigningPubKey\":\"020D9B49DBB6583827CC36E86BF13EDFA600367BE26DB09759AD08890A13CD92F9\",\"TakerGets\":{\"currency\":\"JPY\",\"issuer\":\"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN\",\"value\":\"254121.4048342\"},\"TakerPays\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"2500\"},\"TransactionType\":\"OfferCreate\",\"TxnSignature\":\"304402202EB6221AFBD704EF9E79C8DC69ED1B1B1219DB2239779A1B759CC9C42C759742022024C97FE2E4242C3B687416C1C518CDE1A06956347315B8AAFC45DE0CAC918FA6\",\"hash\":\"B1B959CA2B3B46F07B2F1373C84E927C46B124E9728C79A2736F32AA3F2DB7FB\",\"metaData\":{\"AffectedNodes\":[{\"DeletedNode\":{\"FinalFields\":{\"Account\":\"rMPJDVaiP1eY7QTy3qFKLyBJxry2vuD5Sp\",\"BookDirectory\":\"95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF45222C6B99158DA5E\",\"BookNode\":\"0000000000000000\",\"Flags\":0,\"OwnerNode\":\"0000000000000000\",\"PreviousTxnID\":\"050C1BD88A98FD6F5771EF04D76B1070FA9C3359FB3DB0F0E2518E0CB9BEE1FE\",\"PreviousTxnLgrSeq\":22420573,\"Sequence\":1294409,\"TakerGets\":{\"currency\":\"JPY\",\"issuer\":\"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN\",\"value\":\"255397.84578255\"},\"TakerPays\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"2500\"}},\"LedgerEntryType\":\"Offer\",\"LedgerIndex\":\"1343E6606ABEBB1F9A67C509F0D6AD6BC8E5BB6233A52E1477C8B3EE9B56F22D\"}},{\"CreatedNode\":{\"LedgerEntryType\":\"Offer\",\"LedgerIndex\":\"1AE025735533090254CF26482318847923FF38E72606182926B36482D9D51C68\",\"NewFields\":{\"Account\":\"rMPJDVaiP1eY7QTy3qFKLyBJxry2vuD5Sp\",\"BookDirectory\":\"95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF45222F371609B8F32\",\"Sequence\":1294410,\"TakerGets\":{\"currency\":\"JPY\",\"issuer\":\"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN\",\"value\":\"254121.4048342\"},\"TakerPays\":{\"currency\":\"USD\",\"issuer\":\"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B\",\"value\":\"2500\"}}}},{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"rMPJDVaiP1eY7QTy3qFKLyBJxry2vuD5Sp\",\"Balance\":\"2298060996\",\"Flags\":0,\"OwnerCount\":24,\"Sequence\":1294411},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"6F30F56C9326728173DD7A6FD9D3D84E5E4F95FE552D8F67C2C2BC154C596D53\",\"PreviousFields\":{\"Balance\":\"2298070996\",\"Sequence\":1294410},\"PreviousTxnID\":\"050C1BD88A98FD6F5771EF04D76B1070FA9C3359FB3DB0F0E2518E0CB9BEE1FE\",\"PreviousTxnLgrSeq\":22420573}},{\"DeletedNode\":{\"FinalFields\":{\"ExchangeRate\":\"5222C6B99158DA5E\",\"Flags\":0,\"RootIndex\":\"95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF45222C6B99158DA5E\",\"TakerGetsCurrency\":\"0000000000000000000000004A50590000000000\",\"TakerGetsIssuer\":\"5BBC0F22F61D9224A110650CFE21CC0C4BE13098\",\"TakerPaysCurrency\":\"0000000000000000000000005553440000000000\",\"TakerPaysIssuer\":\"0A20B3C85F482532A9578DBB3950B85CA06594D1\"},\"LedgerEntryType\":\"DirectoryNode\",\"LedgerIndex\":\"95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF45222C6B99158DA5E\"}},{\"CreatedNode\":{\"LedgerEntryType\":\"DirectoryNode\",\"LedgerIndex\":\"95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF45222F371609B8F32\",\"NewFields\":{\"ExchangeRate\":\"5222F371609B8F32\",\"RootIndex\":\"95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF45222F371609B8F32\",\"TakerGetsCurrency\":\"0000000000000000000000004A50590000000000\",\"TakerGetsIssuer\":\"5BBC0F22F61D9224A110650CFE21CC0C4BE13098\",\"TakerPaysCurrency\":\"0000000000000000000000005553440000000000\",\"TakerPaysIssuer\":\"0A20B3C85F482532A9578DBB3950B85CA06594D1\"}}},{\"ModifiedNode\":{\"FinalFields\":{\"Flags\":0,\"Owner\":\"rMPJDVaiP1eY7QTy3qFKLyBJxry2vuD5Sp\",\"RootIndex\":\"987A5375A496B811965A54979A1E1A29F474CBA2D133F0587347B9B58E599666\"},\"LedgerEntryType\":\"DirectoryNode\",\"LedgerIndex\":\"987A5375A496B811965A54979A1E1A29F474CBA2D133F0587347B9B58E599666\"}}],\"TransactionIndex\":3,\"TransactionResult\":\"tesSUCCESS\"}}]" } diff --git a/test/fixtures/responses/get-transaction-no-meta.json b/test/fixtures/responses/get-transaction-no-meta.json index 5be1a066..27fdc322 100644 --- a/test/fixtures/responses/get-transaction-no-meta.json +++ b/test/fixtures/responses/get-transaction-no-meta.json @@ -12,11 +12,7 @@ } }, "destination": { - "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM", - "amount": { - "currency": "USD", - "value": "0.001" - } + "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" }, "paths": "[[{\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"type\":48,\"type_hex\":\"0000000000000030\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"type\":49,\"type_hex\":\"0000000000000031\"}]]" } diff --git a/test/fixtures/responses/get-transaction-payment-include-raw-transaction.json b/test/fixtures/responses/get-transaction-payment-include-raw-transaction.json new file mode 100644 index 00000000..2b6c87ef --- /dev/null +++ b/test/fixtures/responses/get-transaction-payment-include-raw-transaction.json @@ -0,0 +1,89 @@ +{ + "type": "payment", + "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "sequence": 4, + "id": "F4AB442A6D4CBB935D66E1DA7309A5FC71C7143ED4049053EC14E3875B0CF9BF", + "specification": { + "source": { + "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "maxAmount": { + "currency": "XRP", + "value": "1.112209" + } + }, + "destination": { + "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" + }, + "paths": "[[{\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"type\":48,\"type_hex\":\"0000000000000030\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"type\":49,\"type_hex\":\"0000000000000031\"}]]" + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2013-03-12T23:56:50.000Z", + "fee": "0.00001", + "deliveredAmount": { + "currency": "USD", + "value": "0.001", + "counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" + }, + "balanceChanges": { + "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo": [ + { + "counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM", + "currency": "USD", + "value": "-0.001" + }, + { + "counterparty": "r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr", + "currency": "USD", + "value": "0.001002" + } + ], + "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM": [ + { + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "currency": "USD", + "value": "0.001" + } + ], + "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59": [ + { + "currency": "XRP", + "value": "-1.101208" + } + ], + "r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr": [ + { + "currency": "XRP", + "value": "1.101198" + }, + { + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "currency": "USD", + "value": "-0.001002" + } + ] + }, + "orderbookChanges": { + "r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr": [ + { + "direction": "buy", + "quantity": { + "currency": "XRP", + "value": "1.101198" + }, + "totalPrice": { + "currency": "USD", + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "value": "0.001002" + }, + "makerExchangeRate": "1099", + "sequence": 58, + "status": "partially-filled" + } + ] + }, + "ledgerVersion": 348860, + "indexInLedger": 0 + }, + "rawTransaction": "{\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Amount\":{\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\",\"value\":\"0.001\"},\"Destination\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\",\"Fee\":\"10\",\"Flags\":0,\"Paths\":[[{\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"type\":48,\"type_hex\":\"0000000000000030\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"type\":49,\"type_hex\":\"0000000000000031\"}]],\"SendMax\":\"1112209\",\"Sequence\":4,\"SigningPubKey\":\"02BC8C02199949B15C005B997E7C8594574E9B02BA2D0628902E0532989976CF9D\",\"TransactionType\":\"Payment\",\"TxnSignature\":\"304502204EE3E9D1B01D8959B08450FCA9E22025AF503DEF310E34A93863A85CAB3C0BC5022100B61F5B567F77026E8DEED89EED0B7CAF0E6C96C228A2A65216F0DC2D04D52083\",\"date\":416447810,\"hash\":\"F4AB442A6D4CBB935D66E1DA7309A5FC71C7143ED4049053EC14E3875B0CF9BF\",\"inLedger\":348860,\"ledger_index\":348860,\"validated\":true,\"meta\":{\"AffectedNodes\":[{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr\",\"BookDirectory\":\"4627DFFCFF8B5A265EDBD8AE8C14A52325DBFEDAF4F5C32E5E03E788E09BB000\",\"BookNode\":\"0000000000000000\",\"Flags\":0,\"OwnerNode\":\"0000000000000000\",\"Sequence\":58,\"TakerGets\":{\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"value\":\"5.648998\"},\"TakerPays\":\"6208248802\"},\"LedgerEntryType\":\"Offer\",\"LedgerIndex\":\"3CFB3C79D4F1BDB1EE5245259372576D926D9A875713422F7169A6CC60AFA68B\",\"PreviousFields\":{\"TakerGets\":{\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"value\":\"5.65\"},\"TakerPays\":\"6209350000\"},\"PreviousTxnID\":\"8F571C346688D89AC1F737AE3B6BB5D976702B171CC7B4DE5CA3D444D5B8D6B4\",\"PreviousTxnLgrSeq\":348433}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-0.001\"},\"Flags\":131072,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\",\"value\":\"1\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"value\":\"0\"},\"LowNode\":\"0000000000000002\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"4BD1874F8F3A60EDB0C23F5BD43E07953C2B8741B226648310D113DE2B486F01\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"0\"}},\"PreviousTxnID\":\"5B2006DAD0B3130F57ACF7CC5CCAC2EEBCD4B57AAA091A6FD0A24B073D08ABB8\",\"PreviousTxnLgrSeq\":343703}},{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Balance\":\"9998898762\",\"Flags\":0,\"OwnerCount\":3,\"Sequence\":5},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05\",\"PreviousFields\":{\"Balance\":\"9999999970\",\"Sequence\":4},\"PreviousTxnID\":\"53354D84BAE8FDFC3F4DA879D984D24B929E7FEB9100D2AD9EFCD2E126BCCDC8\",\"PreviousTxnLgrSeq\":343570}},{\"ModifiedNode\":{\"FinalFields\":{\"Account\":\"r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr\",\"Balance\":\"912695302618\",\"Flags\":0,\"OwnerCount\":10,\"Sequence\":59},\"LedgerEntryType\":\"AccountRoot\",\"LedgerIndex\":\"F3E119AAA87AF3607CF87F5523BB8278A83BCB4142833288305D767DD30C392A\",\"PreviousFields\":{\"Balance\":\"912694201420\"},\"PreviousTxnID\":\"8F571C346688D89AC1F737AE3B6BB5D976702B171CC7B4DE5CA3D444D5B8D6B4\",\"PreviousTxnLgrSeq\":348433}},{\"ModifiedNode\":{\"FinalFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-5.5541638883365\"},\"Flags\":131072,\"HighLimit\":{\"currency\":\"USD\",\"issuer\":\"r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr\",\"value\":\"1000\"},\"HighNode\":\"0000000000000000\",\"LowLimit\":{\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"value\":\"0\"},\"LowNode\":\"000000000000000C\"},\"LedgerEntryType\":\"RippleState\",\"LedgerIndex\":\"FA1255C2E0407F1945BCF9351257C7C5C28B0F5F09BB81C08D35A03E9F0136BC\",\"PreviousFields\":{\"Balance\":{\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\",\"value\":\"-5.5551658883365\"}},\"PreviousTxnID\":\"8F571C346688D89AC1F737AE3B6BB5D976702B171CC7B4DE5CA3D444D5B8D6B4\",\"PreviousTxnLgrSeq\":348433}}],\"TransactionIndex\":0,\"TransactionResult\":\"tesSUCCESS\"}}" +} diff --git a/test/fixtures/responses/get-transaction-payment.json b/test/fixtures/responses/get-transaction-payment.json index c2776595..49cb8b58 100644 --- a/test/fixtures/responses/get-transaction-payment.json +++ b/test/fixtures/responses/get-transaction-payment.json @@ -12,11 +12,7 @@ } }, "destination": { - "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM", - "amount": { - "currency": "USD", - "value": "0.001" - } + "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" }, "paths": "[[{\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"type\":48,\"type_hex\":\"0000000000000030\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"type\":49,\"type_hex\":\"0000000000000031\"}]]" }, diff --git a/test/fixtures/responses/get-transactions-include-raw-transactions.json b/test/fixtures/responses/get-transactions-include-raw-transactions.json new file mode 100644 index 00000000..8b0cc0a9 --- /dev/null +++ b/test/fixtures/responses/get-transactions-include-raw-transactions.json @@ -0,0 +1,190 @@ +[ + { + "type": "payment", + "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "sequence": 4, + "id": "99404A34E8170319521223A6C604AF48B9F1E3000C377E6141F9A1BF60B0B865", + "specification": { + "memos": [ + { + "type": "client", + "format": "rt1.5.2" + } + ], + "source": { + "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "maxAmount": { + "currency": "XRP", + "value": "1.112209" + } + }, + "destination": { + "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" + }, + "paths": "[[{\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"}]]" + }, + "outcome": { + "result": "tesSUCCESS", + "fee": "0.00001", + "deliveredAmount": { + "currency": "USD", + "value": "0.001", + "counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" + }, + "balanceChanges": { + "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo": [ + { + "counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM", + "currency": "USD", + "value": "-0.001" + }, + { + "counterparty": "r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr", + "currency": "USD", + "value": "0.001002" + } + ], + "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM": [ + { + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "currency": "USD", + "value": "0.001" + } + ], + "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59": [ + { + "currency": "XRP", + "value": "-1.101208" + } + ], + "r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr": [ + { + "currency": "XRP", + "value": "1.101198" + }, + { + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "currency": "USD", + "value": "-0.001002" + } + ] + }, + "orderbookChanges": { + "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59": [ + { + "direction": "buy", + "quantity": { + "currency": "XRP", + "value": "1.101198" + }, + "totalPrice": { + "currency": "USD", + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "value": "0.001002" + }, + "makerExchangeRate": "1099", + "sequence": 58, + "status": "partially-filled" + } + ] + }, + "ledgerVersion": 348859, + "indexInLedger": 0 + }, + "rawTransaction": "{\"TransactionType\":\"Payment\",\"Flags\":0,\"Sequence\":4,\"Amount\":{\"value\":\"0.001\",\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\"},\"Fee\":\"10\",\"SendMax\":\"1112209\",\"SigningPubKey\":\"02BC8C02199949B15C005B997E7C8594574E9B02BA2D0628902E0532989976CF9D\",\"TxnSignature\":\"304502204EE3E9D1B01D8959B08450FCA9E22025AF503DEF310E34A93863A85CAB3C0BC5022100B61F5B567F77026E8DEED89EED0B7CAF0E6C96C228A2A65216F0DC2D04D52083\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Destination\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\",\"Memos\":[{\"Memo\":{\"MemoType\":\"636C69656E74\",\"MemoFormat\":\"7274312E352E32\"}}],\"Paths\":[[{\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"}]],\"hash\":\"99404A34E8170319521223A6C604AF48B9F1E3000C377E6141F9A1BF60B0B865\",\"ledger_index\":348859,\"meta\":{\"TransactionIndex\":0,\"AffectedNodes\":[{\"ModifiedNode\":{\"LedgerEntryType\":\"Offer\",\"PreviousTxnLgrSeq\":348433,\"PreviousTxnID\":\"8F571C346688D89AC1F737AE3B6BB5D976702B171CC7B4DE5CA3D444D5B8D6B4\",\"LedgerIndex\":\"3CFB3C79D4F1BDB1EE5245259372576D926D9A875713422F7169A6CC60AFA68B\",\"PreviousFields\":{\"TakerPays\":\"6209350000\",\"TakerGets\":{\"value\":\"5.65\",\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\"}},\"FinalFields\":{\"Flags\":0,\"Sequence\":58,\"BookNode\":\"0000000000000000\",\"OwnerNode\":\"0000000000000000\",\"BookDirectory\":\"4627DFFCFF8B5A265EDBD8AE8C14A52325DBFEDAF4F5C32E5E03E788E09BB000\",\"TakerPays\":\"6208248802\",\"TakerGets\":{\"value\":\"5.648998\",\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\"},\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\"}}},{\"ModifiedNode\":{\"LedgerEntryType\":\"RippleState\",\"PreviousTxnLgrSeq\":343703,\"PreviousTxnID\":\"5B2006DAD0B3130F57ACF7CC5CCAC2EEBCD4B57AAA091A6FD0A24B073D08ABB8\",\"LedgerIndex\":\"4BD1874F8F3A60EDB0C23F5BD43E07953C2B8741B226648310D113DE2B486F01\",\"PreviousFields\":{\"Balance\":{\"value\":\"0\",\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\"}},\"FinalFields\":{\"Flags\":131072,\"LowNode\":\"0000000000000002\",\"HighNode\":\"0000000000000000\",\"Balance\":{\"value\":\"-0.001\",\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\"},\"LowLimit\":{\"value\":\"0\",\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\"},\"HighLimit\":{\"value\":\"1\",\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\"}}}},{\"ModifiedNode\":{\"LedgerEntryType\":\"AccountRoot\",\"PreviousTxnLgrSeq\":343570,\"PreviousTxnID\":\"53354D84BAE8FDFC3F4DA879D984D24B929E7FEB9100D2AD9EFCD2E126BCCDC8\",\"LedgerIndex\":\"4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05\",\"PreviousFields\":{\"Sequence\":4,\"Balance\":\"9999999970\"},\"FinalFields\":{\"Flags\":0,\"Sequence\":5,\"OwnerCount\":3,\"Balance\":\"9998898762\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\"}}},{\"ModifiedNode\":{\"LedgerEntryType\":\"AccountRoot\",\"PreviousTxnLgrSeq\":348433,\"PreviousTxnID\":\"8F571C346688D89AC1F737AE3B6BB5D976702B171CC7B4DE5CA3D444D5B8D6B4\",\"LedgerIndex\":\"F3E119AAA87AF3607CF87F5523BB8278A83BCB4142833288305D767DD30C392A\",\"PreviousFields\":{\"Balance\":\"912694201420\"},\"FinalFields\":{\"Flags\":0,\"Sequence\":59,\"OwnerCount\":10,\"Balance\":\"912695302618\",\"Account\":\"r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr\"}}},{\"ModifiedNode\":{\"LedgerEntryType\":\"RippleState\",\"PreviousTxnLgrSeq\":348433,\"PreviousTxnID\":\"8F571C346688D89AC1F737AE3B6BB5D976702B171CC7B4DE5CA3D444D5B8D6B4\",\"LedgerIndex\":\"FA1255C2E0407F1945BCF9351257C7C5C28B0F5F09BB81C08D35A03E9F0136BC\",\"PreviousFields\":{\"Balance\":{\"value\":\"-5.5551658883365\",\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\"}},\"FinalFields\":{\"Flags\":131072,\"LowNode\":\"000000000000000C\",\"HighNode\":\"0000000000000000\",\"Balance\":{\"value\":\"-5.5541638883365\",\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\"},\"LowLimit\":{\"value\":\"0\",\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\"},\"HighLimit\":{\"value\":\"1000\",\"currency\":\"USD\",\"issuer\":\"r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr\"}}}}],\"TransactionResult\":\"tesSUCCESS\"},\"validated\":true}" + }, + { + "type": "payment", + "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "id": "99404A34E8170319521223A6C604AF48B9F1E3000C377E6141F9A1BF60B0B865", + "sequence": 4, + "specification": { + "memos": [ + { + "type": "client", + "format": "rt1.5.2" + } + ], + "source": { + "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "maxAmount": { + "currency": "XRP", + "value": "1.112209" + } + }, + "destination": { + "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" + }, + "paths": "[[{\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"}]]" + }, + "outcome": { + "result": "tesSUCCESS", + "fee": "0.00001", + "deliveredAmount": { + "currency": "USD", + "value": "0.001", + "counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" + }, + "balanceChanges": { + "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo": [ + { + "counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM", + "currency": "USD", + "value": "-0.001" + }, + { + "counterparty": "r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr", + "currency": "USD", + "value": "0.001002" + } + ], + "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM": [ + { + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "currency": "USD", + "value": "0.001" + } + ], + "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59": [ + { + "currency": "XRP", + "value": "-1.101208" + } + ], + "r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr": [ + { + "currency": "XRP", + "value": "1.101198" + }, + { + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "currency": "USD", + "value": "-0.001002" + } + ] + }, + "orderbookChanges": { + "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59": [ + { + "direction": "buy", + "quantity": { + "currency": "XRP", + "value": "1.101198" + }, + "totalPrice": { + "currency": "USD", + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "value": "0.001002" + }, + "makerExchangeRate": "1099", + "sequence": 58, + "status": "partially-filled" + } + ] + }, + "ledgerVersion": 348858, + "indexInLedger": 0 + }, + "rawTransaction": "{\"TransactionType\":\"Payment\",\"Flags\":0,\"Sequence\":4,\"Amount\":{\"value\":\"0.001\",\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\"},\"Fee\":\"10\",\"SendMax\":\"1112209\",\"SigningPubKey\":\"02BC8C02199949B15C005B997E7C8594574E9B02BA2D0628902E0532989976CF9D\",\"TxnSignature\":\"304502204EE3E9D1B01D8959B08450FCA9E22025AF503DEF310E34A93863A85CAB3C0BC5022100B61F5B567F77026E8DEED89EED0B7CAF0E6C96C228A2A65216F0DC2D04D52083\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Destination\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\",\"Memos\":[{\"Memo\":{\"MemoType\":\"636C69656E74\",\"MemoFormat\":\"7274312E352E32\"}}],\"Paths\":[[{\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"}]],\"hash\":\"99404A34E8170319521223A6C604AF48B9F1E3000C377E6141F9A1BF60B0B865\",\"ledger_index\":348858,\"meta\":{\"TransactionIndex\":0,\"AffectedNodes\":[{\"ModifiedNode\":{\"LedgerEntryType\":\"Offer\",\"PreviousTxnLgrSeq\":348433,\"PreviousTxnID\":\"8F571C346688D89AC1F737AE3B6BB5D976702B171CC7B4DE5CA3D444D5B8D6B4\",\"LedgerIndex\":\"3CFB3C79D4F1BDB1EE5245259372576D926D9A875713422F7169A6CC60AFA68B\",\"PreviousFields\":{\"TakerPays\":\"6209350000\",\"TakerGets\":{\"value\":\"5.65\",\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\"}},\"FinalFields\":{\"Flags\":0,\"Sequence\":58,\"BookNode\":\"0000000000000000\",\"OwnerNode\":\"0000000000000000\",\"BookDirectory\":\"4627DFFCFF8B5A265EDBD8AE8C14A52325DBFEDAF4F5C32E5E03E788E09BB000\",\"TakerPays\":\"6208248802\",\"TakerGets\":{\"value\":\"5.648998\",\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\"},\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\"}}},{\"ModifiedNode\":{\"LedgerEntryType\":\"RippleState\",\"PreviousTxnLgrSeq\":343703,\"PreviousTxnID\":\"5B2006DAD0B3130F57ACF7CC5CCAC2EEBCD4B57AAA091A6FD0A24B073D08ABB8\",\"LedgerIndex\":\"4BD1874F8F3A60EDB0C23F5BD43E07953C2B8741B226648310D113DE2B486F01\",\"PreviousFields\":{\"Balance\":{\"value\":\"0\",\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\"}},\"FinalFields\":{\"Flags\":131072,\"LowNode\":\"0000000000000002\",\"HighNode\":\"0000000000000000\",\"Balance\":{\"value\":\"-0.001\",\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\"},\"LowLimit\":{\"value\":\"0\",\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\"},\"HighLimit\":{\"value\":\"1\",\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\"}}}},{\"ModifiedNode\":{\"LedgerEntryType\":\"AccountRoot\",\"PreviousTxnLgrSeq\":343570,\"PreviousTxnID\":\"53354D84BAE8FDFC3F4DA879D984D24B929E7FEB9100D2AD9EFCD2E126BCCDC8\",\"LedgerIndex\":\"4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05\",\"PreviousFields\":{\"Sequence\":4,\"Balance\":\"9999999970\"},\"FinalFields\":{\"Flags\":0,\"Sequence\":5,\"OwnerCount\":3,\"Balance\":\"9998898762\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\"}}},{\"ModifiedNode\":{\"LedgerEntryType\":\"AccountRoot\",\"PreviousTxnLgrSeq\":348433,\"PreviousTxnID\":\"8F571C346688D89AC1F737AE3B6BB5D976702B171CC7B4DE5CA3D444D5B8D6B4\",\"LedgerIndex\":\"F3E119AAA87AF3607CF87F5523BB8278A83BCB4142833288305D767DD30C392A\",\"PreviousFields\":{\"Balance\":\"912694201420\"},\"FinalFields\":{\"Flags\":0,\"Sequence\":59,\"OwnerCount\":10,\"Balance\":\"912695302618\",\"Account\":\"r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr\"}}},{\"ModifiedNode\":{\"LedgerEntryType\":\"RippleState\",\"PreviousTxnLgrSeq\":348433,\"PreviousTxnID\":\"8F571C346688D89AC1F737AE3B6BB5D976702B171CC7B4DE5CA3D444D5B8D6B4\",\"LedgerIndex\":\"FA1255C2E0407F1945BCF9351257C7C5C28B0F5F09BB81C08D35A03E9F0136BC\",\"PreviousFields\":{\"Balance\":{\"value\":\"-5.5551658883365\",\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\"}},\"FinalFields\":{\"Flags\":131072,\"LowNode\":\"000000000000000C\",\"HighNode\":\"0000000000000000\",\"Balance\":{\"value\":\"-5.5541638883365\",\"currency\":\"USD\",\"issuer\":\"rrrrrrrrrrrrrrrrrrrrBZbvji\"},\"LowLimit\":{\"value\":\"0\",\"currency\":\"USD\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\"},\"HighLimit\":{\"value\":\"1000\",\"currency\":\"USD\",\"issuer\":\"r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr\"}}}}],\"TransactionResult\":\"tesSUCCESS\"},\"validated\":true}" + } +] diff --git a/test/fixtures/responses/get-transactions.json b/test/fixtures/responses/get-transactions.json index 971be899..3e0a05a2 100644 --- a/test/fixtures/responses/get-transactions.json +++ b/test/fixtures/responses/get-transactions.json @@ -19,11 +19,7 @@ } }, "destination": { - "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM", - "amount": { - "currency": "USD", - "value": "0.001" - } + "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" }, "paths": "[[{\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"}]]" }, @@ -116,11 +112,7 @@ } }, "destination": { - "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM", - "amount": { - "currency": "USD", - "value": "0.001" - } + "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" }, "paths": "[[{\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"}]]" }, diff --git a/test/fixtures/responses/index.js b/test/fixtures/responses/index.js index f84a0489..fd1507c1 100644 --- a/test/fixtures/responses/index.js +++ b/test/fixtures/responses/index.js @@ -35,6 +35,7 @@ module.exports = { orderSell: require('./get-transaction-order-sell.json'), noMeta: require('./get-transaction-no-meta.json'), payment: require('./get-transaction-payment.json'), + paymentIncludeRawTransaction: require('./get-transaction-payment-include-raw-transaction.json'), settings: require('./get-transaction-settings.json'), trustline: require('./get-transaction-trustline-set.json'), trackingOn: require('./get-transaction-settings-tracking-on.json'), @@ -68,6 +69,7 @@ module.exports = { }, getTransactions: { normal: require('./get-transactions.json'), + includeRawTransactions: require('./get-transactions-include-raw-transactions.json'), one: require('./get-transactions-one.json') }, getTrustlines: { diff --git a/test/fixtures/rippled/ledger-with-partial-payment.json b/test/fixtures/rippled/ledger-with-partial-payment.json index 7374a1be..edbb3e1b 100644 --- a/test/fixtures/rippled/ledger-with-partial-payment.json +++ b/test/fixtures/rippled/ledger-with-partial-payment.json @@ -8,7 +8,7 @@ "account_hash": "334EE5F2209538C3099E133D25725E5BFEB40A198EA7028E6317F13E95D533DF", "close_flags": 0, "close_time": 521225631, - "close_time_human": "2016-Jul-07 16:53:51", + "close_time_human": "2016-Jul-07 16:53:51.000000000", "close_time_resolution": 10, "closed": true, "hash": "4F6C0495378FF68A15749C0D51D097EB638DA70319FDAC7A97A27CE63E0BFFED", @@ -22,229 +22,471 @@ "transaction_hash": "C72A2BDCB471F3AEEB917ABC6019407CAE6DA4B858903A8AB2335A0EB077125D", "transactions": [ { - "Account": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "Amount": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "10" - }, - "Destination": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "Fee": "10000", - "Flags": 131072, - "Sequence": 23295, - "SigningPubKey": "02B205F4B92351AC0EEB04254B636F4C49EF922CFA3CAAD03C6477DA1E04E94B53", - "TransactionType": "Payment", - "TxnSignature": "3045022100FAF247A836D601DE74A515B2AADE31186D8B0DA9C23DE489E09753F5CF4BB81F0220477C5B5BC3AC89F2347744F9E00CCA62267E198489D747578162C4C7D156211D", - "hash": "A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A", + "Account": "rJXJEvVxWSG2xVp62AoE7rM3PKUF9S1GSR", + "Fee": "15", + "Flags": 2147483648, + "LastLedgerSequence": 22420576, + "OfferSequence": 84383, + "Sequence": 84384, + "SigningPubKey": "0219D7F97CA3C7BDF0982B0CCFE613761BE563C049A876596B5365A975C669D1A2", + "TransactionType": "OfferCancel", + "TxnSignature": "3045022100D270AC3BAB933C22E88DC557B86BF04BF2A101C2474E0FD6DA5991DB996010EB022071C6571C3031F2B1A0F91106CAFB5C8E766220CFC57676D467258A3A3B966F28", + "hash": "1257EB8C80DE5AF6ACE91E0C05407CC1329E7B6FFBBBFFE9F734682871BD7655", "metaData": { "AffectedNodes": [ { "ModifiedNode": { "FinalFields": { - "Account": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "Balance": "1930599790", + "Account": "rJXJEvVxWSG2xVp62AoE7rM3PKUF9S1GSR", + "Balance": "170452281963", "Flags": 0, - "OwnerCount": 2, - "Sequence": 23296 + "OwnerCount": 3, + "Sequence": 84385 }, "LedgerEntryType": "AccountRoot", - "LedgerIndex": "267C16D24EC42EEF8B03D5BE4E94266B1675FA54AFCE42DE795E02AB61031CBD", + "LedgerIndex": "4CC1921751937D88A7BFF74B5EA2C67673B349EA86C52CE918EED279075EB6E6", "PreviousFields": { - "Balance": "1930609790", - "Sequence": 23295 + "Balance": "170452281978", + "OwnerCount": 4, + "Sequence": 84384 }, - "PreviousTxnID": "0F5396388E91D37BB26C8E24073A57E7C5D51E79AEE4CD855653B8499AE4E3DD", - "PreviousTxnLgrSeq": 22419806 + "PreviousTxnID": "400E30CB98BF337449A69D221B7159484B6EC18002A9285AFB871D60326C81A9", + "PreviousTxnLgrSeq": 22420562 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rJXJEvVxWSG2xVp62AoE7rM3PKUF9S1GSR", + "BookDirectory": "CA462483C85A90DB76D8903681442394D8A5E2D0FFAC259C5D0642737E363451", + "BookNode": "0000000000000000", + "Flags": 0, + "OwnerNode": "0000000000000000", + "PreviousTxnID": "400E30CB98BF337449A69D221B7159484B6EC18002A9285AFB871D60326C81A9", + "PreviousTxnLgrSeq": 22420562, + "Sequence": 84383, + "TakerGets": { + "currency": "EUR", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "243.16481874" + }, + "TakerPays": "42843541733" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "86FFBBEC167E8E6D9540637C12BE2D28808F724B969631E00E506DE279389B8B" + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5D0642737E363451", + "Flags": 0, + "RootIndex": "CA462483C85A90DB76D8903681442394D8A5E2D0FFAC259C5D0642737E363451", + "TakerGetsCurrency": "0000000000000000000000004555520000000000", + "TakerGetsIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CA462483C85A90DB76D8903681442394D8A5E2D0FFAC259C5D0642737E363451" } }, { "ModifiedNode": { "FinalFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-9.980959751659681" - }, - "Flags": 2228224, - "HighLimit": { - "currency": "USD", - "issuer": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "value": "1000000" - }, - "HighNode": "0000000000000000", - "LowLimit": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "0" - }, - "LowNode": "0000000000000423" + "Flags": 0, + "Owner": "rJXJEvVxWSG2xVp62AoE7rM3PKUF9S1GSR", + "RootIndex": "D84063896F704906662E7D93637D579485E19914088FA6F4F929D93CD2163B18" }, - "LedgerEntryType": "RippleState", - "LedgerIndex": "C66957AF25229357F9C2D2BA17CE47D88169788EDA7610AD0F29AD5BCB225EE5", - "PreviousFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-0.0009198315" - } - }, - "PreviousTxnID": "2A01E994D7000000B43DD63825A081B4440A44AB2F6FA0D506158AC9CA6B2869", - "PreviousTxnLgrSeq": 22420532 - } - }, - { - "ModifiedNode": { - "FinalFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-276666.975959" - }, - "Flags": 131072, - "HighLimit": { - "currency": "USD", - "issuer": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "value": "1000000" - }, - "HighNode": "0000000000000000", - "LowLimit": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "0" - }, - "LowNode": "00000000000002D7" - }, - "LedgerEntryType": "RippleState", - "LedgerIndex": "FFD710AE2074A98D920D00CC352F25744899F069A6C1B9E31DD32D2C6606E615", - "PreviousFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-276676.975959" - } - }, - "PreviousTxnID": "BB9DFC87E9D4ED09CA2726DDFE83A4A396ED0D6545536322DE17CDACF45C0D5B", - "PreviousTxnLgrSeq": 22419307 + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "D84063896F704906662E7D93637D579485E19914088FA6F4F929D93CD2163B18" + } + } + ], + "TransactionIndex": 4, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rUp8CvtneUUL6qYaxfZwUHg2cwYuo5jugG", + "Fee": "10000", + "LastLedgerSequence": 22420577, + "Memos": [ + { + "Memo": { + "MemoData": "535F72665F6A70795F7573645F746F6B796F5F6269745F676623715F726970706C65", + "MemoType": "6F666665725F636F6D6D656E74" + } + } + ], + "OfferSequence": 771388, + "Sequence": 771390, + "SigningPubKey": "02CEC39D51583C89A46804CAA7956503E41919022BF4BC842D4FA9CF076783AFCE", + "TakerGets": { + "currency": "JPY", + "issuer": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN", + "value": "302728.16600853" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "3000" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100CAE6228D3D6729E60222B2453DE13C35CAB7049FB430543BB819161F059511E60220371FD55EDF0396A207E57C40114C004B92F6697A260A0CFBC2704E85B255CCEE", + "hash": "43A53F005AF1AE095B39244D3C56E49150C43D16D89B7DA8673937E142858D38", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "1FB6961BD982103CBFD57FA73F30110CE1ED31C85A35A8FB987591CAD1A28C6C", + "NewFields": { + "Account": "rUp8CvtneUUL6qYaxfZwUHg2cwYuo5jugG", + "BookDirectory": "95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF4522334FBE4FC3668", + "Sequence": 771390, + "TakerGets": { + "currency": "JPY", + "issuer": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN", + "value": "302728.16600853" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "3000" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rUp8CvtneUUL6qYaxfZwUHg2cwYuo5jugG", + "Balance": "2048885453", + "Flags": 0, + "OwnerCount": 22, + "RegularKey": "rNXYnXu27dPzQyXxVV6iNBNrJwSz8y5Wzc", + "Sequence": 771391 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "7118386A4D8C55902FD814D62E2F4D7CE90E3B4F44E6B23CAD4C874B9A5771C9", + "PreviousFields": { + "Balance": "2048895453", + "Sequence": 771390 + }, + "PreviousTxnID": "19EB03F21D86C9B225FB6ADACF489BF66C1482C3B05DAAD59C114965FB13A59C", + "PreviousTxnLgrSeq": 22420570 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "52230F211CBF3EFF", + "Flags": 0, + "RootIndex": "95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF452230F211CBF3EFF", + "TakerGetsCurrency": "0000000000000000000000004A50590000000000", + "TakerGetsIssuer": "5BBC0F22F61D9224A110650CFE21CC0C4BE13098", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF452230F211CBF3EFF" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF4522334FBE4FC3668", + "NewFields": { + "ExchangeRate": "522334FBE4FC3668", + "RootIndex": "95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF4522334FBE4FC3668", + "TakerGetsCurrency": "0000000000000000000000004A50590000000000", + "TakerGetsIssuer": "5BBC0F22F61D9224A110650CFE21CC0C4BE13098", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rUp8CvtneUUL6qYaxfZwUHg2cwYuo5jugG", + "RootIndex": "A187A05FE957F5953846DF21A742F20FBFFACF3196D8FFEA85C3E062EA3B7A69" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "A187A05FE957F5953846DF21A742F20FBFFACF3196D8FFEA85C3E062EA3B7A69" + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rUp8CvtneUUL6qYaxfZwUHg2cwYuo5jugG", + "BookDirectory": "95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF452230F211CBF3EFF", + "BookNode": "0000000000000000", + "Flags": 0, + "OwnerNode": "0000000000000000", + "PreviousTxnID": "2073CD805F40D44BADD32EF138FE9782A5D9DF1E9C0700EA41C4D45163ED1FE6", + "PreviousTxnLgrSeq": 22420569, + "Sequence": 771388, + "TakerGets": { + "currency": "JPY", + "issuer": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN", + "value": "304004.98984125" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "3000" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "F5ACC7F4D8253666AB5AF39E812107E7CFC5B7A686E7C24F560F84AA3150BDF0" + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw", + "Expiration": 521226226, + "Fee": "30", + "Flags": 2147483648, + "LastLedgerSequence": 22420575, + "Sequence": 15817540, + "SigningPubKey": "034841BF24BD72C7CC371EBD87CCBF258D8ADB05C18DE207130364A97D8A3EA524", + "TakerGets": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "214" + }, + "TakerPays": { + "currency": "JPY", + "issuer": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN", + "value": "22148.5780242286" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "304402204DF95ADF23D6F5727E573BA085DDE08FB5B7AE9A23CF5709708FE190D87B851A02200C0D7F21C4F989C2B81171B11CE3224F7DB594A413C45CCA5E505ED86ED91418", + "hash": "54DE214FAD77DB326E00100B0112612AC3D7BA3BE17C2AF3480CF919A13DA4A5", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw", + "AccountTxnID": "54DE214FAD77DB326E00100B0112612AC3D7BA3BE17C2AF3480CF919A13DA4A5", + "Balance": "2690753645214", + "Flags": 0, + "OwnerCount": 25, + "RegularKey": "r9S56zu6QeJD5d8A7QMfLAeYavgB9dhaX4", + "Sequence": 15817541 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "2880A9B4FB90A306B576C2D532BFE390AB3904642647DCF739492AA244EF46D1", + "PreviousFields": { + "AccountTxnID": "05408DE689A1D9454DE31BFE586F210C1AB78FBB71D5A096CDA7B453F9E8733C", + "Balance": "2690753645244", + "OwnerCount": 24, + "Sequence": 15817540 + }, + "PreviousTxnID": "05408DE689A1D9454DE31BFE586F210C1AB78FBB71D5A096CDA7B453F9E8733C", + "PreviousTxnLgrSeq": 22420573 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "00000000000022F7", + "Owner": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw", + "RootIndex": "F435FBBEC9654204D7151A01E686BAA8CB325A472D7B61C7916EA58B59355767" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "88048321517F5E225D2963BC749F9F9853D348679406839659056E67D2D374C9" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "9422BBC577CBDD1ED2C13D4C7CC6581BB10EAC3E968D44C2D7FB98E15B2B37F3", + "NewFields": { + "Account": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw", + "BookDirectory": "FB9B9ED334DD7AFC1145AE485D86FB101C07F583CDE55EB95703AD4F200758D9", + "Expiration": 521226226, + "OwnerNode": "00000000000024CB", + "Sequence": 15817540, + "TakerGets": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "214" + }, + "TakerPays": { + "currency": "JPY", + "issuer": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN", + "value": "22148.5780242286" + } + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "FB9B9ED334DD7AFC1145AE485D86FB101C07F583CDE55EB95703AD4F200758D9", + "NewFields": { + "ExchangeRate": "5703AD4F200758D9", + "RootIndex": "FB9B9ED334DD7AFC1145AE485D86FB101C07F583CDE55EB95703AD4F200758D9", + "TakerGetsCurrency": "0000000000000000000000005553440000000000", + "TakerGetsIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1", + "TakerPaysCurrency": "0000000000000000000000004A50590000000000", + "TakerPaysIssuer": "5BBC0F22F61D9224A110650CFE21CC0C4BE13098" + } } } ], - "DeliveredAmount": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "9.980039920159681" - }, "TransactionIndex": 1, "TransactionResult": "tesSUCCESS" } }, { - "Account": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "Amount": { + "Account": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw", + "Expiration": 521226226, + "Fee": "30", + "Flags": 2147483648, + "LastLedgerSequence": 22420575, + "OfferSequence": 15817525, + "Sequence": 15817541, + "SigningPubKey": "034841BF24BD72C7CC371EBD87CCBF258D8ADB05C18DE207130364A97D8A3EA524", + "TakerGets": { + "currency": "BTC", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "4.7" + }, + "TakerPays": { "currency": "USD", "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "10" + "value": "2954.92952861701" }, - "Destination": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "Fee": "10000", - "Flags": 131072, - "Sequence": 23295, - "SigningPubKey": "02B205F4B92351AC0EEB04254B636F4C49EF922CFA3CAAD03C6477DA1E04E94B53", - "TransactionType": "Payment", - "TxnSignature": "3045022100FAF247A836D601DE74A515B2AADE31186D8B0DA9C23DE489E09753F5CF4BB81F0220477C5B5BC3AC89F2347744F9E00CCA62267E198489D747578162C4C7D156211D", - "hash": "A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A", + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100C63DFE5D3A27D42DC87439948C6692C0015B6891FC531F27A58ECA319D388FCF02202CE4E60D940E168250E612A45331134937AD71911DFF8C042FEBB91833332F94", + "hash": "5B79A66B1FD0619159783A8A85F43E14B159D91D3ACB36AEB954A101026BB68E", "metaData": { "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "20046290D68FFFC3AC8DB8B725F2BF0FD4CBAF45C719C76245F247E9C7EDCBFE", + "NewFields": { + "Account": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw", + "BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC9857165611D6A8983F", + "Expiration": 521226226, + "OwnerNode": "00000000000024CB", + "Sequence": 15817541, + "TakerGets": { + "currency": "BTC", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "4.7" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "2954.92952861701" + } + } + } + }, { "ModifiedNode": { "FinalFields": { - "Account": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "Balance": "1930599790", + "Account": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw", + "AccountTxnID": "5B79A66B1FD0619159783A8A85F43E14B159D91D3ACB36AEB954A101026BB68E", + "Balance": "2690753645184", "Flags": 0, - "OwnerCount": 2, - "Sequence": 23296 + "OwnerCount": 25, + "RegularKey": "r9S56zu6QeJD5d8A7QMfLAeYavgB9dhaX4", + "Sequence": 15817542 }, "LedgerEntryType": "AccountRoot", - "LedgerIndex": "267C16D24EC42EEF8B03D5BE4E94266B1675FA54AFCE42DE795E02AB61031CBD", + "LedgerIndex": "2880A9B4FB90A306B576C2D532BFE390AB3904642647DCF739492AA244EF46D1", "PreviousFields": { - "Balance": "1930609790", - "Sequence": 23295 + "AccountTxnID": "54DE214FAD77DB326E00100B0112612AC3D7BA3BE17C2AF3480CF919A13DA4A5", + "Balance": "2690753645214", + "Sequence": 15817541 }, - "PreviousTxnID": "0F5396388E91D37BB26C8E24073A57E7C5D51E79AEE4CD855653B8499AE4E3DD", - "PreviousTxnLgrSeq": 22419806 + "PreviousTxnID": "54DE214FAD77DB326E00100B0112612AC3D7BA3BE17C2AF3480CF919A13DA4A5", + "PreviousTxnLgrSeq": 22420574 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw", + "BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC985716571BD367C12A", + "BookNode": "0000000000000000", + "Expiration": 521226214, + "Flags": 0, + "OwnerNode": "00000000000024CB", + "PreviousTxnID": "EB843063BD289BBFBD376602780A83F5CBA07AAADF65392683B9DE90E43B59C7", + "PreviousTxnLgrSeq": 22420570, + "Sequence": 15817525, + "TakerGets": { + "currency": "BTC", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "4.7" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "2955.46645977528" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "3E26BB816F8D8FE43F01D10284AAC2A2E340AF8B20AD37B125C098A8BCAEF601" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC9857165611D6A8983F", + "NewFields": { + "ExchangeRate": "57165611D6A8983F", + "RootIndex": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC9857165611D6A8983F", + "TakerGetsCurrency": "0000000000000000000000004254430000000000", + "TakerGetsIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5716571BD367C12A", + "Flags": 0, + "RootIndex": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC985716571BD367C12A", + "TakerGetsCurrency": "0000000000000000000000004254430000000000", + "TakerGetsIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC985716571BD367C12A" } }, { "ModifiedNode": { "FinalFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-9.980959751659681" - }, - "Flags": 2228224, - "HighLimit": { - "currency": "USD", - "issuer": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "value": "1000000" - }, - "HighNode": "0000000000000000", - "LowLimit": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "0" - }, - "LowNode": "0000000000000423" + "Flags": 0, + "IndexPrevious": "00000000000022F7", + "Owner": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw", + "RootIndex": "F435FBBEC9654204D7151A01E686BAA8CB325A472D7B61C7916EA58B59355767" }, - "LedgerEntryType": "RippleState", - "LedgerIndex": "C66957AF25229357F9C2D2BA17CE47D88169788EDA7610AD0F29AD5BCB225EE5", - "PreviousFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-0.0009198315" - } - }, - "PreviousTxnID": "2A01E994D7000000B43DD63825A081B4440A44AB2F6FA0D506158AC9CA6B2869", - "PreviousTxnLgrSeq": 22420532 - } - }, - { - "ModifiedNode": { - "FinalFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-276666.975959" - }, - "Flags": 131072, - "HighLimit": { - "currency": "USD", - "issuer": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "value": "1000000" - }, - "HighNode": "0000000000000000", - "LowLimit": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "0" - }, - "LowNode": "00000000000002D7" - }, - "LedgerEntryType": "RippleState", - "LedgerIndex": "FFD710AE2074A98D920D00CC352F25744899F069A6C1B9E31DD32D2C6606E615", - "PreviousFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-276676.975959" - } - }, - "PreviousTxnID": "BB9DFC87E9D4ED09CA2726DDFE83A4A396ED0D6545536322DE17CDACF45C0D5B", - "PreviousTxnLgrSeq": 22419307 + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "88048321517F5E225D2963BC749F9F9853D348679406839659056E67D2D374C9" } } ], - "delivered_amount": "unavailable", "TransactionIndex": 2, "TransactionResult": "tesSUCCESS" } @@ -361,240 +603,155 @@ "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", "value": "9.980039920159681" }, - "delivered_amount": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "9.980039920159681" - }, - "TransactionIndex": 3, - "TransactionResult": "tesSUCCESS" - } - }, - { - "Account": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "Amount": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "10" - }, - "Destination": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "Fee": "10000", - "Flags": 131072, - "Sequence": 23295, - "SigningPubKey": "02B205F4B92351AC0EEB04254B636F4C49EF922CFA3CAAD03C6477DA1E04E94B53", - "TransactionType": "Payment", - "TxnSignature": "3045022100FAF247A836D601DE74A515B2AADE31186D8B0DA9C23DE489E09753F5CF4BB81F0220477C5B5BC3AC89F2347744F9E00CCA62267E198489D747578162C4C7D156211D", - "hash": "A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A", - "metaData": { - "AffectedNodes": [ - { - "ModifiedNode": { - "FinalFields": { - "Account": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "Balance": "1930599790", - "Flags": 0, - "OwnerCount": 2, - "Sequence": 23296 - }, - "LedgerEntryType": "AccountRoot", - "LedgerIndex": "267C16D24EC42EEF8B03D5BE4E94266B1675FA54AFCE42DE795E02AB61031CBD", - "PreviousFields": { - "Balance": "1930609790", - "Sequence": 23295 - }, - "PreviousTxnID": "0F5396388E91D37BB26C8E24073A57E7C5D51E79AEE4CD855653B8499AE4E3DD", - "PreviousTxnLgrSeq": 22419806 - } - }, - { - "ModifiedNode": { - "FinalFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-9.980959751659681" - }, - "Flags": 2228224, - "HighLimit": { - "currency": "USD", - "issuer": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "value": "1000000" - }, - "HighNode": "0000000000000000", - "LowLimit": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "0" - }, - "LowNode": "0000000000000423" - }, - "LedgerEntryType": "RippleState", - "LedgerIndex": "C66957AF25229357F9C2D2BA17CE47D88169788EDA7610AD0F29AD5BCB225EE5", - "PreviousFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-0.0009198315" - } - }, - "PreviousTxnID": "2A01E994D7000000B43DD63825A081B4440A44AB2F6FA0D506158AC9CA6B2869", - "PreviousTxnLgrSeq": 22420532 - } - }, - { - "ModifiedNode": { - "FinalFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-276666.975959" - }, - "Flags": 131072, - "HighLimit": { - "currency": "USD", - "issuer": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "value": "1000000" - }, - "HighNode": "0000000000000000", - "LowLimit": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "0" - }, - "LowNode": "00000000000002D7" - }, - "LedgerEntryType": "RippleState", - "LedgerIndex": "FFD710AE2074A98D920D00CC352F25744899F069A6C1B9E31DD32D2C6606E615", - "PreviousFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-276676.975959" - } - }, - "PreviousTxnID": "BB9DFC87E9D4ED09CA2726DDFE83A4A396ED0D6545536322DE17CDACF45C0D5B", - "PreviousTxnLgrSeq": 22419307 - } - } - ], - "TransactionIndex": 4, - "TransactionResult": "tesSUCCESS" - } - }, - { - "Account": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "Amount": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "10" - }, - "Destination": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "Fee": "10000", - "Flags": 0, - "Sequence": 23295, - "SigningPubKey": "02B205F4B92351AC0EEB04254B636F4C49EF922CFA3CAAD03C6477DA1E04E94B53", - "TransactionType": "Payment", - "TxnSignature": "3045022100FAF247A836D601DE74A515B2AADE31186D8B0DA9C23DE489E09753F5CF4BB81F0220477C5B5BC3AC89F2347744F9E00CCA62267E198489D747578162C4C7D156211D", - "hash": "A0A074D10355223CBE2520A42F93A52E3CC8B4D692570EB4841084F9BBB39F7A", - "metaData": { - "AffectedNodes": [ - { - "ModifiedNode": { - "FinalFields": { - "Account": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "Balance": "1930599790", - "Flags": 0, - "OwnerCount": 2, - "Sequence": 23296 - }, - "LedgerEntryType": "AccountRoot", - "LedgerIndex": "267C16D24EC42EEF8B03D5BE4E94266B1675FA54AFCE42DE795E02AB61031CBD", - "PreviousFields": { - "Balance": "1930609790", - "Sequence": 23295 - }, - "PreviousTxnID": "0F5396388E91D37BB26C8E24073A57E7C5D51E79AEE4CD855653B8499AE4E3DD", - "PreviousTxnLgrSeq": 22419806 - } - }, - { - "ModifiedNode": { - "FinalFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-9.980959751659681" - }, - "Flags": 2228224, - "HighLimit": { - "currency": "USD", - "issuer": "rNNuQMuExCiEjeZ4h9JJnj5PSWypdMXDj4", - "value": "1000000" - }, - "HighNode": "0000000000000000", - "LowLimit": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "0" - }, - "LowNode": "0000000000000423" - }, - "LedgerEntryType": "RippleState", - "LedgerIndex": "C66957AF25229357F9C2D2BA17CE47D88169788EDA7610AD0F29AD5BCB225EE5", - "PreviousFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-0.0009198315" - } - }, - "PreviousTxnID": "2A01E994D7000000B43DD63825A081B4440A44AB2F6FA0D506158AC9CA6B2869", - "PreviousTxnLgrSeq": 22420532 - } - }, - { - "ModifiedNode": { - "FinalFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-276666.975959" - }, - "Flags": 131072, - "HighLimit": { - "currency": "USD", - "issuer": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", - "value": "1000000" - }, - "HighNode": "0000000000000000", - "LowLimit": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "0" - }, - "LowNode": "00000000000002D7" - }, - "LedgerEntryType": "RippleState", - "LedgerIndex": "FFD710AE2074A98D920D00CC352F25744899F069A6C1B9E31DD32D2C6606E615", - "PreviousFields": { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "-276676.975959" - } - }, - "PreviousTxnID": "BB9DFC87E9D4ED09CA2726DDFE83A4A396ED0D6545536322DE17CDACF45C0D5B", - "PreviousTxnLgrSeq": 22419307 - } - } - ], "TransactionIndex": 5, "TransactionResult": "tesSUCCESS" } + }, + { + "Account": "rMPJDVaiP1eY7QTy3qFKLyBJxry2vuD5Sp", + "Fee": "10000", + "LastLedgerSequence": 22420577, + "Memos": [ + { + "Memo": { + "MemoData": "535F72665F6A70795F7573645F746F6B796F5F6269745F6D6178696D23715F726970706C65", + "MemoType": "6F666665725F636F6D6D656E74" + } + } + ], + "OfferSequence": 1294409, + "Sequence": 1294410, + "SigningPubKey": "020D9B49DBB6583827CC36E86BF13EDFA600367BE26DB09759AD08890A13CD92F9", + "TakerGets": { + "currency": "JPY", + "issuer": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN", + "value": "254121.4048342" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "2500" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "304402202EB6221AFBD704EF9E79C8DC69ED1B1B1219DB2239779A1B759CC9C42C759742022024C97FE2E4242C3B687416C1C518CDE1A06956347315B8AAFC45DE0CAC918FA6", + "hash": "B1B959CA2B3B46F07B2F1373C84E927C46B124E9728C79A2736F32AA3F2DB7FB", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "rMPJDVaiP1eY7QTy3qFKLyBJxry2vuD5Sp", + "BookDirectory": "95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF45222C6B99158DA5E", + "BookNode": "0000000000000000", + "Flags": 0, + "OwnerNode": "0000000000000000", + "PreviousTxnID": "050C1BD88A98FD6F5771EF04D76B1070FA9C3359FB3DB0F0E2518E0CB9BEE1FE", + "PreviousTxnLgrSeq": 22420573, + "Sequence": 1294409, + "TakerGets": { + "currency": "JPY", + "issuer": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN", + "value": "255397.84578255" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "2500" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "1343E6606ABEBB1F9A67C509F0D6AD6BC8E5BB6233A52E1477C8B3EE9B56F22D" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "1AE025735533090254CF26482318847923FF38E72606182926B36482D9D51C68", + "NewFields": { + "Account": "rMPJDVaiP1eY7QTy3qFKLyBJxry2vuD5Sp", + "BookDirectory": "95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF45222F371609B8F32", + "Sequence": 1294410, + "TakerGets": { + "currency": "JPY", + "issuer": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN", + "value": "254121.4048342" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "2500" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rMPJDVaiP1eY7QTy3qFKLyBJxry2vuD5Sp", + "Balance": "2298060996", + "Flags": 0, + "OwnerCount": 24, + "Sequence": 1294411 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "6F30F56C9326728173DD7A6FD9D3D84E5E4F95FE552D8F67C2C2BC154C596D53", + "PreviousFields": { + "Balance": "2298070996", + "Sequence": 1294410 + }, + "PreviousTxnID": "050C1BD88A98FD6F5771EF04D76B1070FA9C3359FB3DB0F0E2518E0CB9BEE1FE", + "PreviousTxnLgrSeq": 22420573 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5222C6B99158DA5E", + "Flags": 0, + "RootIndex": "95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF45222C6B99158DA5E", + "TakerGetsCurrency": "0000000000000000000000004A50590000000000", + "TakerGetsIssuer": "5BBC0F22F61D9224A110650CFE21CC0C4BE13098", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF45222C6B99158DA5E" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF45222F371609B8F32", + "NewFields": { + "ExchangeRate": "5222F371609B8F32", + "RootIndex": "95576C3354EA28D72B3A0D084DD6A45C45C2F47A64735CF45222F371609B8F32", + "TakerGetsCurrency": "0000000000000000000000004A50590000000000", + "TakerGetsIssuer": "5BBC0F22F61D9224A110650CFE21CC0C4BE13098", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rMPJDVaiP1eY7QTy3qFKLyBJxry2vuD5Sp", + "RootIndex": "987A5375A496B811965A54979A1E1A29F474CBA2D133F0587347B9B58E599666" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "987A5375A496B811965A54979A1E1A29F474CBA2D133F0587347B9B58E599666" + } + } + ], + "TransactionIndex": 3, + "TransactionResult": "tesSUCCESS" + } } ] }, "ledger_hash": "4F6C0495378FF68A15749C0D51D097EB638DA70319FDAC7A97A27CE63E0BFFED", + "ledger_index": 22420574, "validated": true } } diff --git a/test/mock-rippled.js b/test/mock-rippled.js index 3afa0e59..a99de120 100644 --- a/test/mock-rippled.js +++ b/test/mock-rippled.js @@ -256,7 +256,8 @@ module.exports = function createMockRippled(port) { createLedgerResponse(request, fixtures.ledger.withoutCloseTime)); } else if (request.ledger_index === 4181996) { conn.send(createLedgerResponse(request, fixtures.ledger.withSettingsTx)); - } else if (request.ledger_index === 100000) { + } else if (request.ledger_index === 22420574 && + request.expand === true && request.transactions === true) { conn.send( createLedgerResponse(request, fixtures.ledger.withPartialPayment)); } else if (request.ledger_index === 100001) { @@ -266,8 +267,12 @@ module.exports = function createMockRippled(port) { const response = _.assign({}, fixtures.ledger.normal, { result: { ledger: fullLedger } }); conn.send(createLedgerResponse(request, response)); - } else { + } else if (request.ledger_index === 'validated' || + request.ledger_index === 14661789 || + request.ledger_index === 14661788 /* getTransaction - order */) { conn.send(createLedgerResponse(request, fixtures.ledger.normal)); + } else { + assert(false, 'Unrecognized ledger request: ' + JSON.stringify(request)); } });