ListReceivedByAddress/按地址统计收币数量
listreceivedbyaddress
调用返回各地址收到的比特币数量。该调用需要节点
启用钱包功能。
参数
- Confirmations:计入统计结果的交易所需的最小确认数,默认值:1
- IncludeEmpty:是否包含从未有收入的账户,可选,默认值:false
- IncludeWatchOnly:是否包含watch-only地址,可选,默认值:false
返回值
listreceivedbyaddress
调用返回地址信息数组,成员结构如下:
- Address:地址信息描述对象,结构如下:
- involvesWatchOnly:是否是watch-only地址
- address:地址
- account:关联账户
- amount:收到比特币总数量
- confirmations:该地址最后一个交易的确认数
- label:地址关联的账户
- txids:向该地址支付过的交易数组,成员为交易ID
- involvesWatchOnly:是否是watch-only地址
示例代码
下面的命令按地址分组统计包含至少6个确认的交易收入信息,不包含空账户, 但包含watch-only地址:
~$ bitcoin-cli -testnet listreceivedbyaddress 6 false true
输出结果如下:
[
{
"address" : "mnUbTmdAFD5EAg3348Ejmonub7JcWtrMck",
"account" : "test1",
"amount" : 1.99900000,
"confirmations" : 55680,
"label" : "test1",
"txids" : [
"4d71a6127796766c39270881c779b6e05183f2bf35589261e9572436356f287f",
"997115d0cf7b83ed332e6c1f2e8c44f803c95ea43490c84ce3e9ede4b2e1605f"
]
},
{
"involvesWatchonly" : true,
"address" : "n3GNqMveyvaPvUbH469vDRadqpJMPc84JA",
"account" : "someone else's address2",
"amount" : 0.00050000,
"confirmations" : 34714,
"label" : "someone else's address2",
"txids" : [
"99845fd840ad2cc4d6f93fafb8b072d188821f55d9298772415175c456f3077d"
]
}
]