diff --git a/.changelog/679.bugfix.md b/.changelog/679.bugfix.md new file mode 100644 index 000000000..a3e4a7e4f --- /dev/null +++ b/.changelog/679.bugfix.md @@ -0,0 +1 @@ +Don't die on ERC-721 tokens diff --git a/src/app/pages/TokenDashboardPage/TokenTypeCard.tsx b/src/app/pages/TokenDashboardPage/TokenTypeCard.tsx index 62e50e556..e6f8fc2c0 100644 --- a/src/app/pages/TokenDashboardPage/TokenTypeCard.tsx +++ b/src/app/pages/TokenDashboardPage/TokenTypeCard.tsx @@ -15,6 +15,8 @@ export const getTokenTypeName = (t: TFunction, type: EvmTokenType): string => { switch (type) { case 'ERC20': return t('account.ERC20') + case 'ERC721': + return t('account.ERC721') default: exhaustedTypeWarning('Unknown token type', type) return type diff --git a/src/app/utils/route-utils.ts b/src/app/utils/route-utils.ts index c336336be..965932554 100644 --- a/src/app/utils/route-utils.ts +++ b/src/app/utils/route-utils.ts @@ -66,6 +66,7 @@ export abstract class RouteUtils { ) => { const map: Record = { ERC20: `${this.getAccountRoute(scope, account)}/tokens/erc-20`, + ERC721: `${this.getAccountRoute(scope, account)}/tokens/erc-721`, } const tokenRoutes = map[tokenType] if (!tokenRoutes) throw new Error('Unexpected token type') diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index aa4787cb9..0bcffc0d6 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -5,6 +5,7 @@ "emptyTransactionList": "There are no transactions on record for this account.", "emptyTokenTransferList": "There are no token transfers on record for this account.", "ERC20": "ERC-20", + "ERC721": "ERC-721", "noTokens": "This account holds no tokens", "showMore": "+ {{counter}} more", "title": "Account", diff --git a/src/oasis-nexus/api.ts b/src/oasis-nexus/api.ts index 13554054b..f3540a92d 100644 --- a/src/oasis-nexus/api.ts +++ b/src/oasis-nexus/api.ts @@ -75,6 +75,7 @@ export const isAccountNonEmpty = (account: RuntimeAccount) => !isAccountEmpty(ac export const groupAccountTokenBalances = (account: Omit): RuntimeAccount => { const tokenBalances: Record = { ERC20: [], + ERC721: [], } account.evm_balances.forEach(balance => { if (balance.token_type) tokenBalances[balance.token_type].push(balance)