查询某一交易具体信息
首先通过本方法返回一个Request对象,然后通过submit方法获得某一交易的具体信息。
方法:requestTx({hash:’xxx’});
参数:
参数 | 类型 | 说明 |
---|---|---|
hash | String | 交易hash |
返回:Request对象
例子:
var jlib = require('jingtum-lib');
var Remote = jlib.Remote;
var remote = new Remote({server: 'ws://xxx:port', local_sign:true});
remote.connect(function(err, result) {
if (err) {
return console.log('err:',err);
}
var req = remote.requestTx({hash: '667BC435ABEA1D5C36B486991E7B020466791FB41F396B60ED22299A92375822'});
req.submit(function(err, result) {
if(err) {console.log('err:',err);}
else if(result){
console.log('res:', result);
var fee = result.Fee/1000000;
console.log('关键信息:【 交易费:', fee, '】');
}
});
});
返回结果:
{
Account: 'jQG6pAPYE5FCDVQD4VTwENxxMoRhXDBw3L',
Amount: '30000000',
Destination: 'jPhJWY6Gm3ogz7uhpyxwWGLs63LNPKqhX5',
Fee: '10000',
Flags: 0,
Memos: [ { Memo: [Object] } ],
Sequence: 2,
SigningPubKey: '03AE92DC919E980B619921F19D64FFB965EBE68F1F7608DC73D0AD523F8DAFECCB',
TransactionType: 'Payment',
TxnSignature: '3044022044BC7C9F32B0D78B153F0126923E1AAE544C5F979D28EC0163EF8BFC50C8D40902203E93DB410D62C0A6863785FC9904AA6E01002C390CBB6C2C457B48CFE50DA714',
date: 683796990,
hash: '667BC435ABEA1D5C36B486991E7B020466791FB41F396B60ED22299A92375822',
inLedger: 2346414,
ledger_index: 2346414,
meta:
{ AffectedNodes: [ [Object], [Object], [Object] ],
TransactionIndex: 0,
TransactionResult: 'tesSUCCESS',
delivered_amount: 'unavailable' },
validated: true
}
返回结果说明:
参数 | 类型 | 说明 | |
Account | String | 钱包地址 | |
Platform | String | 平台标识账号(挂单中设置了platform时,此参数才有) | |
Amount | String/Object | 交易金额 | |
Destination | String | 交易对家地址 | |
Fee | String | 燃料费 | |
Flags | String | 交易标记 | |
Memos | Array | 备注 | |
Sequence | Integer | 自身账号的交易号 | |
SigningPubKey | String | 签名公钥 | |
Timestamp | Integer | 交易提交时间戳,非签名方式提交才有此字段 | |
TransactionType | String | 交易类型 | |
TxnSignature | String | 交易签名 | |
date | Integer | 交易进账本时间 | |
hash | String | 交易hash | |
inLedger | Integer | 交易所在的账本号 | |
ledger_index | Integer | 账本高度 | |
meta | Object | 交易影响的节点 | |
AffectedNodes | Array | 受影响的节点 | |
TransactionIndex | Integer | -- | |
TransactionResult | String | 交易结果 | |
delivered_amount | String | -- | |
validated | Boolean | 交易是否通过验证 |