import { BigNumber } from "ethers" ; import { parseUnits } from "ethers/lib/utils" ; import { getDisplayAssets , VaultAddressMap , VaultOptions , } from "../constants/constants" ; import { getAssetColor } from "./asset" ; export const isVaultFull = ( deposits , cap , decimals ) => { const margin = parseUnits ( "0.01" , decimals ) ; return ! cap . isZero ( ) && deposits . gte ( cap . sub ( margin ) ) ; } ; export const isVaultSupportedOnChain = ( vaultOption , chainId ) : Boolean => { return VaultAddressMap [ vaultOption ] . chainId === chainId ; } ; export const isETHVault = ( vault ) => [ "rETH-THETA" , "rstETH-THETA" ] . includes ( vault ) ; export const getVaultColor = ( vault ) => getAssetColor ( getDisplayAssets ( vault ) ) ;