记录类信息

查询交易信息

在交易完成后,用户可查询单个交易记录信息。输入参数为交易完成后返回的hash值。 井通交易记录类型分为如下几种:

用户提交的交易类型主要有Payment、OfferCreate、OfferCancel。

Java Example

// construct source wallet
Wallet wallet1 = new Wallet("snqFcH......pQYzxEEbW");

// get tx by hash
Transaction tx = wallet1.getTransaction("4C844B3EE7A......6233414");

Python Example

# construct source wallet
wallet1 = new Wallet("snqFcH......pQYzxEEbW");

# get tx by hash
wallet1.getTransaction("4C844B3EE7A......6233414");

PHP Example

// construct source wallet
$wallet1 = new Wallet('jfCiWtSt4ju......NYxakm5yP9S','snwjtucx9......MbVz8hFiK9');

// get tx by hash
$wallet1->getTransaction('4C844B3EE7A......6233414');

Node.JS Example

// construct source wallet
var Wallet = require('jingtum-sdk').Wallet;
Wallet wallet1 = new Wallet("snqFcH......pQYzxEEbW");

// get tx by hash
wallet.getTransaction('4C844B3EE7A......6233414', function (err, data) {
    if(err) console.log(err);
    else console.log(JSON.stringify(data));
});

查询交易历史

井通提供查询账号的交易历史,包括交易时间、交易Hash、交易费用等内容,同时提供多种维度的查询方法, 包括根据支付方地址,对方地址,是否移除失败的支付历史,支付方向,返回的每页数据量、返回第几页的数据。 返回的结果信息里面的每个对象的字段解释信息请见数据格式的说明部分。请注意如果不设置选项的话, 默认返回的交易历史是第一页的10条数据。

参数类型说明如下:

参数 类型 说明
source_account String 支付方地址
destination_account String 支付接收方地
results_per_page Integer 返回的每页数据量,默认每页10项
page Integer 返回第几页的数据,从第1页开始

Java Example

// construct source wallet
Wallet wallet1 = new Wallet("snqFcH......pQYzxEEbW");

// get tx list
TransactionCollection tc = wallet1.getTransactionList();

// get tx list by options
options["source_account"] = "jp53t......DucnwVk";
options["destination_account"] = "j4PqT......Bhm1L4BpW";
options["results_per_page"] = 20;

TransactionCollection tc = wallet1.getTransactionList(options);

Python Example

# construct source wallet
wallet1 = new Wallet("snqFcH......pQYzxEEbW");

# get tx list
tc = wallet1.getTransactionList();

# get tx list by options
options['source_account'] = 'jp53t......DucnwVk';
options['destination_account'] = 'j4PqT......Bhm1L4BpW';
options['results_per_page'] = 20;

tc = wallet1.getTransactionList(options);

PHP Example

// construct source wallet
$wallet1 = new Wallet('snwjtucx9......MbVz8hFiK9');

// get tx list
$ret = $wallet1->getTransactionList();

// get tx list by options
$options['source_account'] = 'jp53t......DucnwVk';
$options['destination_account'] = 'j4PqT......Bhm1L4BpW';
$options['results_per_page'] = 20;

$ret = $wallet1->getTransactionList($options);

Node.JS Example

// construct source wallet
var Wallet = require('jingtum-sdk').Wallet;
var my_wallet = new Wallet('shNKNxg......AKBFy5W5kK');

// get tx list
my_wallet.getTransactionList(function (err, data) {
    if(err) console.log(err);
    else console.log(JSON.stringify(data));
});

// get tx list by options
var options = {};
options['source_account'] = 'jp53t......DucnwVk';
options['destination_account'] = 'j4PqT......Bhm1L4BpW';

my_wallet.getTransactionList(options, function (err, data) {
    if(err) console.log(err);
    else console.log(JSON.stringify(data));
});