diff --git a/src/api/common/schemas/get-paths.json b/src/api/common/schemas/get-paths.json index 3e50b4f8..db658c55 100644 --- a/src/api/common/schemas/get-paths.json +++ b/src/api/common/schemas/get-paths.json @@ -5,7 +5,7 @@ "items": { "type": "object", "properties": { - "source": {"$ref": "adjustment"}, + "source": {"$ref": "maxAdjustment"}, "destination": {"$ref": "adjustment"}, "paths": {"type": "string"} }, diff --git a/src/api/ledger/parse/pathfind.js b/src/api/ledger/parse/pathfind.js index 7ffaf214..39456d3c 100644 --- a/src/api/ledger/parse/pathfind.js +++ b/src/api/ledger/parse/pathfind.js @@ -9,12 +9,13 @@ function parsePaths(paths) { } function parsePathfind(sourceAddress: string, - destinationAmount: Object, pathfindResult: Object): Object { + destinationAmount: Object, pathfindResult: Object +): Object { return pathfindResult.alternatives.map(function(alternative) { return { source: { address: sourceAddress, - amount: parseAmount(alternative.source_amount) + maxAmount: parseAmount(alternative.source_amount) }, destination: { address: pathfindResult.destination_account, diff --git a/test/fixtures/api/responses/get-paths-send-usd.json b/test/fixtures/api/responses/get-paths-send-usd.json index ea177562..d2ba1250 100644 --- a/test/fixtures/api/responses/get-paths-send-usd.json +++ b/test/fixtures/api/responses/get-paths-send-usd.json @@ -2,7 +2,7 @@ { "source": { "address": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", - "amount": { + "maxAmount": { "currency": "USD", "value": "0.000001002", "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo" diff --git a/test/fixtures/api/responses/get-paths-xrp-to-xrp.json b/test/fixtures/api/responses/get-paths-xrp-to-xrp.json index 146b2ae3..d4fbda31 100644 --- a/test/fixtures/api/responses/get-paths-xrp-to-xrp.json +++ b/test/fixtures/api/responses/get-paths-xrp-to-xrp.json @@ -2,7 +2,7 @@ { "source": { "address": "rwBYyfufTzk77zUSKEu4MvixfarC35av1J", - "amount": { + "maxAmount": { "currency": "XRP", "value": "0.000002" } diff --git a/test/fixtures/api/responses/get-paths.json b/test/fixtures/api/responses/get-paths.json index 1fe5ac9e..00259882 100644 --- a/test/fixtures/api/responses/get-paths.json +++ b/test/fixtures/api/responses/get-paths.json @@ -2,7 +2,7 @@ { "source": { "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "amount": { + "maxAmount": { "currency": "JPY", "value": "0.1117218827811721", "counterparty": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59" @@ -21,7 +21,7 @@ { "source": { "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "amount": { + "maxAmount": { "currency": "USD", "value": "0.001002", "counterparty": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59" @@ -40,7 +40,7 @@ { "source": { "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "amount": { + "maxAmount": { "currency": "XRP", "value": "0.207669" }