Skip to content

Commit

Permalink
Merge pull request #281 from tangem/release/3.6.0
Browse files Browse the repository at this point in the history
Release version 3.6.0
  • Loading branch information
tureck1y authored May 10, 2023
2 parents 2e55f1c + 71fc641 commit 2ecdf90
Show file tree
Hide file tree
Showing 15 changed files with 108 additions and 236 deletions.
209 changes: 7 additions & 202 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,208 +1,13 @@
* 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
* 7c0c3ef - (HEAD -> release/3.6.0, tag: develop-228, origin/develop, develop) Merge pull request #279 from tangem/IOS-3574_derivedkeys_serialization
|\
| * 3d5ce9a - Merge branch 'develop' into IOS-3478_import_wallet_refactor
| |\
| |/
|/|
* | d7b131a - (tag: develop-224) Merge pull request #275 from tangem/IOS-3502_keep_same_session
|\ \
| * | 84bdd06 - IOS-3502 Keep same session for the newest cards on signing
|/ /
| * f76871a - IOS-3478 Refactor import wallet facade and update to the latest v6 minor
|/
* 3e6d3a1 - (tag: develop-223) Merge pull request #273 from tangem/IOS-3496_resolve_ambigious_inits
|\
| * 55de33f - IOS-3496 Resolve ambigious inits
|/
* c5aac89 - (tag: develop-222) Merge pull request #272 from tangem/IOS-3432_add_attestcardkey
|\
| * 1445024 - IOS-3432 Expose a card's key attestation into a facade
|/
* d18a956 - (tag: develop-221) Merge pull request #271 from tangem/IOS-3440_add_precheck
|\
| * cfd2ece - IOS-3440 Add precheck for backup state
|/
* 2d7c6ec - (tag: develop-220) Merge pull request #270 from tangem/IOS-3467_backup_prechecks
|\
| * 5945868 - IOS-3467 Fix typo
| * 45a73c2 - IOS-3467 Add extra backup prechecks
|/
* 6558d79 - (tag: develop-219) Merge pull request #269 from tangem/IOS-3438_filter_by_max_fw
|\
| * ee756b3 - IOS-3438 Filter cards by firmware
|/
* 54c9cf7 - (tag: develop-218) Merge pull request #267 from tangem/IOS-3383_demo_shign_hsahes_var
|\
| * 22a73f9 - Merge branch 'develop' into IOS-3383_demo_shign_hsahes_var
| |\
| |/
|/|
* | f0d97a4 - (tag: develop-217) Merge pull request #268 from tangem/IOS-3335-add-unable-to-reset-access-code-message
|\ \
| * | 5d679a9 - IOS-3335: Add localization for disabled access code recovery error
|/ /
| * deab060 - IOS-3383 Expose signed hashes count into demo view
|/
* 73be7ac - (tag: develop-216) Merge pull request #265 from tangem/IOS-3290_user_settings
|\
| * 709d95e - Merge branch 'develop' into IOS-3290_user_settings
| |\
| |/
|/|
* | ea2ce8b - (tag: develop-215) Merge pull request #266 from tangem/IOS-3371_open_bip32
|\ \
| * | 695bb2e - IOS-3371 Reveal Bip32 to public
|/ /
| * acb5667 - IOS-3290 Rename resetting to recovery
| * 18ba08d - IOS-3290 Fix docs and uncomment the precheck
| * 7191113 - IOS-3290 Merge branch 'develop' into IOS-3290_user_settings
| |\
| |/
|/|
* | b4658cf - (tag: develop-214) Merge pull request #264 from tangem/IOS-3291_get_entropy
|\ \
| * | e7cd983 - IOS-3291 Fix error
| * | 0b87f1a - IOS-3291 Fix doc and uncomment the precheck
| * | d13821e - IOS-3291 Merge branch 'develop' into IOS-3291_get_entropy
| |\ \
| |/ /
|/| |
* | | d2c3e00 - (tag: develop-213) Merge pull request #263 from tangem/IOS-3289_check_wallet
|\ \ \
| * | | e351826 - IOS-3289 Remove a curve from params
| * | | 7794c69 - IOS-3289 Add more docs
| * | | 4ecfba5 - IOS-3289 Fix doc
| * | | 3da0bc5 - Merge branch 'develop' into IOS-3289_check_wallet
| |\ \ \
| |/ / /
|/| | |
* | | | 6a731aa - (tag: develop-212) Merge pull request #262 from tangem/IOS-3219_create_wallet_from_seed
|\ \ \ \
| * | | | acde40d - IOS-3219 Refactor create wallet
| * | | | 00213fc - IOS-3219 Fix typos and renamings
| * | | | f1125ac - IOS-3219 Bump fw version
| * | | | 922c2e0 - IOS-3219 Rename external wallet to keys import
| * | | | 162e9fd - IOS-3219 Add new SW
| * | | | 1753447 - IOS-3219 Fix backuped status
| * | | | 1310337 - Merge branch 'develop' into IOS-3219_create_wallet_from_seed
| |\ \ \ \
| |/ / / /
|/| | | |
| * | | | 06f04d7 - IOS-3219 Add status extension
| * | | | 9e36f87 - IOS-3219 Add precheck for duplicated wallet
| * | | | c530f58 - IOS-3219 Create wallet from the seed
| | * | | 49791f6 - IOS-3289 Use secp256k1 curve for wallet attestation
| | * | | 046525f - IOS-3289 Check wallet with the wallet's status
| |/ / /
| | * / 358ee5b - IOS-3291 Get entropy command
| |/ /
| | * 0e1ca6b - IOS-3290 Refactor to separate settings
| | * 16856f6 - IOS-3290 Add usersettings support
| |/
|/|
* | e2604c2 - (tag: develop-211) Merge pull request #259 from tangem/IOS-3273_configure_logger_from_start
|\ \
| |/
|/|
| * f73bc65 - Merge branch 'develop' into IOS-3273_configure_logger_from_start
| |\
| |/
|/|
* | 1ebe14f - (tag: develop-210) Merge pull request #260 from tangem/IOS-3280-fix-tangem-sdk-string-sorting-warning
|\ \
| * | 7c4b6e7 - IOS-3280 Fixed string sorting script warning
|/ /
| * ef6cbc1 - IOS-3273 Keep logger configured from start
|/
* 032e70c - (tag: develop-209) Merge pull request #258 from tangem/IOS-3271_fix_decoding
|\
| * 29908fe - IOS-3271 Validate the key
| * 335d7e4 - IOS-3271 Fix decoding
|/
* d251dd1 - (tag: develop-208) Merge pull request #257 from tangem/IOS-3268_update_cards
|\
| * dbabc6a - IOS-3268 Update cards after code fetch
|/
* ef61d8d - (tag: develop-207) Merge pull request #256 from tangem/IOS-3226_reset_both_codes
|\
| * b266094 - IOS-3226 Handle both codes resetting in same time
| * 2a2d69d - IOS-3574 Serialize derivedKeys as object
|/
* 00fceec - (tag: develop-206) Merge pull request #255 from tangem/IOS-3059_seed
* c2b460c - (tag: develop-227) Merge pull request #277 from tangem/IOS-3533-sdk-chaining-example-command-does-not-execute
|\
| * ccf272a - IOS-3059 Remowe extra whitespases
| * 444d689 - IOS-3059 Open initializer
| * e18e99c - IOS-3059 Update podspec
| * 977888c - IOS-3059 Open validation, change regex
| * de875a1 - IOS-3059 Refactor from HEX conversion
| * b4a4a6d - IOS-3059 Make Base58 extensions public
| * 0056f00 - IOS-3059 Add tests
| * b0c9dec - IOS-3059 Make serialization public
| * 64fa93f - IOS-3059 Rename wordscount
| * 69984c5 - IOS-3059 Merge remote-tracking branch 'origin/IOS-3059_seed' into IOS-3059_seed
| |\
| | * 47ea569 - Update TangemSdk/TangemSdk/Crypto/BIP39/BIP39.swift
| * | f7a2b25 - IOS-3059 Code polishing
| |/
| * 007515e - IOS-3059 Merge remote-tracking branch 'origin/IOS-3059_seed' into IOS-3059_seed
| |\
| | * ed18774 - IOS-3059 Small polishing and commenting
| | * 9c753c9 - IOS-3059 Remove comment
| | * c3d7c46 - IOS-3059 Remove comment
| * | 17241c4 - IOS-3059 Polishing and commenting
| |/
| * 084ea0c - IOS-3059 Complete bip32 with tests
| * 253807d - IOS-3059 Configure podspec
| * c0931ed - IOS-3059 Add seed generation into Mnemonic
| * 458e001 - IOS-3059 Merge branch 'develop' into IOS-3059_seed
| * b632a9d - Merge branch 'develop' into IOS-3533-sdk-chaining-example-command-does-not-execute
| |\
| |/
|/|
* | 06ff871 - (tag: develop-205) Merge pull request #253 from tangem/IOS-2935_cover_cryptokit_error_p256
|\ \
| * \ 7c64465 - Merge branch 'develop' into IOS-2935_cover_cryptokit_error_p256
| |\ \
| |/ /
|/| |
* | | f22db73 - (tag: develop-204) Merge pull request #251 from tangem/IOS-2929-sorting-strings
|\ \ \
| * \ \ a005d20 - Merge branch 'develop' into IOS-2929-sorting-strings
| |\ \ \
| |/ / /
|/| | |
| * | | 14b80b3 - IOS-2929 Merge remote-tracking branch 'origin/develop' into IOS-2929-sorting-strings
| |\ \ \
| * | | | 6f2187e - IOS-2929 Removed sorting script
| * | | | 4906681 - IOS-2929 Added strings sorting
| | | * | 891d196 - Merge branch 'develop' into IOS-2935_cover_cryptokit_error_p256
| | | |\ \
| |_|_|/ /
|/| | | |
* | | | | d068820 - (tag: develop-203) Merge pull request #254 from tangem/IOS-3172-l-10-n-sync-card-sdk
|\ \ \ \ \
| |_|/ / /
|/| | | |
| * | | | 7a21959 - IOS-3172 l10n sync
|/ / / /
| | * | ecbae31 - Merge branch 'develop' into IOS-2935_cover_cryptokit_error_p256
| | |\ \
| |_|/ /
|/| | |
| | * | 5f97b10 - IOS-2935 Add Constants
| | * | 811bbbb - IOS-2935 Cover the CryptoKit error
| |/ /
| | * 31b5a0a - IOS-3059 Clean
| | * 644e33e - IOS-3059 Implement keys generation
| | * 277aba7 - IOS-3059 Move files
| | * 22b4481 - IOS-3059 Add seed generation and parsing
| | * 28b3998 - IOS-3059 Some optimizations
| | * 6fe6521 - IOS-3059 Generate mnemonic
| |/
|/|
* | 4c32720 - (tag: develop-202) Merge pull request #252 from tangem/IOS-3108_remeber_tag_until_success_or_failure
|\ \
| |/
|/|
| * 76ee1a3 - IOS-3108 rearrange some code
| * 23ae894 - IOS-3108 Do not release a remembered tag until the operation completion
|/
* 17f7663 - (tag: develop-201) Merge pull request #249 from tangem/master
* | 0f6b2c4 - (tag: develop-226) Merge pull request #278 from tangem/master
/
* f22dcfd - IOS-3533 Added a hack to delay the execution of the second command in chaining example
29 changes: 16 additions & 13 deletions Example/TangemSdkExample/AppModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -339,20 +339,23 @@ extension AppModel {
switch result {
case .success:
session.resume()
let createWallet = CreateWalletTask(curve: .secp256k1)
createWallet.run(in: session) { result2 in
switch result2 {
case .success(let response):
self.logger.log(response)
case .failure:
break
let secondTaskDelay: TimeInterval = 3
DispatchQueue.main.asyncAfter(deadline: .now() + secondTaskDelay) {
let createWallet = CreateWalletTask(curve: .secp256k1)
createWallet.run(in: session) { result2 in
switch result2 {
case .success(let response):
self.logger.log(response)
case .failure:
break
}

DispatchQueue.main.async {
self.handleCompletion(result)
}

session.stop()
}

DispatchQueue.main.async {
self.handleCompletion(result)
}

session.stop()
}

case .failure(let error):
Expand Down
2 changes: 1 addition & 1 deletion TangemSdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'TangemSdk'
s.version = '3.5.0'
s.version = '3.6.0'
s.summary = 'Use TangemSdk for Tangem cards integration'

# This description is used to generate tags and improve search results.
Expand Down
4 changes: 4 additions & 0 deletions TangemSdk/TangemSdk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
DC59CB0A29AF6F9C00EC14E1 /* EntropyLength.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC59CB0929AF6F9C00EC14E1 /* EntropyLength.swift */; };
DC59CB0C29AF706100EC14E1 /* MnemonicError.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC59CB0B29AF706100EC14E1 /* MnemonicError.swift */; };
DC59CB0E29AF70C700EC14E1 /* Mnemonic.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC59CB0D29AF70C700EC14E1 /* Mnemonic.swift */; };
DC7254902A03E20A0003FE1B /* DerivedKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC72548F2A03E20A0003FE1B /* DerivedKeys.swift */; };
DC8B0E3F286F221D009D64F7 /* BiometricsUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC8B0E3E286F221D009D64F7 /* BiometricsUtil.swift */; };
DCA9706628E35EAD0046E62E /* GenerateOTPCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCA9706528E35EAD0046E62E /* GenerateOTPCommand.swift */; };
DCC0A21129D3146100C45B13 /* SetUserSettingsCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC0A21029D3146100C45B13 /* SetUserSettingsCommand.swift */; };
Expand Down Expand Up @@ -661,6 +662,7 @@
DC59CB0929AF6F9C00EC14E1 /* EntropyLength.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EntropyLength.swift; sourceTree = "<group>"; };
DC59CB0B29AF706100EC14E1 /* MnemonicError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MnemonicError.swift; sourceTree = "<group>"; };
DC59CB0D29AF70C700EC14E1 /* Mnemonic.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Mnemonic.swift; sourceTree = "<group>"; };
DC72548F2A03E20A0003FE1B /* DerivedKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DerivedKeys.swift; sourceTree = "<group>"; };
DC8B0E3E286F221D009D64F7 /* BiometricsUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BiometricsUtil.swift; sourceTree = "<group>"; };
DCA9706528E35EAD0046E62E /* GenerateOTPCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenerateOTPCommand.swift; sourceTree = "<group>"; };
DCC0A21029D3146100C45B13 /* SetUserSettingsCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetUserSettingsCommand.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1427,6 +1429,7 @@
5D379C26268FA47600C7F473 /* EncryptionMode.swift */,
5D270F2426A0199100D2EDC1 /* WalletData.swift */,
DCC0A21529D3216100C45B13 /* UserSettings.swift */,
DC72548F2A03E20A0003FE1B /* DerivedKeys.swift */,
);
path = Card;
sourceTree = "<group>";
Expand Down Expand Up @@ -1838,6 +1841,7 @@
5D2F3EE526CBDAA100779CAC /* KeyboardAdaptive.swift in Sources */,
5D7D5FB223449D4000058D69 /* SessionEnvironment.swift in Sources */,
5D2FE06324DD82750086B5E8 /* AttestCardKeyCommand.swift in Sources */,
DC7254902A03E20A0003FE1B /* DerivedKeys.swift in Sources */,
DC1244E229BB7B390037BC05 /* WIF.swift in Sources */,
5D539ECB276CDD8600AB8B53 /* DeriveMultipleWalletPublicKeysTask.swift in Sources */,
DA6C752A292682650070EEFD /* LAContext+.swift in Sources */,
Expand Down
64 changes: 64 additions & 0 deletions TangemSdk/TangemSdk/Common/Card/DerivedKeys.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//
// DerivedKeys.swift
// TangemSdk
//
// Created by Alexander Osokin on 04.05.2023.
// Copyright © 2023 Tangem AG. All rights reserved.
//

