react-native-zcash 0.10.1-beta.1 → 0.10.1-beta.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - changed: iOS - Emit balance after rescan
6
+ - fixed: iOS - get UUID after starting synchronizer
7
+
5
8
  ## 0.10.0 (2025-11-18)
6
9
 
7
10
  - changed: Upgrade iOS and Android sdks to v2.4.0
@@ -0,0 +1,8 @@
1
+ {
2
+ "network": "main",
3
+ "height": "3150000",
4
+ "hash": "0000000000c66421496f3867e52025857d5df6464ca89676e97fda6319a353f6",
5
+ "time": 1764285860,
6
+ "saplingTree": "011b000970a8f021b875227791410e74b6db54cc9fe525541ee2f23843f216a254001f000001075db6cbe43ade41618d1e2aff9ec2dd86bc882566647ce620ff2f5b1664b146019b88e7333d472e4a9010d5a560bed5cff2d6e01e588a4e4c78f0c867d3fd06690001641d134f1b960b02e2a6f2a10e057fa2a902a2a2ac358fb3250793c40543f9330001e86babd3906538d1bba74eab03749fff6ecd722ac834f75572442adcb1455c0001ed3448d8e90a5865f1ec825b08fd9fed4dae70d0909eb7e9f862993a8d735d4100016309bb08d0c9cd15ee21e66c9d9c677e2f647b808168085c38690a7dbfbf536a000105c333d7b6b61b4e3be4ec79bc3c35541e2a206f23d4532060e68ff1e133326c000194ba2edf2d7ccac96720733e47705dcdf8861639357e16599e294b1b5222765c0001931c48ea50688eae5e54c24d0df7a6b00ce498f92eb5e1cfd6a2d87d8ebd5364017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
7
+ "orchardTree": "01b8ec11c61c521b754bd641aadc592bef5851e41cb7070ca27c899e26392c0b2a001f00000001ce97872e0edd27b685c06ecd8a2ba7d2028f051149a2a8c2817ff4daaa42443d0000018858d9d03a31dd41ac845dab9dec6bb15de4995daca18583ba7950843434d327019b6351708049c32438f37dabcf1b441e9f6890f50b25bdf019cb30493a4f3320000001f0c21063d3f24b9844b2d33574ac7a0c03819fc1582f7f90b0226afc93ebf7270154e024bf04f93e6e12fe87750bcda7564892237a265a4c3b7bf67cedd5ae6c0200019815cef43e802ce3e0ddb711f1df67091bb9e4f7cae55d6e2f67a51b1e2ee12700012b54af73061b31e19c35e5ab464cda2485e2c236a00b8cfebc2be9e90effd01301905ae252612cb76b216003da1312a47b95d56eeb72207dbe5a809e53032157270000017c8ece2b2ab2355d809b58809b21c7a5e95cfc693cd689387f7533ec8749261e01cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
8
+ }
package/ios/RNZcash.swift CHANGED
@@ -383,6 +383,14 @@ class RNZcash: RCTEventEmitter {
383
383
  wallet.subscribe()
384
384
  let txs = try await wallet.synchronizer.allTransactions()
385
385
  wallet.emitTxs(transactions: txs)
386
+ let balances = try await wallet.synchronizer.getAccountsBalances()
387
+ if let accountUUID = wallet.accountUUID,
388
+ let accountBalance = balances[accountUUID]
389
+ {
390
+ let data = wallet.createBalanceEventData(from: accountBalance)
391
+ wallet.emit("BalanceEvent", data)
392
+ }
393
+
386
394
  resolve(nil)
387
395
  case .failure:
388
396
  reject("RescanError", "Failed to rescan wallet", genericError)
@@ -594,6 +602,8 @@ class WalletSynchronizer: NSObject {
594
602
  }
595
603
 
596
604
  func updateProcessorState(event: SynchronizerState) {
605
+ updateBalanceState(event: event)
606
+
597
607
  var scanProgress = 0
598
608
 
599
609
  switch event.internalSyncStatus {
@@ -620,7 +630,6 @@ class WalletSynchronizer: NSObject {
620
630
  "networkBlockHeight": self.processorState.networkBlockHeight,
621
631
  ]
622
632
  emit("UpdateEvent", data)
623
- updateBalanceState(event: event)
624
633
  }
625
634
 
626
635
  func initializeProcessorState() {
@@ -630,16 +639,7 @@ class WalletSynchronizer: NSObject {
630
639
  )
631
640
  }
632
641
 
633
- func updateBalanceState(event: SynchronizerState) {
634
- guard let accountUUID = self.accountUUID else {
635
- return
636
- }
637
-
638
- // Safely check if the account exists in the balances dictionary
639
- guard let accountBalance = event.accountsBalances[accountUUID] else {
640
- return
641
- }
642
-
642
+ func createBalanceEventData(from accountBalance: AccountBalance) -> NSDictionary {
643
643
  // Account exists, safely access the balance properties
644
644
  let transparentBalance = accountBalance.unshielded
645
645
  let shieldedBalance = accountBalance.saplingBalance
@@ -654,7 +654,7 @@ class WalletSynchronizer: NSObject {
654
654
  let orchardAvailableZatoshi = orchardBalance.spendableValue
655
655
  let orchardTotalZatoshi = orchardBalance.total()
656
656
 
657
- let data: NSDictionary = [
657
+ return [
658
658
  "alias": self.alias,
659
659
  "transparentAvailableZatoshi": String(transparentAvailableZatoshi.amount),
660
660
  "transparentTotalZatoshi": String(transparentTotalZatoshi.amount),
@@ -662,7 +662,20 @@ class WalletSynchronizer: NSObject {
662
662
  "saplingTotalZatoshi": String(saplingTotalZatoshi.amount),
663
663
  "orchardAvailableZatoshi": String(orchardAvailableZatoshi.amount),
664
664
  "orchardTotalZatoshi": String(orchardTotalZatoshi.amount),
665
- ]
665
+ ] as NSDictionary
666
+ }
667
+
668
+ func updateBalanceState(event: SynchronizerState) {
669
+ guard let accountUUID = self.accountUUID else {
670
+ return
671
+ }
672
+
673
+ // Safely check if the account exists in the balances dictionary
674
+ guard let accountBalance = event.accountsBalances[accountUUID] else {
675
+ return
676
+ }
677
+
678
+ let data = createBalanceEventData(from: accountBalance)
666
679
  emit("BalanceEvent", data)
667
680
  }
668
681
 
@@ -0,0 +1,8 @@
1
+ {
2
+ "network": "main",
3
+ "height": "3150000",
4
+ "hash": "0000000000c66421496f3867e52025857d5df6464ca89676e97fda6319a353f6",
5
+ "time": 1764285860,
6
+ "saplingTree": "011b000970a8f021b875227791410e74b6db54cc9fe525541ee2f23843f216a254001f000001075db6cbe43ade41618d1e2aff9ec2dd86bc882566647ce620ff2f5b1664b146019b88e7333d472e4a9010d5a560bed5cff2d6e01e588a4e4c78f0c867d3fd06690001641d134f1b960b02e2a6f2a10e057fa2a902a2a2ac358fb3250793c40543f9330001e86babd3906538d1bba74eab03749fff6ecd722ac834f75572442adcb1455c0001ed3448d8e90a5865f1ec825b08fd9fed4dae70d0909eb7e9f862993a8d735d4100016309bb08d0c9cd15ee21e66c9d9c677e2f647b808168085c38690a7dbfbf536a000105c333d7b6b61b4e3be4ec79bc3c35541e2a206f23d4532060e68ff1e133326c000194ba2edf2d7ccac96720733e47705dcdf8861639357e16599e294b1b5222765c0001931c48ea50688eae5e54c24d0df7a6b00ce498f92eb5e1cfd6a2d87d8ebd5364017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
7
+ "orchardTree": "01b8ec11c61c521b754bd641aadc592bef5851e41cb7070ca27c899e26392c0b2a001f00000001ce97872e0edd27b685c06ecd8a2ba7d2028f051149a2a8c2817ff4daaa42443d0000018858d9d03a31dd41ac845dab9dec6bb15de4995daca18583ba7950843434d327019b6351708049c32438f37dabcf1b441e9f6890f50b25bdf019cb30493a4f3320000001f0c21063d3f24b9844b2d33574ac7a0c03819fc1582f7f90b0226afc93ebf7270154e024bf04f93e6e12fe87750bcda7564892237a265a4c3b7bf67cedd5ae6c0200019815cef43e802ce3e0ddb711f1df67091bb9e4f7cae55d6e2f67a51b1e2ee12700012b54af73061b31e19c35e5ab464cda2485e2c236a00b8cfebc2be9e90effd01301905ae252612cb76b216003da1312a47b95d56eeb72207dbe5a809e53032157270000017c8ece2b2ab2355d809b58809b21c7a5e95cfc693cd689387f7533ec8749261e01cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
8
+ }
@@ -8,32 +8,32 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>libzcashlc.a</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64</string>
11
+ <string>ios-arm64_x86_64-simulator</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>libzcashlc.a</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
+ <string>x86_64</string>
17
18
  </array>
18
19
  <key>SupportedPlatform</key>
19
20
  <string>ios</string>
21
+ <key>SupportedPlatformVariant</key>
22
+ <string>simulator</string>
20
23
  </dict>
21
24
  <dict>
22
25
  <key>BinaryPath</key>
23
26
  <string>libzcashlc.a</string>
24
27
  <key>LibraryIdentifier</key>
25
- <string>ios-arm64_x86_64-simulator</string>
28
+ <string>ios-arm64</string>
26
29
  <key>LibraryPath</key>
27
30
  <string>libzcashlc.a</string>
28
31
  <key>SupportedArchitectures</key>
29
32
  <array>
30
33
  <string>arm64</string>
31
- <string>x86_64</string>
32
34
  </array>
33
35
  <key>SupportedPlatform</key>
34
36
  <string>ios</string>
35
- <key>SupportedPlatformVariant</key>
36
- <string>simulator</string>
37
37
  </dict>
38
38
  </array>
39
39
  <key>CFBundlePackageType</key>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-zcash",
3
- "version": "0.10.1-beta.1",
3
+ "version": "0.10.1-beta.3",
4
4
  "description": "Zcash library for React Native",
5
5
  "homepage": "https://github.com/EdgeApp/react-native-zcash",
6
6
  "repository": {