get_transfers - 获取转账清单
get_transfers
返回转账清单。该方法无别名。
输入参数
- in:是否包含转入,boolean,可选
- out:是否包含转出,boolean,可选
- pending:是否包含待定转账,boolean,可选
- failed:是否包含失败转账,boolean,可选
- pool:是否包含交易池中的转账,boolean,可选
- filter_by_height:是否使用区块高度过滤转账,boolean,可选
- min_height:扫描转账的最小区块高度,unsigned int,可选
- max_height:扫描转账的最大区块高度,unsigned int,可选
- account_index:账户索引,unsigned int,可选
- subaddr_indices:子地址索引,unsigned int数组,可选
输出结果
- in:转入数组,成员结构如下:
- address:转账地址,string
- amount:转账金额,unsigned int
- confirmations:确认数,unsigned int
- double_spend_seen:是否存在双重消费,boolean
- fee:转账的交易手续费,unsigned int
- height:转账首次确认区块高度,unsigned int
- note:转账注释,string
- payment_id:转账支付ID,string
- subaddr_index:子地址索引:
- major :账户索引,unsigned int
- minor :子地址索引,unsigned int
- suggested_confirmations_threshold :区块确认阈值建议,unsigned int
- timestamp:转账首次确认POSIX时间戳,unsigned int
- txid:转账交易ID,string
- type:转账类型,string,"in"
- unlock_time:解锁区块数,unsigned int
- out:转出数组,成员结构同上
- pending:待确认转账数组,成员结构同上
- failed:失败转账数组,成员结构同上
- pool:交易池转账数组,成员结构同上
示例代码
curl请求:
$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json'
响应结果:
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"in": [{
"address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp",
"amount": 200000000000,
"confirmations": 1,
"double_spend_seen": false,
"fee": 21650200000,
"height": 153624,
"note": "",
"payment_id": "0000000000000000",
"subaddr_index": {
"major": 1,
"minor": 0
},
"suggested_confirmations_threshold": 1,
"timestamp": 1535918400,
"txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a",
"type": "in",
"unlock_time": 0
}]
}
}