/** * Adaptor withdraw operations for rescuing stuck funds from failed cross-chain unwraps. */ import type { EvmReadProvider, EvmWriteProvider } from "../../types/evm.js"; import { type FeeOverrides } from "../../utils/fees.js"; /** * Balances stuck in an adaptor contract for a given user. */ export interface AdaptorBalances { /** Underlying token balance stuck in the adaptor. */ underlyingTokenBalance: bigint; /** zERC20 token balance stuck in the adaptor. */ zerc20Balance: bigint; /** Native token balance stuck in the adaptor. */ nativeBalance: bigint; /** Underlying token address as configured in the adaptor. */ underlyingTokenAddress: `0x${string}`; /** zERC20 token address as configured in the adaptor. */ zerc20TokenAddress: `0x${string}`; } /** * Parameters for `withdrawFromAdaptor`. */ export interface AdaptorWithdrawParams { /** Write provider used to sign and submit transactions. */ writeProvider: EvmWriteProvider; /** Optional read provider for receipt polling. */ readProvider?: EvmReadProvider; /** Adaptor contract address. */ adaptorAddress: string; /** Token address to withdraw (underlying, zERC20, or native sentinel). */ token: string; /** Amount to withdraw (bigint-like). */ amount: bigint | number | string; /** Optional fee overrides (e.g., gas, maxFeePerGas). */ feeOverrides?: FeeOverrides; } /** * Fetch balances stuck in an adaptor contract for a given user. * * @remarks * When a cross-chain unwrap fails (e.g. due to Stargate liquidity shortage), * user funds remain in the adaptor contract. This function reads those balances * so the UI can prompt the user to withdraw. * * @param params.provider - Provider to use for contract reads. * @param params.account - User address to check balances for. * @param params.adaptorAddress - Adaptor contract address. */ export declare function fetchAdaptorBalances(params: { provider: EvmReadProvider; account: string; adaptorAddress: string; }): Promise; /** * Check whether any funds are stuck in the adaptor for a given user. * * @remarks Convenience wrapper around `fetchAdaptorBalances` that returns `true` * if any balance (underlying, zERC20, or native) is greater than zero. */ export declare function hasStuckFunds(params: { provider: EvmReadProvider; account: string; adaptorAddress: string; }): Promise; /** * Withdraw stuck funds from an adaptor contract. * * @remarks * Calls the adaptor's `withdraw(token, amount)` function. The token parameter * should be one of: * - The underlying token address (for funds that were unwrapped but failed to bridge) * - The zERC20 token address (for funds that failed before unwrap) * - The native token sentinel `0xEeee...` (for stuck native token) * * @throws If `amount` is not positive. * @returns Transaction hash for the withdraw. */ export declare function withdrawFromAdaptor(params: AdaptorWithdrawParams): Promise<{ transactionHash: string; }>; //# sourceMappingURL=adaptorWithdraw.d.ts.map