Integration
This guide focuses on the code to integrate the Bundler. To see how this interacts with other packages in the sdk you can view the Smart Accounts Integration page.
Installation
First, install the required packages for initializing the Bundler and Smart Account.
- npm
- yarn
- pnpm
npm install @biconomy/account
yarn add @biconomy/account
pnpm add @biconomy/account
Integration
info
Click here to learn more about our dashboard and how to get your own bundler url.
To create a bundler instance pass the bundler url, with other optional params.
import { create } from "@biconomy/account";
const userOpReceiptMaxDurationIntervals: { [key in number]?: number } = {
[80002]: 60000,
};
const bundler = await create({
bundlerUrl: "", // <-- Read about this at https://docs.biconomy.io/dashboard#bundler-url
userOpReceiptMaxDurationIntervals,
});
Parameters
- bundlerUrl(
string
, required): bundler url from the dashboard - userOpReceiptIntervals(
object
, optional): The polling interval per chain for the tx receipt in milliseconds. Default value is 5 seconds. - userOpWaitForTxHashIntervals(
object
, optional): The polling interval per chain for the tx result in milliseconds. Default value is 0.5 seconds. - userOpReceiptMaxDurationIntervals(
object
, optional): The maximum duration in milliseconds per chain to wait for the tx receipt. Default value is 30 seconds. - userOpWaitForTxHashMaxDurationIntervals(
object
, optional): The maximum duration in milliseconds per chain to wait for the tx hash. Default value is 20 seconds.
returns
- bundler(
Promise<Bundler>
): bundler instance
Once initialized you will be able to pass this Bundler instance to the Smart Account configuration to use in conjunction with Smart Accounts. See our tutorials for in depth integrations of the Smart Account and Bundler.