From 6b36bef419ba4c73a212318a274e6c16edb8fb0b Mon Sep 17 00:00:00 2001 From: Emil Sawicki Date: Thu, 27 Jun 2024 18:28:12 +0200 Subject: [PATCH] fix(wallet): Consider ERC1155 as NFT --- src/app/modules/main/wallet_section/activity/entry.nim | 5 ++++- .../main/wallet_section/all_tokens/flat_tokens_model.nim | 2 +- .../main/wallet_section/all_tokens/token_by_symbol_model.nim | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/modules/main/wallet_section/activity/entry.nim b/src/app/modules/main/wallet_section/activity/entry.nim index 3fedbaae82..d3f1ed1143 100644 --- a/src/app/modules/main/wallet_section/activity/entry.nim +++ b/src/app/modules/main/wallet_section/activity/entry.nim @@ -205,7 +205,10 @@ QtObject: read = getChainId proc getIsNFT*(self: ActivityEntry): bool {.slot.} = - return self.metadata.transferType.isSome() and self.metadata.transferType.unsafeGet() == TransferType.Erc721 + if self.metadata.transferType.isNone(): + return false + let transferType = self.metadata.transferType.unsafeGet() + return transferType == TransferType.Erc721 or transferType == TransferType.Erc1155 QtProperty[bool] isNFT: read = getIsNFT diff --git a/src/app/modules/main/wallet_section/all_tokens/flat_tokens_model.nim b/src/app/modules/main/wallet_section/all_tokens/flat_tokens_model.nim index 76d6b2e8bf..0b2771ee8f 100644 --- a/src/app/modules/main/wallet_section/all_tokens/flat_tokens_model.nim +++ b/src/app/modules/main/wallet_section/all_tokens/flat_tokens_model.nim @@ -19,7 +19,7 @@ type Address Decimals Image - # Native, Erc20, Erc721 + # Native, Erc20, Erc721, Erc1155 Type # only be valid if source is custom CommunityId diff --git a/src/app/modules/main/wallet_section/all_tokens/token_by_symbol_model.nim b/src/app/modules/main/wallet_section/all_tokens/token_by_symbol_model.nim index 4de1a6860a..c6f16fee72 100644 --- a/src/app/modules/main/wallet_section/all_tokens/token_by_symbol_model.nim +++ b/src/app/modules/main/wallet_section/all_tokens/token_by_symbol_model.nim @@ -18,7 +18,7 @@ type AddressPerChain Decimals Image - # Native, Erc20, Erc721 + # Native, Erc20, Erc721, Erc1155 Type # only be valid if source is custom CommunityId