Using a simple javascript client
const jayson = require('jayson');
const Promise = require('bluebird');
// create a client
const client = jayson.client.http({
port: 3000,
hostname: 'localhost'
});
Promise.promisifyAll(client);
const id = '9EC02E71D47A82964F777408D565B4CF607DBDE9703C509B67F8E690D5B07715';
client.requestAsync('getTransaction', [id])
.then(res => console.log(res));
// =>
{ jsonrpc: '2.0',
id: 'e466f6c6-9875-46be-8832-1f2a5feedc4c',
error:
{ code: 99,
message: 'Server is missing ledger history in the specified range',
data: { name: 'MissingLedgerHistoryError' } } }
client.requestAsync('getTransactions',
['rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B', {binary: true, limit: 5}])
.then(res => console.log(res.result));
// =>
[
{
"type": "order",
"address": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw",
"sequence": 10451208,
"id": "1AEC150110D2C65FB6A3BAC323F234421F95FA496B88C7C8517E50C2E17321B9",
"specification": {
"direction": "buy",
"quantity": {
"currency": "XRP",
"value": "465440.337341"
},
"totalPrice": {
"currency": "USD",
"value": "1950",
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"expirationTime": "2015-11-25T05:24:49.000Z"
},
"outcome": {
"result": "tesSUCCESS",
"fee": "0.011",
"balanceChanges": {
"rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw": [
{
"currency": "XRP",
"value": "-0.011"
}
]
...