/** * Shared types for liquidity manager operations. */ import type { Hex } from "../../types/evm.js"; /** * Common result for liquidity manager write operations. * @remarks * Some flows may perform an ERC-20 `approve` transaction before the main action. */ export interface LiquidityActionResult { /** Transaction hash for the main action (wrap / unwrap / send). */ transactionHash: string; /** Optional transaction hash for an approval transaction executed before the main action. */ approvalTransactionHash?: string; } /** * Quote returned by local unwrap helper functions. * @remarks Amounts are expressed in the zERC20's smallest unit. */ export interface LocalUnwrapQuote { /** Fee charged by the liquidity manager for unwrap. */ fee: bigint; /** Expected output amount after subtracting `fee`. */ expectedOut: bigint; /** Available underlying token liquidity in the liquidity manager. */ availableLiquidity: bigint; } /** * Balances for the underlying token and its corresponding zERC20. */ export interface LiquidityBalances { /** Underlying token address as configured in the liquidity manager. */ underlyingAddress: `0x${string}`; /** Balance of the underlying token for the account. */ underlyingBalance: bigint; /** Decimals for the underlying token (native tokens use 18). */ underlyingDecimals: number; /** Balance of the zERC20 token for the account. */ zerc20Balance: bigint; /** Decimals for the zERC20 token. */ zerc20Decimals: number; } /** * LayerZero compose payload for the adaptor's `bridgeUnwrap(...)`-style logic. * @remarks This is ABI-encoded into `SendParam.composeMsg` in cross-chain unwrap flows. */ export interface BridgeRequest { dstEid: number; to: `0x${string}`; /** Minimum acceptable output on destination, after fees and slippage. */ minAmountOut: bigint; extraOptions: Hex; composeMsg: Hex; oftCmd: Hex; } /** * Parameters for the OFT `send(...)` call. * @remarks * `to` is a bytes32 value (padded address) as expected by OFT contracts. */ export interface SendParam { dstEid: number; to: Hex; /** Amount in local decimals (LD). */ amountLD: bigint; /** Minimum acceptable amount in local decimals (LD), after slippage. */ minAmountLD: bigint; extraOptions: Hex; composeMsg: Hex; oftCmd: Hex; } /** * Result returned by `buildCrossUnwrapQuote`. * @remarks Values are returned separately so callers can display fees and compute totals. */ export interface CrossUnwrapQuote { /** Fee paid in token to perform the unwrap at the destination adaptor. */ tokenUnwrapFee: bigint; /** Fee paid in native token to bridge / execute at the destination. */ nativeBridgeFee: bigint; /** Fee paid in token to bridge (OFT token fee). */ tokenBridgeFee: bigint; /** Native fee required for the OFT `send(...)` call on the source chain. */ sendNativeFee: bigint; /** Expected output amount after subtracting token fees, before destination execution variance. */ expectedOut: bigint; /** Fully constructed OFT send parameters. */ sendParam: SendParam; /** Fully constructed compose payload passed to the destination adaptor. */ bridgeRequest: BridgeRequest; } //# sourceMappingURL=types.d.ts.map