@owlprotocol/contracts-account-abstraction
Version:
ERC4337 Account Abstraction support for deploying relevant smart contracts and interacting with UserOps.
47 lines (46 loc) • 1.94 kB
TypeScript
import { Address, PartialBy, Hex } from "viem";
import { UserOperation } from "viem/account-abstraction";
export type GetPaymasterStubDataParameters07 = 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 GetPaymasterStubDataReturnType07 = {
paymaster: Address;
paymasterData: Hex;
paymasterVerificationGasLimit?: bigint | undefined;
paymasterPostOpGasLimit: bigint;
sponsor?: {
name: string;
icon?: string | undefined;
} | undefined;
isFinal?: boolean | undefined;
};
/**
* Retrieves paymaster-related User Operation properties to be used for gas estimation.
*
* - Docs: https://viem.sh/account-abstraction/actions/paymaster/getPaymasterStubData
*
* @param client - Client to use
* @param parameters - {@link GetPaymasterStubDataParameters}
* @returns Paymaster-related User Operation properties. {@link GetPaymasterStubDataReturnType}
*
* @example
* import { http } from 'viem'
* import { createPaymasterClient, getPaymasterStubData } from 'viem/account-abstraction'
*
* const paymasterClient = createPaymasterClient({
* transport: http('https://...'),
* })
*
* const userOperation = { ... }
*
* const values = await getPaymasterStubData(paymasterClient, {
* chainId: 1,
* entryPointAddress: '0x...',
* ...userOperation,
* })
*/
export declare function getPaymasterStubData(client: {
paymaster: Address;
}, parameters: GetPaymasterStubDataParameters07): Promise<GetPaymasterStubDataReturnType07>;