ListTransactions/查询最近发生的钱包交易
listtransactions
调用返回最近发生的与钱包有关的交易清单。该调用需要节点
启用钱包功能。
参数
- Account:钱包账户名
- Count:要提取的交易数量,默认值:10
- Skip:要跳过的交易数量,默认值:0
- IncludeWatchOnly:是否包含watch-only地址,默认值:false
返回值
listtransactions
调用返回指定数量的交易数组,成员结构如下:
- account:账户名
- address:地址
- category:交易类别
- amount:金额
- label:交易备注
- vout:输出序号
- fee:交易费
- confirmations:确认数量
- trusted:是否可用,仅对未确认交易有效
- generated:是否币基交易
- blockhash:区块哈希
- blockindex:区块序号
- blocktime:区块时间戳
- txid:交易id
- walletconflicts:冲突交易数组
- time:交易打包时间戳
- timereceived:收到交易的时间戳
- comment:备注
- to:目标备注
- otheraccount:对端账户
- bip125-replaceable:是否可替换交易
- abandoned:是否废弃交易
示例代码
下面的命令返回最新一条影响钱包的交易:
~$ bitcoin-cli listtransactions "*" 1 0 true
输出结果如下:
[
{
"involvesWatchonly" : true,
"account" : "",
"address" : "1GeDA9rRpqaCdsdkTzGtbajt6jPvn3pg2N",
"category" : "send",
"amount" : -3.45902877,
"vout" : 0,
"fee" : -0.00032890,
"confirmations" : 29710,
"blockhash" : "0000000000000000008b9cb38cd3105e75af94b3af79d0a59cbe4edb618fb814",
"blockindex" : 1705,
"blocktime" : 1463173519,
"txid" : "9b32d4315ac4c5e0d3a5fb947b9a198d3641698badc820643a7df23081f99695e",
"walletconflicts" : [
],
"time" : 1418695703,
"timereceived" : 1418925580,
"bip125-replaceable" : "no",
"abandoned": false
}
]