react-native-zcash 0.10.1-beta.3 → 0.10.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/RNZcash.swift +2 -9
- package/package.json +1 -1
package/ios/RNZcash.swift
CHANGED
|
@@ -118,6 +118,7 @@ class RNZcash: RCTEventEmitter {
|
|
|
118
118
|
alias: alias, initializer: initializer, emitter: sendToJs)
|
|
119
119
|
let seedBytes = try Mnemonic.deterministicSeedBytes(from: seed)
|
|
120
120
|
let initMode = newWallet ? WalletInitMode.newWallet : WalletInitMode.existingWallet
|
|
121
|
+
let ufvk = try deriveUnifiedViewingKey(seed, network)
|
|
121
122
|
|
|
122
123
|
_ = try await wallet.synchronizer.prepare(
|
|
123
124
|
with: seedBytes,
|
|
@@ -128,7 +129,7 @@ class RNZcash: RCTEventEmitter {
|
|
|
128
129
|
)
|
|
129
130
|
try await wallet.synchronizer.start()
|
|
130
131
|
let accounts = try await wallet.synchronizer.listAccounts()
|
|
131
|
-
let accountUUID = accounts.first(where: { $0.
|
|
132
|
+
let accountUUID = accounts.first(where: { $0.ufvk == ufvk })?.id
|
|
132
133
|
wallet.accountUUID = accountUUID
|
|
133
134
|
wallet.subscribe()
|
|
134
135
|
await synchronizerStore.set(wallet, for: alias)
|
|
@@ -733,14 +734,6 @@ class WalletSynchronizer: NSObject {
|
|
|
733
734
|
}
|
|
734
735
|
}
|
|
735
736
|
|
|
736
|
-
extension AccountUUID {
|
|
737
|
-
static func fromAlias(_ alias: String) -> AccountUUID {
|
|
738
|
-
let bytes = Array(alias.utf8)
|
|
739
|
-
let folded = foldTo16Bytes(bytes)
|
|
740
|
-
return AccountUUID(id: folded)
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
|
|
744
737
|
func foldTo16Bytes(_ bytes: [UInt8]) -> [UInt8] {
|
|
745
738
|
var out = [UInt8](repeating: 0, count: 16)
|
|
746
739
|
for (i, b) in bytes.enumerated() {
|