listlabels
listlabels ( "purpose" ) Returns the list of all labels, or labels that are assigned to addresses with a specific purpose. Arguments: 1. purpose (string, optional) Address purpose to list labels for ('send','receive'). An empty string is the same as not providing this argument. Result: [ (json array) "str", (string) Label name ... ] Examples: List all labels > bitcoin-cli listlabels List labels that have receiving addresses > bitcoin-cli listlabels receive List labels that have sending addresses > bitcoin-cli listlabels send As a JSON-RPC call > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "listlabels", "params": [receive]}' -H 'content-type: application/json' http://127.0.0.1:8332/
Signature
listlabels(purpose?: string) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"listlabels","params":["\"<purpose>\""]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| purpose | string | — | Address purpose to list labels for ('send','receive'). An empty string is the same as not providing this argument. |
Result
Type: any
[ (json array) "str", (string) Label name ... ]
Source: services/core-node/bcore/src/wallet/rpc/addresses.cpp:592
C++ symbol: listlabels