UNPKG

@abstraxn/bundler

Version:

Abstraxn Bundler package to interact with any bundler node as per ERC4337 standard

66 lines (65 loc) 2.34 kB
import { IBundler } from "./interfaces/IBundler"; import { UserOperation, ChainId } from "@abstraxn/core-types"; import { Bundlerconfig, UserOpResponse, UserOpReceipt, UserOpGasResponse, UserOpByHashResponse, GasFeeValues, UserOpStatus, SimulationType } from "./utils/Types"; /** * This class implements IBundler interface. * Implementation sends UserOperation to a bundler URL as per ERC4337 standard. * Checkout the proposal for more details on Bundlers. */ export declare class Bundler implements IBundler { readonly bundlerConfig: Bundlerconfig; UserOpReceiptIntervals: { [key in ChainId]?: number; }; UserOpWaitForTxHashIntervals: { [key in ChainId]?: number; }; UserOpReceiptMaxDurationIntervals: { [key in ChainId]?: number; }; UserOpWaitForTxHashMaxDurationIntervals: { [key in ChainId]?: number; }; constructor(bundlerConfig: Bundlerconfig); private getBundlerUrl; /** * * @param chainId * @description This function will fetch gasPrices from bundler * @returns Promise<UserOpGasPricesResponse> */ estimateUserOpGas(userOp: UserOperation): Promise<UserOpGasResponse>; /** * * @param userOp * @description This function will send signed userOp to bundler to get mined on chain * @returns Promise<UserOpResponse> */ sendUserOp(userOp: UserOperation, simulationType?: SimulationType): Promise<UserOpResponse>; /** * * @param userOpHash * @description This function will return userOpReceipt for a given userOpHash * @returns Promise<UserOpReceipt> */ getUserOpReceipt(userOpHash: string): Promise<UserOpReceipt>; /** * * @param userOpHash * @description This function will return userOpReceipt for a given userOpHash * @returns Promise<UserOpReceipt> */ getUserOpStatus(userOpHash: string): Promise<UserOpStatus>; /** * * @param userOpHash * @param chainId * @description this function will return UserOpByHashResponse for given UserOpHash * @returns Promise<UserOpByHashResponse> */ getUserOpByHash(userOpHash: string): Promise<UserOpByHashResponse>; /** * @description This function will return the gas fee values */ getGasFeeValues(): Promise<GasFeeValues>; }