react-native-zcash 0.6.14 → 0.7.0

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.
Files changed (163) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/android/build.gradle +4 -4
  3. package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/2470000.json +8 -0
  4. package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/2480000.json +8 -0
  5. package/android/src/main/java/app/edge/rnzcash/RNZcashModule.kt +51 -9
  6. package/ios/RNZcash.m +8 -0
  7. package/ios/RNZcash.swift +66 -16
  8. package/ios/ZCashLightClientKit/Block/Actions/DownloadAction.swift +1 -1
  9. package/ios/ZCashLightClientKit/Block/Actions/EnhanceAction.swift +3 -1
  10. package/ios/ZCashLightClientKit/Block/Actions/FetchUTXOsAction.swift +1 -1
  11. package/ios/ZCashLightClientKit/Block/Actions/ProcessSuggestedScanRangesAction.swift +11 -2
  12. package/ios/ZCashLightClientKit/Block/Actions/RewindAction.swift +2 -2
  13. package/ios/ZCashLightClientKit/Block/Actions/ScanAction.swift +28 -11
  14. package/ios/ZCashLightClientKit/Block/Actions/UpdateChainTipAction.swift +4 -4
  15. package/ios/ZCashLightClientKit/Block/Actions/UpdateSubtreeRootsAction.swift +36 -7
  16. package/ios/ZCashLightClientKit/Block/Actions/ValidateServerAction.swift +1 -1
  17. package/ios/ZCashLightClientKit/Block/CompactBlockProcessor.swift +93 -51
  18. package/ios/ZCashLightClientKit/Block/Download/BlockDownloader.swift +0 -26
  19. package/ios/ZCashLightClientKit/Block/Enhance/BlockEnhancer.swift +5 -6
  20. package/ios/ZCashLightClientKit/Block/FetchUnspentTxOutputs/UTXOFetcher.swift +1 -11
  21. package/ios/ZCashLightClientKit/Block/SaplingParameters/SaplingParametersHandler.swift +6 -4
  22. package/ios/ZCashLightClientKit/Block/Scan/BlockScanner.swift +10 -12
  23. package/ios/ZCashLightClientKit/Checkpoint/BundleCheckpointSource.swift +38 -0
  24. package/ios/ZCashLightClientKit/Checkpoint/BundleCheckpointURLProvider.swift +40 -0
  25. package/ios/ZCashLightClientKit/{Constants/Checkpoint+Constants.swift → Checkpoint/Checkpoint+helpers.swift} +1 -33
  26. package/ios/ZCashLightClientKit/Checkpoint/CheckpointSource.swift +34 -0
  27. package/ios/ZCashLightClientKit/Checkpoint/CheckpointSourceFactory.swift +14 -0
  28. package/ios/ZCashLightClientKit/ClosureSynchronizer.swift +61 -6
  29. package/ios/ZCashLightClientKit/CombineSynchronizer.swift +63 -4
  30. package/ios/ZCashLightClientKit/Constants/ZcashSDK.swift +4 -0
  31. package/ios/ZCashLightClientKit/DAO/TransactionDao.swift +21 -33
  32. package/ios/ZCashLightClientKit/DAO/UnspentTransactionOutputDao.swift +0 -182
  33. package/ios/ZCashLightClientKit/Entity/AccountEntity.swift +0 -173
  34. package/ios/ZCashLightClientKit/Entity/TransactionEntity.swift +5 -2
  35. package/ios/ZCashLightClientKit/Error/Sourcery/generateErrorCode.sh +1 -1
  36. package/ios/ZCashLightClientKit/Error/ZcashError.swift +53 -1
  37. package/ios/ZCashLightClientKit/Error/ZcashErrorCode.swift +19 -1
  38. package/ios/ZCashLightClientKit/Error/ZcashErrorCodeDefinition.swift +32 -0
  39. package/ios/ZCashLightClientKit/Initializer.swift +8 -17
  40. package/ios/ZCashLightClientKit/Metrics/SDKMetrics.swift +103 -217
  41. package/ios/ZCashLightClientKit/Model/Proposal.swift +45 -0
  42. package/ios/ZCashLightClientKit/Model/ScanSummary.swift +14 -0
  43. package/ios/ZCashLightClientKit/Model/WalletSummary.swift +58 -0
  44. package/ios/ZCashLightClientKit/Model/WalletTypes.swift +0 -16
  45. package/ios/ZCashLightClientKit/Modules/Service/GRPC/LightWalletGRPCService.swift +5 -3
  46. package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/proposal.pb.swift +934 -0
  47. package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/proto/proposal.proto +138 -0
  48. package/ios/ZCashLightClientKit/Modules/Service/LightWalletService.swift +2 -4
  49. package/ios/ZCashLightClientKit/Providers/LatestBlocksDataProvider.swift +9 -1
  50. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2272500.json +8 -0
  51. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2275000.json +8 -0
  52. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2277500.json +8 -0
  53. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2282500.json +8 -0
  54. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2285000.json +8 -0
  55. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2287500.json +8 -0
  56. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2292500.json +8 -0
  57. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2295000.json +8 -0
  58. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2297500.json +8 -0
  59. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2302500.json +8 -0
  60. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2305000.json +8 -0
  61. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2307500.json +8 -0
  62. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2312500.json +8 -0
  63. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2315000.json +8 -0
  64. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2317500.json +8 -0
  65. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2322500.json +8 -0
  66. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2325000.json +8 -0
  67. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2327500.json +8 -0
  68. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2332500.json +8 -0
  69. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2335000.json +8 -0
  70. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2337500.json +8 -0
  71. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2342500.json +8 -0
  72. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2345000.json +8 -0
  73. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2347500.json +8 -0
  74. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2352500.json +8 -0
  75. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2355000.json +8 -0
  76. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2357500.json +8 -0
  77. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2362500.json +8 -0
  78. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2365000.json +8 -0
  79. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2367500.json +8 -0
  80. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2372500.json +8 -0
  81. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2375000.json +8 -0
  82. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2377500.json +8 -0
  83. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2382500.json +8 -0
  84. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2385000.json +8 -0
  85. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2387500.json +8 -0
  86. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2392500.json +8 -0
  87. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2395000.json +8 -0
  88. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2397500.json +8 -0
  89. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2402500.json +8 -0
  90. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2405000.json +8 -0
  91. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2407500.json +8 -0
  92. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2412500.json +8 -0
  93. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2415000.json +8 -0
  94. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2417500.json +8 -0
  95. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2422500.json +8 -0
  96. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2425000.json +8 -0
  97. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2427500.json +8 -0
  98. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2432500.json +8 -0
  99. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2435000.json +8 -0
  100. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2437500.json +8 -0
  101. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2442500.json +8 -0
  102. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2445000.json +8 -0
  103. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2447500.json +8 -0
  104. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2452500.json +8 -0
  105. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2455000.json +8 -0
  106. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2457500.json +8 -0
  107. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2462500.json +8 -0
  108. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2465000.json +8 -0
  109. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2467500.json +8 -0
  110. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2470000.json +8 -0
  111. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2472500.json +8 -0
  112. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2480000.json +8 -0
  113. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2560000.json +8 -0
  114. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2570000.json +8 -0
  115. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2580000.json +8 -0
  116. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2590000.json +8 -0
  117. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2600000.json +8 -0
  118. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2610000.json +8 -0
  119. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2620000.json +8 -0
  120. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2630000.json +8 -0
  121. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2640000.json +8 -0
  122. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2650000.json +8 -0
  123. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2660000.json +8 -0
  124. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2670000.json +8 -0
  125. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2680000.json +8 -0
  126. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2690000.json +8 -0
  127. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2700000.json +8 -0
  128. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2710000.json +8 -0
  129. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2720000.json +8 -0
  130. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2730000.json +8 -0
  131. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2740000.json +8 -0
  132. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2750000.json +8 -0
  133. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2760000.json +8 -0
  134. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2770000.json +8 -0
  135. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2780000.json +8 -0
  136. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2790000.json +8 -0
  137. package/ios/ZCashLightClientKit/Rust/ZcashKeyDerivationBackend.swift +1 -5
  138. package/ios/ZCashLightClientKit/Rust/ZcashRustBackend.swift +327 -153
  139. package/ios/ZCashLightClientKit/Rust/ZcashRustBackendWelding.swift +78 -36
  140. package/ios/ZCashLightClientKit/Rust/zcashlc.h +402 -118
  141. package/ios/ZCashLightClientKit/Synchronizer/ClosureSDKSynchronizer.swift +43 -14
  142. package/ios/ZCashLightClientKit/Synchronizer/CombineSDKSynchronizer.swift +52 -14
  143. package/ios/ZCashLightClientKit/Synchronizer/Dependencies.swift +10 -6
  144. package/ios/ZCashLightClientKit/Synchronizer/SDKSynchronizer.swift +220 -70
  145. package/ios/ZCashLightClientKit/Synchronizer.swift +105 -29
  146. package/ios/ZCashLightClientKit/Transaction/TransactionEncoder.swift +61 -32
  147. package/ios/ZCashLightClientKit/Transaction/WalletTransactionEncoder.swift +52 -61
  148. package/ios/ZCashLightClientKit/Utils/DBActor.swift +21 -0
  149. package/ios/ZCashLightClientKit/Utils/LoggingProxy.swift +5 -0
  150. package/ios/ZCashLightClientKit/Utils/OSLogger.swift +71 -14
  151. package/ios/libzcashlc.xcframework/Info.plist +5 -5
  152. package/ios/libzcashlc.xcframework/ios-arm64/libzcashlc.a +0 -0
  153. package/ios/libzcashlc.xcframework/ios-arm64_x86_64-simulator/libzcashlc.a +0 -0
  154. package/lib/rnzcash.rn.js +21 -6
  155. package/lib/rnzcash.rn.js.map +1 -1
  156. package/lib/src/react-native.d.ts +2 -1
  157. package/lib/src/types.d.ts +9 -1
  158. package/package.json +1 -1
  159. package/src/react-native.ts +23 -4
  160. package/src/types.ts +10 -1
  161. package/ios/ZCashLightClientKit/Model/ScanProgress.swift +0 -29
  162. package/ios/ZCashLightClientKit/Repository/UnspentTransactionOutputRepository.swift +0 -16
  163. /package/ios/ZCashLightClientKit/{Model → Checkpoint}/Checkpoint.swift +0 -0
