Skip to main content

selectAddress

Opens a popup dialog letting the user pick one address from a provided list. Useful for account-selection UX driven from the bridge popup.

Signature

await dcent.selectAddress(addresses: string[]): Promise<V1Response>

Parameters

FieldTypeNotes
addressesstring[]Candidate addresses to show. A non-array argument throws param_error.
const res = await dcent.selectAddress(['0x6A5C…', '0x9bF2…'])
const { selected_index, selected_address } = res.body.parameter

Response

{
"header": { "version": "1.0", "status": "success" },
"body": {
"command": "select_address",
"parameter": {
"selected_index": 0,
"selected_address": "0x6A5C…"
}
}
}
FieldTypeDescription
selected_indexnumberIndex of the chosen address within the input array.
selected_addressstringThe address string the user picked.
info

If the user cancels the dialog the promise still resolves — check header.status === 'failure' and user_cancel (4001).