UNPKG

@zerodev/sdk

Version:

A utility library for working with ERC-4337

62 lines 4.37 kB
import type { Address, Hex } from "viem"; import { type EntryPointVersion, type UserOperation } from "viem/account-abstraction"; import type { ZeroDevPaymasterClient } from "../../clients/paymasterClient.js"; export type EstimateGasInERC20Parameters = { userOperation: UserOperation; gasTokenAddress: Hex; entryPoint: Address; }; export type GetERC20TokenQuotesReturnType = { maxGasCostToken: string; tokenDecimals: string; }; export type EstimateGasInERC20ReturnType = { amount: number; }; /** * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation. */ export declare const estimateGasInERC20: <entryPointVersion extends EntryPointVersion>(client: { account: import("viem/account-abstraction").SmartAccount | undefined; batch?: { multicall?: boolean | { batchSize?: number | undefined; deployless?: boolean | undefined; wait?: number | undefined; } | undefined; } | undefined; cacheTime: number; ccipRead?: false | { request?: ((parameters: import("viem").CcipRequestParameters) => Promise<`0x${string}`>) | undefined; } | undefined; chain: import("viem").Chain | undefined; experimental_blockTag?: import("viem").BlockTag | undefined; key: string; name: string; pollingInterval: number; request: import("viem").EIP1193RequestFn<import("../../index.js").ZeroDevPaymasterRpcSchema<entryPointVersion>>; transport: import("viem").TransportConfig<string, import("viem").EIP1193RequestFn> & Record<string, any>; type: string; uid: string; getPaymasterData: (parameters: import("viem/account-abstraction").GetPaymasterDataParameters) => Promise<import("viem/account-abstraction").GetPaymasterDataReturnType>; getPaymasterStubData: (parameters: import("viem/account-abstraction").GetPaymasterStubDataParameters) => Promise<import("viem/account-abstraction").GetPaymasterStubDataReturnType>; sponsorUserOperation: (args: import("./sponsorUserOperation.js").SponsorUserOperationParameters) => Promise<import("./sponsorUserOperation.js").SponsorUserOperationReturnType>; estimateGasInERC20: (args: EstimateGasInERC20Parameters) => Promise<EstimateGasInERC20ReturnType>; extend: <const client extends { [x: string]: unknown; account?: undefined; batch?: undefined; cacheTime?: undefined; ccipRead?: undefined; chain?: undefined; experimental_blockTag?: undefined; key?: undefined; name?: undefined; pollingInterval?: undefined; request?: undefined; transport?: undefined; type?: undefined; uid?: undefined; } & import("viem").ExactPartial<Pick<import("viem").PublicActions<import("viem").Transport, import("viem").Chain | undefined, import("viem/account-abstraction").SmartAccount | undefined>, "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getChainId" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "prepareTransactionRequest" | "readContract" | "sendRawTransaction" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions<import("viem").Chain | undefined, import("viem/account-abstraction").SmartAccount | undefined>, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem/account-abstraction").SmartAccount | undefined, import("../../index.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, import("viem/account-abstraction").PaymasterActions & import("../../index.js").ZeroDevPaymasterClientActions>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem/account-abstraction").SmartAccount | undefined, import("../../index.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, { [K in keyof client]: client[K]; } & import("viem/account-abstraction").PaymasterActions & import("../../index.js").ZeroDevPaymasterClientActions>; }, args: EstimateGasInERC20Parameters) => Promise<EstimateGasInERC20ReturnType>; //# sourceMappingURL=estimateGasInERC20.d.ts.map