@@ -3,6 +3,36 @@
3
3
  #include <stdint.h>
4
4
  #include <stdlib.h>
5
5
 
6
+ /**
7
+ * A struct that contains details about an account in the wallet.
8
+ */
9
+ typedef struct FfiAccount {
10
+ uint8_t seed_fingerprint[32];
11
+ uint32_t account_index;
12
+ } FfiAccount;
13
+
14
+ /**
15
+ * A struct that contains a pointer to, and length information for, a heap-allocated
16
+ * slice of [`FfiAccount`] values.
17
+ *
18
+ * # Safety
19
+ *
20
+ * - `ptr` must be non-null and must be valid for reads for `len * mem::size_of::<FfiAccount>()`
21
+ * many bytes, and it must be properly aligned. This means in particular:
22
+ * - The entire memory range pointed to by `ptr` must be contained within a single allocated
23
+ * object. Slices can never span across multiple allocated objects.
24
+ * - `ptr` must be non-null and aligned even for zero-length slices.
25
+ * - `ptr` must point to `len` consecutive properly initialized values of type
26
+ * [`FfiAccount`].
27
+ * - The total size `len * mem::size_of::<FfiAccount>()` of the slice pointed to
28
+ * by `ptr` must be no larger than isize::MAX. See the safety documentation of pointer::offset.
29
+ * - See the safety documentation of [`FfiAccount`]
30
+ */
31
+ typedef struct FfiAccounts {
32
+ struct FfiAccount *ptr;
33
+ uintptr_t len;
34
+ } FfiAccounts;
35
+
6
36
  /**
7
37
  * A struct that contains an account identifier along with a pointer to the binary encoding
8
38
  * of an associated key.
@@ -91,6 +121,56 @@ typedef struct FfiSubtreeRoots {
91
121
  uintptr_t len;
92
122
  } FfiSubtreeRoots;
93
123
 
124
+ /**
125
+ * Balance information for a value within a single pool in an account.
126
+ */
127
+ typedef struct FfiBalance {
128
+ /**
129
+ * The value in the account that may currently be spent; it is possible to compute witnesses
130
+ * for all the notes that comprise this value, and all of this value is confirmed to the
131
+ * required confirmation depth.
132
+ */
133
+ int64_t spendable_value;
134
+ /**
135
+ * The value in the account of shielded change notes that do not yet have sufficient
136
+ * confirmations to be spendable.
137
+ */
138
+ int64_t change_pending_confirmation;
139
+ /**
140
+ * The value in the account of all remaining received notes that either do not have sufficient
141
+ * confirmations to be spendable, or for which witnesses cannot yet be constructed without
142
+ * additional scanning.
143
+ */
144
+ int64_t value_pending_spendability;
145
+ } FfiBalance;
146
+
147
+ /**
148
+ * Balance information for a single account.
149
+ *
150
+ * The sum of this struct's fields is the total balance of the account.
151
+ */
152
+ typedef struct FfiAccountBalance {
153
+ uint32_t account_id;
154
+ /**
155
+ * The value of unspent Sapling outputs belonging to the account.
156
+ */
157
+ struct FfiBalance sapling_balance;
158
+ /**
159
+ * The value of unspent Orchard outputs belonging to the account.
160
+ */
161
+ struct FfiBalance orchard_balance;
162
+ /**
163
+ * The value of all unspent transparent outputs belonging to the account,
164
+ * irrespective of confirmation depth.
165
+ *
166
+ * Unshielded balances are not subject to confirmation-depth constraints, because the
167
+ * only possible operation on a transparent balance is to shield it, it is possible
168
+ * to create a zero-conf transaction to perform that shielding, and the resulting
169
+ * shielded notes will be subject to normal confirmation rules.
170
+ */
171
+ int64_t unshielded;
172
+ } FfiAccountBalance;
173
+
94
174
  /**
95
175
  * A struct that contains details about scan progress.
96
176
  *
@@ -103,6 +183,42 @@ typedef struct FfiScanProgress {
103
183
  uint64_t denominator;
104
184
  } FfiScanProgress;
105
185
 
186
+ /**
187
+ * A type representing the potentially-spendable value of unspent outputs in the wallet.
188
+ *
189
+ * The balances reported using this data structure may overestimate the total spendable
190
+ * value of the wallet, in the case that the spend of a previously received shielded note
191
+ * has not yet been detected by the process of scanning the chain. The balances reported
192
+ * using this data structure can only be certain to be unspent in the case that
193
+ * [`Self::is_synced`] is true, and even in this circumstance it is possible that a newly
194
+ * created transaction could conflict with a not-yet-mined transaction in the mempool.
195
+ *
196
+ * # Safety
197
+ *
198
+ * - `account_balances` must be non-null and must be valid for reads for
199
+ * `account_balances_len * mem::size_of::<FfiAccountBalance>()` many bytes, and it must
200
+ * be properly aligned. This means in particular:
201
+ * - The entire memory range pointed to by `account_balances` must be contained within
202
+ * a single allocated object. Slices can never span across multiple allocated objects.
203
+ * - `account_balances` must be non-null and aligned even for zero-length slices.
204
+ * - `account_balances` must point to `len` consecutive properly initialized values of
205
+ * type [`FfiAccountBalance`].
206
+ * - The total size `account_balances_len * mem::size_of::<FfiAccountBalance>()` of the
207
+ * slice pointed to by `account_balances` must be no larger than `isize::MAX`. See the
208
+ * safety documentation of `pointer::offset`.
209
+ * - `scan_progress` must, if non-null, point to a struct having the layout of
210
+ * [`FfiScanProgress`].
211
+ */
212
+ typedef struct FfiWalletSummary {
213
+ struct FfiAccountBalance *account_balances;
214
+ uintptr_t account_balances_len;
215
+ int32_t chain_tip_height;
216
+ int32_t fully_scanned_height;
217
+ struct FfiScanProgress *scan_progress;
218
+ uint64_t next_sapling_subtree_index;
219
+ uint64_t next_orchard_subtree_index;
220
+ } FfiWalletSummary;
221
+
106
222
  /**
107
223
  * A struct that contains the start (inclusive) and end (exclusive) of a range of blocks
108
224
  * to scan.
@@ -135,6 +251,17 @@ typedef struct FfiScanRanges {
135
251
  uintptr_t len;
136
252
  } FfiScanRanges;
137
253
 
254
+ /**
255
+ * Metadata about modifications to the wallet state made in the course of scanning a set
256
+ * of blocks.
257
+ */
258
+ typedef struct FfiScanSummary {
259
+ int32_t scanned_start;
260
+ int32_t scanned_end;
261
+ uint64_t spent_sapling_note_count;
262
+ uint64_t received_sapling_note_count;
263
+ } FfiScanSummary;
264
+
138
265
  typedef struct FFIBlockMeta {
139
266
  uint32_t height;
140
267
  uint8_t *block_hash_ptr;
@@ -149,6 +276,46 @@ typedef struct FFIBlocksMeta {
149
276
  uintptr_t len;
150
277
  } FFIBlocksMeta;
151
278
 
279
+ /**
280
+ * A struct that contains a pointer to, and length information for, a heap-allocated
281
+ * boxed slice.
282
+ *
283
+ * # Safety
284
+ *
285
+ * - `ptr` must be non-null and valid for reads for `len` bytes, and it must have an
286
+ * alignment of `1`. Its contents must be an encoded Proposal protobuf.
287
+ * - The memory referenced by `ptr` must not be mutated for the lifetime of the struct
288
+ * (up until [`zcashlc_free_boxed_slice`] is called with it).
289
+ * - The total size `len` must be no larger than `isize::MAX`. See the safety
290
+ * documentation of `pointer::offset`.
291
+ */
292
+ typedef struct FfiBoxedSlice {
293
+ uint8_t *ptr;
294
+ uintptr_t len;
295
+ } FfiBoxedSlice;
296
+
297
+ /**
298
+ * A struct that contains a pointer to, and length information for, a heap-allocated
299
+ * slice of `[u8; 32]` arrays.
300
+ *
301
+ * # Safety
302
+ *
303
+ * - `ptr` must be non-null and must be valid for reads for `len * mem::size_of::<[u8; 32]>()`
304
+ * many bytes, and it must be properly aligned. This means in particular:
305
+ * - The entire memory range pointed to by `ptr` must be contained within a single
306
+ * allocated object. Slices can never span across multiple allocated objects.
307
+ * - `ptr` must be non-null and aligned even for zero-length slices.
308
+ * - `ptr` must point to `len` consecutive properly initialized values of type
309
+ * `[u8; 32]`.
310
+ * - The total size `len * mem::size_of::<[u8; 32]>()` of the slice pointed to
311
+ * by `ptr` must be no larger than isize::MAX. See the safety documentation of
312
+ * `pointer::offset`.
313
+ */
314
+ typedef struct FfiTxIds {
315
+ uint8_t (*ptr)[32];
316
+ uintptr_t len;
317
+ } FfiTxIds;
318
+
152
319
  /**
153
320
  * Initializes global Rust state, such as the logging infrastructure and threadpools.
154
321
  *
@@ -188,8 +355,11 @@ void zcashlc_clear_last_error(void);
188
355
  * null pointer if the caller wishes to attempt migrations without providing the wallet's seed
189
356
  * value.
190
357
  *
191
- * Returns 0 if successful, 1 if the seed must be provided in order to execute the requested
192
- * migrations, or -1 otherwise.
358
+ * Returns:
359
+ * - 0 if successful.
360
+ * - 1 if the seed must be provided in order to execute the requested migrations
361
+ * - 2 if the provided seed is not relevant to any of the derived accounts in the wallet.
362
+ * - -1 on error.
193
363
  *
194
364
  * # Safety
195
365
  *
@@ -211,6 +381,34 @@ int32_t zcashlc_init_data_database(const uint8_t *db_data,
211
381
  uintptr_t seed_len,
212
382
  uint32_t network_id);
213
383
 
384
+ /**
385
+ * Frees an array of FfiAccounts values as allocated by `zcashlc_list_accounts`.
386
+ *
387
+ * # Safety
388
+ *
389
+ * - `ptr` must be non-null and must point to a struct having the layout of [`FfiAccounts`].
390
+ * See the safety documentation of [`FfiAccounts`].
391
+ */
392
+ void zcashlc_free_accounts(struct FfiAccounts *ptr);
393
+
394
+ /**
395
+ * Returns a list of the accounts in the wallet.
396
+ *
397
+ * # Safety
398
+ *
399
+ * - `db_data` must be non-null and valid for reads for `db_data_len` bytes, and it must have an
400
+ * alignment of `1`. Its contents must be a string representing a valid system path in the
401
+ * operating system's preferred representation.
402
+ * - The memory referenced by `db_data` must not be mutated for the duration of the function call.
403
+ * - The total size `db_data_len` must be no larger than `isize::MAX`. See the safety
404
+ * documentation of pointer::offset.
405
+ * - Call [`zcashlc_free_accounts`] to free the memory associated with the returned pointer
406
+ * when done using it.
407
+ */
408
+ struct FfiAccounts *zcashlc_list_accounts(const uint8_t *db_data,
409
+ uintptr_t db_data_len,
410
+ uint32_t network_id);
411
+
214
412
  /**
215
413
  * Frees a FFIBinaryKey value
216
414
  *
@@ -264,6 +462,20 @@ struct FFIBinaryKey *zcashlc_create_account(const uint8_t *db_data,
264
462
  int64_t recover_until,
265
463
  uint32_t network_id);
266
464
 
465
+ /**
466
+ * Checks whether the given seed is relevant to any of the accounts in the wallet.
467
+ *
468
+ * Returns:
469
+ * - `1` for `Ok(true)`.
470
+ * - `0` for `Ok(false)`.
471
+ * - `-1` for `Err(_)`.
472
+ */
473
+ int8_t zcashlc_is_seed_relevant_to_any_derived_account(const uint8_t *db_data,
474
+ uintptr_t db_data_len,
475
+ const uint8_t *seed,
476
+ uintptr_t seed_len,
477
+ uint32_t network_id);
478
+
267
479
  /**
268
480
  * Frees an array of FFIEncodedKeys values as allocated by `zcashlc_derive_unified_viewing_keys_from_seed`
269
481
  *
@@ -434,7 +646,7 @@ char *zcashlc_get_sapling_receiver_for_unified_address(const char *ua);
434
646
  * - `address` must be non-null and must point to a null-terminated UTF-8 string.
435
647
  * - The memory referenced by `address` must not be mutated for the duration of the function call.
436
648
  */
437
- bool zcashlc_is_valid_shielded_address(const char *address, uint32_t network_id);
649
+ bool zcashlc_is_valid_sapling_address(const char *address, uint32_t network_id);
438
650
 
439
651
  /**
440
652
  * Returns the network type and address kind for the given address string,
@@ -512,42 +724,6 @@ bool zcashlc_is_valid_unified_full_viewing_key(const char *ufvk, uint32_t networ
512
724
  */
513
725
  bool zcashlc_is_valid_unified_address(const char *address, uint32_t network_id);
514
726
 
515
- /**
516
- * Returns the balance for the specified account, including all unspent notes that we know about.
517
- *
518
- * # Safety
519
- *
520
- * - `db_data` must be non-null and valid for reads for `db_data_len` bytes, and it must have an
521
- * alignment of `1`. Its contents must be a string representing a valid system path in the
522
- * operating system's preferred representation.
523
- * - The memory referenced by `db_data` must not be mutated for the duration of the function call.
524
- * - The total size `db_data_len` must be no larger than `isize::MAX`. See the safety
525
- * documentation of pointer::offset.
526
- */
527
- int64_t zcashlc_get_balance(const uint8_t *db_data,
528
- uintptr_t db_data_len,
529
- int32_t account,
530
- uint32_t network_id);
531
-
532
- /**
533
- * Returns the verified balance for the account, which ignores notes that have been
534
- * received too recently and are not yet deemed spendable according to `min_confirmations`.
535
- *
536
- * # Safety
537
- *
538
- * - `db_data` must be non-null and valid for reads for `db_data_len` bytes, and it must have an
539
- * alignment of `1`. Its contents must be a string representing a valid system path in the
540
- * operating system's preferred representation.
541
- * - The memory referenced by `db_data` must not be mutated for the duration of the function call.
542
- * - The total size `db_data_len` must be no larger than `isize::MAX`. See the safety
543
- * documentation of pointer::offset.
544
- */
545
- int64_t zcashlc_get_verified_balance(const uint8_t *db_data,
546
- uintptr_t db_data_len,
547
- int32_t account,
548
- uint32_t network_id,
549
- uint32_t min_confirmations);
550
-
551
727
  /**
552
728
  * Returns the verified transparent balance for `address`, which ignores utxos that have been
553
729
  * received too recently and are not yet deemed spendable according to `min_confirmations`.
@@ -647,6 +823,7 @@ int64_t zcashlc_get_total_transparent_balance_for_account(const uint8_t *db_data
647
823
  bool zcashlc_get_memo(const uint8_t *db_data,
648
824
  uintptr_t db_data_len,
649
825
  const uint8_t *txid_bytes,
826
+ uint32_t output_pool,
650
827
  uint16_t output_index,
651
828
  uint8_t *memo_bytes_ret,
652
829
  uint32_t network_id);
@@ -748,6 +925,29 @@ bool zcashlc_put_sapling_subtree_roots(const uint8_t *db_data,
748
925
  const struct FfiSubtreeRoots *roots,
749
926
  uint32_t network_id);
750
927
 
928
+ /**
929
+ * Adds a sequence of Orchard subtree roots to the data store.
930
+ *
931
+ * Returns true if the subtrees could be stored, false otherwise. When false is returned,
932
+ * caller should check for errors.
933
+ *
934
+ * # Safety
935
+ *
936
+ * - `db_data` must be non-null and valid for reads for `db_data_len` bytes, and it must have an
937
+ * alignment of `1`. Its contents must be a string representing a valid system path in the
938
+ * operating system's preferred representation.
939
+ * - The memory referenced by `db_data` must not be mutated for the duration of the function call.
940
+ * - The total size `db_data_len` must be no larger than `isize::MAX`. See the safety
941
+ * documentation of `pointer::offset`.
942
+ * - `roots` must be non-null and initialized.
943
+ * - The memory referenced by `roots` must not be mutated for the duration of the function call.
944
+ */
945
+ bool zcashlc_put_orchard_subtree_roots(const uint8_t *db_data,
946
+ uintptr_t db_data_len,
947
+ uint64_t start_index,
948
+ const struct FfiSubtreeRoots *roots,
949
+ uint32_t network_id);
950
+
751
951
  /**
752
952
  * Updates the wallet's view of the blockchain.
753
953
  *
@@ -815,7 +1015,10 @@ int64_t zcashlc_max_scanned_height(const uint8_t *db_data,
815
1015
  uint32_t network_id);
816
1016
 
817
1017
  /**
818
- * Returns the scan progress derived from the current wallet state.
1018
+ * Returns the account balances and sync status given the specified minimum number of
1019
+ * confirmations.
1020
+ *
1021
+ * Returns `fully_scanned_height = -1` if the wallet has no balance data available.
819
1022
  *
820
1023
  * # Safety
821
1024
  *
@@ -827,9 +1030,20 @@ int64_t zcashlc_max_scanned_height(const uint8_t *db_data,
827
1030
  * - The total size `db_data_len` must be no larger than `isize::MAX`. See the safety
828
1031
  * documentation of pointer::offset.
829
1032
  */
830
- struct FfiScanProgress zcashlc_get_scan_progress(const uint8_t *db_data,
831
- uintptr_t db_data_len,
832
- uint32_t network_id);
1033
+ struct FfiWalletSummary *zcashlc_get_wallet_summary(const uint8_t *db_data,
1034
+ uintptr_t db_data_len,
1035
+ uint32_t network_id,
1036
+ uint32_t min_confirmations);
1037
+
1038
+ /**
1039
+ * Frees an [`FfiWalletSummary`] value.
1040
+ *
1041
+ * # Safety
1042
+ *
1043
+ * - `ptr` must be non-null and must point to a struct having the layout of [`FfiWalletSummary`].
1044
+ * See the safety documentation of [`FfiWalletSummary`].
1045
+ */
1046
+ void zcashlc_free_wallet_summary(struct FfiWalletSummary *ptr);
833
1047
 
834
1048
  /**
835
1049
  * Frees an array of FfiScanRanges values as allocated by `zcashlc_derive_unified_viewing_keys_from_seed`
@@ -898,13 +1112,24 @@ struct FfiScanRanges *zcashlc_suggest_scan_ranges(const uint8_t *db_data,
898
1112
  * - The total size `db_data_len` must be no larger than `isize::MAX`. See the safety
899
1113
  * documentation of pointer::offset.
900
1114
  */
901
- int32_t zcashlc_scan_blocks(const uint8_t *fs_block_cache_root,
902
- uintptr_t fs_block_cache_root_len,
903
- const uint8_t *db_data,
904
- uintptr_t db_data_len,
905
- int32_t from_height,
906
- uint32_t scan_limit,
907
- uint32_t network_id);
1115
+ struct FfiScanSummary *zcashlc_scan_blocks(const uint8_t *fs_block_cache_root,
1116
+ uintptr_t fs_block_cache_root_len,
1117
+ const uint8_t *db_data,
1118
+ uintptr_t db_data_len,
1119
+ int32_t from_height,
1120
+ const uint8_t *from_state,
1121
+ uintptr_t from_state_len,
1122
+ uint32_t scan_limit,
1123
+ uint32_t network_id);
1124
+
1125
+ /**
1126
+ * Frees an [`FfiScanSummary`] value.
1127
+ *
1128
+ * # Safety
1129
+ *
1130
+ * - `ptr` must be non-null and must point to a struct having the layout of [`FfiScanSummary`].
1131
+ */
1132
+ void zcashlc_free_scan_summary(struct FfiScanSummary *ptr);
908
1133
 
909
1134
  /**
910
1135
  * Inserts a UTXO into the wallet database.
@@ -1045,14 +1270,19 @@ int32_t zcashlc_decrypt_and_store_transaction(const uint8_t *db_data,
1045
1270
  uint32_t network_id);
1046
1271
 
1047
1272
  /**
1048
- * Creates a transaction paying the specified address from the given account.
1273
+ * Frees an [`FfiBoxedSlice`].
1049
1274
  *
1050
- * Returns the row index of the newly-created transaction in the `transactions` table
1051
- * within the data database. The caller can read the raw transaction bytes from the `raw`
1052
- * column in order to broadcast the transaction to the network.
1275
+ * # Safety
1053
1276
  *
1054
- * Do not call this multiple times in parallel, or you will generate transactions that
1055
- * double-spend the same notes.
1277
+ * - `ptr` must be non-null and must point to a struct having the layout of
1278
+ * [`FfiBoxedSlice`]. See the safety documentation of [`FfiBoxedSlice`].
1279
+ */
1280
+ void zcashlc_free_boxed_slice(struct FfiBoxedSlice *ptr);
1281
+
1282
+ /**
1283
+ * Select transaction inputs, compute fees, and construct a proposal for a transaction
1284
+ * that can then be authorized and made ready for submission to the network with
1285
+ * `zcashlc_create_proposed_transaction`.
1056
1286
  *
1057
1287
  * # Safety
1058
1288
  *
@@ -1062,42 +1292,45 @@ int32_t zcashlc_decrypt_and_store_transaction(const uint8_t *db_data,
1062
1292
  * - The memory referenced by `db_data` must not be mutated for the duration of the function call.
1063
1293
  * - The total size `db_data_len` must be no larger than `isize::MAX`. See the safety
1064
1294
  * documentation of pointer::offset.
1065
- * - `usk_ptr` must be non-null and must point to an array of `usk_len` bytes containing a unified
1066
- * spending key encoded as returned from the `zcashlc_create_account` or
1067
- * `zcashlc_derive_spending_key` functions.
1068
- * - The memory referenced by `usk_ptr` must not be mutated for the duration of the function call.
1069
- * - The total size `usk_len` must be no larger than `isize::MAX`. See the safety documentation
1070
- * of pointer::offset.
1071
1295
  * - `to` must be non-null and must point to a null-terminated UTF-8 string.
1072
1296
  * - `memo` must either be null (indicating an empty memo or a transparent recipient) or point to a
1073
1297
  * 512-byte array.
1074
- * - `spend_params` must be non-null and valid for reads for `spend_params_len` bytes, and it must have an
1075
- * alignment of `1`. Its contents must be the Sapling spend proving parameters.
1076
- * - The memory referenced by `spend_params` must not be mutated for the duration of the function call.
1077
- * - The total size `spend_params_len` must be no larger than `isize::MAX`. See the safety
1078
- * documentation of pointer::offset.
1079
- * - `output_params` must be non-null and valid for reads for `output_params_len` bytes, and it must have an
1080
- * alignment of `1`. Its contents must be the Sapling output proving parameters.
1081
- * - The memory referenced by `output_params` must not be mutated for the duration of the function call.
1082
- * - The total size `output_params_len` must be no larger than `isize::MAX`. See the safety
1298
+ */
1299
+ struct FfiBoxedSlice *zcashlc_propose_transfer(const uint8_t *db_data,
1300
+ uintptr_t db_data_len,
1301
+ int32_t account,
1302
+ const char *to,
1303
+ int64_t value,
1304
+ const uint8_t *memo,
1305
+ uint32_t network_id,
1306
+ uint32_t min_confirmations,
1307
+ bool use_zip317_fees);
1308
+
1309
+ /**
1310
+ * Select transaction inputs, compute fees, and construct a proposal for a transaction
1311
+ * from a ZIP-321 payment URI that can then be authorized and made ready for submission to the
1312
+ * network with `zcashlc_create_proposed_transaction`.
1313
+ *
1314
+ * # Safety
1315
+ *
1316
+ * - `db_data` must be non-null and valid for reads for `db_data_len` bytes, and it must have an
1317
+ * alignment of `1`. Its contents must be a string representing a valid system path in the
1318
+ * operating system's preferred representation.
1319
+ * - The memory referenced by `db_data` must not be mutated for the duration of the function call.
1320
+ * - The total size `db_data_len` must be no larger than `isize::MAX`. See the safety
1083
1321
  * documentation of pointer::offset.
1084
- * - `txid_bytes_ret` must be non-null and must point to an allocated 32-byte region of memory.
1322
+ * - `payment_uri` must be non-null and must point to a null-terminated UTF-8 string.
1323
+ * - `network_id` a u32. 0 for Testnet and 1 for Mainnet
1324
+ * - `min_confirmations` number of confirmations of the funds to spend
1325
+ * - `use_zip317_fees` `true`` to use ZIP-317 fees.
1085
1326
  */
1086
- bool zcashlc_create_to_address(const uint8_t *db_data,
1087
- uintptr_t db_data_len,
1088
- const uint8_t *usk_ptr,
1089
- uintptr_t usk_len,
1090
- const char *to,
1091
- int64_t value,
1092
- const uint8_t *memo,
1093
- const uint8_t *spend_params,
1094
- uintptr_t spend_params_len,
1095
- const uint8_t *output_params,
1096
- uintptr_t output_params_len,
1097
- uint32_t network_id,
1098
- uint32_t min_confirmations,
1099
- bool use_zip317_fees,
1100
- uint8_t *txid_bytes_ret);
1327
+ struct FfiBoxedSlice *zcashlc_propose_transfer_from_uri(const uint8_t *db_data,
1328
+ uintptr_t db_data_len,
1329
+ int32_t account,
1330
+ const char *payment_uri,
1331
+ uint32_t network_id,
1332
+ uint32_t min_confirmations,
1333
+ bool use_zip317_fees);
1101
1334
 
1102
1335
  int32_t zcashlc_branch_id_for_height(int32_t height, uint32_t network_id);
1103
1336
 
@@ -1111,8 +1344,9 @@ int32_t zcashlc_branch_id_for_height(int32_t height, uint32_t network_id);
1111
1344
  void zcashlc_string_free(char *s);
1112
1345
 
1113
1346
  /**
1114
- * Shield transparent UTXOs by sending them to an address associated with the specified Sapling
1115
- * spending key.
1347
+ * Select transaction inputs, compute fees, and construct a proposal for a shielding
1348
+ * transaction that can then be authorized and made ready for submission to the network
1349
+ * with `zcashlc_create_proposed_transaction`.
1116
1350
  *
1117
1351
  * # Safety
1118
1352
  *
@@ -1122,36 +1356,86 @@ void zcashlc_string_free(char *s);
1122
1356
  * - The memory referenced by `db_data` must not be mutated for the duration of the function call.
1123
1357
  * - The total size `db_data_len` must be no larger than `isize::MAX`. See the safety
1124
1358
  * documentation of pointer::offset.
1125
- * - `usk_ptr` must be non-null and must point to an array of `usk_len` bytes containing a unified
1126
- * spending key encoded as returned from the `zcashlc_create_account` or
1127
- * `zcashlc_derive_spending_key` functions.
1128
- * - The memory referenced by `usk_ptr` must not be mutated for the duration of the function call.
1129
- * - The total size `usk_len` must be no larger than `isize::MAX`. See the safety documentation
1130
- * - `memo` must either be null (indicating an empty memo) or point to a 512-byte array.
1131
1359
  * - `shielding_threshold` a non-negative shielding threshold amount in zatoshi
1132
- * - `spend_params` must be non-null and valid for reads for `spend_params_len` bytes, and it must have an
1133
- * alignment of `1`. Its contents must be the Sapling spend proving parameters.
1134
- * - The memory referenced by `spend_params` must not be mutated for the duration of the function call.
1360
+ */
1361
+ struct FfiBoxedSlice *zcashlc_propose_shielding(const uint8_t *db_data,
1362
+ uintptr_t db_data_len,
1363
+ int32_t account,
1364
+ const uint8_t *memo,
1365
+ uint64_t shielding_threshold,
1366
+ const char *transparent_receiver,
1367
+ uint32_t network_id,
1368
+ uint32_t min_confirmations,
1369
+ bool use_zip317_fees);
1370
+
1371
+ /**
1372
+ * Frees an array of FfiTxIds values as allocated by `zcashlc_create_proposed_transactions`.
1373
+ *
1374
+ * # Safety
1375
+ *
1376
+ * - `ptr` must be non-null and must point to a struct having the layout of [`FfiTxIds`].
1377
+ * See the safety documentation of [`FfiTxIds`].
1378
+ */
1379
+ void zcashlc_free_txids(struct FfiTxIds *ptr);
1380
+
1381
+ /**
1382
+ * Creates a transaction from the given proposal.
1383
+ *
1384
+ * Returns the row index of the newly-created transaction in the `transactions` table
1385
+ * within the data database. The caller can read the raw transaction bytes from the `raw`
1386
+ * column in order to broadcast the transaction to the network.
1387
+ *
1388
+ * Do not call this multiple times in parallel, or you will generate transactions that
1389
+ * double-spend the same notes.
1390
+ *
1391
+ * # Safety
1392
+ *
1393
+ * - `db_data` must be non-null and valid for reads for `db_data_len` bytes, and it must
1394
+ * have an alignment of `1`. Its contents must be a string representing a valid system
1395
+ * path in the operating system's preferred representation.
1396
+ * - The memory referenced by `db_data` must not be mutated for the duration of the
1397
+ * function call.
1398
+ * - The total size `db_data_len` must be no larger than `isize::MAX`. See the safety
1399
+ * documentation of `pointer::offset`.
1400
+ * - `proposal_ptr` must be non-null and valid for reads for `proposal_len` bytes, and it
1401
+ * must have an alignment of `1`. Its contents must be an encoded Proposal protobuf.
1402
+ * - The memory referenced by `proposal_ptr` must not be mutated for the duration of the
1403
+ * function call.
1404
+ * - The total size `proposal_len` must be no larger than `isize::MAX`. See the safety
1405
+ * documentation of `pointer::offset`.
1406
+ * - `usk_ptr` must be non-null and must point to an array of `usk_len` bytes containing
1407
+ * a unified spending key encoded as returned from the `zcashlc_create_account` or
1408
+ * `zcashlc_derive_spending_key` functions.
1409
+ * - The memory referenced by `usk_ptr` must not be mutated for the duration of the
1410
+ * function call.
1411
+ * - The total size `usk_len` must be no larger than `isize::MAX`. See the safety
1412
+ * documentation of `pointer::offset`.
1413
+ * - `to` must be non-null and must point to a null-terminated UTF-8 string.
1414
+ * - `memo` must either be null (indicating an empty memo or a transparent recipient) or
1415
+ * point to a 512-byte array.
1416
+ * - `spend_params` must be non-null and valid for reads for `spend_params_len` bytes,
1417
+ * and it must have an alignment of `1`. Its contents must be the Sapling spend proving
1418
+ * parameters.
1419
+ * - The memory referenced by `spend_params` must not be mutated for the duration of the
1420
+ * function call.
1135
1421
  * - The total size `spend_params_len` must be no larger than `isize::MAX`. See the safety
1136
- * documentation of pointer::offset.
1137
- * - `output_params` must be non-null and valid for reads for `output_params_len` bytes, and it must have an
1138
- * alignment of `1`. Its contents must be the Sapling output proving parameters.
1139
- * - The memory referenced by `output_params` must not be mutated for the duration of the function call.
1422
+ * documentation of `pointer::offset`.
1423
+ * - `output_params` must be non-null and valid for reads for `output_params_len` bytes,
1424
+ * and it must have an alignment of `1`. Its contents must be the Sapling output
1425
+ * proving parameters.
1426
+ * - The memory referenced by `output_params` must not be mutated for the duration of the
1427
+ * function call.
1140
1428
  * - The total size `output_params_len` must be no larger than `isize::MAX`. See the safety
1141
1429
  * documentation of pointer::offset.
1142
- * - `txid_bytes_ret` must be non-null and must point to an allocated 32-byte region of memory.
1143
- */
1144
- bool zcashlc_shield_funds(const uint8_t *db_data,
1145
- uintptr_t db_data_len,
1146
- const uint8_t *usk_ptr,
1147
- uintptr_t usk_len,
1148
- const uint8_t *memo,
1149
- uint64_t shielding_threshold,
1150
- const uint8_t *spend_params,
1151
- uintptr_t spend_params_len,
1152
- const uint8_t *output_params,
1153
- uintptr_t output_params_len,
1154
- uint32_t network_id,
1155
- uint32_t min_confirmations,
1156
- bool use_zip317_fees,
1157
- uint8_t *txid_bytes_ret);
1430
+ */
1431
+ struct FfiTxIds *zcashlc_create_proposed_transactions(const uint8_t *db_data,
1432
+ uintptr_t db_data_len,
1433
+ const uint8_t *proposal_ptr,
1434
+ uintptr_t proposal_len,
1435
+ const uint8_t *usk_ptr,
1436
+ uintptr_t usk_len,
1437
+ const uint8_t *spend_params,
1438
+ uintptr_t spend_params_len,
1439
+ const uint8_t *output_params,
1440
+ uintptr_t output_params_len,
1441
+ uint32_t network_id);