react-native-zcash 0.9.9 → 0.9.11

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
@@ -1,5 +1,15 @@
1
1
  # React Native Zcash
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 0.9.11 (2025-09-09)
6
+
7
+ - changed: Updated checkpoints
8
+
9
+ ## 0.9.10 (2025-08-13)
10
+
11
+ - fixed: Make the `initialize` return type compatible with RN79.
12
+
3
13
  ## 0.9.9 (2025-08-04)
4
14
 
5
15
  - changed: Updated checkpoints to block 3010000
@@ -0,0 +1,8 @@
1
+ {
2
+ "network": "main",
3
+ "height": "3020000",
4
+ "hash": "000000000037c640e2f5b446baea21d482741d8188c485be4de4b172f3cb77c1",
5
+ "time": 1754490535,
6
+ "saplingTree": "01cbd7cbe98c0e563421e96128f691cb4d6880fe06520afcdaf543fe04d83ea233015ac0609529bd81bab7273dbf2554b7a263dc39a5f8e482bfdb48ff72ad474c1d1f000184e8f5016442ebd92a619aaafb61531b4eaae8ac43fac2a3d6fc8d32ea684e20000001fd2f218bac5268e20b12e317676bea951d98c1c617ffb2fcff5d25b374b4a7540169eeef5960d7caf9428223c31e868e1a3987b4dbf39a018fd070851f38e47c6a0000012dffe7e51571d1b384afb3bbcb032259b323e0e84250c4fd25e0146692e46f6600011be7ad49955589016a54e73247f31222010b0bb411c96c5e76d31ce092957d2a0001bbc535c7b4ed77ea8e03b934e58822617cfc2513d04625646f1a1eb0f3c0aa2801dfe644736b1489455cf10c8f7915c9fc9aca07091239d50571ff21c6b907986b01060af6a6c1415a6eaf780073ffa3d0ab35af7bb391bccc4e6ea65a1230dad83001ab58f1ebb2860e257c50350a3e1b54778b7729bdd11eacaa9213c4b5f4dbb44c00017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
7
+ "orchardTree": "016977c99948d91a13c7c94d3a9e91666295f1d9ae35e858e23048cb6f01590c2a012c426e689984059d9528c9d2db9b015c904d8221adfc5417ce2b9022c8ea15051f01ad93f51f05e75ab786825638b4763d797d74b60c440d98285099142a733d392401562fe3b688cc0160a80c1227080b22d8713ad1f79c5d6eeb0b0731e77c1dca120001ba474db97689fbd81edf3081b36cc4d0f06e49e248f766a8a675e5ca82bd893a016276f00b93030a12bd87d0a0e137334e1458ef02004c7b232eae5c046b6b1d3e01a1f3574445e06c528d3f893301c093b0f58e735b041e595f08938342751e150101dbb01b83be7808423222c9f0a1fdf7212ab21ee700e02d77337c36653180510d000115aa047a01e96d303bef41901a62932451dd250beeb8f777632f1e17b1caac1700013f1050c048a796abfd1ed6def0a481d5274a30b8bf491ab9c668d7e82d70671b00000000000152dad142de8d870d83b688618b7660e049741aa143a78440c722296a17ca550a012d113bc8f6a4f41b3963cfa0717176c2d31ce7bfae4d250a1fff5e061dd9d3250160040850b766b126a2b4843fcdfdffa5d5cab3f53bc860a3bef68958b5f066170001cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "network": "main",
3
+ "height": "3030000",
4
+ "hash": "00000000013d81ab7196500fdf8c5fa45133b9f2b644e5c872ac9abe1e2a1217",
5
+ "time": 1755245049,
6
+ "saplingTree": "017a325851bd6171b52671c398666434b49cacdde93c8f3bb0560173d6f23e515001f2e4a4048db52fc80b929d3803ab83ce6f0befeac814a73b71396fa50c8047041f0123819ab8a00292fe82d54cb289eda272f7492d2783d5109228dda2f98228c2540001ad61deff1a000288feb43f90a4e74bff87c388606d3c8588302e6a2a49a4116b00011443ffb8d6be6afdfea81f1ad86ccad717c388f224b060805c74798ebe6e7f20014ca413d59407e74b85e513c6bf8d85102837052ead9319d8d0c29fc9da8eac2101072ee88f1c297e3d1ae5ab79d0cbc1071fb9697fabcaef76580c9b365b15e4100000014f31dd106cd32fcd5efb4a677240452e55965c31995633367de8f27cd643d0020001f6d2681946539bde3dc800942aafc5396c3c2549acbe8c1d2cc236f94c4aec5701bbc535c7b4ed77ea8e03b934e58822617cfc2513d04625646f1a1eb0f3c0aa2801dfe644736b1489455cf10c8f7915c9fc9aca07091239d50571ff21c6b907986b01060af6a6c1415a6eaf780073ffa3d0ab35af7bb391bccc4e6ea65a1230dad83001ab58f1ebb2860e257c50350a3e1b54778b7729bdd11eacaa9213c4b5f4dbb44c00017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
7
+ "orchardTree": "016c10ed2f2d45d70e9b82088f3c3265b2c11a261955b7d58a829c477d30e5d425019a7384cfe16599878230bcee0a69b72a8fc7e58ad79bfd4a34c542df8cc2871a1f0001916edf6c306cced67ad58ee27d2160cf15bc5016efd5bdcda34074c351f3b13f0001c2fe30e8e2c1563cddc03e7ab4604823160cadafc5fd810644fa4d8b63837a2a017ed0cc6167f2c8d85aacbbd59a49f13e7416b3c29a5f38f0d9977c665b48ab2801feea3aa081fb02af930d5575a729102464a709705aeda0f18a783b0fd3ffad0e000000012fd91ec708131351d33a2d9555341facbc8ea40070dbf709a9bbd0e1e03980170101b25392b3e223535c40a0b3f892d6854b6dd74e64d90e93acd301fd125cb40e01a8221d74913c79973aa39ec57944c158aeddf3223dbffaafa5a4415c36f5493001b95d671c4c0df0beae74f812929b1e2329d1ab951658a8a4622081e6d4011f220000000152dad142de8d870d83b688618b7660e049741aa143a78440c722296a17ca550a012d113bc8f6a4f41b3963cfa0717176c2d31ce7bfae4d250a1fff5e061dd9d3250160040850b766b126a2b4843fcdfdffa5d5cab3f53bc860a3bef68958b5f066170001cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "network": "main",
3
+ "height": "3040000",
4
+ "hash": "000000000142026daa34142861c0be6adf4175137d34c556e80c59ef37b62fc0",
5
+ "time": 1755998504,
6
+ "saplingTree": "01f9b9a8242a34846b7700c7d3734f7fad13894ebbc8983921c9b84366b43d804c001f01dc9e6fdb2841b3003679d4d1fa3c93ae58a757b0cfa1267ced512264c081026301a7b92aa7a150cd369ec37d218a8853d8af7ea9fbdc697eeb70430790d331882200014d3e025a67177138664aed48f693c30c5b7396006ee1faf601c7807ab0f5d34f000001c7722c943118483d8e7f5277ed38d1fa99c310eddebaf57baabba5b8b10ab05f01932181b09fb094fcf41269a8b931a2ef869b9da87a7d11c0cde80979ecc6df4a000000000000000001931c48ea50688eae5e54c24d0df7a6b00ce498f92eb5e1cfd6a2d87d8ebd5364017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
7
+ "orchardTree": "01893c211c7b1e82d036d85f8883b5262d8053a57d5411fe2f6293a01b4f01e0160145ae1aad5e5c6b5007fe5fa2770255c3460bc73071cd5f60fd1b53dc126d42281f00000001aee9f51317bf7801999123e841e9e6a5749d302e4782075234d3a363979413020000000000015884d12f5e1fa9fca0ca9a7ac5eee1c1a13570af2835d5586c56d0b3d27a8a350000000001a99f7e098a8fbdc10145a30733d59c22c04f9704cc847a95dcc7bb7aaf8b2e07000152dad142de8d870d83b688618b7660e049741aa143a78440c722296a17ca550a012d113bc8f6a4f41b3963cfa0717176c2d31ce7bfae4d250a1fff5e061dd9d3250160040850b766b126a2b4843fcdfdffa5d5cab3f53bc860a3bef68958b5f066170001cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "network": "main",
3
+ "height": "3050000",
4
+ "hash": "000000000068040466332dd37a0b1b00778880504017d4a5cc5cf4b94c082dd7",
5
+ "time": 1756750935,
6
+ "saplingTree": "01b12b3edecdefc8e21410cd5a137c8f5ccb3cdac0c6bcf96c5f2d22b6b9be99230122a97a066230f133194ac6f341b03dfca1061e9d43f430ff3c3eb40de86ad3511f01212cb1f246abdccd30acd226669d0a73cd19a760904f4e4931c0db4ceb072729014315614eae7c77978b412afb3088688ecbed9fa5ed1d74357db395f404efcc4501c50bdf1d9b3271129bc91239fb0e97a9c6aa972057d7b19e5af78c1216f5cd0900012d772b872324fd3672f67c15839b0fd2f3538ecd255d153f9fe3b82f7a7c27720001205869d22155d590c132da6be69dc49177fc47053196bd52630321b20a28bd2f0000017f13e79f872cb9b40b5c8184713cc761221e583a027cc1eb023bbfba7a03294e01cf65104076f65dd1779c47086e7cd0d4d818d2d3ce7a0ac7d454a76cf73fb453000000000001931c48ea50688eae5e54c24d0df7a6b00ce498f92eb5e1cfd6a2d87d8ebd5364017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
7
+ "orchardTree": "010d758a7f40b555b2ce70f7c2dba008c750480b52c401ffe7b020829d03cb633001f7dfa650faaf82881077d15c1c4e63ccc372f443415f2c0e41db8cefdabe533a1f016511b348f17888fe8779f7c436c938fb6d0d9f3d0b4ca7aec50bbb8e42eb40290178dce1f2a1458f1cf8d5781c5935ed3efa5ae1c2c836e132b02e95a35a429a2401b074c7ec71667066d961638f707d259fb8c91f96ea6793de85854240613b8a11019e1fe097ec717cb9c21efba9dd1a3c2f6ba18c5473b1a233745bfb3e97e663220000016eaab385e9440c2123355a1e166bf2b25c586925f37e33c0ced9312de0597f2401cd9a59bc93cc81d016068df04083c657a241b4370d6774310510c26eacc3cf29000000000001a4286999b62e6df4a6c8315acb76e30ed242a52d97598fc20adeb87475f6e72e01a99f7e098a8fbdc10145a30733d59c22c04f9704cc847a95dcc7bb7aaf8b2e07000152dad142de8d870d83b688618b7660e049741aa143a78440c722296a17ca550a012d113bc8f6a4f41b3963cfa0717176c2d31ce7bfae4d250a1fff5e061dd9d3250160040850b766b126a2b4843fcdfdffa5d5cab3f53bc860a3bef68958b5f066170001cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
8
+ }
@@ -22,8 +22,9 @@ import kotlinx.coroutines.flow.*
22
22
  import kotlinx.coroutines.launch
