react-native-zcash 0.10.1-beta.1 → 0.10.1-beta.2
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 +3 -0
- package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/3150000.json +8 -0
- package/ios/RNZcash.swift +24 -12
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3150000.json +8 -0
- package/ios/libzcashlc.xcframework/Info.plist +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -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)
|
|
@@ -630,16 +638,7 @@ class WalletSynchronizer: NSObject {
|
|
|
630
638
|
)
|
|
631
639
|
}
|
|
632
640
|
|
|
633
|
-
func
|
|
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
|
-
|
|
641
|
+
func createBalanceEventData(from accountBalance: AccountBalance) -> NSDictionary {
|
|
643
642
|
// Account exists, safely access the balance properties
|
|
644
643
|
let transparentBalance = accountBalance.unshielded
|
|
645
644
|
let shieldedBalance = accountBalance.saplingBalance
|
|
@@ -654,7 +653,7 @@ class WalletSynchronizer: NSObject {
|
|
|
654
653
|
let orchardAvailableZatoshi = orchardBalance.spendableValue
|
|
655
654
|
let orchardTotalZatoshi = orchardBalance.total()
|
|
656
655
|
|
|
657
|
-
|
|
656
|
+
return [
|
|
658
657
|
"alias": self.alias,
|
|
659
658
|
"transparentAvailableZatoshi": String(transparentAvailableZatoshi.amount),
|
|
660
659
|
"transparentTotalZatoshi": String(transparentTotalZatoshi.amount),
|
|
@@ -662,7 +661,20 @@ class WalletSynchronizer: NSObject {
|
|
|
662
661
|
"saplingTotalZatoshi": String(saplingTotalZatoshi.amount),
|
|
663
662
|
"orchardAvailableZatoshi": String(orchardAvailableZatoshi.amount),
|
|
664
663
|
"orchardTotalZatoshi": String(orchardTotalZatoshi.amount),
|
|
665
|
-
]
|
|
664
|
+
] as NSDictionary
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
func updateBalanceState(event: SynchronizerState) {
|
|
668
|
+
guard let accountUUID = self.accountUUID else {
|
|
669
|
+
return
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
// Safely check if the account exists in the balances dictionary
|
|
673
|
+
guard let accountBalance = event.accountsBalances[accountUUID] else {
|
|
674
|
+
return
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
let data = createBalanceEventData(from: accountBalance)
|
|
666
678
|
emit("BalanceEvent", data)
|
|
667
679
|
}
|
|
668
680
|
|
|
@@ -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-
|
|
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-
|
|
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>
|