import { type Address, type Hash, type Hex, type TransactionReceipt } from "viem"; import type { AddressOrAccount } from "../../entities/Account.js"; import type { PluginPrefetchData } from "../../plugins/types.js"; import { type DecodedSmartContractError } from "../../utils/decodeSmartContractErrors.js"; import type { IDeploymentService } from "../deploymentService/index.js"; import type { ProviderService } from "../providerService/index.js"; import type { IExecutionService } from "./executionService.js"; import type { PermitSingleTypedData, TransactionPlan, TransactionPlanItem, TransactionPlanPrepared } from "./executionServiceTypes.js"; export type TransactionPlanExecutionStatus = "approval" | "permit2Signature" | "evcBatch" | "contractCall" | "completed"; export type TransactionPlanExecutionProgress = { completed: number; total: number; item?: TransactionPlanItem; status?: TransactionPlanExecutionStatus; hash?: Hash; }; export type TransactionPlanExecutionResult = { plan: TransactionPlan; hashes: Hash[]; receipts: TransactionReceipt[]; }; export type TransactionPlanPublicClient = { waitForTransactionReceipt: (parameters: { hash: Hash; }) => Promise; readContract: (parameters: any) => Promise; }; export type TransactionPlanTransactionRequest = { to: Address; data: Hex; value?: bigint; }; export type TransactionPlanSignTypedDataRequest = PermitSingleTypedData; export type ExecuteTransactionPlanArgs = { plan: TransactionPlan; chainId: number; account: AddressOrAccount; sendTransaction: (parameters: TransactionPlanTransactionRequest) => Promise; signTypedData?: (parameters: TransactionPlanSignTypedDataRequest) => Promise; /** Defaults to true. When enabled, unresolved approvals prefer the Permit2 path. */ usePermit2?: boolean; /** Defaults to false. When enabled, newly created approvals use max allowance values. */ unlimitedApproval?: boolean; /** * Optional plugin prefetch payload (Pyth Hermes updates, keyring vault * gating, …) to skip per-plugin network I/O. For execute-time freshness, * callers typically omit this so plugins pull fresh Pyth updates at * broadcast time and avoid on-chain staleness reverts. */ prefetch?: PluginPrefetchData; onProgress?: (progress: TransactionPlanExecutionProgress) => void; }; /** * Execute against a {@link TransactionPlanPrepared} envelope produced by * {@link IExecutionService.prepareTransactionPlan}. Plugins and required-approval * resolution have already run, so execution skips them — the executor walks the * envelope's plan as-is. */ export type ExecutePreparedTransactionPlanArgs = { prepared: TransactionPlanPrepared; sendTransaction: (parameters: TransactionPlanTransactionRequest) => Promise; signTypedData?: (parameters: TransactionPlanSignTypedDataRequest) => Promise; onProgress?: (progress: TransactionPlanExecutionProgress) => void; }; export type ExecuteTransactionPlanInternalArgs = ExecuteTransactionPlanArgs & { plan: TransactionPlan; executionService: IExecutionService; deploymentService: IDeploymentService; providerService: ProviderService; /** When true, skip wallet fetch + resolveRequiredApprovals — the plan's * requiredApproval items already have `.resolved` populated. */ alreadyResolved?: boolean; }; export declare class TransactionPlanExecutionError extends Error { readonly decodedErrors: DecodedSmartContractError[]; readonly originalError: unknown; constructor(message: string, originalError: unknown, decodedErrors: DecodedSmartContractError[]); } declare function approvalAmountLabel(amount: bigint): string; /** * Execute a transaction plan: resolves approvals, collects Permit2 signatures, * sends approval/EVC-batch/contract-call items sequentially, waits for each * receipt, and returns all hashes and receipts. Permit2 signatures collected * during a `requiredApproval` are prepended to the next `evcBatch` item. */ export declare function executeTransactionPlan(args: ExecuteTransactionPlanInternalArgs): Promise; export { approvalAmountLabel }; //# sourceMappingURL=execute.d.ts.map