Skip to content

Commit

Permalink
fix: price info (#1201)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hemanthghs authored Mar 18, 2024
1 parent e32ab66 commit ae5bd38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/custom-hooks/useGetValidatorInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ValidatorProfileInfo } from '@/types/staking';
import { getValidatorRank } from '@/utils/util';
import { parseBalance } from '@/utils/denom';
import useGetAllChainsInfo from './useGetAllChainsInfo';
import { OASIS_CONFIG, POLYGON_CONFIG, WITVAL } from '@/utils/constants';
import { COIN_GECKO_IDS, OASIS_CONFIG, POLYGON_CONFIG, WITVAL } from '@/utils/constants';

const removedChains = ['crescent-1', 'archway-1', 'celestia']

Expand Down Expand Up @@ -113,7 +113,8 @@ const useGetValidatorInfo = () => {
);
const tokens = totalStaked;
const usdPriceInfo: TokenInfo | undefined =
tokensPriceInfo?.[minimalDenom]?.info;
tokensPriceInfo?.[minimalDenom]?.info ||
tokensPriceInfo?.[COIN_GECKO_IDS?.[minimalDenom]]?.info;
const totalStakedInUSD = usdPriceInfo
? (totalStaked * usdPriceInfo.usd).toString()
: '-';
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,9 @@ export const OASIS_CONFIG = {
operatorAddress: 'oasis1qzc687uuywnel4eqtdn6x3t9hkdvf6sf2gtv4ye9',
},
};

export const COIN_GECKO_IDS: Record<string, string> = {
ubld: 'BLD',
umars: 'Mars Protocol',
ucmdx: 'cmdx',
};

0 comments on commit ae5bd38

Please sign in to comment.