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
| Field | Type | Notes |
|---|---|---|
addresses | string[] | 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…"
}
}
}
| Field | Type | Description |
|---|---|---|
selected_index | number | Index of the chosen address within the input array. |
selected_address | string | The address string the user picked. |
info
If the user cancels the dialog the promise still resolves — check header.status === 'failure' and user_cancel (4001).