import { type Abi, type Hex } from "viem"; import type { EvmAddress } from "./evm.js"; import { type ProtocolNetwork } from "./protocol-addresses.js"; export type BigintLike = string | number | bigint; export type ProtocolApprovalMode = "auto" | "force" | "skip"; export type ProtocolRiskClass = "stake" | "claim" | "governance" | "maintenance" | "economic"; export type ProtocolTransaction = { to: EvmAddress; data: Hex; valueEth: string; }; export type ProtocolContractCallStep = { kind: "contract-call"; label: string; contract: string; functionName: string; transaction: ProtocolTransaction; }; export type ProtocolErc20ApprovalStep = { kind: "erc20-approval"; label: string; tokenAddress: EvmAddress; spenderAddress: EvmAddress; amount: string; transaction: ProtocolTransaction; }; export type ProtocolPlanStep = ProtocolContractCallStep | ProtocolErc20ApprovalStep; export type ProtocolExecutionPlan = { network: ProtocolNetwork; action: TAction; riskClass: ProtocolRiskClass; summary: string; preconditions: readonly string[]; steps: readonly ProtocolPlanStep[]; expectedEvents?: readonly string[]; }; export declare function normalizeProtocolBigInt(value: BigintLike, label: string): bigint; export declare function normalizeProtocolValueEth(value: string, label: string): string; export declare function formatProtocolValueEthFromWei(value: BigintLike, label: string): string; export declare function normalizeOptionalProtocolBigInt(value: BigintLike | null | undefined, label: string): bigint | null; export declare function buildProtocolCallStep(params: { contract: string; functionName: string; label: string; to: string; abi: Abi; args?: readonly unknown[]; valueEth?: string; }): ProtocolContractCallStep; export declare function buildProtocolApprovalStep(params: { label: string; tokenAddress: string; spenderAddress: string; amount: BigintLike; }): ProtocolErc20ApprovalStep; export declare function buildApprovalPlan(params: { mode?: ProtocolApprovalMode; tokenAddress: string; spenderAddress: string; requiredAmount: BigintLike; currentAllowance?: BigintLike | null; approvalAmount?: BigintLike; tokenLabel: string; spenderLabel: string; }): { approvalIncluded: boolean; preconditions: string[]; steps: ProtocolPlanStep[]; }; export declare function resolveProtocolPlanNetwork(network?: ProtocolNetwork | string): ProtocolNetwork; export declare function serializeProtocolBigInts(value: unknown): unknown;