Skip to content

Commit

Permalink
Add additional token queries for jettons in Tx Filter token list
Browse files Browse the repository at this point in the history
  • Loading branch information
ealymbaev committed Sep 5, 2024
1 parent 3edc51b commit 082508e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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? {
Expand Down

0 comments on commit 082508e

Please sign in to comment.