Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Begin to fix ERC-271 tokens #679

Merged
merged 2 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/679.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't die on ERC-721 tokens
2 changes: 2 additions & 0 deletions src/app/pages/TokenDashboardPage/TokenTypeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/app/utils/route-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export abstract class RouteUtils {
) => {
const map: Record<EvmTokenType, string | undefined> = {
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')
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/oasis-nexus/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const isAccountNonEmpty = (account: RuntimeAccount) => !isAccountEmpty(ac
export const groupAccountTokenBalances = (account: Omit<RuntimeAccount, 'tokenBalances'>): RuntimeAccount => {
const tokenBalances: Record<generated.EvmTokenType, generated.RuntimeEvmBalance[]> = {
ERC20: [],
ERC721: [],
}
account.evm_balances.forEach(balance => {
if (balance.token_type) tokenBalances[balance.token_type].push(balance)
Expand Down
13 changes: 11 additions & 2 deletions src/oasis-nexus/generated/api.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.