/** * EVM provider interfaces for library-agnostic contract interaction. * * @remarks * These interfaces define the minimal surface that SDK public functions require. * viem's `PublicClient` and `WalletClient` satisfy these interfaces structurally * (no wrapper/adapter needed), while users of ethers.js or other libraries can * provide thin adapters. */ /** Hex-encoded string with `0x` prefix. Identical to viem's `Hex` type. */ export type Hex = `0x${string}`; /** * Read-only EVM provider for contract reads, balance queries, and fee estimation. * * @remarks * viem's `PublicClient` satisfies this interface without any adapter. */ export interface EvmReadProvider { readContract(args: { address: Hex; abi: readonly unknown[]; functionName: string; args?: readonly unknown[]; }): Promise; /** Optional — only required by functions that query native balances (e.g. `fetchLiquidityManagerBalances`). */ getBalance?(args: { address: Hex; }): Promise; /** Optional — not all providers support EIP-1559 fee estimation. */ estimateFeesPerGas?(): Promise<{ gasPrice?: bigint | null; maxFeePerGas?: bigint | null; maxPriorityFeePerGas?: bigint | null; }>; /** Optional — legacy gas price fallback. */ getGasPrice?(): Promise; /** Optional — only required by write flows that need receipt polling. */ waitForTransactionReceipt?(args: { hash: Hex; }): Promise<{ transactionHash: Hex; }>; /** Optional — required by layerzeroScan codec to decode tx input. */ getTransaction?(args: { hash: Hex; }): Promise<{ input: Hex; [key: string]: unknown; }>; /** Optional — required by layerzeroScan codec to read tx logs. */ getTransactionReceipt?(args: { hash: Hex; }): Promise<{ logs: ReadonlyArray<{ topics: readonly Hex[]; data: Hex; }>; [key: string]: unknown; }>; } /** * Write provider for signing and submitting EVM transactions. * * @remarks * viem's `WalletClient` (with `publicActions` extension) satisfies this interface. * A plain `WalletClient` without `publicActions` only has `writeContract` but may * lack `readContract` / `waitForTransactionReceipt`; pass a separate `EvmReadProvider` * in that case. */ export interface EvmWriteProvider { account?: { address: Hex; }; chain?: { id: number; }; writeContract(args: { address: Hex; abi: readonly unknown[]; functionName: string; args?: readonly unknown[]; account?: Hex | { address: Hex; }; chain?: { id: number; }; value?: bigint; gasPrice?: bigint; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; type?: string; }): Promise; } //# sourceMappingURL=evm.d.ts.map