mars-v2-frontend/src/utils/assets.ts
2023-04-14 14:52:44 +02:00

22 lines
574 B
TypeScript

import { ASSETS } from 'constants/assets'
export function getAssetByDenom(denom: string) {
return ASSETS.find((asset) => asset.denom === denom)
}
export function getAssetBySymbol(symbol: string) {
return ASSETS.find((asset) => asset.symbol === symbol)
}
export function getMarketAssets(): Asset[] {
return ASSETS.filter((asset) => asset.isEnabled && asset.isMarket)
}
export function getBaseAsset() {
return ASSETS.find((asset) => asset.denom === 'uosmo')!
}
export function getDisplayCurrencies() {
return ASSETS.filter((asset) => asset.isDisplayCurrency)
}