mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 11:45:49 +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 'transactions':
|
||||
case 'accounts':
|
||||
case 'ledger_index':
|
||||
case 'ledger_hash':
|
||||
request.message[o] = true;
|
||||
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);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user