Skip to content

Commit

Permalink
fix: coingecko id empty string (#30)
Browse files Browse the repository at this point in the history
Keplr throws error `Error: "currencies[n]" does not match any of the
allowed types` when using chain info with currencies that have
`coinGeckoId: ""` instead of `undefined` such as [Sei asset in chain
registry](https://github.com/cosmos/chain-registry/blob/master/sei/assetlist.json#L53)
  • Loading branch information
ryoid authored Dec 20, 2023
1 parent dfc0d5b commit 036781d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/registry/keplr/toKeplrChainInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function toKeplrChainInfo(
coinDecimals: asset.denom_units.find(
(denomUnit: { denom: string }) => denomUnit.denom === asset.display
)?.exponent ?? 6,
coinGeckoId: asset.coingecko_id,
coinGeckoId: asset.coingecko_id === "" ? undefined : asset.coingecko_id,
coinImageUrl: asset.logo_URIs?.svg ?? asset.logo_URIs?.png,
}));

Expand Down

0 comments on commit 036781d

Please sign in to comment.