Skip to main content

importAddress

Overview

The ' importAddress' method allows you to add an address or script (in hex format) that can be monitored as if it were in your wallet, but cannot be used to spend. This method requires a new wallet backup. It is important to note that if the rescan option is set to true, this call can take over an hour to complete. During this time, other RPC calls might report that the imported address exists, but related transactions are still missing, leading to temporarily incorrect or bogus balances and unspent outputs until the rescan completes. If you have the full public key, it is recommended to use the 'importPubKey' method instead. To import more than one address, use the 'importMulti' method.

Request

wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'X-CoinAPI-Key: 73034021-THIS-IS-SAMPLE-KEY' \
--body-data '{"jsonrpc":"2.0","id":1,"method":"importAddress","params": [ ]}' \
'https://bitcoin-mainnet.node.coinapi.io'

Request Parameters

  • address (string, required): The Bitcoin address or hex-encoded script.
  • label (string, optional, default: ""): An optional label.
  • rescan (boolean, optional, default: true): Rescan the wallet for transactions.
  • p2sh (boolean, optional, default: false): Add the P2SH version of the script as well.

Response

{
"result": "...", // The response result
"error": null, // Error details, if any
"id": 1
}