Skip to content

Commit

Permalink
Merge pull request #308 from forbole/dev
Browse files Browse the repository at this point in the history
fix empty denoms
  • Loading branch information
calvinkei authored Sep 14, 2021
2 parents 39d05bd + 27681c4 commit cf24906
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions misc/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,9 @@ export const transformRedelegations = (data: any, balanceData: any): Redelegatio
export const transformTransactions = (
data: any,
validatorsMap: { [address: string]: Validator },
tokensPrices: TokenPrice[]
prices: TokenPrice[]
): Activity[] => {
const tokensPrices = prices.length ? prices : defaultDenoms
return get(data, 'messages_by_address', [])
.map((t) => {
if (t.type.includes('MsgSend')) {
Expand Down Expand Up @@ -449,7 +450,7 @@ export const getEquivalentCoinToSend = (
availableCoins: Array<{ amount: string; denom: string }>,
tokensPrices: TokenPrice[]
): { amount: number; denom: string } => {
const tokenPrice = tokensPrices.find(
const tokenPrice = (tokensPrices.length ? tokensPrices : defaultDenoms).find(
(tp) => tp.unit_name.toLowerCase() === amount.denom.toLowerCase()
)
if (!tokenPrice) {
Expand Down

0 comments on commit cf24906

Please sign in to comment.