mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-30 17:15:49 +00:00
WS: Add support for ledger_entry to return an account_root.
This commit is contained in:
committed by
Stefan Thomas
parent
f6b4f4c171
commit
7d7f5f568b
23
js/remote.js
23
js/remote.js
@@ -168,6 +168,8 @@ Remote.method('request', function(command, done) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Remote.method('ledger_closed', function(done) {
|
Remote.method('ledger_closed', function(done) {
|
||||||
|
assert(this.trusted); // If not trusted, need to check proof.
|
||||||
|
|
||||||
this.request({ 'command' : 'ledger_closed' }, done);
|
this.request({ 'command' : 'ledger_closed' }, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -177,6 +179,17 @@ Remote.method('ledger_current', function(done) {
|
|||||||
this.request({ 'command' : 'ledger_current' }, done);
|
this.request({ 'command' : 'ledger_current' }, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// <-> params:
|
||||||
|
// --> ledger : optional
|
||||||
|
// --> ledger_index : optional
|
||||||
|
Remote.method('ledger_entry', function(params, done) {
|
||||||
|
assert(this.trusted); // If not trusted, need to check proof, maybe talk packet protocol.
|
||||||
|
|
||||||
|
params.command = 'ledger_entry';
|
||||||
|
|
||||||
|
this.request(params, done);
|
||||||
|
});
|
||||||
|
|
||||||
// Submit a json transaction.
|
// Submit a json transaction.
|
||||||
// done(value)
|
// done(value)
|
||||||
// <-> value: { 'status', status, 'result' : result, ... }
|
// <-> value: { 'status', status, 'result' : result, ... }
|
||||||
@@ -186,16 +199,6 @@ Remote.method('submit', function(json, done) {
|
|||||||
// });
|
// });
|
||||||
});
|
});
|
||||||
|
|
||||||
// done(value)
|
|
||||||
// --> value: { 'status', status, 'result' : result, ... }
|
|
||||||
// done may be called up to 3 times.
|
|
||||||
Remote.method('account_root', function(account_id, done) {
|
|
||||||
this.request({
|
|
||||||
'command' : 'ledger_current',
|
|
||||||
}, function() {
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
exports.Remote = Remote;
|
exports.Remote = Remote;
|
||||||
exports.remoteConfig = remoteConfig;
|
exports.remoteConfig = remoteConfig;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user