import Foundation

// We can't use CodingKeyRepresentable because of iOS 15 version
@available(iOS 13.0, *)
public struct DerivedKeys: JSONStringConvertible {
public private(set) var keys: [DerivationPath:ExtendedPublicKey]

public init(keys: [DerivationPath : ExtendedPublicKey]) {
self.keys = keys
}

public subscript(_ path: DerivationPath) -> ExtendedPublicKey? {
get {
return keys[path]
}
set(newValue) {
keys[path] = newValue
}
}
}

@available(iOS 13.0, *)
extension DerivedKeys: Codable {
public init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
let stringDictionary = try container.decode([String: ExtendedPublicKey].self)

let keysDictionary: [DerivationPath: ExtendedPublicKey] = try stringDictionary.reduce(into: [:]) { partialResult, item in
let path = try DerivationPath(rawPath: item.key)
partialResult[path] = item.value
}

self.init(keys: keysDictionary)
}

public func encode(to encoder: Encoder) throws {
let stringDictionary = keys.reduce(into: [:]) { partialResult, item in
partialResult[item.key.rawPath] = item.value
}

var container = encoder.singleValueContainer()
try container.encode(stringDictionary)
}
}


@available(iOS 13.0, *)
extension DerivedKeys: ExpressibleByDictionaryLiteral {
public init(dictionaryLiteral elements: (DerivationPath, ExtendedPublicKey)...) {
let dictionary = elements.reduce(into: [:]) { partialResult, item in
partialResult[item.0] = item.1
}

self.init(keys: dictionary)
}
}
2 changes: 1 addition & 1 deletion TangemSdk/TangemSdk/Common/Card/Wallet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public extension Card {
/// Does this wallet has a backup
public var hasBackup: Bool
/// Derived keys according to `Config.defaultDerivationPaths`
public var derivedKeys: [DerivationPath:ExtendedPublicKey] = [:]
public var derivedKeys: DerivedKeys = [:]
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation

@available(iOS 13.0, *)
public class DeriveMultipleWalletPublicKeysTask: CardSessionRunnable {
public typealias Response = [Data: [DerivationPath:ExtendedPublicKey]]
public typealias Response = [Data: DerivedKeys]

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

0 comments on commit 2ecdf90

Please sign in to comment.