Connect to Blocto wallet

Before you started to interact with blocto wallet, you need to fire a connect request.

Once the connection request is fired, there would be a prompt modal to guide user to register/login to Blocto wallet.

import BloctoSDK from "@blocto/sdk";

const bloctoSDK = new BloctoSDK({
  solana: {
    net: "devnet"
  }
});
const connectWallet = async () {
    try {
        const accounts = await bloctoSDK?.solana?.request({ method: "connect" }); // wallet address
    } catch (error) {
        console.error(error)
    }
}

const disconnectWallet = async () {
    try {
        await bloctoSDK?.solana?.request({ method: "disconnect" });
    } catch (error) {
        console.error(error)
    }
}

Last updated

Change request #370: docs: add web sdk v0.5.0 ERC-4337 docs