import type { Chain, Client, Hex, Transport } from "viem"; import type { BundlerRpcSchema } from "../../client/decorators/bundlerClient"; import type { UserOperationReceipt } from "../../types"; export const getUserOperationReceipt = async < TClient extends Client, >( client: TClient, args: { hash: Hex; tag: "pending" | "latest" | undefined; }, ): Promise => { if (args.tag === undefined) { return client.request({ method: "eth_getUserOperationReceipt", params: [args.hash], }); } return client.request({ method: "eth_getUserOperationReceipt", params: [args.hash, args.tag], }); };