* ✨replaced minLpToReceive with slippage * ✨Re-lend assets after entering vault * 🐛Fix vault unlock bug
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import { ASSETS } from 'constants/assets'
|
|
|
|
export function getAssetByDenom(denom: string): Asset | undefined {
|
|
return ASSETS.find((asset) => asset.denom === denom)
|
|
}
|
|
|
|
export function getAssetBySymbol(symbol: string) {
|
|
return ASSETS.find((asset) => asset.symbol === symbol)
|
|
}
|
|
|
|
export function getEnabledMarketAssets(): Asset[] {
|
|
return ASSETS.filter((asset) => asset.isEnabled && asset.isMarket)
|
|
}
|
|
|
|
export function getAssetsMustHavePriceInfo(): Asset[] {
|
|
return ASSETS.filter((asset) => (asset.isEnabled && asset.isMarket) || asset.forceFetchPrice)
|
|
}
|
|
|
|
export function getBaseAsset() {
|
|
return ASSETS.find((asset) => asset.denom === 'uosmo')!
|
|
}
|
|
|
|
export function getDisplayCurrencies() {
|
|
return ASSETS.filter((asset) => asset.isDisplayCurrency)
|
|
}
|
|
|
|
export function getAllAssets(): Asset[] {
|
|
return ASSETS
|
|
}
|
|
|
|
export function findCoinByDenom(denom: string, coins: BigNumberCoin[]) {
|
|
return coins.find((coin) => coin.denom === denom)
|
|
}
|
|
|
|
export function getLendEnabledAssets() {
|
|
return ASSETS.filter((asset) => asset.isAutoLendEnabled)
|
|
}
|