Multichain Validation Module
This module acts as an extention of the ECDSA Module. The added benefit of this module is you now have the ability to use a single signer accross multiple blockchain networks. This allows you now to completely abstract away the chain that the user is interacting with.
Installation
- npm
- yarn
- pnpm
npm install @biconomy/modules
yarn add @biconomy/modules
pnpm add @biconomy/modules
Integration
import { MultiChainValidationModule, DEFAULT_MULTICHAIN_MODULE } from "@biconomy/modules";
const multiChainModule = await MultiChainValidationModule.create({
signer: signer,
moduleAddress: DEFAULT_MULTICHAIN_MODULE
})
Once initialized it can be passed to the smart account create method to create a smart account.
Here is how you can set up Smart Account instances accross multiple chains:
let baseAccount = await BiconomySmartAccountV2.create({
chainId: ChainId.BASE_GOERLI_TESTNET,
paymaster: //basePaymaster,
bundler: //baseBundler,
entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS,
defaultValidationModule: multiChainModule,
activeValidationModule: multiChainModule
});
let polygonAccount = await BiconomySmartAccountV2.create({
chainId: ChainId.POLYGON_MUMBAI,
paymaster: //polygonPaymaster,
bundler: //polygonBundler,
entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS,
defaultValidationModule: multiChainModule,
activeValidationModule: multiChainModule
});