Skip to content

Commit

Permalink
Addtional handling for unknown denoms
Browse files Browse the repository at this point in the history
  • Loading branch information
webbushka committed Nov 1, 2023
1 parent 2a2cdb2 commit 3926419
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export const AccountAssets = () => {
const tableData = accountAssets.map((a) => ({
...a,
displayDenom: assetMetadata.find((md) => md.base === a.denom)?.display,
exponent: assetMetadata.find((md) => md.base === a.denom)?.denomUnits?.[1].exponent,
exponent:
assetMetadata.find((md) => md.base === a.denom)?.denomUnits?.find((du) => !!du.exponent)
?.exponent || 0,
}));

// Table header values in order
Expand Down
8 changes: 5 additions & 3 deletions src/Pages/Assets/Components/AssetsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ const AssetsList = () => {
getAssetsList: getTableData,
} = useAssets();

const tableData = assets.map(a => ({
const tableData = assets.map((a) => ({
...a,
displayDenom: assetMetadata.find(md => md.base === a.marker)?.display,
exponent: assetMetadata.find(md => md.base === a.marker)?.denomUnits[1].exponent,
displayDenom: assetMetadata.find((md) => md.base === a.marker)?.display,
exponent:
assetMetadata.find((md) => md.base === a.marker)?.denomUnits?.find((du) => !!du.exponent)
?.exponent || 0,
}));

useEffect(() => {
Expand Down

0 comments on commit 3926419

Please sign in to comment.