Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Commit 2ecdf90

Browse files
authored
Merge pull request #281 from tangem/release/3.6.0
Release version 3.6.0
2 parents 2e55f1c + 71fc641 commit 2ecdf90

File tree

15 files changed

+108
-236
lines changed

15 files changed

+108
-236
lines changed

CHANGELOG

Lines changed: 7 additions & 202 deletions
Original file line numberDiff line numberDiff line change
@@ -1,208 +1,13 @@
1-
* d349643 - (HEAD -> release/3.5.0, tag: develop-225, tag: 28, origin/develop, develop) Merge pull request #274 from tangem/IOS-3478_import_wallet_refactor
1+
* 7c0c3ef - (HEAD -> release/3.6.0, tag: develop-228, origin/develop, develop) Merge pull request #279 from tangem/IOS-3574_derivedkeys_serialization
22
|\
3-
| * 3d5ce9a - Merge branch 'develop' into IOS-3478_import_wallet_refactor
4-
| |\
5-
| |/
6-
|/|
7-
* | d7b131a - (tag: develop-224) Merge pull request #275 from tangem/IOS-3502_keep_same_session
8-
|\ \
9-
| * | 84bdd06 - IOS-3502 Keep same session for the newest cards on signing
10-
|/ /
11-
| * f76871a - IOS-3478 Refactor import wallet facade and update to the latest v6 minor
12-
|/
13-
* 3e6d3a1 - (tag: develop-223) Merge pull request #273 from tangem/IOS-3496_resolve_ambigious_inits
14-
|\
15-
| * 55de33f - IOS-3496 Resolve ambigious inits
16-
|/
17-
* c5aac89 - (tag: develop-222) Merge pull request #272 from tangem/IOS-3432_add_attestcardkey
18-
|\
19-
| * 1445024 - IOS-3432 Expose a card's key attestation into a facade
20-
|/
21-
* d18a956 - (tag: develop-221) Merge pull request #271 from tangem/IOS-3440_add_precheck
22-
|\
23-
| * cfd2ece - IOS-3440 Add precheck for backup state
24-
|/
25-
* 2d7c6ec - (tag: develop-220) Merge pull request #270 from tangem/IOS-3467_backup_prechecks
26-
|\
27-
| * 5945868 - IOS-3467 Fix typo
28-
| * 45a73c2 - IOS-3467 Add extra backup prechecks
29-
|/
30-
* 6558d79 - (tag: develop-219) Merge pull request #269 from tangem/IOS-3438_filter_by_max_fw
31-
|\
32-
| * ee756b3 - IOS-3438 Filter cards by firmware
33-
|/
34-
* 54c9cf7 - (tag: develop-218) Merge pull request #267 from tangem/IOS-3383_demo_shign_hsahes_var
35-
|\
36-
| * 22a73f9 - Merge branch 'develop' into IOS-3383_demo_shign_hsahes_var
37-
| |\
38-
| |/
39-
|/|
40-
* | f0d97a4 - (tag: develop-217) Merge pull request #268 from tangem/IOS-3335-add-unable-to-reset-access-code-message
41-
|\ \
42-
| * | 5d679a9 - IOS-3335: Add localization for disabled access code recovery error
43-
|/ /
44-
| * deab060 - IOS-3383 Expose signed hashes count into demo view
45-
|/
46-
* 73be7ac - (tag: develop-216) Merge pull request #265 from tangem/IOS-3290_user_settings
47-
|\
48-
| * 709d95e - Merge branch 'develop' into IOS-3290_user_settings
49-
| |\
50-
| |/
51-
|/|
52-
* | ea2ce8b - (tag: develop-215) Merge pull request #266 from tangem/IOS-3371_open_bip32
53-
|\ \
54-
| * | 695bb2e - IOS-3371 Reveal Bip32 to public
55-
|/ /
56-
| * acb5667 - IOS-3290 Rename resetting to recovery
57-
| * 18ba08d - IOS-3290 Fix docs and uncomment the precheck
58-
| * 7191113 - IOS-3290 Merge branch 'develop' into IOS-3290_user_settings
59-
| |\
60-
| |/
61-
|/|
62-
* | b4658cf - (tag: develop-214) Merge pull request #264 from tangem/IOS-3291_get_entropy
63-
|\ \
64-
| * | e7cd983 - IOS-3291 Fix error
65-
| * | 0b87f1a - IOS-3291 Fix doc and uncomment the precheck
66-
| * | d13821e - IOS-3291 Merge branch 'develop' into IOS-3291_get_entropy
67-
| |\ \
68-
| |/ /
69-
|/| |
70-
* | | d2c3e00 - (tag: develop-213) Merge pull request #263 from tangem/IOS-3289_check_wallet
71-
|\ \ \
72-
| * | | e351826 - IOS-3289 Remove a curve from params
73-
| * | | 7794c69 - IOS-3289 Add more docs
74-
| * | | 4ecfba5 - IOS-3289 Fix doc
75-
| * | | 3da0bc5 - Merge branch 'develop' into IOS-3289_check_wallet
76-
| |\ \ \
77-
| |/ / /
78-
|/| | |
79-
* | | | 6a731aa - (tag: develop-212) Merge pull request #262 from tangem/IOS-3219_create_wallet_from_seed
80-
|\ \ \ \
81-
| * | | | acde40d - IOS-3219 Refactor create wallet
82-
| * | | | 00213fc - IOS-3219 Fix typos and renamings
83-
| * | | | f1125ac - IOS-3219 Bump fw version
84-
| * | | | 922c2e0 - IOS-3219 Rename external wallet to keys import
85-
| * | | | 162e9fd - IOS-3219 Add new SW
86-
| * | | | 1753447 - IOS-3219 Fix backuped status
87-
| * | | | 1310337 - Merge branch 'develop' into IOS-3219_create_wallet_from_seed
88-
| |\ \ \ \
89-
| |/ / / /
90-
|/| | | |
91-
| * | | | 06f04d7 - IOS-3219 Add status extension
92-
| * | | | 9e36f87 - IOS-3219 Add precheck for duplicated wallet
93-
| * | | | c530f58 - IOS-3219 Create wallet from the seed
94-
| | * | | 49791f6 - IOS-3289 Use secp256k1 curve for wallet attestation
95-
| | * | | 046525f - IOS-3289 Check wallet with the wallet's status
96-
| |/ / /
97-
| | * / 358ee5b - IOS-3291 Get entropy command
98-
| |/ /
99-
| | * 0e1ca6b - IOS-3290 Refactor to separate settings
100-
| | * 16856f6 - IOS-3290 Add usersettings support
101-
| |/
102-
|/|
103-
* | e2604c2 - (tag: develop-211) Merge pull request #259 from tangem/IOS-3273_configure_logger_from_start
104-
|\ \
105-
| |/
106-
|/|
107-
| * f73bc65 - Merge branch 'develop' into IOS-3273_configure_logger_from_start
108-
| |\
109-
| |/
110-
|/|
111-
* | 1ebe14f - (tag: develop-210) Merge pull request #260 from tangem/IOS-3280-fix-tangem-sdk-string-sorting-warning
112-
|\ \
113-
| * | 7c4b6e7 - IOS-3280 Fixed string sorting script warning
114-
|/ /
115-
| * ef6cbc1 - IOS-3273 Keep logger configured from start
116-
|/
117-
* 032e70c - (tag: develop-209) Merge pull request #258 from tangem/IOS-3271_fix_decoding
118-
|\
119-
| * 29908fe - IOS-3271 Validate the key
120-
| * 335d7e4 - IOS-3271 Fix decoding
121-
|/
122-
* d251dd1 - (tag: develop-208) Merge pull request #257 from tangem/IOS-3268_update_cards
123-
|\
124-
| * dbabc6a - IOS-3268 Update cards after code fetch
125-
|/
126-
* ef61d8d - (tag: develop-207) Merge pull request #256 from tangem/IOS-3226_reset_both_codes
127-
|\
128-
| * b266094 - IOS-3226 Handle both codes resetting in same time
3+
| * 2a2d69d - IOS-3574 Serialize derivedKeys as object
1294
|/
130-
* 00fceec - (tag: develop-206) Merge pull request #255 from tangem/IOS-3059_seed
5+
* c2b460c - (tag: develop-227) Merge pull request #277 from tangem/IOS-3533-sdk-chaining-example-command-does-not-execute
1316
|\
132-
| * ccf272a - IOS-3059 Remowe extra whitespases
133-
| * 444d689 - IOS-3059 Open initializer
134-
| * e18e99c - IOS-3059 Update podspec
135-
| * 977888c - IOS-3059 Open validation, change regex
136-
| * de875a1 - IOS-3059 Refactor from HEX conversion
137-
| * b4a4a6d - IOS-3059 Make Base58 extensions public
138-
| * 0056f00 - IOS-3059 Add tests
139-
| * b0c9dec - IOS-3059 Make serialization public
140-
| * 64fa93f - IOS-3059 Rename wordscount
141-
| * 69984c5 - IOS-3059 Merge remote-tracking branch 'origin/IOS-3059_seed' into IOS-3059_seed
142-
| |\
143-
| | * 47ea569 - Update TangemSdk/TangemSdk/Crypto/BIP39/BIP39.swift
144-
| * | f7a2b25 - IOS-3059 Code polishing
145-
| |/
146-
| * 007515e - IOS-3059 Merge remote-tracking branch 'origin/IOS-3059_seed' into IOS-3059_seed
147-
| |\
148-
| | * ed18774 - IOS-3059 Small polishing and commenting
149-
| | * 9c753c9 - IOS-3059 Remove comment
150-
| | * c3d7c46 - IOS-3059 Remove comment
151-
| * | 17241c4 - IOS-3059 Polishing and commenting
152-
| |/
153-
| * 084ea0c - IOS-3059 Complete bip32 with tests
154-
| * 253807d - IOS-3059 Configure podspec
155-
| * c0931ed - IOS-3059 Add seed generation into Mnemonic
156-
| * 458e001 - IOS-3059 Merge branch 'develop' into IOS-3059_seed
7+
| * b632a9d - Merge branch 'develop' into IOS-3533-sdk-chaining-example-command-does-not-execute
1578
| |\
1589
| |/
15910
|/|
160-
* | 06ff871 - (tag: develop-205) Merge pull request #253 from tangem/IOS-2935_cover_cryptokit_error_p256
161-
|\ \
162-
| * \ 7c64465 - Merge branch 'develop' into IOS-2935_cover_cryptokit_error_p256
163-
| |\ \
164-
| |/ /
165-
|/| |
166-
* | | f22db73 - (tag: develop-204) Merge pull request #251 from tangem/IOS-2929-sorting-strings
167-
|\ \ \
168-
| * \ \ a005d20 - Merge branch 'develop' into IOS-2929-sorting-strings
169-
| |\ \ \
170-
| |/ / /
171-
|/| | |
172-
| * | | 14b80b3 - IOS-2929 Merge remote-tracking branch 'origin/develop' into IOS-2929-sorting-strings
173-
| |\ \ \
174-
| * | | | 6f2187e - IOS-2929 Removed sorting script
175-
| * | | | 4906681 - IOS-2929 Added strings sorting
176-
| | | * | 891d196 - Merge branch 'develop' into IOS-2935_cover_cryptokit_error_p256
177-
| | | |\ \
178-
| |_|_|/ /
179-
|/| | | |
180-
* | | | | d068820 - (tag: develop-203) Merge pull request #254 from tangem/IOS-3172-l-10-n-sync-card-sdk
181-
|\ \ \ \ \
182-
| |_|/ / /
183-
|/| | | |
184-
| * | | | 7a21959 - IOS-3172 l10n sync
185-
|/ / / /
186-
| | * | ecbae31 - Merge branch 'develop' into IOS-2935_cover_cryptokit_error_p256
187-
| | |\ \
188-
| |_|/ /
189-
|/| | |
190-
| | * | 5f97b10 - IOS-2935 Add Constants
191-
| | * | 811bbbb - IOS-2935 Cover the CryptoKit error
192-
| |/ /
193-
| | * 31b5a0a - IOS-3059 Clean
194-
| | * 644e33e - IOS-3059 Implement keys generation
195-
| | * 277aba7 - IOS-3059 Move files
196-
| | * 22b4481 - IOS-3059 Add seed generation and parsing
197-
| | * 28b3998 - IOS-3059 Some optimizations
198-
| | * 6fe6521 - IOS-3059 Generate mnemonic
199-
| |/
200-
|/|
201-
* | 4c32720 - (tag: develop-202) Merge pull request #252 from tangem/IOS-3108_remeber_tag_until_success_or_failure
202-
|\ \
203-
| |/
204-
|/|
205-
| * 76ee1a3 - IOS-3108 rearrange some code
206-
| * 23ae894 - IOS-3108 Do not release a remembered tag until the operation completion
207-
|/
208-
* 17f7663 - (tag: develop-201) Merge pull request #249 from tangem/master
11+
* | 0f6b2c4 - (tag: develop-226) Merge pull request #278 from tangem/master
12+
/
13+
* f22dcfd - IOS-3533 Added a hack to delay the execution of the second command in chaining example

