UNPKG

@owlprotocol/contracts-account-abstraction

Version:

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

31 lines (30 loc) 1.11 kB
import { Client, Transport, Chain, Account } from "viem"; import { SendUserOperationReturnType, UserOperation } from "viem/account-abstraction"; /** * Broadcasts a User Operation to the Bundler. * * - Docs: https://viem.sh/actions/bundler/sendUserOperation * * @param client - Client to use * @param parameters - {@link SendUserOperationParameters} * @returns The User Operation hash. {@link SendUserOperationReturnType} * * @example * import { createBundlerClient, http, parseEther } from 'viem' * import { mainnet } from 'viem/chains' * import { toSmartAccount } from 'viem/accounts' * import { sendUserOperation } from 'viem/actions' * * const account = await toSmartAccount({ ... }) * * const bundlerClient = createBundlerClient({ * chain: mainnet, * transport: http(), * }) * * const values = await sendUserOperation(bundlerClient, { * account, * calls: [{ to: '0x...', value: parseEther('1') }], * }) */ export declare function sendUserOperation(client: Client<Transport, Chain | undefined, Account>, parameters: UserOperation<"0.7">): Promise<SendUserOperationReturnType>;