UNPKG

@molecularlabs/nucleus-frontend

Version:
30 lines (27 loc) 1.29 kB
import { UserRequest } from './withdraw.js'; import 'viem'; import '../../api/vault-config.js'; import 'viem/chains'; import '../config.js'; import '../../contracts/atomic-queue-abi.js'; import '../../contracts/boring-vault-abi.js'; import '../bridge.js'; import '../../contracts/cross-chain-teller-base-abi.js'; import '../tokens.js'; /** * Prepares a withdrawal request with the specified parameters * @param redeemAmount The amount of tokens to be redeemed * @param atomicPrice The current atomic price for the withdrawal * @param deadline Optional timestamp for when the request expires * @returns UserRequest object with withdrawal parameters */ declare const prepareUserRequest: (offerAmount: bigint, atomicPrice: bigint, deadline: number) => UserRequest; /** * Calculates the final redeem amount accounting for exchange rate and slippage * @param amount The initial amount to be redeemed * @param exchangeRate The current exchange rate between tokens * @param slippage The slippage tolerance as a decimal (e.g., 0.01 for 1%) * @returns The final redeem amount after applying exchange rate and slippage */ declare const calculateAtomicPrice: (rateInQuote: bigint, wantAssetDecimals: number, slippage: number) => bigint; export { calculateAtomicPrice, prepareUserRequest };