Example/TangemSdkExample/AppModel.swift

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -339,20 +339,23 @@ extension AppModel {
339339
switch result {
340340
case .success:
341341
session.resume()
342-
let createWallet = CreateWalletTask(curve: .secp256k1)
343-
createWallet.run(in: session) { result2 in
344-
switch result2 {
345-
case .success(let response):
346-
self.logger.log(response)
347-
case .failure:
348-
break
342+
let secondTaskDelay: TimeInterval = 3
343+
DispatchQueue.main.asyncAfter(deadline: .now() + secondTaskDelay) {
344+
let createWallet = CreateWalletTask(curve: .secp256k1)
345+
createWallet.run(in: session) { result2 in
346+
switch result2 {
347+
case .success(let response):
348+
self.logger.log(response)
349+
case .failure:
350+
break
351+
}
352+
353+
DispatchQueue.main.async {
354+
self.handleCompletion(result)
355+
}
356+
357+
session.stop()
349358
}
350-
351-
DispatchQueue.main.async {
352-
self.handleCompletion(result)
353-
}
354-
355-
session.stop()
356359
}
357360

358361
case .failure(let error):

TangemSdk.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'TangemSdk'
11-
s.version = '3.5.0'
11+
s.version = '3.6.0'
1212
s.summary = 'Use TangemSdk for Tangem cards integration'
1313

1414
# This description is used to generate tags and improve search results.

TangemSdk/TangemSdk.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@
318318
DC59CB0A29AF6F9C00EC14E1 /* EntropyLength.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC59CB0929AF6F9C00EC14E1 /* EntropyLength.swift */; };
319319
DC59CB0C29AF706100EC14E1 /* MnemonicError.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC59CB0B29AF706100EC14E1 /* MnemonicError.swift */; };
320320
DC59CB0E29AF70C700EC14E1 /* Mnemonic.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC59CB0D29AF70C700EC14E1 /* Mnemonic.swift */; };
321+
DC7254902A03E20A0003FE1B /* DerivedKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC72548F2A03E20A0003FE1B /* DerivedKeys.swift */; };
321322
DC8B0E3F286F221D009D64F7 /* BiometricsUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC8B0E3E286F221D009D64F7 /* BiometricsUtil.swift */; };
322323
DCA9706628E35EAD0046E62E /* GenerateOTPCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCA9706528E35EAD0046E62E /* GenerateOTPCommand.swift */; };
323324
DCC0A21129D3146100C45B13 /* SetUserSettingsCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC0A21029D3146100C45B13 /* SetUserSettingsCommand.swift */; };
@@ -661,6 +662,7 @@
661662
DC59CB0929AF6F9C00EC14E1 /* EntropyLength.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EntropyLength.swift; sourceTree = "<group>"; };
662663
DC59CB0B29AF706100EC14E1 /* MnemonicError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MnemonicError.swift; sourceTree = "<group>"; };
663664
DC59CB0D29AF70C700EC14E1 /* Mnemonic.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Mnemonic.swift; sourceTree = "<group>"; };
665+
DC72548F2A03E20A0003FE1B /* DerivedKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DerivedKeys.swift; sourceTree = "<group>"; };
664666
DC8B0E3E286F221D009D64F7 /* BiometricsUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BiometricsUtil.swift; sourceTree = "<group>"; };
665667
DCA9706528E35EAD0046E62E /* GenerateOTPCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenerateOTPCommand.swift; sourceTree = "<group>"; };
666668
DCC0A21029D3146100C45B13 /* SetUserSettingsCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetUserSettingsCommand.swift; sourceTree = "<group>"; };
@@ -1427,6 +1429,7 @@
14271429
5D379C26268FA47600C7F473 /* EncryptionMode.swift */,
14281430
5D270F2426A0199100D2EDC1 /* WalletData.swift */,
14291431
DCC0A21529D3216100C45B13 /* UserSettings.swift */,
1432+
DC72548F2A03E20A0003FE1B /* DerivedKeys.swift */,
14301433
);
14311434
path = Card;
14321435
sourceTree = "<group>";
@@ -1838,6 +1841,7 @@
18381841
5D2F3EE526CBDAA100779CAC /* KeyboardAdaptive.swift in Sources */,
18391842
5D7D5FB223449D4000058D69 /* SessionEnvironment.swift in Sources */,
18401843
5D2FE06324DD82750086B5E8 /* AttestCardKeyCommand.swift in Sources */,
1844+
DC7254902A03E20A0003FE1B /* DerivedKeys.swift in Sources */,
18411845
DC1244E229BB7B390037BC05 /* WIF.swift in Sources */,
18421846
5D539ECB276CDD8600AB8B53 /* DeriveMultipleWalletPublicKeysTask.swift in Sources */,
18431847
DA6C752A292682650070EEFD /* LAContext+.swift in Sources */,
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
//
2+
// DerivedKeys.swift
3+
// TangemSdk
4+
//
5+
// Created by Alexander Osokin on 04.05.2023.
6+
// Copyright © 2023 Tangem AG. All rights reserved.
7+
//
8+
9+
import Foundation
10+
11+
// We can't use CodingKeyRepresentable because of iOS 15 version
12+
@available(iOS 13.0, *)
13+
public struct DerivedKeys: JSONStringConvertible {
14+
public private(set) var keys: [DerivationPath:ExtendedPublicKey]
15+
16+
public init(keys: [DerivationPath : ExtendedPublicKey]) {
17+
self.keys = keys
18+
}
19+
20+
public subscript(_ path: DerivationPath) -> ExtendedPublicKey? {
21+
get {
22+
return keys[path]
23+
}
24+
set(newValue) {
25+
keys[path] = newValue
26+
}
27+
}
28+
}
29+
30+
@available(iOS 13.0, *)
31+
extension DerivedKeys: Codable {
32+
public init(from decoder: Decoder) throws {
33+
let container = try decoder.singleValueContainer()
34+
let stringDictionary = try container.decode([String: ExtendedPublicKey].self)
35+
36+
let keysDictionary: [DerivationPath: ExtendedPublicKey] = try stringDictionary.reduce(into: [:]) { partialResult, item in
37+
let path = try DerivationPath(rawPath: item.key)
38+
partialResult[path] = item.value
39+
}
40+
41+
self.init(keys: keysDictionary)
42+
}
43+
44+
public func encode(to encoder: Encoder) throws {
45+
let stringDictionary = keys.reduce(into: [:]) { partialResult, item in
46+
partialResult[item.key.rawPath] = item.value
47+
}
48+
49+
var container = encoder.singleValueContainer()
50+
try container.encode(stringDictionary)
51+
}
52+
}
53+
54+
55+
@available(iOS 13.0, *)
56+
extension DerivedKeys: ExpressibleByDictionaryLiteral {
57+
public init(dictionaryLiteral elements: (DerivationPath, ExtendedPublicKey)...) {
58+
let dictionary = elements.reduce(into: [:]) { partialResult, item in
59+
partialResult[item.0] = item.1
60+
}
61+
62+
self.init(keys: dictionary)
63+
}
64+
}

TangemSdk/TangemSdk/Common/Card/Wallet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public extension Card {
3535
/// Does this wallet has a backup
3636
public var hasBackup: Bool
3737
/// Derived keys according to `Config.defaultDerivationPaths`
38-
public var derivedKeys: [DerivationPath:ExtendedPublicKey] = [:]
38+
public var derivedKeys: DerivedKeys = [:]
3939
}
4040
}
4141

TangemSdk/TangemSdk/Operations/Derivation/DeriveMultipleWalletPublicKeysTask.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010

1111
@available(iOS 13.0, *)
1212
public class DeriveMultipleWalletPublicKeysTask: CardSessionRunnable {
13-
public typealias Response = [Data: [DerivationPath:ExtendedPublicKey]]
13+
public typealias Response = [Data: DerivedKeys]
1414

1515
private let derivations: Array<(Data,[DerivationPath])>
1616
private var response: Response = .init()

0 commit comments

Comments
 (0)