importpubkey
importpubkey "pubkey" ( "label" rescan )
Adds a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.
Note: This call can take minutes to complete if rescan is true.
# Import a public key with rescan
yerbas-cli importpubkey "mypubkey"
# Import using a label without rescan
yerbas-cli importpubkey "mypubkey" "testing" false
Arguments
Argument | Type | Description |
---|---|---|
"privkey" | (string) | TThe private key (see dumpprivkey) |
"label" | (string) | An optional label |
rescan | (boolean) | Rescan the wallet for transactions |
Arguments:
1. "pubkey" (string, required) The hex-encoded public key
2. "label" (string, optional, default="") An optional label
3. rescan (boolean, optional, default=true) Rescan the wallet for transactions
Output
Result | Type | Description |
---|---|---|
... | ... | ... |
Result:
{
...
}
Examples
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importpubkey", "params": ["mypubkey", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:9998/