當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Bitcoin listreceivedbyaddress用法及代碼示例

比特幣(Bitcoin) RPC Wallet API中listreceivedbyaddress的用法及代碼示例。

用法:

listreceivedbyaddress ( minconf include_empty include_watchonly "address_filter" )

通過接收地址列出餘額。

參數1 - minconf

類型:數字,可選,默認值= 1

包括了付款前的最少確認數。

參數2 - include_empty

類型:布爾值,可選,默認= false

是否包括未收到任何付款的地址。

參數3 - include_watchonly

類型:布爾值,可選,默認= false

是否包括watch-only個地址(請參閱‘importaddress’)。

參數4 - address_filter

類型:字符串,可選

如果存在,則僅返回此地址上的信息。

返回結果

[
  {
    "involvesWatchonly" : true,        (bool) Only returned if imported addresses were involved in transaction
    "address" : "receivingaddress",  (string) The receiving address
    "amount" : x.xxx,                  (numeric) The total amount in BTC received by the address
    "confirmations" : n,               (numeric) The number of confirmations of the most recent transaction included
    "label" : "label",               (string) The label of the receiving address. The default label is "".
    "txids": [
       "txid",                         (string) The ids of transactions received with the address
       ...
    ]
  }
  ,...
]

示例

bitcoin-cli listreceivedbyaddress
bitcoin-cli listreceivedbyaddress 6 true
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listreceivedbyaddress", "params": [6, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listreceivedbyaddress", "params": [6, true, true, "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

相關用法


注:本文由純淨天空篩選整理自bitcoin.org大神的英文原創作品 Bitcoin listreceivedbyaddress。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。