deriveaddresses - Bitcoin
Example code for the deriveaddresses JSON RPCmethod. Сomplete guide on how to use deriveaddresses JSON RPC in GetBlock Web3 documentation.
Parameters
Parameter
Type
Required
Description
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "deriveaddresses",
"params": ["wpkh([d34db33f/84h/0h/0h]xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/0/*)#aq3rqr9j", [0, 2]],
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "deriveaddresses",
"params": ["wpkh([d34db33f/84h/0h/0h]xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/0/*)#aq3rqr9j", [0, 2]],
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": [
"bc1qcr8te4kr609gcawutmrza0j4xv80jy8z306fyu",
"bc1qnjg0jd8228aq7uj72e4k5l95vjzp9ymcflfz5t",
"bc1qp59yckz4ae5c4efgw2s5wfyvrz0ala7rgvuzcy"
]
}Response Parameters
Field
Type
Description
Use Case
Error Handling
Status Code
Error Message
Cause
Integration Notes
Last updated
Was this helpful?