UNPKG

@owlprotocol/contracts-account-abstraction

Version:

ERC4337 Account Abstraction support for deploying relevant smart contracts and interacting with UserOps.

42 lines (41 loc) 1.89 kB
import { Address, PartialBy, Hex, Client, Transport, LocalAccount, Chain } from "viem"; import { UserOperation } from "viem/account-abstraction"; export type GetPaymasterDataParameters07 = PartialBy<Pick<UserOperation<"0.7">, "callData" | "callGasLimit" | "factory" | "factoryData" | "maxFeePerGas" | "maxPriorityFeePerGas" | "nonce" | "sender" | "preVerificationGas" | "verificationGasLimit" | "paymasterPostOpGasLimit" | "paymasterVerificationGasLimit">, "callGasLimit" | "factory" | "factoryData" | "maxFeePerGas" | "maxPriorityFeePerGas" | "preVerificationGas" | "verificationGasLimit"> & { context?: unknown | undefined; chainId: number; entryPointAddress: Address; }; export type GetPaymasterDataReturnType07 = { paymaster: Address; paymasterData: Hex; paymasterVerificationGasLimit?: bigint | undefined; paymasterPostOpGasLimit?: bigint | undefined; }; /** * Retrieves paymaster-related User Operation properties to be used for sending the User Operation. * * - Docs: https://viem.sh/account-abstraction/actions/paymaster/getPaymasterData * * @param client - Client to use * @param parameters - {@link GetPaymasterDataParameters} * @returns Paymaster-related User Operation properties. {@link GetPaymasterDataReturnType} * * @example * import { http } from 'viem' * import { createPaymasterClient, getPaymasterData } from 'viem/account-abstraction' * * const paymasterClient = createPaymasterClient({ * transport: http('https://...'), * }) * * const userOperation = { ... } * * const values = await getPaymasterData(paymasterClient, { * chainId: 1, * entryPointAddress: '0x...', * ...userOperation, * }) */ export declare function getPaymasterData(client: Client<Transport, Chain | undefined, LocalAccount> & { paymaster: Address; }, parameters: GetPaymasterDataParameters07): Promise<GetPaymasterDataReturnType07>;