@molecularlabs/nucleus-frontend
Version:
Nucleus BoringVault Frontend SDK
35 lines (32 loc) • 1.59 kB
text/typescript
import { ChainId } from '../api/vault-config.mjs';
import { VaultKey } from '../vaults/config.mjs';
import 'viem/chains';
import 'viem';
interface GetDepositExchangeRateParams {
vaultKey: VaultKey;
sourceChainId: ChainId;
depositTokenSymbol: string;
minimumFractionDigits?: number;
maximumFractionDigits?: number;
}
/**
* Gets the deposit exchange rate for a vault (tokens per share)
* @throws {Error} If the token address is not found or if there's an error fetching the rate
* @returns Promise<string> The exchange rate as a formatted string representing how many deposit tokens are worth 1 share
*/
declare const getDepositExchangeRate: ({ vaultKey, sourceChainId, depositTokenSymbol, minimumFractionDigits, maximumFractionDigits, }: GetDepositExchangeRateParams) => Promise<string>;
interface GetWithdrawExchangeRateParams {
vaultKey: VaultKey;
sourceChainId: ChainId;
destinationChainId: ChainId;
wantTokenSymbol: string;
minimumFractionDigits?: number;
maximumFractionDigits?: number;
}
/**
* Gets the withdraw exchange rate for a vault (tokens per share)
* @throws {Error} If the token address is not found or if there's an error fetching the rate
* @returns Promise<string> The exchange rate as a formatted string representing how many want tokens are worth 1 share
*/
declare const getWithdrawExchangeRate: ({ vaultKey, sourceChainId, destinationChainId, wantTokenSymbol, minimumFractionDigits, maximumFractionDigits, }: GetWithdrawExchangeRateParams) => Promise<string>;
export { getDepositExchangeRate, getWithdrawExchangeRate };