Use maxAmount in getPaths results so they can be passed to preparePayment

This commit is contained in:
Chris Clark
2015-08-25 15:09:36 -07:00
parent 4f3c3e9f66
commit 683199044b
5 changed files with 9 additions and 8 deletions

View File

@@ -5,7 +5,7 @@
"items": {
"type": "object",
"properties": {
"source": {"$ref": "adjustment"},
"source": {"$ref": "maxAdjustment"},
"destination": {"$ref": "adjustment"},
"paths": {"type": "string"}
},

View File

@@ -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,

View File

@@ -2,7 +2,7 @@
{
"source": {
"address": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo",
"amount": {
"maxAmount": {
"currency": "USD",
"value": "0.000001002",
"counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo"

View File

@@ -2,7 +2,7 @@
{
"source": {
"address": "rwBYyfufTzk77zUSKEu4MvixfarC35av1J",
"amount": {
"maxAmount": {
"currency": "XRP",
"value": "0.000002"
}

View File

@@ -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"
}