Skip to main content

Initialization

Any wallets that are installed, should initialize an AlgorandProvider object and assign it to window.algorand.

First, we will need to check if the window.algorand object exists:

if (!window.algorand) {
throw new Error('no wallets are installed!');
}

If the window.algorand object exists, we can check what wallets have been added:

const wallets = window.algorand.getWallets();

console.log(wallets);
// ['agora-wallet', 'another-awesome-wallet']

When we have confirmed that the window.algorand object exists and contains wallets, we can proceed to enabling the dApp with a wallet.