import { Context, Effect, Layer } from "effect"; import type { AccessList, Account, Address, Authorization, Hash, Hex } from "viem"; import type { ClientNotFoundError, ReceiptTimeoutError, TransactionFailedError, TransactionReplacedError, WrongNetworkError } from "../core/index.js"; import { InsufficientFundsError, PublicClientService, UserRejectedError, WalletClientService, WalletNotConnectedError } from "../core/index.js"; import type { TxPolicy } from "../tx/index.js"; import { TxManager } from "../tx/index.js"; import type { TransactionResult } from "../types/index.js"; import type { Erc7579ModeCode } from "./erc7579.js"; import { Eip7702AuthorizationPreparationError, Eip7702AuthorizationSigningError, Eip7702SendTransactionError } from "./errors.js"; export type Eip7702Call = { readonly to: Address; readonly data: Hex; readonly value?: bigint | undefined; }; export type Eip7702AuthorizationExecutor = "self" | Address | Account; export type Eip7702TxOverrides = { readonly accessList?: AccessList | undefined; readonly gas?: bigint | undefined; readonly maxFeePerGas?: bigint | undefined; readonly maxPriorityFeePerGas?: bigint | undefined; readonly nonce?: number | undefined; }; export type DelegateAndExecuteErc7579BatchParams = { readonly chainId: number; readonly account?: Address | Account | undefined; readonly delegation: Address; readonly calls: readonly Eip7702Call[]; readonly mode?: Erc7579ModeCode | undefined; readonly tx?: Eip7702TxOverrides | undefined; }; export type ApproveAndExecuteParams = { readonly chainId: number; readonly account?: Address | Account | undefined; readonly delegation: Address; readonly token: Address; readonly spender: Address; readonly amount: bigint; readonly call: Eip7702Call; readonly mode?: Erc7579ModeCode | undefined; readonly tx?: Eip7702TxOverrides | undefined; }; export type DelegateAndExecuteResult = TransactionResult; export type Eip7702ServiceShape = { readonly prepareAuthorization: (params: { readonly chainId: number; readonly account: Address | Account; readonly contractAddress: Address; readonly executor?: Eip7702AuthorizationExecutor | undefined; }) => Effect.Effect, Eip7702AuthorizationPreparationError | ClientNotFoundError>; readonly delegateAndExecuteErc7579Batch: (params: DelegateAndExecuteErc7579BatchParams) => Effect.Effect; readonly delegateAndExecuteErc7579BatchAndWait: (params: DelegateAndExecuteErc7579BatchParams & { readonly policy?: TxPolicy | undefined; }) => Effect.Effect; readonly approveAndExecute: (params: ApproveAndExecuteParams) => Effect.Effect; readonly approveAndExecuteAndWait: (params: ApproveAndExecuteParams & { readonly policy?: TxPolicy | undefined; }) => Effect.Effect; }; declare const Eip7702Service_base: Context.TagClass; export declare class Eip7702Service extends Eip7702Service_base { } export declare const Eip7702ServiceLive: Layer.Layer; export {}; //# sourceMappingURL=service.d.ts.map