@ledgerhq/zcash-utils 2.6.0 → 2.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @ledgerhq/zcash-utils
2
2
 
3
+ ## 2.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 985f662: Move the Zcash crates from their NU7 pre-releases to the stable releases that set the NU7 mainnet activation height (3543405). A mainnet transaction whose target block is past that height is built under the ZIP 259 branch id (`0x77190AD9`), and the expiry cap now sees NU7 ahead on mainnet. From NU7 activation the builder's default expiry is 120 blocks after the target instead of 40, the same duration at 25-second blocks. The PCZT encoding is unchanged.
8
+
9
+ ## 2.7.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 9f2aa1f: Move the Zcash crates to their NU7 pre-releases. A transaction whose target block is past NU7 activation is built under the ZIP 259 branch id (`0x77190AD9`), and the expiry cap now sees NU7 ahead on testnet. These releases carry no NU7 mainnet activation height yet, so mainnet transactions keep the NU6.3 branch id until a release that sets it is pinned. The PCZT encoding is unchanged.
14
+ - 695c4e6: `buildTransaction` and `buildIronwoodTransaction` take an optional `regtestActivationHeights` for a regtest node whose activation schedule differs from the canonical one. The builder then selects the branch id that node enforces and caps the expiry below the upgrade it has scheduled. The field is refused with mainnet or testnet.
15
+ - 57191c4: Apply ZIP 2009's ZIP-317 marginal fee: `buildTransaction` and `buildIronwoodTransaction` accept a fee computed at 1,000 zatoshis per logical action on mainnet from height 3,590,000 and on test networks, and keep 5,000 on mainnet below that height. A fee computed at 5,000 is still accepted past the switch.
16
+
17
+ ### Patch Changes
18
+
19
+ - 38e0cfe: The error returned by `buildTransaction` and `buildIronwoodTransaction` for a fee that does not satisfy ZIP-317 reads `craft error: fee …` once, instead of repeating the `craft error:` prefix.
20
+
3
21
  ## 2.6.0
4
22
 
5
23
  ### Minor Changes
package/index.d.ts CHANGED
@@ -210,6 +210,27 @@ export interface TransparentInputJs {
210
210
  */
211
211
  addressIndex: number
212
212
  }
213
+ /**
214
+ * Regtest activation heights a local node was started with, one optional
215
+ * height per network upgrade. Each height given replaces the canonical
216
+ * regtest value (Overwinter through Canopy at 1, NU5 through NU6.3 at 2, NU7
217
+ * unscheduled); each one omitted keeps it. Lets the builder pick the same
218
+ * branch id, and cap the expiry height at the same upcoming activation, as a
219
+ * node whose `activation_heights` differ from the canonical set.
220
+ */
221
+ export interface RegtestActivationHeightsJs {
222
+ overwinter?: number
223
+ sapling?: number
224
+ blossom?: number
225
+ heartwood?: number
226
+ canopy?: number
227
+ nu5?: number
228
+ nu6?: number
229
+ nu6_1?: number
230
+ nu6_2?: number
231
+ nu6_3?: number
232
+ nu7?: number
233
+ }
213
234
  /**
214
235
  * Arguments for [`build_transaction`].
215
236
  *
@@ -242,6 +263,12 @@ export interface BuildTransactionParams {
242
263
  */
243
264
  transparentAccountPubkey?: string
244
265
  network?: string
266
+ /**
267
+ * Only with `network: "regtest"`: activation heights of the local node,
268
+ * when its schedule differs from the canonical regtest set. Refused with
269
+ * any other network.
270
+ */
271
+ regtestActivationHeights?: RegtestActivationHeightsJs
245
272
  /**
246
273
  * 64-char hex (32 bytes): ZIP-32 seed fingerprint of the wallet seed,
247
274
  * read from the device. Stamped onto each real spend so the device can
@@ -255,6 +282,11 @@ export interface BuildTransactionParams {
255
282
  * loss). Per FR-4 the fee is selected by ledger-live; this
256
283
  * crate validates it against ZIP-317 and derives change from it rather
257
284
  * than computing a fee itself.
285
+ *
286
+ * The ZIP-317 marginal fee depends on the target block (ZIP 2009): 1,000
287
+ * zatoshis per logical action on mainnet from height 3,590,000 and on test
288
+ * networks, 5,000 on mainnet below it. A fee computed at 5,000 is still
289
+ * accepted past the switch; one computed at 1,000 is refused before it.
258
290
  */
259
291
  feeZat: string
260
292
  spends: Array<OrchardSpendInputJs>
@@ -335,6 +367,12 @@ export interface BuildIronwoodTransactionParams {
335
367
  grpcUrl: string
336
368
  ufvk: string
337
369
  network?: string
370
+ /**
371
+ * Only with `network: "regtest"`: activation heights of the local node,
372
+ * when its schedule differs from the canonical regtest set. Refused with
373
+ * any other network.
374
+ */
375
+ regtestActivationHeights?: RegtestActivationHeightsJs
338
376
  /**
339
377
  * 64-char hex (32 bytes): ZIP-32 seed fingerprint of the wallet seed,
340
378
  * read from the device. Stamped onto each real spend so the device can
@@ -348,6 +386,11 @@ export interface BuildIronwoodTransactionParams {
348
386
  * loss). Per FR-4 the fee is selected by ledger-live; this
349
387
  * crate validates it against ZIP-317 Rev 1 and derives the (always
350
388
  * Ironwood) change from it rather than computing a fee itself.
389
+ *
390
+ * The ZIP-317 marginal fee depends on the target block (ZIP 2009): 1,000
391
+ * zatoshis per logical action on mainnet from height 3,590,000 and on test
392
+ * networks, 5,000 on mainnet below it. A fee computed at 5,000 is still
393
+ * accepted past the switch; one computed at 1,000 is refused before it.
351
394
  */
352
395
  feeZat: string
353
396
  spends: Array<IronwoodSpendInputJs>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/zcash-utils",
3
- "version": "2.6.0",
3
+ "version": "2.8.0",
4
4
  "description": "Native Zcash key derivation and shielded sync — Node.js (NAPI)",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",