/** * Cross-chain unwrap operations using LayerZero. */ import type { EvmReadProvider, EvmWriteProvider } from "../../types/evm.js"; import type { TokenEntry } from "../../registry/tokens.js"; import { type FeeOverrides } from "../../utils/fees.js"; import type { CrossUnwrapQuote, LiquidityActionResult } from "./types.js"; /** * Parameters for `buildCrossUnwrapQuote`. */ export interface CrossUnwrapQuoteParams { /** Source token (zERC20) config on the source chain. */ sourceToken: TokenEntry; /** Destination token config on the destination chain (must include adaptor address and eid). */ destinationToken: TokenEntry; /** Amount to send/unwrap (bigint-like, in source token local decimals). */ amount: bigint | number | string; /** EVM account address initiating the flow (source chain). */ account: string; /** Read provider for source chain reads. */ readProviderSource: EvmReadProvider; /** Read provider for destination chain reads (adaptor quote). */ readProviderDestination: EvmReadProvider; /** * Slippage tolerance in basis points (e.g. 50 = 0.5%, 300 = 3%). * @remarks Applied to both `SendParam.minAmountLD` and `BridgeRequest.minAmountOut`. */ slippageBps?: number; } /** * Build a cross-chain unwrap quote, including LayerZero options and OFT `send` parameters. * @remarks * - This function performs contract reads on both source and destination chains to compute fees. * - Returned `sendParam` and `bridgeRequest` are safe to pass directly into `sendCrossUnwrap`. * - Slippage is applied and then "dust" is removed so amounts align with shared-decimal precision. * @throws If required token configuration is missing (`eid`, `adaptorAddress`). * @throws If `amount` is not positive or cannot cover required token fees. * @throws If the OFT quote requires LZ token fee payment (unsupported). */ export declare function buildCrossUnwrapQuote(params: CrossUnwrapQuoteParams): Promise; /** * Apply slippage tolerance to an amount. * @param amount - The original amount * @param slippageBps - Slippage in basis points (e.g. 50 = 0.5%, 300 = 3%) * @returns The minimum acceptable amount after slippage */ export declare function applySlippage(amount: bigint, slippageBps: number): bigint; /** * Parameters for `sendCrossUnwrap`. */ export interface CrossUnwrapSendParams { /** Write provider used to sign and submit transactions on the source chain. */ writeProvider: EvmWriteProvider; /** Optional read provider for reads and receipt polling. */ readProvider?: EvmReadProvider; /** Read provider for destination chain reads (required when no pre-built quote is provided). */ readProviderDestination?: EvmReadProvider; /** Source token (zERC20) config on the source chain. */ sourceToken: TokenEntry; /** Destination token config on the destination chain. */ destinationToken: TokenEntry; /** Amount to send/unwrap (bigint-like, in source token local decimals). */ amount: bigint | number | string; /** Optional pre-built quote from `buildCrossUnwrapQuote`. If omitted, the quote is built internally. */ quote?: CrossUnwrapQuote; /** Optional fee overrides (e.g., gas, maxFeePerGas). */ feeOverrides?: FeeOverrides; } /** * Submit the source-chain transaction for cross-chain unwrap (OFT `send(...)`). * @remarks * The required native fee is taken from the quote and sent as `value` with the transaction. */ export declare function sendCrossUnwrap(params: CrossUnwrapSendParams): Promise; //# sourceMappingURL=crossUnwrap.d.ts.map