Connect / Disconnect

Use Blocto wallet SDK to connect Ethereum

Install from npm/yarn

$ yarn add @blocto/sdk

Step 1 - Configure Web3 and @blocto/sdk

Goerli RPC demo

import Web3 from "web3";
import BloctoSDK from "@blocto/sdk";

const bloctoSDK = new BloctoSDK({
  ethereum: {
    chainId: "0x5", // (required) chainId to be used
    rpc: `https://goerli.infura.io/v3/ef5a5728e2354955b562d2ffa4ae5305`, // (required for Ethereum) JSON RPC endpoint
  },
});

const web3 = new Web3(bloctoSDK.ethereum);

export { web3, bloctoSDK };

Step 2 - Connect / Disconnect

Connect with prefilled email

Sample

Last updated

Was this helpful?