23
23
  import java.util.Base64
24
24
 
25
- class RNZcashModule(private val reactContext: ReactApplicationContext) :
26
- ReactContextBaseJavaModule(reactContext) {
25
+ class RNZcashModule(
26
+ private val reactContext: ReactApplicationContext,
27
+ ) : ReactContextBaseJavaModule(reactContext) {
27
28
  /**
28
29
  * Scope for anything that out-lives the synchronizer, meaning anything that can be used before
29
30
  * the synchronizer starts or after it stops. Everything else falls within the scope of the
@@ -46,135 +47,139 @@ class RNZcashModule(private val reactContext: ReactApplicationContext) :
46
47
  defaultPort: Int = 9067,
47
48
  newWallet: Boolean,
48
49
  promise: Promise,
49
- ) = moduleScope.launch {
50
- promise.wrap {
51
- val network = networks.getOrDefault(networkName, ZcashNetwork.Mainnet)
52
- val endpoint = LightWalletEndpoint(defaultHost, defaultPort, true)
53
- val seedPhrase = SeedPhrase.new(seed)
54
- val initMode = if (newWallet) WalletInitMode.NewWallet else WalletInitMode.ExistingWallet
55
- if (!synchronizerMap.containsKey(alias)) {
56
- synchronizerMap[alias] =
57
- Synchronizer.new(
58
- reactApplicationContext,
59
- network,
60
- alias,
61
- endpoint,
62
- seedPhrase.toByteArray(),
63
- BlockHeight.new(birthdayHeight.toLong()),
64
- initMode,
65
- ) as SdkSynchronizer
66
- }
67
- val wallet = getWallet(alias)
68
- val scope = wallet.coroutineScope
69
- combine(wallet.progress, wallet.networkHeight) { progress, networkHeight ->
70
- return@combine mapOf("progress" to progress, "networkHeight" to networkHeight)
71
- }.collectWith(scope) { map ->
72
- val progress = map["progress"] as PercentDecimal
73
- var networkBlockHeight = map["networkHeight"] as BlockHeight?
74
- if (networkBlockHeight == null) networkBlockHeight = BlockHeight.new(birthdayHeight.toLong())
75
-
76
- sendEvent("UpdateEvent") { args ->
77
- args.putString("alias", alias)
78
- args.putInt(
79
- "scanProgress",
80
- progress.toPercentage(),
81
- )
82
- args.putInt("networkBlockHeight", networkBlockHeight.value.toInt())
50
+ ) {
51
+ moduleScope.launch {
52
+ promise.wrap {
53
+ val network = networks.getOrDefault(networkName, ZcashNetwork.Mainnet)
54
+ val endpoint = LightWalletEndpoint(defaultHost, defaultPort, true)
55
+ val seedPhrase = SeedPhrase.new(seed)
56
+ val initMode = if (newWallet) WalletInitMode.NewWallet else WalletInitMode.ExistingWallet
57
+ if (!synchronizerMap.containsKey(alias)) {
58
+ synchronizerMap[alias] =
59
+ Synchronizer.new(
60
+ reactApplicationContext,
61
+ network,
62
+ alias,
63
+ endpoint,
64
+ seedPhrase.toByteArray(),
65
+ BlockHeight.new(birthdayHeight.toLong()),
66
+ initMode,
67
+ ) as SdkSynchronizer
83
68
  }
84
- }
85
- wallet.status.collectWith(scope) { status ->
86
- sendEvent("StatusEvent") { args ->
87
- args.putString("alias", alias)
88
- args.putString("name", status.toString())
69
+ val wallet = getWallet(alias)
70
+ val scope = wallet.coroutineScope
71
+ combine(wallet.progress, wallet.networkHeight) { progress, networkHeight ->
72
+ return@combine mapOf("progress" to progress, "networkHeight" to networkHeight)
73
+ }.collectWith(scope) { map ->
74
+ val progress = map["progress"] as PercentDecimal
75
+ var networkBlockHeight = map["networkHeight"] as BlockHeight?
76
+ if (networkBlockHeight == null) networkBlockHeight = BlockHeight.new(birthdayHeight.toLong())
77
+
78
+ sendEvent("UpdateEvent") { args ->
79
+ args.putString("alias", alias)
80
+ args.putInt(
81
+ "scanProgress",
82
+ progress.toPercentage(),
83
+ )
84
+ args.putInt("networkBlockHeight", networkBlockHeight.value.toInt())
85
+ }
89
86
  }
90
- }
91
- wallet.transactions.collectWith(scope) { txList ->
92
- scope.launch {
93
- val nativeArray = Arguments.createArray()
94
- txList.filter { tx -> tx.transactionState != TransactionState.Expired }.map { tx ->
95
- launch {
96
- val parsedTx = parseTx(wallet, tx)
97
- nativeArray.pushMap(parsedTx)
87
+ wallet.status.collectWith(scope) { status ->
88
+ sendEvent("StatusEvent") { args ->
89
+ args.putString("alias", alias)
90
+ args.putString("name", status.toString())
91
+ }
92
+ }
93
+ wallet.transactions.collectWith(scope) { txList ->
94
+ scope.launch {
95
+ val nativeArray = Arguments.createArray()
96
+ txList
97
+ .filter { tx -> tx.transactionState != TransactionState.Expired }
98
+ .map { tx ->
99
+ launch {
100
+ val parsedTx = parseTx(wallet, tx)
101
+ nativeArray.pushMap(parsedTx)
102
+ }
103
+ }.forEach { it.join() }
104
+
105
+ sendEvent("TransactionEvent") { args ->
106
+ args.putString("alias", alias)
107
+ args.putArray(
108
+ "transactions",
109
+ nativeArray,
110
+ )
98
111
  }
99
- }.forEach { it.join() }
112
+ }
113
+ }
114
+ combine(
115
+ wallet.transparentBalance,
116
+ wallet.saplingBalances,
117
+ wallet.orchardBalances,
118
+ ) { transparentBalance: Zatoshi?, saplingBalances: WalletBalance?, orchardBalances: WalletBalance? ->
119
+ return@combine Balances(
120
+ transparentBalance = transparentBalance,
121
+ saplingBalances = saplingBalances,
122
+ orchardBalances = orchardBalances,
123
+ )
124
+ }.collectWith(scope) { map ->
125
+ val transparentBalance = map.transparentBalance
126
+ val saplingBalances = map.saplingBalances
127
+ val orchardBalances = map.orchardBalances
128
+
129
+ val transparentAvailableZatoshi = transparentBalance ?: Zatoshi(0L)
130
+ val transparentTotalZatoshi = transparentBalance ?: Zatoshi(0L)
100
131
 
101
- sendEvent("TransactionEvent") { args ->
132
+ val saplingAvailableZatoshi = saplingBalances?.available ?: Zatoshi(0L)
133
+ val saplingTotalZatoshi = saplingBalances?.total ?: Zatoshi(0L)
134
+
135
+ val orchardAvailableZatoshi = orchardBalances?.available ?: Zatoshi(0L)
136
+ val orchardTotalZatoshi = orchardBalances?.total ?: Zatoshi(0L)
137
+
138
+ sendEvent("BalanceEvent") { args ->
102
139
  args.putString("alias", alias)
103
- args.putArray(
104
- "transactions",
105
- nativeArray,
106
- )
140
+ args.putString("transparentAvailableZatoshi", transparentAvailableZatoshi.value.toString())
141
+ args.putString("transparentTotalZatoshi", transparentTotalZatoshi.value.toString())
142
+ args.putString("saplingAvailableZatoshi", saplingAvailableZatoshi.value.toString())
143
+ args.putString("saplingTotalZatoshi", saplingTotalZatoshi.value.toString())
144
+ args.putString("orchardAvailableZatoshi", orchardAvailableZatoshi.value.toString())
145
+ args.putString("orchardTotalZatoshi", orchardTotalZatoshi.value.toString())
107
146
  }
108
147
  }
109
- }
110
- combine(
111
- wallet.transparentBalance,
112
- wallet.saplingBalances,
113
- wallet.orchardBalances,
114
- ) { transparentBalance: Zatoshi?, saplingBalances: WalletBalance?, orchardBalances: WalletBalance? ->
115
- return@combine Balances(
116
- transparentBalance = transparentBalance,
117
- saplingBalances = saplingBalances,
118
- orchardBalances = orchardBalances,
119
- )
120
- }.collectWith(scope) { map ->
121
- val transparentBalance = map.transparentBalance
122
- val saplingBalances = map.saplingBalances
123
- val orchardBalances = map.orchardBalances
124
-
125
- val transparentAvailableZatoshi = transparentBalance ?: Zatoshi(0L)
126
- val transparentTotalZatoshi = transparentBalance ?: Zatoshi(0L)
127
-
128
- val saplingAvailableZatoshi = saplingBalances?.available ?: Zatoshi(0L)
129
- val saplingTotalZatoshi = saplingBalances?.total ?: Zatoshi(0L)
130
-
131
- val orchardAvailableZatoshi = orchardBalances?.available ?: Zatoshi(0L)
132
- val orchardTotalZatoshi = orchardBalances?.total ?: Zatoshi(0L)
133
-
134
- sendEvent("BalanceEvent") { args ->
135
- args.putString("alias", alias)
136
- args.putString("transparentAvailableZatoshi", transparentAvailableZatoshi.value.toString())
137
- args.putString("transparentTotalZatoshi", transparentTotalZatoshi.value.toString())
138
- args.putString("saplingAvailableZatoshi", saplingAvailableZatoshi.value.toString())
139
- args.putString("saplingTotalZatoshi", saplingTotalZatoshi.value.toString())
140
- args.putString("orchardAvailableZatoshi", orchardAvailableZatoshi.value.toString())
141
- args.putString("orchardTotalZatoshi", orchardTotalZatoshi.value.toString())
142
- }
143
- }
144
148
 
145
- fun handleError(
146
- level: String,
147
- error: Throwable?,
148
- ) {
149
- sendEvent("ErrorEvent") { args ->
150
- args.putString("alias", alias)
151
- args.putString("level", level)
152
- args.putString("message", error?.message ?: "Unknown error")
149
+ fun handleError(
150
+ level: String,
151
+ error: Throwable?,
152
+ ) {
153
+ sendEvent("ErrorEvent") { args ->
154
+ args.putString("alias", alias)
155
+ args.putString("level", level)
156
+ args.putString("message", error?.message ?: "Unknown error")
157
+ }
153
158
  }
154
- }
155
159
 
156
- // Error listeners
157
- wallet.onCriticalErrorHandler = { error ->
158
- handleError("critical", error)
159
- false
160
- }
161
- wallet.onProcessorErrorHandler = { error ->
162
- handleError("error", error)
163
- true
164
- }
165
- wallet.onSetupErrorHandler = { error ->
166
- handleError("error", error)
167
- false
168
- }
169
- wallet.onSubmissionErrorHandler = { error ->
170
- handleError("error", error)
171
- false
172
- }
173
- wallet.onChainErrorHandler = { errorHeight, rewindHeight ->
174
- val message = "Chain error detected at height: $errorHeight. Rewinding to: $rewindHeight"
175
- handleError("error", Throwable(message))
160
+ // Error listeners
161
+ wallet.onCriticalErrorHandler = { error ->
162
+ handleError("critical", error)
163
+ false
164
+ }
165
+ wallet.onProcessorErrorHandler = { error ->
166
+ handleError("error", error)
167
+ true
168
+ }
169
+ wallet.onSetupErrorHandler = { error ->
170
+ handleError("error", error)
171
+ false
172
+ }
173
+ wallet.onSubmissionErrorHandler = { error ->
174
+ handleError("error", error)
175
+ false
176
+ }
177
+ wallet.onChainErrorHandler = { errorHeight, rewindHeight ->
178
+ val message = "Chain error detected at height: $errorHeight. Rewinding to: $rewindHeight"
179
+ handleError("error", Throwable(message))
180
+ }
181
+ return@wrap null
176
182
  }
177
- return@wrap null
178
183
  }
179
184
  }
180
185
 
@@ -349,9 +354,10 @@ class RNZcashModule(private val reactContext: ReactApplicationContext) :
349
354
  val proposal = Proposal.fromByteArray(proposalByteArray)
350
355
 
351
356
  val txs =
352
- wallet.coroutineScope.async {
353
- wallet.createProposedTransactions(proposal, usk).take(proposal.transactionCount()).toList()
354
- }.await()
357
+ wallet.coroutineScope
358
+ .async {
359
+ wallet.createProposedTransactions(proposal, usk).take(proposal.transactionCount()).toList()
360
+ }.await()
355
361
  val txid = txs[txs.lastIndex].txIdString() // The last transfer is the most relevant to the user
356
362
  promise.resolve(txid)
357
363
  } catch (t: Throwable) {
@@ -445,9 +451,7 @@ class RNZcashModule(private val reactContext: ReactApplicationContext) :
445
451
  /**
446
452
  * Retrieve wallet object from synchronizer map
447
453
  */
448
- private fun getWallet(alias: String): SdkSynchronizer {
449
- return synchronizerMap[alias] ?: throw Exception("Wallet not found")
450
- }
454
+ private fun getWallet(alias: String): SdkSynchronizer = synchronizerMap[alias] ?: throw Exception("Wallet not found")
451
455
 
452
456
  /**
453
457
  * Wrap the given block of logic in a promise, rejecting for any error.
@@ -0,0 +1,8 @@
1
+ {
2
+ "network": "main",
3
+ "height": "3020000",
4
+ "hash": "000000000037c640e2f5b446baea21d482741d8188c485be4de4b172f3cb77c1",
5
+ "time": 1754490535,
6
+ "saplingTree": "01cbd7cbe98c0e563421e96128f691cb4d6880fe06520afcdaf543fe04d83ea233015ac0609529bd81bab7273dbf2554b7a263dc39a5f8e482bfdb48ff72ad474c1d1f000184e8f5016442ebd92a619aaafb61531b4eaae8ac43fac2a3d6fc8d32ea684e20000001fd2f218bac5268e20b12e317676bea951d98c1c617ffb2fcff5d25b374b4a7540169eeef5960d7caf9428223c31e868e1a3987b4dbf39a018fd070851f38e47c6a0000012dffe7e51571d1b384afb3bbcb032259b323e0e84250c4fd25e0146692e46f6600011be7ad49955589016a54e73247f31222010b0bb411c96c5e76d31ce092957d2a0001bbc535c7b4ed77ea8e03b934e58822617cfc2513d04625646f1a1eb0f3c0aa2801dfe644736b1489455cf10c8f7915c9fc9aca07091239d50571ff21c6b907986b01060af6a6c1415a6eaf780073ffa3d0ab35af7bb391bccc4e6ea65a1230dad83001ab58f1ebb2860e257c50350a3e1b54778b7729bdd11eacaa9213c4b5f4dbb44c00017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
7
+ "orchardTree": "016977c99948d91a13c7c94d3a9e91666295f1d9ae35e858e23048cb6f01590c2a012c426e689984059d9528c9d2db9b015c904d8221adfc5417ce2b9022c8ea15051f01ad93f51f05e75ab786825638b4763d797d74b60c440d98285099142a733d392401562fe3b688cc0160a80c1227080b22d8713ad1f79c5d6eeb0b0731e77c1dca120001ba474db97689fbd81edf3081b36cc4d0f06e49e248f766a8a675e5ca82bd893a016276f00b93030a12bd87d0a0e137334e1458ef02004c7b232eae5c046b6b1d3e01a1f3574445e06c528d3f893301c093b0f58e735b041e595f08938342751e150101dbb01b83be7808423222c9f0a1fdf7212ab21ee700e02d77337c36653180510d000115aa047a01e96d303bef41901a62932451dd250beeb8f777632f1e17b1caac1700013f1050c048a796abfd1ed6def0a481d5274a30b8bf491ab9c668d7e82d70671b00000000000152dad142de8d870d83b688618b7660e049741aa143a78440c722296a17ca550a012d113bc8f6a4f41b3963cfa0717176c2d31ce7bfae4d250a1fff5e061dd9d3250160040850b766b126a2b4843fcdfdffa5d5cab3f53bc860a3bef68958b5f066170001cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "network": "main",
3
+ "height": "3030000",
4
+ "hash": "00000000013d81ab7196500fdf8c5fa45133b9f2b644e5c872ac9abe1e2a1217",
5
+ "time": 1755245049,
6
+ "saplingTree": "017a325851bd6171b52671c398666434b49cacdde93c8f3bb0560173d6f23e515001f2e4a4048db52fc80b929d3803ab83ce6f0befeac814a73b71396fa50c8047041f0123819ab8a00292fe82d54cb289eda272f7492d2783d5109228dda2f98228c2540001ad61deff1a000288feb43f90a4e74bff87c388606d3c8588302e6a2a49a4116b00011443ffb8d6be6afdfea81f1ad86ccad717c388f224b060805c74798ebe6e7f20014ca413d59407e74b85e513c6bf8d85102837052ead9319d8d0c29fc9da8eac2101072ee88f1c297e3d1ae5ab79d0cbc1071fb9697fabcaef76580c9b365b15e4100000014f31dd106cd32fcd5efb4a677240452e55965c31995633367de8f27cd643d0020001f6d2681946539bde3dc800942aafc5396c3c2549acbe8c1d2cc236f94c4aec5701bbc535c7b4ed77ea8e03b934e58822617cfc2513d04625646f1a1eb0f3c0aa2801dfe644736b1489455cf10c8f7915c9fc9aca07091239d50571ff21c6b907986b01060af6a6c1415a6eaf780073ffa3d0ab35af7bb391bccc4e6ea65a1230dad83001ab58f1ebb2860e257c50350a3e1b54778b7729bdd11eacaa9213c4b5f4dbb44c00017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
7
+ "orchardTree": "016c10ed2f2d45d70e9b82088f3c3265b2c11a261955b7d58a829c477d30e5d425019a7384cfe16599878230bcee0a69b72a8fc7e58ad79bfd4a34c542df8cc2871a1f0001916edf6c306cced67ad58ee27d2160cf15bc5016efd5bdcda34074c351f3b13f0001c2fe30e8e2c1563cddc03e7ab4604823160cadafc5fd810644fa4d8b63837a2a017ed0cc6167f2c8d85aacbbd59a49f13e7416b3c29a5f38f0d9977c665b48ab2801feea3aa081fb02af930d5575a729102464a709705aeda0f18a783b0fd3ffad0e000000012fd91ec708131351d33a2d9555341facbc8ea40070dbf709a9bbd0e1e03980170101b25392b3e223535c40a0b3f892d6854b6dd74e64d90e93acd301fd125cb40e01a8221d74913c79973aa39ec57944c158aeddf3223dbffaafa5a4415c36f5493001b95d671c4c0df0beae74f812929b1e2329d1ab951658a8a4622081e6d4011f220000000152dad142de8d870d83b688618b7660e049741aa143a78440c722296a17ca550a012d113bc8f6a4f41b3963cfa0717176c2d31ce7bfae4d250a1fff5e061dd9d3250160040850b766b126a2b4843fcdfdffa5d5cab3f53bc860a3bef68958b5f066170001cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "network": "main",
3
+ "height": "3040000",
4
+ "hash": "000000000142026daa34142861c0be6adf4175137d34c556e80c59ef37b62fc0",
5
+ "time": 1755998504,
6
+ "saplingTree": "01f9b9a8242a34846b7700c7d3734f7fad13894ebbc8983921c9b84366b43d804c001f01dc9e6fdb2841b3003679d4d1fa3c93ae58a757b0cfa1267ced512264c081026301a7b92aa7a150cd369ec37d218a8853d8af7ea9fbdc697eeb70430790d331882200014d3e025a67177138664aed48f693c30c5b7396006ee1faf601c7807ab0f5d34f000001c7722c943118483d8e7f5277ed38d1fa99c310eddebaf57baabba5b8b10ab05f01932181b09fb094fcf41269a8b931a2ef869b9da87a7d11c0cde80979ecc6df4a000000000000000001931c48ea50688eae5e54c24d0df7a6b00ce498f92eb5e1cfd6a2d87d8ebd5364017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
7
+ "orchardTree": "01893c211c7b1e82d036d85f8883b5262d8053a57d5411fe2f6293a01b4f01e0160145ae1aad5e5c6b5007fe5fa2770255c3460bc73071cd5f60fd1b53dc126d42281f00000001aee9f51317bf7801999123e841e9e6a5749d302e4782075234d3a363979413020000000000015884d12f5e1fa9fca0ca9a7ac5eee1c1a13570af2835d5586c56d0b3d27a8a350000000001a99f7e098a8fbdc10145a30733d59c22c04f9704cc847a95dcc7bb7aaf8b2e07000152dad142de8d870d83b688618b7660e049741aa143a78440c722296a17ca550a012d113bc8f6a4f41b3963cfa0717176c2d31ce7bfae4d250a1fff5e061dd9d3250160040850b766b126a2b4843fcdfdffa5d5cab3f53bc860a3bef68958b5f066170001cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "network": "main",
3
+ "height": "3050000",
4
+ "hash": "000000000068040466332dd37a0b1b00778880504017d4a5cc5cf4b94c082dd7",
5
+ "time": 1756750935,
6
+ "saplingTree": "01b12b3edecdefc8e21410cd5a137c8f5ccb3cdac0c6bcf96c5f2d22b6b9be99230122a97a066230f133194ac6f341b03dfca1061e9d43f430ff3c3eb40de86ad3511f01212cb1f246abdccd30acd226669d0a73cd19a760904f4e4931c0db4ceb072729014315614eae7c77978b412afb3088688ecbed9fa5ed1d74357db395f404efcc4501c50bdf1d9b3271129bc91239fb0e97a9c6aa972057d7b19e5af78c1216f5cd0900012d772b872324fd3672f67c15839b0fd2f3538ecd255d153f9fe3b82f7a7c27720001205869d22155d590c132da6be69dc49177fc47053196bd52630321b20a28bd2f0000017f13e79f872cb9b40b5c8184713cc761221e583a027cc1eb023bbfba7a03294e01cf65104076f65dd1779c47086e7cd0d4d818d2d3ce7a0ac7d454a76cf73fb453000000000001931c48ea50688eae5e54c24d0df7a6b00ce498f92eb5e1cfd6a2d87d8ebd5364017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
7
+ "orchardTree": "010d758a7f40b555b2ce70f7c2dba008c750480b52c401ffe7b020829d03cb633001f7dfa650faaf82881077d15c1c4e63ccc372f443415f2c0e41db8cefdabe533a1f016511b348f17888fe8779f7c436c938fb6d0d9f3d0b4ca7aec50bbb8e42eb40290178dce1f2a1458f1cf8d5781c5935ed3efa5ae1c2c836e132b02e95a35a429a2401b074c7ec71667066d961638f707d259fb8c91f96ea6793de85854240613b8a11019e1fe097ec717cb9c21efba9dd1a3c2f6ba18c5473b1a233745bfb3e97e663220000016eaab385e9440c2123355a1e166bf2b25c586925f37e33c0ced9312de0597f2401cd9a59bc93cc81d016068df04083c657a241b4370d6774310510c26eacc3cf29000000000001a4286999b62e6df4a6c8315acb76e30ed242a52d97598fc20adeb87475f6e72e01a99f7e098a8fbdc10145a30733d59c22c04f9704cc847a95dcc7bb7aaf8b2e07000152dad142de8d870d83b688618b7660e049741aa143a78440c722296a17ca550a012d113bc8f6a4f41b3963cfa0717176c2d31ce7bfae4d250a1fff5e061dd9d3250160040850b766b126a2b4843fcdfdffa5d5cab3f53bc860a3bef68958b5f066170001cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
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.9.9",
3
+ "version": "0.9.11",
4
4
  "description": "Zcash library for React Native",
5
5
  "homepage": "https://github.com/EdgeApp/react-native-zcash",
6
6
  "repository": {