From 082508e08362243c0e5dacd0d7db1e1598e88ff9 Mon Sep 17 00:00:00 2001 From: EA Date: Thu, 5 Sep 2024 12:07:51 +0600 Subject: [PATCH] Add additional token queries for jettons in Tx Filter token list --- .../project.pbxproj | 2 +- .../Core/Adapters/TonTransactionAdapter.swift | 21 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj index efcba1a735..83267b73ec 100644 --- a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj +++ b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj @@ -12894,7 +12894,7 @@ repositoryURL = "https://github.com/horizontalsystems/TonKit.Swift"; requirement = { kind = exactVersion; - version = 1.0.0; + version = 1.0.1; }; }; 6BF66DD82BA1A73300963242 /* XCRemoteSwiftPackageReference "ObjectMapper" */ = { diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Adapters/TonTransactionAdapter.swift b/UnstoppableWallet/UnstoppableWallet/Core/Adapters/TonTransactionAdapter.swift index e7162205b6..20e72e9fa1 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Adapters/TonTransactionAdapter.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Adapters/TonTransactionAdapter.swift @@ -91,7 +91,26 @@ extension TonTransactionAdapter: ITransactionsAdapter { } var additionalTokenQueries: [TokenQuery] { - [] // todo + tonKit.tagTokens().compactMap { tagToken in + var tokenType: TokenType? + + switch tagToken.platform { + case .native: + tokenType = .native + case .jetton: + if let jettonAddress = tagToken.jettonAddress { + tokenType = .jetton(address: jettonAddress.toString(bounceable: true)) + } + default: + () + } + + guard let tokenType else { + return nil + } + + return TokenQuery(blockchainType: .ton, tokenType: tokenType) + } } func explorerUrl(transactionHash: String) -> String? {