Connect with Polkadot extension
Prerequisites
Utilizing Polkadot extension, Next.js, and TypeScript:
export const getAccounts = async () => {
const { web3Accounts, web3Enable } = await import("@polkadot/extension-dapp");
const extensions = await web3Enable("Name your dApp powered by Ternoa");
if (extensions.length === 0)
throw new Error(
'polkadot{.js} extension might not be installed. Make sure you allowed the dApp in the "Manage Website Access" settings of your wallet.'
);
return await web3Accounts();
};
Next
Last updated