From becb3d30de68f04a6f29f3d2c81ed895f636b43e Mon Sep 17 00:00:00 2001 From: Dmitry Fedorov <80246944+fedorov-d@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:32:16 +0400 Subject: [PATCH] IOS-7048 icp blockchain (#3607) --- Podfile | 13 +++- Podfile.lock | 8 +-- .../Models/Config/SupportedBlockchains.swift | 1 + .../ExchangeService/MercuryoService.swift | 3 +- .../ExchangeService/MoonPayService.swift | 2 + .../CommonExpressTransactionBuilder.swift | 3 +- .../CustomTokenContractAddressConverter.swift | 3 +- ...TokenInteractionAvailabilityProvider.swift | 3 +- .../SendTransactionParametersBuilder.swift | 3 +- .../Contents.json | 15 ++++ .../internet-computer.fill.pdf | Bin 0 -> 6005 bytes .../internetcomputer.imageset/Contents.json | 15 ++++ .../internet-computer.pdf | Bin 0 -> 1469 bytes TangemApp.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 64 ++++++++++++++++-- 15 files changed, 118 insertions(+), 17 deletions(-) create mode 100644 Tangem/Resources/Assets/Tokens.xcassets/internetcomputer.fill.imageset/Contents.json create mode 100644 Tangem/Resources/Assets/Tokens.xcassets/internetcomputer.fill.imageset/internet-computer.fill.pdf create mode 100644 Tangem/Resources/Assets/Tokens.xcassets/internetcomputer.imageset/Contents.json create mode 100644 Tangem/Resources/Assets/Tokens.xcassets/internetcomputer.imageset/internet-computer.pdf diff --git a/Podfile b/Podfile index 0e159dbc4e..a421da61ac 100644 --- a/Podfile +++ b/Podfile @@ -31,7 +31,7 @@ end def blockchain_sdk_pods # 'TangemWalletCore' dependency must be added via SPM - pod 'BlockchainSdk', :git => 'https://github.com/tangem/blockchain-sdk-swift.git', :tag => 'develop-646' + pod 'BlockchainSdk', :git => 'https://github.com/tangem/blockchain-sdk-swift.git', :tag => 'develop-648' #pod 'BlockchainSdk', :path => '../blockchain-sdk-swift' pod 'Solana.Swift', :git => 'https://github.com/tangem/Solana.Swift', :tag => '1.2.0-tangem10' @@ -182,7 +182,7 @@ post_install do |installer| "BlockchainSdk", "https://github.com/tangem/wallet-core-binaries-ios.git", "TangemWalletCoreBinariesWrapper", - { :kind => "exactVersion", :version => "4.0.21-tangem6" } + { :kind => "exactVersion", :version => "4.0.46-tangem1" } ) # `SwiftProtobuf` SPM package for `BlockchainSdk` pod @@ -212,6 +212,15 @@ post_install do |installer| { :kind => "exactVersion", :version => "0.2.1" } ) + # `IcpKit` SPM package for `BlockchainSdk` pod + add_spm_package_to_target( + installer.pods_project, + "BlockchainSdk", + "https://github.com/tangem/IcpKit.git", + "IcpKit", + { :kind => "exactVersion", :version => "0.1.2-tangem3" } + ) + # `SwiftProtobuf` SPM package for `BinanceChain` pod add_spm_package_to_target( installer.pods_project, diff --git a/Podfile.lock b/Podfile.lock index 2234caea3e..d46881f227 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -222,7 +222,7 @@ DEPENDENCIES: - AmplitudeSwift (= 1.6.2) - BinanceChain (from `https://github.com/tangem/swiftbinancechain.git`, tag `0.0.11`) - BitcoinCore.swift (from `https://github.com/tangem/bitcoincore.git`, tag `0.0.20`) - - BlockchainSdk (from `https://github.com/tangem/blockchain-sdk-swift.git`, tag `develop-646`) + - BlockchainSdk (from `https://github.com/tangem/blockchain-sdk-swift.git`, tag `develop-648`) - BlockiesSwift (~> 0.1.2) - CombineExt (~> 1.8.0) - Firebase/Analytics (= 10.29.0) @@ -278,7 +278,7 @@ EXTERNAL SOURCES: :tag: 0.0.20 BlockchainSdk: :git: https://github.com/tangem/blockchain-sdk-swift.git - :tag: develop-646 + :tag: develop-648 Solana.Swift: :git: https://github.com/tangem/Solana.Swift :tag: 1.2.0-tangem10 @@ -301,7 +301,7 @@ CHECKOUT OPTIONS: :tag: 0.0.20 BlockchainSdk: :git: https://github.com/tangem/blockchain-sdk-swift.git - :tag: develop-646 + :tag: develop-648 Solana.Swift: :git: https://github.com/tangem/Solana.Swift :tag: 1.2.0-tangem10 @@ -354,6 +354,6 @@ SPEC CHECKSUMS: TangemSdk: 4a188873f9dbed6340cca9ad6a010240af6df432 WalletConnectSwiftV2: 5ea47db4d86e39fc749b66a05a661af9e87b277d -PODFILE CHECKSUM: 20124c86a9af979e7248e892681ce144a7699c73 +PODFILE CHECKSUM: cf385ecf6ba588891dd8586ffa9eba3e9e6594f1 COCOAPODS: 1.15.2 diff --git a/Tangem/App/Models/Config/SupportedBlockchains.swift b/Tangem/App/Models/Config/SupportedBlockchains.swift index f17836bc2d..8ea9881001 100644 --- a/Tangem/App/Models/Config/SupportedBlockchains.swift +++ b/Tangem/App/Models/Config/SupportedBlockchains.swift @@ -59,6 +59,7 @@ struct SupportedBlockchains { private func testableBlockchains() -> Set { [ .mantle(testnet: false), + .internetComputer(curve: .secp256k1), ] } diff --git a/Tangem/App/Services/ExchangeService/MercuryoService.swift b/Tangem/App/Services/ExchangeService/MercuryoService.swift index 1ae10c89dc..103bfc2231 100644 --- a/Tangem/App/Services/ExchangeService/MercuryoService.swift +++ b/Tangem/App/Services/ExchangeService/MercuryoService.swift @@ -273,7 +273,8 @@ private extension Blockchain { .radiant, .bittensor, .joystream, - .koinos: + .koinos, + .internetComputer: // Did you get a compilation error here? If so, check whether the network is supported at https://api.mercuryo.io/v1.6/lib/currencies return nil } diff --git a/Tangem/App/Services/ExchangeService/MoonPayService.swift b/Tangem/App/Services/ExchangeService/MoonPayService.swift index eddf2563c9..588fc1a428 100644 --- a/Tangem/App/Services/ExchangeService/MoonPayService.swift +++ b/Tangem/App/Services/ExchangeService/MoonPayService.swift @@ -381,6 +381,7 @@ private extension Blockchain { case .joystream: return nil case .bittensor: return nil case .koinos: return nil + case .internetComputer: return nil // Did you get a compilation error here? If so, check whether the network is supported at https://api.moonpay.com/v3/currencies } } @@ -452,6 +453,7 @@ private extension Blockchain { case .joystream: return nil case .bittensor: return nil case .koinos: return nil + case .internetComputer: return nil // Did you get a compilation error here? If so, check whether the network is supported at https://api.moonpay.com/v3/currencies } } diff --git a/Tangem/App/Services/Express/ExpressTransactionBuilder/CommonExpressTransactionBuilder.swift b/Tangem/App/Services/Express/ExpressTransactionBuilder/CommonExpressTransactionBuilder.swift index 5171bf7cc5..66b111840f 100644 --- a/Tangem/App/Services/Express/ExpressTransactionBuilder/CommonExpressTransactionBuilder.swift +++ b/Tangem/App/Services/Express/ExpressTransactionBuilder/CommonExpressTransactionBuilder.swift @@ -173,7 +173,8 @@ private extension CommonExpressTransactionBuilder { .base, .bittensor, .joystream, - .koinos: + .koinos, + .internetComputer: throw ExpressTransactionBuilderError.blockchainDonNotSupportedExtraId } } diff --git a/Tangem/App/Utilities/CustomTokenContractAddressConverter.swift b/Tangem/App/Utilities/CustomTokenContractAddressConverter.swift index 5699c84ab5..68b7e7baa9 100644 --- a/Tangem/App/Utilities/CustomTokenContractAddressConverter.swift +++ b/Tangem/App/Utilities/CustomTokenContractAddressConverter.swift @@ -96,7 +96,8 @@ struct CustomTokenContractAddressConverter { .base, .bittensor, .joystream, - .koinos: + .koinos, + .internetComputer: // Did you get a compilation error here? If so, check if the network supports multiple token contract address // formats (as Hedera does, for example) and add the appropriate conversion logic here if needed return originalAddress diff --git a/Tangem/App/Utilities/TokenInteractionAvailabilityProvider.swift b/Tangem/App/Utilities/TokenInteractionAvailabilityProvider.swift index 89d5942fd8..45976b4ebc 100644 --- a/Tangem/App/Utilities/TokenInteractionAvailabilityProvider.swift +++ b/Tangem/App/Utilities/TokenInteractionAvailabilityProvider.swift @@ -95,7 +95,8 @@ struct TokenInteractionAvailabilityProvider { .base, .bittensor, .joystream, - .koinos: + .koinos, + .internetComputer: // Checking that we have at least one valid (non-empty) address // diff --git a/Tangem/Modules/Send/Helpers/SendTransactionParametersBuilder.swift b/Tangem/Modules/Send/Helpers/SendTransactionParametersBuilder.swift index 1eebd09832..7f5c688c8b 100644 --- a/Tangem/Modules/Send/Helpers/SendTransactionParametersBuilder.swift +++ b/Tangem/Modules/Send/Helpers/SendTransactionParametersBuilder.swift @@ -96,7 +96,8 @@ struct SendTransactionParametersBuilder { .base, .bittensor, .joystream, - .koinos: + .koinos, + .internetComputer: return nil } } diff --git a/Tangem/Resources/Assets/Tokens.xcassets/internetcomputer.fill.imageset/Contents.json b/Tangem/Resources/Assets/Tokens.xcassets/internetcomputer.fill.imageset/Contents.json new file mode 100644 index 0000000000..98e99791a5 --- /dev/null +++ b/Tangem/Resources/Assets/Tokens.xcassets/internetcomputer.fill.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "internet-computer.fill.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/Tangem/Resources/Assets/Tokens.xcassets/internetcomputer.fill.imageset/internet-computer.fill.pdf b/Tangem/Resources/Assets/Tokens.xcassets/internetcomputer.fill.imageset/internet-computer.fill.pdf new file mode 100644 index 0000000000000000000000000000000000000000..628ff51274c090068a7c1616ce4b4042eb5c775e GIT binary patch literal 6005 zcmeHLc~}!!5+4zjZ5WE58$55R*Y-AU&VkdY%O9xz0mcpH)?L_<0xK|nk>Qh-;LF2p9##P(T6?J5;7o;_ytE!{Sg6 zjF<);q0FYG_!E&bmBy+V6N@-nBR8lB&6GGT4)egeF=HUTL5IsCp?KK5D;_J40Lq{u z9)bvA`i)kNdQ(Je$$5mN!Ab)hZ)DOES}TKA%=+js^D!f%)#goQ3Wag86@DQHY=yui zKcm*i_-S2@{PYXMzXVo=!^Tbc!VaB)aR+S*zJP-Xtr~`sO`2f|gliPEX~BqeKSa9R zhyyN{PtH?RES{uNpyH{SRw(!N4S)`8PhZF zYqx*`q5v_$qpiEG@N-05K2Jo$iPoHvZvhXXs6$8Ku(&)C2c=KXVIkn!2>3=@a99{u zfMS^O?W6D@eQtt>fPn|bP)T@*RcZsS1OIB70r$t{gaW5;KXs+q(%`W9xZFU~=upGA z08^lj0C$%ZWn4hL8`-H?WDH0WFs+km^jet?*T~~q&4Z9ZGew6P$T-3l6S_#67K-bM zXq_C_Q(J_{3_x3rag0)blV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6lW3Se(}&%KJca3eaDX9 z0pH_$HmIj;y*MGFb8>Nt*Yb}KB^1n!W=1D%*4y2)$wRVbD?A(+U$eo+CO}= z&z9YfKR!jItvhUE!bg`|A)4oW^?S}PadiEbIax-W$zM!b?_Znm9aXOH=Te^XC35E6 zJg#~DtCZs|PnoFSJZrujaoDzQmb%c&x4|s{Oy0XwWq4LJUAZgYNuAhdh5`-^yMp06x<7u z%jLMNa;&e$N0sXclS->&s&j+nn|nK=_AA<#ude=a{^QFZpMS8$Z}!;(%4*QO0?Txu zTm;FC76yj!tY`uk1!hrw$Gp7!l46DESZD?esVqoU&<{vVhvi7$)RfFbr~C?qXaxg3 z128}^jErDH2o}twpw#00(xT+lVg*p40Lsmv4DOttSCX0sv=LMyzyt#li-2MZrcfcI zaswm;FHiKnGgE+0RRH-QNC9S#bABmMuOWu}iy`F)EHKPaOaghZ7;YiRVGxfyCzd4U zni`ub0EMBz&_DsqQpke~83Wx30tg{XLrV-H6JY3| zs4_G(MAv9&Xkh_YRZ^6gnUh+?1&TdS7hrH`6zAurYAR@Crf5O}ML#G%zeEA#VQ>KJ d2WM8L0$mR-OcRSrz}_)5GBM{;Rdw}u0|4McC_exI literal 0 HcmV?d00001 diff --git a/TangemApp.xcodeproj/project.pbxproj b/TangemApp.xcodeproj/project.pbxproj index 0347689650..75a676030c 100644 --- a/TangemApp.xcodeproj/project.pbxproj +++ b/TangemApp.xcodeproj/project.pbxproj @@ -18025,7 +18025,7 @@ repositoryURL = "https://github.com/tangem/wallet-core-binaries-ios.git"; requirement = { kind = exactVersion; - version = "4.0.21-tangem6"; + version = "4.0.46-tangem1"; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/TangemApp.xcworkspace/xcshareddata/swiftpm/Package.resolved b/TangemApp.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3a73ad3517..fffe615ca5 100644 --- a/TangemApp.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/TangemApp.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "677c13ecc7c20d526bb9de12e4b413262812314ac3723da7b55c550905150a6f", + "originHash" : "75f3574e9c9732ee5b0d472f0fe3908371662aa7d2ee0e95e4ce4e32c0500d12", "pins" : [ { "identity" : "anyasyncsequence", @@ -10,6 +10,15 @@ "version" : "1.0.2" } }, + { + "identity" : "base32", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Jarema/Base32.git", + "state" : { + "revision" : "7f723a2e55f1c76e7c79263aebf89dbfcd58e77d", + "version" : "0.10.2" + } + }, { "identity" : "bigint", "kind" : "remoteSourceControl", @@ -37,6 +46,15 @@ "version" : "1.8.1" } }, + { + "identity" : "float16", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SusanDoggie/Float16.git", + "state" : { + "revision" : "936ae66adccf1c91bcaeeb9c0cddde78a13695c3", + "version" : "1.1.1" + } + }, { "identity" : "grpc-swift", "kind" : "remoteSourceControl", @@ -55,6 +73,33 @@ "version" : "0.26.0-tangem3" } }, + { + "identity" : "icpkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/tangem/IcpKit.git", + "state" : { + "revision" : "02aad763a1ebb0847b1f0eaff755159b3a95707a", + "version" : "0.1.2-tangem3" + } + }, + { + "identity" : "potentcodables", + "kind" : "remoteSourceControl", + "location" : "https://github.com/outfoxx/PotentCodables.git", + "state" : { + "revision" : "660e33e84e00b9bf07bd41dd99ff800600e435e7", + "version" : "3.5.0" + } + }, + { + "identity" : "regex", + "kind" : "remoteSourceControl", + "location" : "https://github.com/sharplet/Regex.git", + "state" : { + "revision" : "76c2b73d4281d77fc3118391877efd1bf972f515", + "version" : "2.1.1" + } + }, { "identity" : "scalecodec.swift", "kind" : "remoteSourceControl", @@ -172,6 +217,15 @@ "version" : "2.4.2" } }, + { + "identity" : "swift-numerics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-numerics", + "state" : { + "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b", + "version" : "1.0.2" + } + }, { "identity" : "swift-protobuf-binaries", "kind" : "remoteSourceControl", @@ -186,8 +240,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system.git", "state" : { - "revision" : "025bcb1165deab2e20d4eaba79967ce73013f496", - "version" : "1.2.1" + "revision" : "d2ba781702a1d8285419c15ee62fd734a9437ff5", + "version" : "1.3.2" } }, { @@ -213,8 +267,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tangem/wallet-core-binaries-ios.git", "state" : { - "revision" : "b9906e7e5c56706f0fe1ad3545dbf02dcf195b34", - "version" : "4.0.21-tangem6" + "revision" : "67be5876186284e85a5f5f8757de209ba53d5729", + "version" : "4.0.46-tangem1" } }, {