Requires wallet support.
importaddress RPC adds an address or pubkey script to the wallet without the associated private key, allowing you to watch for transactions affecting that address or pubkey script without being able to spend any of its outputs.
Parameter #1—the address or pubkey script to watch
|Address or Script||string (base58 or hex)||Required
|Either a P2PKH or P2SH address encoded in base58check, or a pubkey script encoded as hex|
Parameter #2—The account into which to place the address or pubkey script
(0 or 1)
|An account name into which the address should be placed. Default is the default account, an empty string(“”)|
Parameter #3—whether to rescan the block chain
(0 or 1)
null on success
|If the address or pubkey script is added to the wallet (or is already part of the wallet), JSON
Add an address, rescanning the local block database for any transactions matching it.
pai-cli -testnet importaddress \ muhtvdmsnbQEPFuEmxcChX58fGvXaaUoVt "watch-only test" true
(No output; success.)
Show that the address has been added:
pai-cli -testnet getaccount muhtvdmsnbQEPFuEmxcChX58fGvXaaUoVt
ImportPrivKey: adds a private key to your wallet. The key should be formatted in the wallet import format created by the dumpprivkey RPC.
ListReceivedByAddress: lists the total number of pai’s received by each address.