Language

Choose a language

/build/rpc / btc

getrawchangeaddress

getrawchangeaddress ( "address_type" ) Returns a new Bitcoin address, for receiving change. This is for use with raw transactions, NOT normal use. Note: Witness v2 (post-quantum ML-DSA) addresses are NOT supported. Arguments: 1. address_type (string, optional, default=set by -changetype) The address type to use. Options are "legacy", "p2sh-segwit", "bech32", and "bech32m". Does NOT support "v2" or witness v2. Result: "str" (string) The address Examples: > bitcoin-cli getrawchangeaddress > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getrawchangeaddress", "params": []}' -H 'content-type: application/json' http://127.0.0.1:8332/

Signature

getrawchangeaddress(address_type?: string) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"getrawchangeaddress","params":["set by -changetype"]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
address_typestringThe address type to use. Options are "legacy", "p2sh-segwit", "bech32", and "bech32m". Does NOT support "v2" or witness v2.

Result

Type:  any

"str" (string) The address

Source: services/core-node/bcore/src/wallet/rpc/addresses.cpp:83

C++ symbol: getrawchangeaddress