Skip to main content

getaddressinfo

Command#

pacprotocol-cli getaddressinfo "address"

Return information about the given PAC address. Some information requires the address to be in the wallet.

Arguments#

address *#

(string, required)

The PAC address to get the information of.

Examples#

pacprotocol-cli getaddressinfo "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressinfo", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"] }' -H 'content-type: text/plain;' http://127.0.0.1:1111/

Result#

{
"address" : "address", #(string) The PAC address validated
"scriptPubKey" : "hex", #(string) The hex encoded scriptPubKey generated by the address
"ismine" : true|false, #(boolean) If the address is yours or not
"iswatchonly" : true|false, #(boolean) If the address is watchonly
"isscript" : true|false, #(boolean) If the key is a script
"script" : "type" #(string, optional) The output script type. Only if "isscript" is true and the redeemscript is known. Possible types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata
"hex" : "hex", #(string, optional) The redeemscript for the p2sh address
"pubkeys" #(string, optional) Array of pubkeys associated with the known redeemscript #(only if "script" is "multisig")
[
"pubkey"
,...
]
"sigsrequired" : xxxxx #(numeric, optional) Number of signatures required to spend multisig output #(only if "script" is "multisig")
"pubkey" : "publickeyhex", #(string, optional) The hex value of the raw public key, for single-key addresses #(possibly embedded in P2SH)
"embedded" : {...}, #(object, optional) Information about the address embedded in P2SH, if relevant and known. It includes all getaddressinfo output fields for the embedded address, excluding metadata #("timestamp", "hdkeypath") and relation to the wallet #("ismine", "iswatchonly", "account").
"iscompressed" : true|false, #(boolean) If the address is compressed
"label" : "label" #(string) The label associated with the address, "" is the default account
"account" : "account" #(string) DEPRECATED. This field will be removed in V0.18. To see this deprecated field, start pacprotocold with -deprecatedrpc=accounts. The account associated with the address, "" is the default account
"timestamp" : timestamp, #(number, optional) The creation time of the key if available in seconds since epoch #(Jan 1 1970 GMT)
"hdkeypath" : "keypath" #(string, optional) The HD keypath if the key is HD and available
"hdchainid" : "<hash>" #(string, optional) The ID of the HD chain
"labels" #(object) Array of labels associated with the address.
[
{ #(json object of label data)
"name": "labelname" #(string) The label
"purpose": "string" #(string) Purpose of address #("send" for sending address, "receive" for receiving address)
},...
]
}

Running following help command

pacprotocol-cli help getaddressinfo

Will produce following output:

getaddressinfo "address"
Return information about the given PAC address. Some information requires the address
to be in the wallet.
Arguments:
1. "address" (string, required) The PAC address to get the information of.
Result:
{
"address" : "address", (string) The PAC address validated
"scriptPubKey" : "hex", (string) The hex encoded scriptPubKey generated by the address
"ismine" : true|false, (boolean) If the address is yours or not
"iswatchonly" : true|false, (boolean) If the address is watchonly
"isscript" : true|false, (boolean) If the key is a script
"script" : "type" (string, optional) The output script type. Only if "isscript" is true and the redeemscript is known. Possible types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata
"hex" : "hex", (string, optional) The redeemscript for the p2sh address
"pubkeys" (string, optional) Array of pubkeys associated with the known redeemscript (only if "script" is "multisig")
[
"pubkey"
,...
]
"sigsrequired" : xxxxx (numeric, optional) Number of signatures required to spend multisig output (only if "script" is "multisig")
"pubkey" : "publickeyhex", (string, optional) The hex value of the raw public key, for single-key addresses (possibly embedded in P2SH)
"embedded" : {...}, (object, optional) Information about the address embedded in P2SH, if relevant and known. It includes all getaddressinfo output fields for the embedded address, excluding metadata ("timestamp", "hdkeypath") and relation to the wallet ("ismine", "iswatchonly", "account").
"iscompressed" : true|false, (boolean) If the address is compressed
"label" : "label" (string) The label associated with the address, "" is the default account
"account" : "account" (string) DEPRECATED. This field will be removed in V0.18. To see this deprecated field, start pacprotocold with -deprecatedrpc=accounts. The account associated with the address, "" is the default account
"timestamp" : timestamp, (number, optional) The creation time of the key if available in seconds since epoch (Jan 1 1970 GMT)
"hdkeypath" : "keypath" (string, optional) The HD keypath if the key is HD and available
"hdchainid" : "<hash>" (string, optional) The ID of the HD chain
"labels" (object) Array of labels associated with the address.
[
{ (json object of label data)
"name": "labelname" (string) The label
"purpose": "string" (string) Purpose of address ("send" for sending address, "receive" for receiving address)
},...
]
}
Examples:
> pacprotocol-cli getaddressinfo "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressinfo", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"] }' -H 'content-type: text/plain;' http://127.0.0.1:1111/