mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 04:05:52 +00:00
[FIX] change handling of requestLedger options
ledger_index and ledger_hash were being set to true instead of the specified value, and according to API docs 'closed','validated', and 'current' can be supplied to the ledger_index field to get the most recent of the specified type
This commit is contained in:
@@ -949,10 +949,19 @@ Remote.prototype.requestLedger = function(options, callback) {
|
|||||||
case 'expand':
|
case 'expand':
|
||||||
case 'transactions':
|
case 'transactions':
|
||||||
case 'accounts':
|
case 'accounts':
|
||||||
case 'ledger_index':
|
|
||||||
case 'ledger_hash':
|
|
||||||
request.message[o] = true;
|
request.message[o] = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'ledger_index':
|
||||||
|
case 'ledger_hash':
|
||||||
|
request.message[o] = options[o];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'closed' :
|
||||||
|
case 'current' :
|
||||||
|
case 'validated' :
|
||||||
|
request.message.ledger_index = o;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}, options);
|
}, options);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user