Integration
First, install the required packages for initializing the Bundler and Smart Account.
- npm
- yarn
npm install @abstraxn/bundler
yarn add @abstraxn/bundler
Usage
To create a bundler instance pass the bundler url, with other optional params.
import { Bundler, IBundler } from "@abstraxn/bundler";
const bundler: IBundler = new Bundler({
bundlerUrl: "", //bundler url
chainId: ChainId.SEPOLIA, // you can use multiple chains available in chainId object
entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS,
});
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