The Biconomy SDK is an Account Abstraction toolkit that enables
simple UX on your dApp, wallet or appchain. Built on top of the ERC 4337 solution for Account Abstraction, we offer a
full-stack solution for tapping into the power of our Smart Accounts Platform, Paymasters, and Bundlers.
// Biconomy Importsimport { IPaymaster, BiconomyPaymaster } from "@biconomy/paymaster";import { IBundler, Bundler } from "@biconomy/bundler";import { BiconomySmartAccountV2, DEFAULT_ENTRYPOINT_ADDRESS } from "@biconomy/account";import { Wallet, providers, ethers } from "ethers";import { ChainId } from "@biconomy/core-types";import { ECDSAOwnershipValidationModule, DEFAULT_ECDSA_OWNERSHIP_MODULE } from "@biconomy/modules";CHAIN = ChainId.POLYGON_MUMBAI; // or any supported chain of your choice// Set up instances of Bundler and Paymaster.// Alternatively you can also use the Multi chain Module this way.const bundler: IBundler = new Bundler({ // get from biconomy dashboard https://dashboard.biconomy.io/ bundlerUrl: "", chainId: CHAIN, entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS,});const paymaster: IPaymaster = new BiconomyPaymaster({ // get from biconomy dashboard https://dashboard.biconomy.io/ paymasterUrl: "",});// create para ethers signerconst provider = new ethers.JsonRpcProvider(CHAIN_PROVIDER, CHAIN);const signer = new ParaEthersSigner(para, provider);// create the biconomy smart account with a para ethers signerconst connect = async () => { try { const module = await ECDSAOwnershipValidationModule.create({ signer: signer, moduleAddress: DEFAULT_ECDSA_OWNERSHIP_MODULE, }); let biconomySmartAccount = await BiconomySmartAccountV2.create({ chainId: ChainId.POLYGON_MUMBAI, bundler: bundler, paymaster: paymaster, entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS, defaultValidationModule: module, activeValidationModule: module, }); const address = await biconomySmartAccount.getAccountAddress(); } catch (error) { console.error(error); }};
For simplicity, Para imports are not included in the above example. It is assumed that the Para object has been
instantiated and the user has created a wallet.