Skip to main content

request 'getAddresses'

request 'getAddresses'

window.btc.request('getAddresses', params);

params type

Params {
types?: PaymentType[];
};

PaymentType = 'p2pkh' | 'p2sh' | 'p2wpkh-p2sh' | 'p2wpkh' | 'p2tr';

response result type

ResponseResult {
addresses: {
type: PaymentType;
address: string;
}[];
};

example

const response = await window.btc.request('getAddresses', {
types: ['p2tr'],
});

console.log(response);
// {
// jsonrpc: '2.0',
// id: 'c6b783c4-e0fa-4060-8a29-6ca2b45d68cf',
// result: [{
// type: 'p2tr',
// address: 'bc1q...',
// }],
// }