@molecularlabs/nucleus-frontend
Version:
Nucleus BoringVault Frontend SDK
45 lines (42 loc) • 1.57 kB
text/typescript
import { Address } from 'viem';
import { ChainId } from './vault-config.mjs';
import 'viem/chains';
import '../vaults/config.mjs';
interface WithdrawAssetsResponse {
[chainId: string]: {
[vaultAddress: string]: {
[tokenAddress: string]: number;
};
};
}
/**
* Interface for optional parameters when fetching withdraw assets
*/
interface FetchWithdrawAssetsParams {
chainId?: ChainId;
vaultAddress?: Address;
}
/**
* Fetches withdraw assets configuration from the API
* @param params Optional parameters for chainId and vaultAddress
* @returns Promise<WithdrawAssetsResponse>
*/
declare function fetchWithdrawAssets(params?: FetchWithdrawAssetsParams): Promise<WithdrawAssetsResponse>;
/**
* Fetches withdraw assets for a specific chain
* @param chainId The chain ID to fetch assets for
* @returns Promise<WithdrawAssetsResponse[string]>
*/
declare function fetchChainWithdrawAssets(chainId: ChainId): Promise<WithdrawAssetsResponse[string]>;
/**
* Fetches withdraw assets for a specific vault on a chain
* @param chainId The chain ID
* @param vaultAddress The vault address
* @returns Promise<WithdrawAssetsResponse[string][string]>
*/
declare function fetchVaultWithdrawAssets(chainId: ChainId, vaultAddress: Address): Promise<WithdrawAssetsResponse[string][string]>;
/**
* Clears the assets cache
*/
declare function clearAssetsCache(): void;
export { type FetchWithdrawAssetsParams, type WithdrawAssetsResponse, clearAssetsCache, fetchChainWithdrawAssets, fetchVaultWithdrawAssets, fetchWithdrawAssets };