Skip to content

Commit

Permalink
fix terra balances and overview (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitcoinera authored Mar 2, 2020
1 parent 09efa0f commit ffdc867
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 7 additions & 5 deletions lib/reducers/terraV3-reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ function undelegationEndTimeReducer(transaction) {
function balanceReducer(coin, fiatValue, gasPrices) {
return {
...coin,
fiatValue: {
amount: fiatValue.amount || 0,
denom: fiatValue.denom || '',
symbol: fiatValue.symbol || ''
},
fiatValue: fiatValue
? {
amount: fiatValue.amount || 0,
denom: fiatValue.denom || '',
symbol: fiatValue.symbol || ''
}
: null,
gasPrice: gasPriceReducer(
gasPrices.find(gasprice => denomLookup(gasprice.denom) === coin.denom)
).price
Expand Down
4 changes: 3 additions & 1 deletion lib/source/terraV3-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ class TerraV3API extends CosmosV2API {
return coins.map(coin => {
return this.reducers.balanceReducer(
coin,
fiatBalances.find(({ denom }) => denom === coin.denom).fiatValue,
fiatBalances
? fiatBalances.find(({ denom }) => denom === coin.denom).fiatValue
: null,
this.gasPrices
)
})
Expand Down

0 comments on commit ffdc867

Please sign in to comment.