Metamask is a cryptocurrency wallet used to interact with the Ethereum blockchain. It allows users to access their Ethereum wallet through a browser extension or mobile app, which can then be used to interact with decentralized applications.

Connecting via Metamask

If you want the user to be able to sign in via Metamask, we can simply import the MetaMaskWalletProvider object like so:

import { MetaMaskWalletProvider } from '@etherspot/prime-sdk';

Then call connect on it which will prompt the user to connect their Metamask.

Finally, we pass this provider into the Prime SDK to instantiate it.

const metamaskProvider = await MetaMaskWalletProvider.connect();
const primeSdk = new PrimeSdk(metamaskProviderTemp, { chainId: 11155111, bundlerProvider: new EtherspotBundler(11155111, bundlerApiKey) });

Transaction Kit

For transaction kit we can follow the same process above, then pass the provider straight into the Transaction kit tags like this:

const metamaskProvider = await MetaMaskWalletProvider.connect();

<EtherspotTransactionKit provider={metamaskProvider}>
</EtherspotTransactionKit>