@molecularlabs/nucleus-frontend
Version:
Nucleus BoringVault Frontend SDK
30 lines (27 loc) • 1.3 kB
text/typescript
import { UserRequest } from './withdraw.mjs';
import 'viem';
import '../../api/vault-config.mjs';
import 'viem/chains';
import '../config.mjs';
import '../../contracts/atomic-queue-abi.mjs';
import '../../contracts/boring-vault-abi.mjs';
import '../bridge.mjs';
import '../../contracts/cross-chain-teller-base-abi.mjs';
import '../tokens.mjs';
/**
* 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 };