avalanche_selectWallet
Prompts the user to select a wallet from a list of enabled wallets, and returns the index of the selected wallet.
Params
(1)1. walletOptions (required)
array of:
enabled
booleanIndicates whether the wallet is available for selection.
type
stringThe type of wallet to select.
name
stringThe name of the wallet.
Result
(SelectedWalletResult)selectedIndex
integerThe index of the selected wallet
Errors
Code | Message |
---|---|
4001 | User rejected the request. |
500 | No wallet options available |
Example
Request
await window.ethereum.request({
"method": "avalanche_selectWallet",
"params": [
[
{
"enabled": true,
"type": "CORE",
"name": "Core Wallet"
},
{
"enabled": true,
"type": "METAMASK",
"name": "Metamask Wallet"
}
]
]
});
Result
1