import { BaseError, type Chain, type Client, type Hash, type Transport } from "viem"; import { type SendUserOperationParameters, type SmartAccount, type UserOperationReceipt } from "viem/account-abstraction"; export type SendUserOperationSyncParameters = SendUserOperationParameters & { /** * Time (ms) from sending the user operation to having its receipt, covering * the bundler call and any receipt polling. * @default client.transport.timeout ?? 10_000 */ timeout?: number | undefined; /** * Polling interval (ms) used while waiting for the receipt. * @default client.pollingInterval */ pollingInterval?: number | undefined; }; export type SendUserOperationSyncReturnType = UserOperationReceipt; export type SendUserOperationSyncErrorKind = /** Rejected before sending (invalid fields, gas limits, simulation). Nothing was sent. */ "rejected" /** * The bundle landed but reverted, so it didn't execute the user operation. * Another bundler may have included it first: check `getUserOperationReceipt` before resending. */ | "bundle_reverted" /** May have been sent, but no receipt before `timeout`. Keep polling `getUserOperationReceipt`. */ | "pending" /** The bundler couldn't send the bundle and no receipt showed up before `timeout`. */ | "not_found"; export declare class SendUserOperationSyncError extends BaseError { readonly kind: SendUserOperationSyncErrorKind; readonly userOperationHash: Hash; /** Whether sending the same user operation again is safe. */ readonly canResend: boolean; constructor({ cause, kind, message: message_, userOperationHash }: { cause?: BaseError | Error | undefined; kind: SendUserOperationSyncErrorKind; /** Overrides the default message, e.g. with the bundler's. */ message?: string | undefined; userOperationHash: Hash; }); } /** * Sends a user operation in its own bundle via `pimlico_sendUserOperationNow` * and returns its receipt, without waiting for the mempool. * * Never resends on its own. Sending and any receipt polling must finish within * `timeout` ms. Otherwise it throws a {@link SendUserOperationSyncError} whose * `kind` says what happened and whose `canResend` says whether sending the same * user operation again is safe. * * - Docs: https://docs.pimlico.io/references/bundler/endpoints/pimlico_sendUserOperationNow * * @param client - Client to use * @param parameters - {@link SendUserOperationSyncParameters} * @returns The user operation receipt. {@link SendUserOperationSyncReturnType} * * @example * import { sendUserOperationSync } from "permissionless/actions/pimlico" * * const receipt = await sendUserOperationSync(smartAccountClient, { * calls: [{ to: "0x...", value: 0n, data: "0x" }] * }) */ export declare function sendUserOperationSync(client: Client, parameters: SendUserOperationSyncParameters): Promise; //# sourceMappingURL=sendUserOperationSync.d.ts.map