mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-05 05:15:48 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f6af4797f | ||
|
|
5985d9022e | ||
|
|
8abc87c27c | ||
|
|
f0feaca785 | ||
|
|
f811bd6c2d | ||
|
|
eeb6e6b39d | ||
|
|
327a8dc451 |
@@ -6,6 +6,7 @@ machine:
|
||||
dependencies:
|
||||
pre:
|
||||
- npm -g install npm@latest-2
|
||||
- npm install flow-bin
|
||||
- wget https://s3-us-west-2.amazonaws.com/ripple-debs/rippled_0.30.1-b11-1.deb
|
||||
- sudo dpkg -i rippled_0.30.1-b11-1.deb
|
||||
test:
|
||||
|
||||
@@ -430,6 +430,7 @@ expirationTime | date-time string | *Optional* Time after which the offer is no
|
||||
fillOrKill | boolean | *Optional* Treat the offer as a [Fill or Kill order](http://en.wikipedia.org/wiki/Fill_or_kill). Only attempt to match existing offers in the ledger, and only do so if the entire quantity can be exchanged.
|
||||
immediateOrCancel | boolean | *Optional* Treat the offer as an [Immediate or Cancel order](http://en.wikipedia.org/wiki/Immediate_or_cancel). If enabled, the offer will never become a ledger node: it only attempts to match existing offers in the ledger.
|
||||
memos | [memos](#transaction-memos) | *Optional* Array of memos to attach to the transaction.
|
||||
orderToReplace | [sequence](#account-sequence-number) | *Optional* The [account sequence number](#account-sequence-number) of an order to cancel before the new order is created, effectively replacing the old order.
|
||||
passive | boolean | *Optional* If enabled, the offer will not consume offers that exactly match it, and instead becomes an Offer node in the ledger. It will still consume offers that cross it.
|
||||
|
||||
### Example
|
||||
@@ -1511,7 +1512,7 @@ options | object | *Optional* Options to determine how the balances will be calc
|
||||
|
||||
### Return Value
|
||||
|
||||
This method returns a promise that resolves with an array of objects with the following structure:
|
||||
This method returns a promise that resolves with an object with the following structure:
|
||||
|
||||
Name | Type | Description
|
||||
---- | ---- | -----------
|
||||
@@ -3051,7 +3052,7 @@ instructions | object | The instructions for how to execute the transaction afte
|
||||
```javascript
|
||||
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
|
||||
const orderCancellation = {orderSequence: 123};
|
||||
return api.prepareOrderCancellation(address, sequence)
|
||||
return api.prepareOrderCancellation(address, orderCancellation)
|
||||
.then(prepared => {/* ... */});
|
||||
```
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ Returns aggregate balances by currency plus a breakdown of assets and obligation
|
||||
|
||||
### Return Value
|
||||
|
||||
This method returns a promise that resolves with an array of objects with the following structure:
|
||||
This method returns a promise that resolves with an object with the following structure:
|
||||
|
||||
<%- renderSchema('output/get-balance-sheet.json') %>
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ All "prepare*" methods have the same return type.
|
||||
```javascript
|
||||
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
|
||||
const orderCancellation = {orderSequence: 123};
|
||||
return api.prepareOrderCancellation(address, sequence)
|
||||
return api.prepareOrderCancellation(address, orderCancellation)
|
||||
.then(prepared => {/* ... */});
|
||||
```
|
||||
|
||||
|
||||
1485
npm-shrinkwrap.json
generated
1485
npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ripple-lib",
|
||||
"version": "0.17.2",
|
||||
"version": "0.17.3",
|
||||
"license": "ISC",
|
||||
"description": "A JavaScript API for interacting with Ripple in Node.js and the browser",
|
||||
"files": [
|
||||
@@ -24,7 +24,7 @@
|
||||
"jayson": "^1.2.2",
|
||||
"lodash": "^3.1.0",
|
||||
"ripple-address-codec": "^2.0.1",
|
||||
"ripple-binary-codec": "^0.1.3",
|
||||
"ripple-binary-codec": "^0.1.4",
|
||||
"ripple-hashes": "^0.1.0",
|
||||
"ripple-keypairs": "^0.10.0",
|
||||
"ripple-lib-transactionparser": "^0.6.0",
|
||||
@@ -41,23 +41,23 @@
|
||||
"babel-preset-es2015": "^6.3.13",
|
||||
"babel-preset-stage-1": "^6.3.13",
|
||||
"babel-register": "^6.3.13",
|
||||
"coveralls": "^2.10.0",
|
||||
"coveralls": "^2.11.9",
|
||||
"doctoc": "^0.15.0",
|
||||
"ejs": "^2.3.4",
|
||||
"eslint": "^2.9.0",
|
||||
"eventemitter2": "^0.4.14",
|
||||
"flow-bin": "^0.24.2",
|
||||
"flow-bin": "^0.30.0",
|
||||
"gulp": "^3.8.10",
|
||||
"gulp-bump": "^0.1.13",
|
||||
"gulp-rename": "^1.2.0",
|
||||
"gulp-uglify": "^1.1.0",
|
||||
"http-server": "^0.8.5",
|
||||
"isparta": "^4.0.0",
|
||||
"istanbul": "^1.1.0-alpha.1",
|
||||
"json-loader": "^0.5.2",
|
||||
"json-schema-to-markdown-table": "^0.4.0",
|
||||
"mocha": "^2.1.0",
|
||||
"mocha-junit-reporter": "^1.9.1",
|
||||
"mocha-in-sauce": "^0.0.1",
|
||||
"mocha-junit-reporter": "^1.9.1",
|
||||
"null-loader": "^0.1.1",
|
||||
"webpack": "^1.5.3",
|
||||
"yargs": "^1.3.1"
|
||||
@@ -72,7 +72,7 @@
|
||||
"watch": "babel -w -D --optional runtime -d dist/npm/ src/",
|
||||
"compile-with-source-maps": "babel -D --optional runtime -s -t -d dist/npm/ src/",
|
||||
"prepublish": "npm run clean && npm run compile",
|
||||
"test": "babel-node node_modules/isparta/lib/cli cover ./node_modules/mocha/bin/_mocha",
|
||||
"test": "babel-node ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha",
|
||||
"coveralls": "cat ./coverage/lcov.info | coveralls",
|
||||
"lint": "if ! [ -f eslintrc ]; then curl -o eslintrc 'https://raw.githubusercontent.com/ripple/javascript-style-guide/es6/eslintrc'; echo 'parser: babel-eslint' >> eslintrc; fi; eslint -c eslintrc src/",
|
||||
"perf": "./scripts/perf_test.sh",
|
||||
|
||||
@@ -35,21 +35,21 @@ unittest() {
|
||||
ln -nfs ../../dist/npm test-compiled/node_modules/ripple-api
|
||||
mocha --opts test-compiled/mocha.opts test-compiled
|
||||
|
||||
# compile tests for browser testing
|
||||
gulp build-min build-tests
|
||||
node --harmony test-compiled/mocked-server.js > /dev/null &
|
||||
#compile tests for browser testing
|
||||
#gulp build-min build-tests
|
||||
#node --harmony test-compiled/mocked-server.js > /dev/null &
|
||||
|
||||
#echo "Running tests in PhantomJS"
|
||||
#mocha-phantomjs test/localrunner.html
|
||||
#echo "Running tests using minified version in PhantomJS"
|
||||
#mocha-phantomjs test/localrunnermin.html
|
||||
|
||||
echo "Running tests in SauceLabs"
|
||||
http-server &
|
||||
npm run sauce
|
||||
#echo "Running tests in SauceLabs"
|
||||
#http-server &
|
||||
#npm run sauce
|
||||
|
||||
pkill -f mocked-server.js
|
||||
pkill -f http-server
|
||||
#pkill -f mocked-server.js
|
||||
#pkill -f http-server
|
||||
rm -rf test-compiled
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,10 @@
|
||||
"format": "date-time",
|
||||
"description": "Time after which the offer is no longer active, as an [ISO 8601 date-time](https://en.wikipedia.org/wiki/ISO_8601)."
|
||||
},
|
||||
"orderToReplace": {
|
||||
"$ref": "sequence",
|
||||
"description": "The [account sequence number](#account-sequence-number) of an order to cancel before the new order is created, effectively replacing the old order."
|
||||
},
|
||||
"memos": {"$ref": "memos"}
|
||||
},
|
||||
"required": ["direction", "quantity", "totalPrice"],
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
/* @flow */
|
||||
'use strict';
|
||||
'use strict'; // eslint-disable-line
|
||||
const _ = require('lodash');
|
||||
const {removeUndefined, rippleTimeToISO8601} = require('./utils');
|
||||
const parseTransaction = require('./transaction');
|
||||
import type {GetLedger} from '../types.js';
|
||||
|
||||
function parseTransactionWrapper(ledgerVersion, tx) {
|
||||
const transaction = _.assign({}, _.omit(tx, 'metaData'),
|
||||
{meta: tx.metaData});
|
||||
const transaction = _.assign({}, _.omit(tx, 'metaData'), {
|
||||
meta: tx.metaData,
|
||||
ledger_index: ledgerVersion
|
||||
});
|
||||
const result = parseTransaction(transaction);
|
||||
if (!result.outcome.ledgerVersion) {
|
||||
result.outcome.ledgerVersion = ledgerVersion;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* @flow */
|
||||
'use strict';
|
||||
'use strict'; // eslint-disable-line
|
||||
const _ = require('lodash');
|
||||
const transactionParser = require('ripple-lib-transactionparser');
|
||||
const utils = require('../utils');
|
||||
@@ -56,19 +56,43 @@ function isPartialPayment(tx) {
|
||||
}
|
||||
|
||||
function parseDeliveredAmount(tx: Object): Amount | void {
|
||||
let deliveredAmount;
|
||||
|
||||
// TODO: Workaround for existing rippled bug where delivered_amount may not be
|
||||
// provided for account_tx
|
||||
if (tx.TransactionType === 'Payment') {
|
||||
if (tx.meta.delivered_amount) {
|
||||
deliveredAmount = parseAmount(tx.meta.delivered_amount);
|
||||
} else if (tx.Amount && !isPartialPayment(tx)) {
|
||||
deliveredAmount = parseAmount(tx.Amount);
|
||||
}
|
||||
if (tx.TransactionType !== 'Payment' ||
|
||||
tx.meta.TransactionResult !== 'tesSUCCESS') {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return deliveredAmount;
|
||||
if (tx.meta.delivered_amount &&
|
||||
tx.meta.delivered_amount === 'unavailable') {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// parsable delivered_amount
|
||||
if (tx.meta.delivered_amount) {
|
||||
return parseAmount(tx.meta.delivered_amount);
|
||||
}
|
||||
|
||||
// DeliveredAmount only present on partial payments
|
||||
if (tx.meta.DeliveredAmount) {
|
||||
return parseAmount(tx.meta.DeliveredAmount);
|
||||
}
|
||||
|
||||
// no partial payment flag, use tx.Amount
|
||||
if (tx.Amount && !isPartialPayment(tx)) {
|
||||
return parseAmount(tx.Amount);
|
||||
}
|
||||
|
||||
// DeliveredAmount field was introduced at
|
||||
// ledger 4594095 - after that point its absence
|
||||
// on a tx flagged as partial payment indicates
|
||||
// the full amount was transferred. The amount
|
||||
// transferred with a partial payment before
|
||||
// that date must be derived from metadata.
|
||||
if (tx.Amount && tx.ledger_index > 4594094) {
|
||||
return parseAmount(tx.Amount);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function parseOutcome(tx: Object): ?Object {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* @flow */
|
||||
'use strict';
|
||||
'use strict'; // eslint-disable-line
|
||||
const _ = require('lodash');
|
||||
const utils = require('./utils');
|
||||
const offerFlags = utils.common.txFlags.OfferCreate;
|
||||
@@ -35,6 +35,9 @@ function createOrderTransaction(account: string, order: Order): Object {
|
||||
if (order.expirationTime !== undefined) {
|
||||
txJSON.Expiration = iso8601ToRippleTime(order.expirationTime);
|
||||
}
|
||||
if (order.orderToReplace !== undefined) {
|
||||
txJSON.OfferSequence = order.orderToReplace;
|
||||
}
|
||||
if (order.memos !== undefined) {
|
||||
txJSON.Memos = _.map(order.memos, utils.convertMemo);
|
||||
}
|
||||
|
||||
@@ -1171,6 +1171,28 @@ describe('RippleAPI', function() {
|
||||
_.partial(checkResult, responses.getLedger.withSettingsTx, 'getLedger'));
|
||||
});
|
||||
|
||||
it('getLedger - with partial payment', function() {
|
||||
const request = {
|
||||
includeTransactions: true,
|
||||
includeAllData: true,
|
||||
ledgerVersion: 100000
|
||||
};
|
||||
return this.api.getLedger(request).then(
|
||||
_.partial(checkResult, responses.getLedger.withPartial, 'getLedger'));
|
||||
});
|
||||
|
||||
it('getLedger - pre 2014 with partial payment', function() {
|
||||
const request = {
|
||||
includeTransactions: true,
|
||||
includeAllData: true,
|
||||
ledgerVersion: 100001
|
||||
};
|
||||
return this.api.getLedger(request).then(
|
||||
_.partial(checkResult,
|
||||
responses.getLedger.pre2014withPartial,
|
||||
'getLedger'));
|
||||
});
|
||||
|
||||
it('getLedger - full, then computeLedgerHash', function() {
|
||||
const request = {
|
||||
includeTransactions: true,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"value": "2"
|
||||
},
|
||||
"immediateOrCancel": true,
|
||||
"orderToReplace": 12345,
|
||||
"memos": [
|
||||
{
|
||||
"type": "test",
|
||||
|
||||
79
test/fixtures/responses/get-ledger-pre2014-with-partial.json
vendored
Normal file
79
test/fixtures/responses/get-ledger-pre2014-with-partial.json
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"stateHash": "334EE5F2209538C3099E133D25725E5BFEB40A198EA7028E6317F13E95D533DF",
|
||||
"closeTime": "2016-07-07T16:53:51.000Z",
|
||||
"closeTimeResolution": 10,
|
||||
"closeFlags": 0,
|
||||
"ledgerHash": "4F6C0495378FF68A15749C0D51D097EB638DA70319FDAC7A97A27CE63E0BFFED",
|
||||
"ledgerVersion": 12345,
|
||||
"parentLedgerHash": "4F636662B714CD9CCE965E9C23BB2E1058A2DF496F5A2416299317AE03F1CD35",
|
||||
"parentCloseTime": "2016-07-07T16:53:50.000Z",
|
||||
"totalDrops": "99997302532397566",
|
||||
"transactionHash": "C72A2BDCB471F3AEEB917ABC6019407CAE6DA4B858903A8AB2335A0EB077125D",
|
||||
"transactions": [
|
||||
{
|
||||
"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": 12345,
|
||||
"indexInLedger": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"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}}],\"TransactionIndex\":1,\"TransactionResult\":\"tesSUCCESS\"}}]"
|
||||
}
|
||||
354
test/fixtures/responses/get-ledger-with-partial-payment.json
vendored
Normal file
354
test/fixtures/responses/get-ledger-with-partial-payment.json
vendored
Normal file
File diff suppressed because one or more lines are too long
4
test/fixtures/responses/index.js
vendored
4
test/fixtures/responses/index.js
vendored
@@ -59,7 +59,9 @@ module.exports = {
|
||||
header: require('./get-ledger'),
|
||||
full: require('./get-ledger-full'),
|
||||
withSettingsTx: require('./get-ledger-with-settings-tx'),
|
||||
withStateAsHashes: require('./get-ledger-with-state-as-hashes')
|
||||
withStateAsHashes: require('./get-ledger-with-state-as-hashes'),
|
||||
withPartial: require('./get-ledger-with-partial-payment'),
|
||||
pre2014withPartial: require('./get-ledger-pre2014-with-partial')
|
||||
},
|
||||
prepareOrder: {
|
||||
buy: require('./prepare-order.json'),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"txJSON": "{\"TransactionType\":\"OfferCreate\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"TakerGets\":{\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\",\"value\":\"10.1\"},\"TakerPays\":\"2000000\",\"Flags\":2148139008,\"Memos\":[{\"Memo\":{\"MemoData\":\"7465787465642064617461\",\"MemoType\":\"74657374\",\"MemoFormat\":\"706C61696E2F74657874\"}}],\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}",
|
||||
"txJSON": "{\"TransactionType\":\"OfferCreate\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"TakerGets\":{\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\",\"value\":\"10.1\"},\"TakerPays\":\"2000000\",\"Flags\":2148139008,\"Memos\":[{\"Memo\":{\"MemoData\":\"7465787465642064617461\",\"MemoType\":\"74657374\",\"MemoFormat\":\"706C61696E2F74657874\"}}],\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23,\"OfferSequence\":12345}",
|
||||
"instructions": {
|
||||
"fee": "0.000012",
|
||||
"sequence": 23,
|
||||
|
||||
6
test/fixtures/rippled/index.js
vendored
6
test/fixtures/rippled/index.js
vendored
@@ -1,4 +1,4 @@
|
||||
'use strict'; // eslint-disable-line
|
||||
'use strict'; // eslint-disable-line
|
||||
|
||||
module.exports = {
|
||||
submit: {
|
||||
@@ -10,7 +10,9 @@ module.exports = {
|
||||
notFound: require('./ledger-not-found'),
|
||||
withoutCloseTime: require('./ledger-without-close-time'),
|
||||
withSettingsTx: require('./ledger-with-settings-tx'),
|
||||
withStateAsHashes: require('./ledger-with-state-as-hashes')
|
||||
withStateAsHashes: require('./ledger-with-state-as-hashes'),
|
||||
withPartialPayment: require('./ledger-with-partial-payment'),
|
||||
pre2014withPartial: require('./ledger-pre2014-with-partial')
|
||||
},
|
||||
empty: require('./empty'),
|
||||
subscribe: require('./subscribe'),
|
||||
|
||||
141
test/fixtures/rippled/ledger-pre2014-with-partial.json
vendored
Normal file
141
test/fixtures/rippled/ledger-pre2014-with-partial.json
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
{
|
||||
"id": 1,
|
||||
"status": "success",
|
||||
"type": "response",
|
||||
"result": {
|
||||
"ledger": {
|
||||
"accepted": true,
|
||||
"account_hash": "334EE5F2209538C3099E133D25725E5BFEB40A198EA7028E6317F13E95D533DF",
|
||||
"close_flags": 0,
|
||||
"close_time": 521225631,
|
||||
"close_time_human": "2016-Jul-07 16:53:51",
|
||||
"close_time_resolution": 10,
|
||||
"closed": true,
|
||||
"hash": "4F6C0495378FF68A15749C0D51D097EB638DA70319FDAC7A97A27CE63E0BFFED",
|
||||
"ledger_hash": "4F6C0495378FF68A15749C0D51D097EB638DA70319FDAC7A97A27CE63E0BFFED",
|
||||
"ledger_index": "12345",
|
||||
"parent_close_time": 521225630,
|
||||
"parent_hash": "4F636662B714CD9CCE965E9C23BB2E1058A2DF496F5A2416299317AE03F1CD35",
|
||||
"seqNum": "22420574",
|
||||
"totalCoins": "99997302532397566",
|
||||
"total_coins": "99997302532397566",
|
||||
"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",
|
||||
"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": 1,
|
||||
"TransactionResult": "tesSUCCESS"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"ledger_hash": "4F6C0495378FF68A15749C0D51D097EB638DA70319FDAC7A97A27CE63E0BFFED",
|
||||
"ledger_index": 12345,
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
600
test/fixtures/rippled/ledger-with-partial-payment.json
vendored
Normal file
600
test/fixtures/rippled/ledger-with-partial-payment.json
vendored
Normal file
@@ -0,0 +1,600 @@
|
||||
{
|
||||
"id": 1,
|
||||
"status": "success",
|
||||
"type": "response",
|
||||
"result": {
|
||||
"ledger": {
|
||||
"accepted": true,
|
||||
"account_hash": "334EE5F2209538C3099E133D25725E5BFEB40A198EA7028E6317F13E95D533DF",
|
||||
"close_flags": 0,
|
||||
"close_time": 521225631,
|
||||
"close_time_human": "2016-Jul-07 16:53:51",
|
||||
"close_time_resolution": 10,
|
||||
"closed": true,
|
||||
"hash": "4F6C0495378FF68A15749C0D51D097EB638DA70319FDAC7A97A27CE63E0BFFED",
|
||||
"ledger_hash": "4F6C0495378FF68A15749C0D51D097EB638DA70319FDAC7A97A27CE63E0BFFED",
|
||||
"ledger_index": "22420574",
|
||||
"parent_close_time": 521225630,
|
||||
"parent_hash": "4F636662B714CD9CCE965E9C23BB2E1058A2DF496F5A2416299317AE03F1CD35",
|
||||
"seqNum": "22420574",
|
||||
"totalCoins": "99997302532397566",
|
||||
"total_coins": "99997302532397566",
|
||||
"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",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"ledger_hash": "4F6C0495378FF68A15749C0D51D097EB638DA70319FDAC7A97A27CE63E0BFFED",
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
@@ -205,6 +205,12 @@ 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) {
|
||||
conn.send(
|
||||
createLedgerResponse(request, fixtures.ledger.withPartialPayment));
|
||||
} else if (request.ledger_index === 100001) {
|
||||
conn.send(
|
||||
createLedgerResponse(request, fixtures.ledger.pre2014withPartial));
|
||||
} else if (request.ledger_index === 38129) {
|
||||
const response = _.assign({}, fixtures.ledger.normal,
|
||||
{result: {ledger: fullLedger}});
|
||||
|
||||
Reference in New Issue
Block a user