diff --git a/KinBase.podspec b/KinBase.podspec index 403eabd..887d99e 100644 --- a/KinBase.podspec +++ b/KinBase.podspec @@ -8,7 +8,7 @@ # Pod::Spec.new do |s| s.name = 'KinBase' - s.version = '2.1.2' + s.version = '2.1.3' s.summary = 'Kin SDK for iOS' s.description = <<-DESC diff --git a/KinBase/KinBase.xcodeproj/project.pbxproj b/KinBase/KinBase.xcodeproj/project.pbxproj index 0ebd704..56c5fac 100644 --- a/KinBase/KinBase.xcodeproj/project.pbxproj +++ b/KinBase/KinBase.xcodeproj/project.pbxproj @@ -1799,7 +1799,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.2; + MARKETING_VERSION = 2.1.3; OTHER_LDFLAGS = ( "$(inherited)", "-l\"c++\"", @@ -1841,7 +1841,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.2; + MARKETING_VERSION = 2.1.3; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/KinBase/KinBase/Src/KinAccountContext.swift b/KinBase/KinBase/Src/KinAccountContext.swift index ad2c00a..1057574 100644 --- a/KinBase/KinBase/Src/KinAccountContext.swift +++ b/KinBase/KinBase/Src/KinAccountContext.swift @@ -32,10 +32,11 @@ public enum AccountSpec { public protocol KinAccountReadOperations { /** Returns the account info + - Parameter appIndex: set to client AppIndex to attribute account creation, - Parameter forceUpdate: set to `true` to force an update from network - Returns: a `Promise` containing the `KinAccount` or an error */ - func getAccount(forceUpdate: Bool) -> Promise + func getAccount(appIndex: AppIndex, forceUpdate: Bool) -> Promise /** Returns the current balance and listens to future account balance changes. @@ -273,17 +274,17 @@ public class KinAccountContext { // MARK: KinAccountReadOperations extension KinAccountContext: KinAccountReadOperations { - public func getAccount(forceUpdate: Bool = false) -> Promise { + public func getAccount(appIndex: AppIndex = AppIndex(value: 0), forceUpdate: Bool = false) -> Promise { log.info(msg: #function) return storage.getAccount(accountPublicKey) .then(on: dispatchQueue) { storedAccount -> Promise in guard let account = storedAccount else { return self.getAccountAndRecover() } - + switch account.status { case .unregistered: - return self.registerAccount(account: account) + return self.registerAccount(account: account, appIndex: appIndex) .then(on: self.dispatchQueue) { _ in self.getAccountAndRecover() } @@ -587,9 +588,9 @@ extension KinAccountContext { } } - private func registerAccount(account: KinAccount) -> Promise { - let keyPair = KeyPair(publicKey: account.publicKey, privateKey: account.privateKey!) // FIXME: - return service.createAccount(account: account.publicKey, signer: keyPair, appIndex: AppIndex(value: 0)) + private func registerAccount(account: KinAccount, appIndex: AppIndex) -> Promise { + let keyPair = KeyPair(publicKey: account.publicKey, privateKey: account.privateKey!) + return service.createAccount(account: account.publicKey, signer: keyPair, appIndex: appIndex) .then(on: dispatchQueue) { registeredAccount -> KinAccount in return account.merge(registeredAccount) } diff --git a/KinBase/KinBase/Src/Network/KinService.swift b/KinBase/KinBase/Src/Network/KinService.swift index 3420b43..148a99f 100644 --- a/KinBase/KinBase/Src/Network/KinService.swift +++ b/KinBase/KinBase/Src/Network/KinService.swift @@ -407,8 +407,9 @@ extension KinServiceV4 : KinServiceType { // Add memo if app index is provided if let appIndex = appIndex { let memo = try! KinBinaryMemo(typeId: KinBinaryMemo.TransferType.none.rawValue, appIdx: appIndex.value) - instructions.append( - MemoProgram.memoInsutruction(with: memo.encode().base64EncodedData()) + instructions.insert( + MemoProgram.memoInsutruction(with: memo.encode().base64EncodedData()), + at: 0 ) } diff --git a/KinBase/README.md b/KinBase/README.md index 880c21b..222574b 100644 --- a/KinBase/README.md +++ b/KinBase/README.md @@ -7,7 +7,7 @@ The KinBase module is the foundation upon which the rest of the SDK stands. ## Installation Add the following to your Podfile. ``` -pod 'KinBase', '~> 2.1.2' +pod 'KinBase', '~> 2.1.3' ``` ## Overview diff --git a/KinDesign.podspec b/KinDesign.podspec index 407d416..4ff8e24 100644 --- a/KinDesign.podspec +++ b/KinDesign.podspec @@ -3,7 +3,7 @@ # Pod::Spec.new do |s| s.name = 'KinDesign' - s.version = '2.1.2' + s.version = '2.1.3' s.summary = 'Kin Design Library for iOS' s.description = <<-DESC diff --git a/KinDesign/KinDesign.xcodeproj/project.pbxproj b/KinDesign/KinDesign.xcodeproj/project.pbxproj index b370cd5..d56c886 100644 --- a/KinDesign/KinDesign.xcodeproj/project.pbxproj +++ b/KinDesign/KinDesign.xcodeproj/project.pbxproj @@ -430,7 +430,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.2; + MARKETING_VERSION = 2.1.3; PRODUCT_BUNDLE_IDENTIFIER = org.kin..KinDesign; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -458,7 +458,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.2; + MARKETING_VERSION = 2.1.3; PRODUCT_BUNDLE_IDENTIFIER = org.kin..KinDesign; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; diff --git a/KinDesign/README.md b/KinDesign/README.md index 64a5c21..2155980 100644 --- a/KinDesign/README.md +++ b/KinDesign/README.md @@ -10,7 +10,7 @@ All of these components can be tested out and browsed in the [sample app](../Kin ## Installation Add the following to your project's Podfile. ``` -pod 'KinDesign', '~> 2.1.2' +pod 'KinDesign', '~> 2.1.3' ``` ### Primary Button diff --git a/KinSampleApp/KinSampleApp.xcodeproj/project.pbxproj b/KinSampleApp/KinSampleApp.xcodeproj/project.pbxproj index 15e023e..f3ec248 100644 --- a/KinSampleApp/KinSampleApp.xcodeproj/project.pbxproj +++ b/KinSampleApp/KinSampleApp.xcodeproj/project.pbxproj @@ -580,7 +580,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.1.2; + MARKETING_VERSION = 2.1.3; PRODUCT_BUNDLE_IDENTIFIER = org.kin..KinSampleApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -602,7 +602,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.1.2; + MARKETING_VERSION = 2.1.3; PRODUCT_BUNDLE_IDENTIFIER = org.kin..KinSampleApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; diff --git a/KinUX.podspec b/KinUX.podspec index 16aae2e..b720540 100644 --- a/KinUX.podspec +++ b/KinUX.podspec @@ -3,7 +3,7 @@ # Pod::Spec.new do |s| s.name = 'KinUX' - s.version = '2.1.2' + s.version = '2.1.3' s.summary = 'UX Library for Kin SDK iOS' s.description = <<-DESC @@ -20,8 +20,8 @@ Pod::Spec.new do |s| s.source_files = 'KinUX/KinUX/Src/**/*' - s.dependency 'KinBase', '~> 2.1.2' - s.dependency 'KinDesign', '~> 2.1.2' + s.dependency 'KinBase', '~> 2.1.3' + s.dependency 'KinDesign', '~> 2.1.3' # Dependencies needed for KinGrpcApi s.dependency 'gRPC-ProtoRPC' diff --git a/KinUX/KinUX.xcodeproj/project.pbxproj b/KinUX/KinUX.xcodeproj/project.pbxproj index c105a79..3ce09cc 100644 --- a/KinUX/KinUX.xcodeproj/project.pbxproj +++ b/KinUX/KinUX.xcodeproj/project.pbxproj @@ -589,7 +589,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.2; + MARKETING_VERSION = 2.1.3; PRODUCT_BUNDLE_IDENTIFIER = org.kin..KinUX; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -619,7 +619,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.2; + MARKETING_VERSION = 2.1.3; PRODUCT_BUNDLE_IDENTIFIER = org.kin..KinUX; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; diff --git a/KinUX/README.md b/KinUX/README.md index cd91443..afd11ae 100644 --- a/KinUX/README.md +++ b/KinUX/README.md @@ -6,7 +6,7 @@ The KinUX module provides an easy to use out of the box spend flow UI that is pr Add the following to your project's Podfile. This will also transitively pull in KinBase and KinDesign into your project as well. ``` -pod 'KinUX', '~> 2.1.2' +pod 'KinUX', '~> 2.1.3' ``` ## Overview diff --git a/README.md b/README.md index c722dd5..2714f5d 100644 --- a/README.md +++ b/README.md @@ -26,13 +26,13 @@ In your Podfile ``` // If you just want to access the blockchain & no UI -pod 'KinBase', '~> 2.1.2' +pod 'KinBase', '~> 2.1.3' // Add spend to use the modal spend flow to allow users to buy things with Kin -pod 'KinUX', '~> 2.1.2' +pod 'KinUX', '~> 2.1.3' // Add design for direct access to UI views you can use in your own app -pod 'KinDesign', '~> 2.1.2' +pod 'KinDesign', '~> 2.1.3' ``` ## Sample App