Skip to main content

MetaMask

metamask

Allows to sign a message with an ethereum account using MetaMask browser extension (for chrome or firefox).

warning

In order to authenticate, eth_sign requests must be enabled in MetaMask in advanced settings. This is considered a dangerous feature as it enables an attacker to make you sign almost anything.

List all available accounts

import { enableMetaMask, allMetamaskAccounts } from "@logion/extension";

if(await enableMetaMask("MyLogionWebApp")) {
const accounts = await allMetamaskAccounts();
const authenticated = await client.authenticate(addresses, signer);
...
}
info

If several accounts are available, the call to authenticate will require a signature for each one of them.