Skip to content

Commit

Permalink
fix: toKeplrChainInfo undefined currency decimals (#26)
Browse files Browse the repository at this point in the history
Potentially might be not found if assetlist has issues.

I think having it default to `6` would be better as its more common than
`0`
  • Loading branch information
ryoid authored Nov 22, 2023
1 parent 35e5ac1 commit 25703a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/registry/keplr/toKeplrChainInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export function toKeplrChainInfo(
const currencies: Currency[] = chainRegistryAssetList.assets.map((asset) => ({
coinDenom: asset.symbol,
coinMinimalDenom: asset.base,
coinDecimals: asset.denom_units.filter(
coinDecimals: asset.denom_units.find(
(denomUnit: { denom: string }) => denomUnit.denom === asset.display
)[0]?.exponent,
)?.exponent ?? 6,
coinGeckoId: asset.coingecko_id,
coinImageUrl: asset.logo_URIs?.svg ?? asset.logo_URIs?.png,
}));
Expand Down

0 comments on commit 25703a4

Please sign in to comment.