Biconomy SDK
Search…
⌃K

Connect Wallet

Connecting your EOA signer account for multi-chain Smart Account access
Biconomy Smart Account is a Smart Contract Wallet that sits on top of your EOA account. EOA is the controller for this smart account and authorises transactions with signing.
import {
ChainId
} from "@biconomy/core-types";
import SmartAccount from "@biconomy/smart-account";
// Get the EOA provider for choice of your wallet which manahes your signer
const { provider, address } = useWeb3AuthContext();
const walletProvider = new ethers.providers.Web3Provider(provider);
// Initialize the Smart Account
let options = {
activeNetworkId: ChainId.GOERLI,
supportedNetworksIds: [ ChainId.GOERLI, ChainId.POLYGON_MAINNET, ChainId.POLYGON_MUMBAI
]}
let smartAccount = new SmartAccount(walletProvider, options);
smartAccount = await smartAccount.init();
Above code connects your EOA signer and spins up multi-chain instance of Smart Account
Options that can be provided for Smart Account initialisation are below. If you don't provide any of the values it gets merged with default Biconomy SDK config.
export interface SmartAccountConfig {
activeNetworkId: ChainId // active (default) networkId
supportedNetworksIds: ChainId[] // array of supported networks your Dapp is on
backendUrl: string
relayerUrl: string // if you're running your own relayer provide url here
socketServerUrl: string // specific to biconomy messaging sdk
signType: SignTypeMethod // by default is EIP712_SIGN
networkConfig: NetworkConfig[] // array of chain specific network config
entryPointAddress?: string // optional entry point address
biconomySigningServiceUrl?: string
bundlerUrl?: string // bundlerUrl to fallback to if chain specific is not provided
}
// where NetworkConfig is...
export type NetworkConfig = {
chainId: ChainId
providerUrl?: string // custom RPC url of your choice
bundlerUrl?: string // if you're running your own bundler provide url here
customPaymasterAPI?: IPaymasterAPI // if you need to plug in custom paymaster
dappAPIKey?: string // optional dapp api key. must be added while using Biconomy paymaster dashboard
}