@bitgo/wasm-utxo 5.3.0 → 5.4.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.
@@ -1,4 +1,20 @@
1
1
  import { IronwoodWitness as WasmIronwoodWitness } from "../wasm/wasm_utxo.js";
2
+ /**
3
+ * A node of a pruned Orchard note-commitment (sub)tree, for {@link ZcashIronwoodWitness.buildFromShard}'s
4
+ * `shard`/`cap` inputs. Mirrors a real pruned tree store's shape (e.g. a `shardtree::ShardTree`):
5
+ * most leaves are never individually retained, only enough annotated hashes to reproduce a witness.
6
+ */
7
+ export type ShardTreeNode = {
8
+ type: "Nil";
9
+ } | {
10
+ type: "Leaf";
11
+ hash: Uint8Array;
12
+ } | {
13
+ type: "Parent";
14
+ hash?: Uint8Array;
15
+ left: ShardTreeNode;
16
+ right: ShardTreeNode;
17
+ };
2
18
  /**
3
19
  * A validated Merkle witness for an Ironwood/Orchard note commitment.
4
20
  *
@@ -19,6 +35,19 @@ export declare class ZcashIronwoodWitness {
19
35
  * recompute to `anchor`
20
36
  */
21
37
  static build(cmx: Uint8Array, position: number, authPath: Uint8Array[], anchor: Uint8Array): ZcashIronwoodWitness;
38
+ /**
39
+ * Build and validate a Merkle witness from a pruned shard + cap, instead of a
40
+ * caller-precomputed 32-entry path.
41
+ *
42
+ * `shardHeight` chooses which level the shard's root sits at (it spans up to `2^shardHeight`
43
+ * leaves); `shard` is the pruned subtree containing `position`, rooted at that level; `cap` is
44
+ * the pruned tree above every shard, down to (and including) shard-root nodes. `leafCount` is
45
+ * the total number of leaves committed to the tree as of `anchor` — positions beyond it are
46
+ * treated as canonically empty.
47
+ * @throws Under the same conditions as {@link build}, plus if `shard`/`cap` don't have enough
48
+ * detail to witness `position` as of `leafCount`
49
+ */
50
+ static buildFromShard(position: number, shardHeight: number, leafCount: bigint, cmx: Uint8Array, shard: ShardTreeNode, cap: ShardTreeNode, anchor: Uint8Array): ZcashIronwoodWitness;
22
51
  /** The leaf's position in the note commitment tree. */
23
52
  get position(): number;
24
53
  /**
@@ -26,6 +26,21 @@ class ZcashIronwoodWitness {
26
26
  static build(cmx, position, authPath, anchor) {
27
27
  return new ZcashIronwoodWitness((0, wasm_utxo_js_1.ironwood_build_witness)(cmx, position, authPath, anchor));
28
28
  }
29
+ /**
30
+ * Build and validate a Merkle witness from a pruned shard + cap, instead of a
31
+ * caller-precomputed 32-entry path.
32
+ *
33
+ * `shardHeight` chooses which level the shard's root sits at (it spans up to `2^shardHeight`
34
+ * leaves); `shard` is the pruned subtree containing `position`, rooted at that level; `cap` is
35
+ * the pruned tree above every shard, down to (and including) shard-root nodes. `leafCount` is
36
+ * the total number of leaves committed to the tree as of `anchor` — positions beyond it are
37
+ * treated as canonically empty.
38
+ * @throws Under the same conditions as {@link build}, plus if `shard`/`cap` don't have enough
39
+ * detail to witness `position` as of `leafCount`
40
+ */
41
+ static buildFromShard(position, shardHeight, leafCount, cmx, shard, cap, anchor) {
42
+ return new ZcashIronwoodWitness((0, wasm_utxo_js_1.ironwood_build_witness_from_shard)(position, shardHeight, leafCount, cmx, shard, cap, anchor));
43
+ }
29
44
  /** The leaf's position in the note commitment tree. */
30
45
  get position() {
31
46
  return this._wasm.position;
@@ -14,6 +14,7 @@ export { ZcashIronwoodBitGoPsbt, zip302NoMemo, type CreateEmptyIronwoodOptions,
14
14
  export { ZcashUnifiedAddress } from "./ZcashUnifiedAddress.js";
15
15
  export { ZcashV6Transaction } from "./ZcashV6Transaction.js";
16
16
  export { ZcashIronwoodWitness } from "./ZcashIronwoodWitness.js";
17
+ export type { ShardTreeNode } from "./ZcashIronwoodWitness.js";
17
18
  import type { ScriptType } from "./scriptType.js";
18
19
  /**
19
20
  * Check if a network supports a given fixed-script wallet script type
@@ -1924,6 +1924,23 @@ export class ZcashV6Transaction {
1924
1924
  */
1925
1925
  export function ironwood_build_witness(cmx: Uint8Array, position: number, auth_path: Uint8Array[], anchor: Uint8Array): IronwoodWitness;
1926
1926
 
1927
+ /**
1928
+ * Build and validate an Ironwood witness from a pruned shard + cap, instead of a
1929
+ * caller-precomputed 32-entry path (see `ironwood_build_witness`).
1930
+ *
1931
+ * `shardHeight` chooses which level the shard's root sits at (it spans up to `2^shardHeight`
1932
+ * leaves); `shard` is the pruned subtree containing `position`, rooted at that level; `cap` is the
1933
+ * pruned tree above every shard, down to (and including) shard-root nodes. `leafCount` is the
1934
+ * total number of leaves committed to the tree as of `anchor` — positions beyond it are treated
1935
+ * as canonically empty. `shard`/`cap` are plain JS objects (not JSON strings) shaped like:
1936
+ * `{ type: "Nil" } | { type: "Leaf", hash: Uint8Array } | { type: "Parent", hash?: Uint8Array,
1937
+ * left: ShardTreeNode, right: ShardTreeNode }`.
1938
+ *
1939
+ * Throws under the same conditions as `ironwood_build_witness`, plus if `shard`/`cap` don't have
1940
+ * enough detail to witness `position` as of `leafCount`.
1941
+ */
1942
+ export function ironwood_build_witness_from_shard(position: number, shard_height: number, leaf_count: bigint, cmx: Uint8Array, shard: any, cap: any, anchor: Uint8Array): IronwoodWitness;
1943
+
1927
1944
  /**
1928
1945
  * Check if the inspect feature is enabled.
1929
1946
  *
@@ -7269,6 +7269,50 @@ function ironwood_build_witness(cmx, position, auth_path, anchor) {
7269
7269
  }
7270
7270
  exports.ironwood_build_witness = ironwood_build_witness;
7271
7271
 
7272
+ /**
7273
+ * Build and validate an Ironwood witness from a pruned shard + cap, instead of a
7274
+ * caller-precomputed 32-entry path (see `ironwood_build_witness`).
7275
+ *
7276
+ * `shardHeight` chooses which level the shard's root sits at (it spans up to `2^shardHeight`
7277
+ * leaves); `shard` is the pruned subtree containing `position`, rooted at that level; `cap` is the
7278
+ * pruned tree above every shard, down to (and including) shard-root nodes. `leafCount` is the
7279
+ * total number of leaves committed to the tree as of `anchor` — positions beyond it are treated
7280
+ * as canonically empty. `shard`/`cap` are plain JS objects (not JSON strings) shaped like:
7281
+ * `{ type: "Nil" } | { type: "Leaf", hash: Uint8Array } | { type: "Parent", hash?: Uint8Array,
7282
+ * left: ShardTreeNode, right: ShardTreeNode }`.
7283
+ *
7284
+ * Throws under the same conditions as `ironwood_build_witness`, plus if `shard`/`cap` don't have
7285
+ * enough detail to witness `position` as of `leafCount`.
7286
+ * @param {number} position
7287
+ * @param {number} shard_height
7288
+ * @param {bigint} leaf_count
7289
+ * @param {Uint8Array} cmx
7290
+ * @param {any} shard
7291
+ * @param {any} cap
7292
+ * @param {Uint8Array} anchor
7293
+ * @returns {IronwoodWitness}
7294
+ */
7295
+ function ironwood_build_witness_from_shard(position, shard_height, leaf_count, cmx, shard, cap, anchor) {
7296
+ try {
7297
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
7298
+ const ptr0 = passArray8ToWasm0(cmx, wasm.__wbindgen_export);
7299
+ const len0 = WASM_VECTOR_LEN;
7300
+ const ptr1 = passArray8ToWasm0(anchor, wasm.__wbindgen_export);
7301
+ const len1 = WASM_VECTOR_LEN;
7302
+ wasm.ironwood_build_witness_from_shard(retptr, position, shard_height, leaf_count, ptr0, len0, addHeapObject(shard), addHeapObject(cap), ptr1, len1);
7303
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
7304
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
7305
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
7306
+ if (r2) {
7307
+ throw takeObject(r1);
7308
+ }
7309
+ return IronwoodWitness.__wrap(r0);
7310
+ } finally {
7311
+ wasm.__wbindgen_add_to_stack_pointer(16);
7312
+ }
7313
+ }
7314
+ exports.ironwood_build_witness_from_shard = ironwood_build_witness_from_shard;
7315
+
7272
7316
  /**
7273
7317
  * Check if the inspect feature is enabled.
7274
7318
  *
@@ -7602,6 +7646,13 @@ function __wbg_get_imports() {
7602
7646
  const ret = Error(getStringFromWasm0(arg0, arg1));
7603
7647
  return addHeapObject(ret);
7604
7648
  },
7649
+ __wbg_String_8f0eb39a4a4c2f66: function(arg0, arg1) {
7650
+ const ret = String(getObject(arg1));
7651
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
7652
+ const len1 = WASM_VECTOR_LEN;
7653
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
7654
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
7655
+ },
7605
7656
  __wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2: function(arg0, arg1) {
7606
7657
  const v = getObject(arg1);
7607
7658
  const ret = typeof(v) === 'bigint' ? v : undefined;
@@ -7620,6 +7671,10 @@ function __wbg_get_imports() {
7620
7671
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
7621
7672
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
7622
7673
  },
7674
+ __wbg___wbindgen_in_47fa6863be6f2f25: function(arg0, arg1) {
7675
+ const ret = getObject(arg0) in getObject(arg1);
7676
+ return ret;
7677
+ },
7623
7678
  __wbg___wbindgen_is_bigint_31b12575b56f32fc: function(arg0) {
7624
7679
  const ret = typeof(getObject(arg0)) === 'bigint';
7625
7680
  return ret;
@@ -7649,6 +7704,10 @@ function __wbg_get_imports() {
7649
7704
  const ret = getObject(arg0) === getObject(arg1);
7650
7705
  return ret;
7651
7706
  },
7707
+ __wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811: function(arg0, arg1) {
7708
+ const ret = getObject(arg0) == getObject(arg1);
7709
+ return ret;
7710
+ },
7652
7711
  __wbg___wbindgen_number_get_8ff4255516ccad3e: function(arg0, arg1) {
7653
7712
  const obj = getObject(arg1);
7654
7713
  const ret = typeof(obj) === 'number' ? obj : undefined;
@@ -7678,6 +7737,14 @@ function __wbg_get_imports() {
7678
7737
  const ret = getObject(arg0).crypto;
7679
7738
  return addHeapObject(ret);
7680
7739
  },
7740
+ __wbg_done_57b39ecd9addfe81: function(arg0) {
7741
+ const ret = getObject(arg0).done;
7742
+ return ret;
7743
+ },
7744
+ __wbg_entries_58c7934c745daac7: function(arg0) {
7745
+ const ret = Object.entries(getObject(arg0));
7746
+ return addHeapObject(ret);
7747
+ },
7681
7748
  __wbg_for_c3adefd268cb6f1c: function(arg0, arg1) {
7682
7749
  const ret = Symbol.for(getStringFromWasm0(arg0, arg1));
7683
7750
  return addHeapObject(ret);
@@ -7697,6 +7764,48 @@ function __wbg_get_imports() {
7697
7764
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
7698
7765
  return addHeapObject(ret);
7699
7766
  }, arguments); },
7767
+ __wbg_instanceof_ArrayBuffer_c367199e2fa2aa04: function(arg0) {
7768
+ let result;
7769
+ try {
7770
+ result = getObject(arg0) instanceof ArrayBuffer;
7771
+ } catch (_) {
7772
+ result = false;
7773
+ }
7774
+ const ret = result;
7775
+ return ret;
7776
+ },
7777
+ __wbg_instanceof_Map_53af74335dec57f4: function(arg0) {
7778
+ let result;
7779
+ try {
7780
+ result = getObject(arg0) instanceof Map;
7781
+ } catch (_) {
7782
+ result = false;
7783
+ }
7784
+ const ret = result;
7785
+ return ret;
7786
+ },
7787
+ __wbg_instanceof_Uint8Array_9b9075935c74707c: function(arg0) {
7788
+ let result;
7789
+ try {
7790
+ result = getObject(arg0) instanceof Uint8Array;
7791
+ } catch (_) {
7792
+ result = false;
7793
+ }
7794
+ const ret = result;
7795
+ return ret;
7796
+ },
7797
+ __wbg_isArray_d314bb98fcf08331: function(arg0) {
7798
+ const ret = Array.isArray(getObject(arg0));
7799
+ return ret;
7800
+ },
7801
+ __wbg_isSafeInteger_bfbc7332a9768d2a: function(arg0) {
7802
+ const ret = Number.isSafeInteger(getObject(arg0));
7803
+ return ret;
7804
+ },
7805
+ __wbg_iterator_6ff6560ca1568e55: function() {
7806
+ const ret = Symbol.iterator;
7807
+ return addHeapObject(ret);
7808
+ },
7700
7809
  __wbg_length_32ed9a279acd054c: function(arg0) {
7701
7810
  const ret = getObject(arg0).length;
7702
7811
  return ret;
@@ -7737,6 +7846,14 @@ function __wbg_get_imports() {
7737
7846
  const ret = new Uint8Array(arg0 >>> 0);
7738
7847
  return addHeapObject(ret);
7739
7848
  },
7849
+ __wbg_next_3482f54c49e8af19: function() { return handleError(function (arg0) {
7850
+ const ret = getObject(arg0).next();
7851
+ return addHeapObject(ret);
7852
+ }, arguments); },
7853
+ __wbg_next_418f80d8f5303233: function(arg0) {
7854
+ const ret = getObject(arg0).next;
7855
+ return addHeapObject(ret);
7856
+ },
7740
7857
  __wbg_node_905d3e251edff8a2: function(arg0) {
7741
7858
  const ret = getObject(arg0).node;
7742
7859
  return addHeapObject(ret);
@@ -7783,6 +7900,10 @@ function __wbg_get_imports() {
7783
7900
  const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
7784
7901
  return addHeapObject(ret);
7785
7902
  },
7903
+ __wbg_value_0546255b415e96c1: function(arg0) {
7904
+ const ret = getObject(arg0).value;
7905
+ return addHeapObject(ret);
7906
+ },
7786
7907
  __wbg_versions_c01dfd4722a88165: function(arg0) {
7787
7908
  const ret = getObject(arg0).versions;
7788
7909
  return addHeapObject(ret);
@@ -7812,17 +7933,22 @@ function __wbg_get_imports() {
7812
7933
  const ret = arg0;
7813
7934
  return addHeapObject(ret);
7814
7935
  },
7815
- __wbindgen_cast_0000000000000002: function(arg0, arg1) {
7936
+ __wbindgen_cast_0000000000000002: function(arg0) {
7937
+ // Cast intrinsic for `I64 -> Externref`.
7938
+ const ret = arg0;
7939
+ return addHeapObject(ret);
7940
+ },
7941
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
7816
7942
  // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
7817
7943
  const ret = getArrayU8FromWasm0(arg0, arg1);
7818
7944
  return addHeapObject(ret);
7819
7945
  },
7820
- __wbindgen_cast_0000000000000003: function(arg0, arg1) {
7946
+ __wbindgen_cast_0000000000000004: function(arg0, arg1) {
7821
7947
  // Cast intrinsic for `Ref(String) -> Externref`.
7822
7948
  const ret = getStringFromWasm0(arg0, arg1);
7823
7949
  return addHeapObject(ret);
7824
7950
  },
7825
- __wbindgen_cast_0000000000000004: function(arg0) {
7951
+ __wbindgen_cast_0000000000000005: function(arg0) {
7826
7952
  // Cast intrinsic for `U64 -> Externref`.
7827
7953
  const ret = BigInt.asUintN(64, arg0);
7828
7954
  return addHeapObject(ret);
Binary file
@@ -2,58 +2,10 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const __wbg_addressnamespace_free: (a: number, b: number) => void;
5
- export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
6
- export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
7
- export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
8
- export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
9
- export const isInspectEnabled: () => number;
10
- export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
11
- export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
12
- export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
13
- export const wasmdimensions_empty: () => number;
14
- export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
15
- export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number, d: number) => void;
16
- export const wasmdimensions_from_output_script_length: (a: number) => number;
17
- export const wasmdimensions_from_output_script_type: (a: number, b: number, c: number) => void;
18
- export const wasmdimensions_from_psbt: (a: number, b: number) => void;
19
- export const wasmdimensions_get_input_vsize: (a: number, b: number, c: number) => number;
20
- export const wasmdimensions_get_input_weight: (a: number, b: number, c: number) => number;
21
- export const wasmdimensions_get_output_vsize: (a: number) => number;
22
- export const wasmdimensions_get_output_weight: (a: number) => number;
23
- export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
24
- export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
25
- export const wasmdimensions_has_segwit: (a: number) => number;
26
- export const wasmdimensions_plus: (a: number, b: number) => number;
27
- export const wasmdimensions_times: (a: number, b: number) => number;
28
- export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
29
- export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
30
- export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
31
- export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
32
- export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
33
- export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
34
- export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
35
- export const wrapdescriptor_descType: (a: number, b: number) => void;
36
- export const wrapdescriptor_encode: (a: number, b: number) => void;
37
- export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
38
- export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
39
- export const wrapdescriptor_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
40
- export const wrapdescriptor_hasWildcard: (a: number) => number;
41
- export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
42
- export const wrapdescriptor_node: (a: number, b: number) => void;
43
- export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
44
- export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
45
- export const wrapdescriptor_toString: (a: number, b: number) => void;
46
- export const wrapminiscript_encode: (a: number, b: number) => void;
47
- export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
48
- export const wrapminiscript_fromBitcoinScriptExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
49
- export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
50
- export const wrapminiscript_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
51
- export const wrapminiscript_node: (a: number, b: number) => void;
52
- export const wrapminiscript_toAsmString: (a: number, b: number) => void;
53
- export const wrapminiscript_toString: (a: number, b: number) => void;
5
+ export const __wbg_bip322namespace_free: (a: number, b: number) => void;
54
6
  export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
55
7
  export const __wbg_ironwoodwitness_free: (a: number, b: number) => void;
56
- export const __wbg_messagenamespace_free: (a: number, b: number) => void;
8
+ export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
57
9
  export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
58
10
  export const __wbg_wasmecpair_free: (a: number, b: number) => void;
59
11
  export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
@@ -61,13 +13,22 @@ export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
61
13
  export const __wbg_wrappsbt_free: (a: number, b: number) => void;
62
14
  export const __wbg_zcashunifiedaddress_free: (a: number, b: number) => void;
63
15
  export const __wbg_zcashv6transaction_free: (a: number, b: number) => void;
16
+ export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
17
+ export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
18
+ export const bip322namespace_add_bip322_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
19
+ export const bip322namespace_get_bip322_message: (a: number, b: number, c: number) => void;
20
+ export const bip322namespace_verify_bip322_psbt_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
21
+ export const bip322namespace_verify_bip322_psbt_input_with_pubkeys: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
22
+ export const bip322namespace_verify_bip322_tx_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
23
+ export const bip322namespace_verify_bip322_tx_input_with_pubkeys: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
64
24
  export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
65
25
  export const inscriptionsnamespace_sign_reveal_transaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: bigint) => void;
66
26
  export const ironwood_build_witness: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
27
+ export const ironwood_build_witness_from_shard: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number, h: number, i: number, j: number) => void;
67
28
  export const ironwoodwitness_auth_path: (a: number, b: number) => void;
68
29
  export const ironwoodwitness_position: (a: number) => number;
69
- export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
70
- export const messagenamespace_verify_message: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
30
+ export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
31
+ export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
71
32
  export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
72
33
  export const wasmdashtransaction_get_inputs: (a: number, b: number) => void;
73
34
  export const wasmdashtransaction_get_outputs: (a: number, b: number) => void;
@@ -187,18 +148,13 @@ export const wasmzcashtransaction_lock_time: (a: number) => number;
187
148
  export const wasmzcashtransaction_version: (a: number) => number;
188
149
  export const wrappsbt_lock_time: (a: number) => number;
189
150
  export const wrappsbt_version: (a: number) => number;
190
- export const __wbg_bip322namespace_free: (a: number, b: number) => void;
191
151
  export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
192
152
  export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
153
+ export const __wbg_messagenamespace_free: (a: number, b: number) => void;
193
154
  export const __wbg_wasmbip32_free: (a: number, b: number) => void;
155
+ export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
194
156
  export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
195
157
  export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
196
- export const bip322namespace_add_bip322_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
197
- export const bip322namespace_get_bip322_message: (a: number, b: number, c: number) => void;
198
- export const bip322namespace_verify_bip322_psbt_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
199
- export const bip322namespace_verify_bip322_psbt_input_with_pubkeys: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
200
- export const bip322namespace_verify_bip322_tx_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
201
- export const bip322namespace_verify_bip322_tx_input_with_pubkeys: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
202
158
  export const bitgopsbt_add_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number, k: number) => void;
203
159
  export const bitgopsbt_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number, j: number, k: number, l: number) => void;
204
160
  export const bitgopsbt_add_ironwood_output: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
@@ -298,6 +254,8 @@ export const fixedscriptwalletnamespace_output_script_with_network_str: (a: numb
298
254
  export const fixedscriptwalletnamespace_p2sh_p2pk_output_script: (a: number, b: number, c: number) => void;
299
255
  export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: number, c: number, d: number, e: number) => void;
300
256
  export const fixedscriptwalletnamespace_to_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
257
+ export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
258
+ export const messagenamespace_verify_message: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
301
259
  export const wasmbip32_chain_code: (a: number) => number;
302
260
  export const wasmbip32_depth: (a: number) => number;
303
261
  export const wasmbip32_derive: (a: number, b: number, c: number) => void;
@@ -320,6 +278,21 @@ export const wasmbip32_private_key: (a: number) => number;
320
278
  export const wasmbip32_public_key: (a: number) => number;
321
279
  export const wasmbip32_to_base58: (a: number, b: number) => void;
322
280
  export const wasmbip32_to_wif: (a: number, b: number) => void;
281
+ export const wasmdimensions_empty: () => number;
282
+ export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
283
+ export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number, d: number) => void;
284
+ export const wasmdimensions_from_output_script_length: (a: number) => number;
285
+ export const wasmdimensions_from_output_script_type: (a: number, b: number, c: number) => void;
286
+ export const wasmdimensions_from_psbt: (a: number, b: number) => void;
287
+ export const wasmdimensions_get_input_vsize: (a: number, b: number, c: number) => number;
288
+ export const wasmdimensions_get_input_weight: (a: number, b: number, c: number) => number;
289
+ export const wasmdimensions_get_output_vsize: (a: number) => number;
290
+ export const wasmdimensions_get_output_weight: (a: number) => number;
291
+ export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
292
+ export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
293
+ export const wasmdimensions_has_segwit: (a: number) => number;
294
+ export const wasmdimensions_plus: (a: number, b: number) => number;
295
+ export const wasmdimensions_times: (a: number, b: number) => number;
323
296
  export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
324
297
  export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
325
298
  export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
@@ -332,6 +305,34 @@ export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
332
305
  export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
333
306
  export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
334
307
  export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
308
+ export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
309
+ export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
310
+ export const isInspectEnabled: () => number;
311
+ export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
312
+ export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
313
+ export const wrapdescriptor_descType: (a: number, b: number) => void;
314
+ export const wrapdescriptor_encode: (a: number, b: number) => void;
315
+ export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
316
+ export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
317
+ export const wrapdescriptor_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
318
+ export const wrapdescriptor_hasWildcard: (a: number) => number;
319
+ export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
320
+ export const wrapdescriptor_node: (a: number, b: number) => void;
321
+ export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
322
+ export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
323
+ export const wrapdescriptor_toString: (a: number, b: number) => void;
324
+ export const wrapminiscript_encode: (a: number, b: number) => void;
325
+ export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
326
+ export const wrapminiscript_fromBitcoinScriptExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
327
+ export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
328
+ export const wrapminiscript_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
329
+ export const wrapminiscript_node: (a: number, b: number) => void;
330
+ export const wrapminiscript_toAsmString: (a: number, b: number) => void;
331
+ export const wrapminiscript_toString: (a: number, b: number) => void;
332
+ export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
333
+ export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
334
+ export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
335
+ export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
335
336
  export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
336
337
  export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
337
338
  export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
@@ -1,4 +1,20 @@
1
1
  import { IronwoodWitness as WasmIronwoodWitness } from "../wasm/wasm_utxo.js";
2
+ /**
3
+ * A node of a pruned Orchard note-commitment (sub)tree, for {@link ZcashIronwoodWitness.buildFromShard}'s
4
+ * `shard`/`cap` inputs. Mirrors a real pruned tree store's shape (e.g. a `shardtree::ShardTree`):
5
+ * most leaves are never individually retained, only enough annotated hashes to reproduce a witness.
6
+ */
7
+ export type ShardTreeNode = {
8
+ type: "Nil";
9
+ } | {
10
+ type: "Leaf";
11
+ hash: Uint8Array;
12
+ } | {
13
+ type: "Parent";
14
+ hash?: Uint8Array;
15
+ left: ShardTreeNode;
16
+ right: ShardTreeNode;
17
+ };
2
18
  /**
3
19
  * A validated Merkle witness for an Ironwood/Orchard note commitment.
4
20
  *
@@ -19,6 +35,19 @@ export declare class ZcashIronwoodWitness {
19
35
  * recompute to `anchor`
20
36
  */
21
37
  static build(cmx: Uint8Array, position: number, authPath: Uint8Array[], anchor: Uint8Array): ZcashIronwoodWitness;
38
+ /**
39
+ * Build and validate a Merkle witness from a pruned shard + cap, instead of a
40
+ * caller-precomputed 32-entry path.
41
+ *
42
+ * `shardHeight` chooses which level the shard's root sits at (it spans up to `2^shardHeight`
43
+ * leaves); `shard` is the pruned subtree containing `position`, rooted at that level; `cap` is
44
+ * the pruned tree above every shard, down to (and including) shard-root nodes. `leafCount` is
45
+ * the total number of leaves committed to the tree as of `anchor` — positions beyond it are
46
+ * treated as canonically empty.
47
+ * @throws Under the same conditions as {@link build}, plus if `shard`/`cap` don't have enough
48
+ * detail to witness `position` as of `leafCount`
49
+ */
50
+ static buildFromShard(position: number, shardHeight: number, leafCount: bigint, cmx: Uint8Array, shard: ShardTreeNode, cap: ShardTreeNode, anchor: Uint8Array): ZcashIronwoodWitness;
22
51
  /** The leaf's position in the note commitment tree. */
23
52
  get position(): number;
24
53
  /**
@@ -1,4 +1,4 @@
1
- import { ironwood_build_witness, } from "../wasm/wasm_utxo.js";
1
+ import { ironwood_build_witness, ironwood_build_witness_from_shard, } from "../wasm/wasm_utxo.js";
2
2
  /**
3
3
  * A validated Merkle witness for an Ironwood/Orchard note commitment.
4
4
  *
@@ -23,6 +23,21 @@ export class ZcashIronwoodWitness {
23
23
  static build(cmx, position, authPath, anchor) {
24
24
  return new ZcashIronwoodWitness(ironwood_build_witness(cmx, position, authPath, anchor));
25
25
  }
26
+ /**
27
+ * Build and validate a Merkle witness from a pruned shard + cap, instead of a
28
+ * caller-precomputed 32-entry path.
29
+ *
30
+ * `shardHeight` chooses which level the shard's root sits at (it spans up to `2^shardHeight`
31
+ * leaves); `shard` is the pruned subtree containing `position`, rooted at that level; `cap` is
32
+ * the pruned tree above every shard, down to (and including) shard-root nodes. `leafCount` is
33
+ * the total number of leaves committed to the tree as of `anchor` — positions beyond it are
34
+ * treated as canonically empty.
35
+ * @throws Under the same conditions as {@link build}, plus if `shard`/`cap` don't have enough
36
+ * detail to witness `position` as of `leafCount`
37
+ */
38
+ static buildFromShard(position, shardHeight, leafCount, cmx, shard, cap, anchor) {
39
+ return new ZcashIronwoodWitness(ironwood_build_witness_from_shard(position, shardHeight, leafCount, cmx, shard, cap, anchor));
40
+ }
26
41
  /** The leaf's position in the note commitment tree. */
27
42
  get position() {
28
43
  return this._wasm.position;
@@ -14,6 +14,7 @@ export { ZcashIronwoodBitGoPsbt, zip302NoMemo, type CreateEmptyIronwoodOptions,
14
14
  export { ZcashUnifiedAddress } from "./ZcashUnifiedAddress.js";
15
15
  export { ZcashV6Transaction } from "./ZcashV6Transaction.js";
16
16
  export { ZcashIronwoodWitness } from "./ZcashIronwoodWitness.js";
17
+ export type { ShardTreeNode } from "./ZcashIronwoodWitness.js";
17
18
  import type { ScriptType } from "./scriptType.js";
18
19
  /**
19
20
  * Check if a network supports a given fixed-script wallet script type
@@ -1924,6 +1924,23 @@ export class ZcashV6Transaction {
1924
1924
  */
1925
1925
  export function ironwood_build_witness(cmx: Uint8Array, position: number, auth_path: Uint8Array[], anchor: Uint8Array): IronwoodWitness;
1926
1926
 
1927
+ /**
1928
+ * Build and validate an Ironwood witness from a pruned shard + cap, instead of a
1929
+ * caller-precomputed 32-entry path (see `ironwood_build_witness`).
1930
+ *
1931
+ * `shardHeight` chooses which level the shard's root sits at (it spans up to `2^shardHeight`
1932
+ * leaves); `shard` is the pruned subtree containing `position`, rooted at that level; `cap` is the
1933
+ * pruned tree above every shard, down to (and including) shard-root nodes. `leafCount` is the
1934
+ * total number of leaves committed to the tree as of `anchor` — positions beyond it are treated
1935
+ * as canonically empty. `shard`/`cap` are plain JS objects (not JSON strings) shaped like:
1936
+ * `{ type: "Nil" } | { type: "Leaf", hash: Uint8Array } | { type: "Parent", hash?: Uint8Array,
1937
+ * left: ShardTreeNode, right: ShardTreeNode }`.
1938
+ *
1939
+ * Throws under the same conditions as `ironwood_build_witness`, plus if `shard`/`cap` don't have
1940
+ * enough detail to witness `position` as of `leafCount`.
1941
+ */
1942
+ export function ironwood_build_witness_from_shard(position: number, shard_height: number, leaf_count: bigint, cmx: Uint8Array, shard: any, cap: any, anchor: Uint8Array): IronwoodWitness;
1943
+
1927
1944
  /**
1928
1945
  * Check if the inspect feature is enabled.
1929
1946
  *
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./wasm_utxo_bg.js";
5
5
  __wbg_set_wasm(wasm);
6
6
 
7
7
  export {
8
- AddressNamespace, Bip322Namespace, BitGoPsbt, FixedScriptWalletNamespace, InscriptionsNamespace, IronwoodWitness, MessageNamespace, UtxolibCompatNamespace, WasmBIP32, WasmDashTransaction, WasmDimensions, WasmECPair, WasmReplayProtection, WasmRootWalletKeys, WasmTransaction, WasmUtxoNamespace, WasmZcashTransaction, WrapDescriptor, WrapMiniscript, WrapPsbt, ZcashUnifiedAddress, ZcashV6Transaction, ironwood_build_witness, isInspectEnabled, parsePsbtRawToJson, parsePsbtToJson, parseTxToJson, zcashHasOrchardReceiver, zcashHasTransparentReceiver, zcashToShieldedReceiverWithCoin, zcashToTransparentReceiverWithCoin, zcash_branch_id_for_height, zcash_ironwood_version_group_id
8
+ AddressNamespace, Bip322Namespace, BitGoPsbt, FixedScriptWalletNamespace, InscriptionsNamespace, IronwoodWitness, MessageNamespace, UtxolibCompatNamespace, WasmBIP32, WasmDashTransaction, WasmDimensions, WasmECPair, WasmReplayProtection, WasmRootWalletKeys, WasmTransaction, WasmUtxoNamespace, WasmZcashTransaction, WrapDescriptor, WrapMiniscript, WrapPsbt, ZcashUnifiedAddress, ZcashV6Transaction, ironwood_build_witness, ironwood_build_witness_from_shard, isInspectEnabled, parsePsbtRawToJson, parsePsbtToJson, parseTxToJson, zcashHasOrchardReceiver, zcashHasTransparentReceiver, zcashToShieldedReceiverWithCoin, zcashToTransparentReceiverWithCoin, zcash_branch_id_for_height, zcash_ironwood_version_group_id
9
9
  } from "./wasm_utxo_bg.js";
@@ -7244,6 +7244,49 @@ export function ironwood_build_witness(cmx, position, auth_path, anchor) {
7244
7244
  }
7245
7245
  }
7246
7246
 
7247
+ /**
7248
+ * Build and validate an Ironwood witness from a pruned shard + cap, instead of a
7249
+ * caller-precomputed 32-entry path (see `ironwood_build_witness`).
7250
+ *
7251
+ * `shardHeight` chooses which level the shard's root sits at (it spans up to `2^shardHeight`
7252
+ * leaves); `shard` is the pruned subtree containing `position`, rooted at that level; `cap` is the
7253
+ * pruned tree above every shard, down to (and including) shard-root nodes. `leafCount` is the
7254
+ * total number of leaves committed to the tree as of `anchor` — positions beyond it are treated
7255
+ * as canonically empty. `shard`/`cap` are plain JS objects (not JSON strings) shaped like:
7256
+ * `{ type: "Nil" } | { type: "Leaf", hash: Uint8Array } | { type: "Parent", hash?: Uint8Array,
7257
+ * left: ShardTreeNode, right: ShardTreeNode }`.
7258
+ *
7259
+ * Throws under the same conditions as `ironwood_build_witness`, plus if `shard`/`cap` don't have
7260
+ * enough detail to witness `position` as of `leafCount`.
7261
+ * @param {number} position
7262
+ * @param {number} shard_height
7263
+ * @param {bigint} leaf_count
7264
+ * @param {Uint8Array} cmx
7265
+ * @param {any} shard
7266
+ * @param {any} cap
7267
+ * @param {Uint8Array} anchor
7268
+ * @returns {IronwoodWitness}
7269
+ */
7270
+ export function ironwood_build_witness_from_shard(position, shard_height, leaf_count, cmx, shard, cap, anchor) {
7271
+ try {
7272
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
7273
+ const ptr0 = passArray8ToWasm0(cmx, wasm.__wbindgen_export);
7274
+ const len0 = WASM_VECTOR_LEN;
7275
+ const ptr1 = passArray8ToWasm0(anchor, wasm.__wbindgen_export);
7276
+ const len1 = WASM_VECTOR_LEN;
7277
+ wasm.ironwood_build_witness_from_shard(retptr, position, shard_height, leaf_count, ptr0, len0, addHeapObject(shard), addHeapObject(cap), ptr1, len1);
7278
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
7279
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
7280
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
7281
+ if (r2) {
7282
+ throw takeObject(r1);
7283
+ }
7284
+ return IronwoodWitness.__wrap(r0);
7285
+ } finally {
7286
+ wasm.__wbindgen_add_to_stack_pointer(16);
7287
+ }
7288
+ }
7289
+
7247
7290
  /**
7248
7291
  * Check if the inspect feature is enabled.
7249
7292
  *
@@ -7563,6 +7606,13 @@ export function __wbg_Error_8c4e43fe74559d73(arg0, arg1) {
7563
7606
  const ret = Error(getStringFromWasm0(arg0, arg1));
7564
7607
  return addHeapObject(ret);
7565
7608
  }
7609
+ export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
7610
+ const ret = String(getObject(arg1));
7611
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
7612
+ const len1 = WASM_VECTOR_LEN;
7613
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
7614
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
7615
+ }
7566
7616
  export function __wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2(arg0, arg1) {
7567
7617
  const v = getObject(arg1);
7568
7618
  const ret = typeof(v) === 'bigint' ? v : undefined;
@@ -7581,6 +7631,10 @@ export function __wbg___wbindgen_debug_string_0bc8482c6e3508ae(arg0, arg1) {
7581
7631
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
7582
7632
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
7583
7633
  }
7634
+ export function __wbg___wbindgen_in_47fa6863be6f2f25(arg0, arg1) {
7635
+ const ret = getObject(arg0) in getObject(arg1);
7636
+ return ret;
7637
+ }
7584
7638
  export function __wbg___wbindgen_is_bigint_31b12575b56f32fc(arg0) {
7585
7639
  const ret = typeof(getObject(arg0)) === 'bigint';
7586
7640
  return ret;
@@ -7610,6 +7664,10 @@ export function __wbg___wbindgen_jsval_eq_11888390b0186270(arg0, arg1) {
7610
7664
  const ret = getObject(arg0) === getObject(arg1);
7611
7665
  return ret;
7612
7666
  }
7667
+ export function __wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811(arg0, arg1) {
7668
+ const ret = getObject(arg0) == getObject(arg1);
7669
+ return ret;
7670
+ }
7613
7671
  export function __wbg___wbindgen_number_get_8ff4255516ccad3e(arg0, arg1) {
7614
7672
  const obj = getObject(arg1);
7615
7673
  const ret = typeof(obj) === 'number' ? obj : undefined;
@@ -7639,6 +7697,14 @@ export function __wbg_crypto_574e78ad8b13b65f(arg0) {
7639
7697
  const ret = getObject(arg0).crypto;
7640
7698
  return addHeapObject(ret);
7641
7699
  }
7700
+ export function __wbg_done_57b39ecd9addfe81(arg0) {
7701
+ const ret = getObject(arg0).done;
7702
+ return ret;
7703
+ }
7704
+ export function __wbg_entries_58c7934c745daac7(arg0) {
7705
+ const ret = Object.entries(getObject(arg0));
7706
+ return addHeapObject(ret);
7707
+ }
7642
7708
  export function __wbg_for_c3adefd268cb6f1c(arg0, arg1) {
7643
7709
  const ret = Symbol.for(getStringFromWasm0(arg0, arg1));
7644
7710
  return addHeapObject(ret);
@@ -7658,6 +7724,48 @@ export function __wbg_get_b3ed3ad4be2bc8ac() { return handleError(function (arg0
7658
7724
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
7659
7725
  return addHeapObject(ret);
7660
7726
  }, arguments); }
7727
+ export function __wbg_instanceof_ArrayBuffer_c367199e2fa2aa04(arg0) {
7728
+ let result;
7729
+ try {
7730
+ result = getObject(arg0) instanceof ArrayBuffer;
7731
+ } catch (_) {
7732
+ result = false;
7733
+ }
7734
+ const ret = result;
7735
+ return ret;
7736
+ }
7737
+ export function __wbg_instanceof_Map_53af74335dec57f4(arg0) {
7738
+ let result;
7739
+ try {
7740
+ result = getObject(arg0) instanceof Map;
7741
+ } catch (_) {
7742
+ result = false;
7743
+ }
7744
+ const ret = result;
7745
+ return ret;
7746
+ }
7747
+ export function __wbg_instanceof_Uint8Array_9b9075935c74707c(arg0) {
7748
+ let result;
7749
+ try {
7750
+ result = getObject(arg0) instanceof Uint8Array;
7751
+ } catch (_) {
7752
+ result = false;
7753
+ }
7754
+ const ret = result;
7755
+ return ret;
7756
+ }
7757
+ export function __wbg_isArray_d314bb98fcf08331(arg0) {
7758
+ const ret = Array.isArray(getObject(arg0));
7759
+ return ret;
7760
+ }
7761
+ export function __wbg_isSafeInteger_bfbc7332a9768d2a(arg0) {
7762
+ const ret = Number.isSafeInteger(getObject(arg0));
7763
+ return ret;
7764
+ }
7765
+ export function __wbg_iterator_6ff6560ca1568e55() {
7766
+ const ret = Symbol.iterator;
7767
+ return addHeapObject(ret);
7768
+ }
7661
7769
  export function __wbg_length_32ed9a279acd054c(arg0) {
7662
7770
  const ret = getObject(arg0).length;
7663
7771
  return ret;
@@ -7698,6 +7806,14 @@ export function __wbg_new_with_length_a2c39cbe88fd8ff1(arg0) {
7698
7806
  const ret = new Uint8Array(arg0 >>> 0);
7699
7807
  return addHeapObject(ret);
7700
7808
  }
7809
+ export function __wbg_next_3482f54c49e8af19() { return handleError(function (arg0) {
7810
+ const ret = getObject(arg0).next();
7811
+ return addHeapObject(ret);
7812
+ }, arguments); }
7813
+ export function __wbg_next_418f80d8f5303233(arg0) {
7814
+ const ret = getObject(arg0).next;
7815
+ return addHeapObject(ret);
7816
+ }
7701
7817
  export function __wbg_node_905d3e251edff8a2(arg0) {
7702
7818
  const ret = getObject(arg0).node;
7703
7819
  return addHeapObject(ret);
@@ -7744,6 +7860,10 @@ export function __wbg_subarray_a96e1fef17ed23cb(arg0, arg1, arg2) {
7744
7860
  const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
7745
7861
  return addHeapObject(ret);
7746
7862
  }
7863
+ export function __wbg_value_0546255b415e96c1(arg0) {
7864
+ const ret = getObject(arg0).value;
7865
+ return addHeapObject(ret);
7866
+ }
7747
7867
  export function __wbg_versions_c01dfd4722a88165(arg0) {
7748
7868
  const ret = getObject(arg0).versions;
7749
7869
  return addHeapObject(ret);
@@ -7773,17 +7893,22 @@ export function __wbindgen_cast_0000000000000001(arg0) {
7773
7893
  const ret = arg0;
7774
7894
  return addHeapObject(ret);
7775
7895
  }
7776
- export function __wbindgen_cast_0000000000000002(arg0, arg1) {
7896
+ export function __wbindgen_cast_0000000000000002(arg0) {
7897
+ // Cast intrinsic for `I64 -> Externref`.
7898
+ const ret = arg0;
7899
+ return addHeapObject(ret);
7900
+ }
7901
+ export function __wbindgen_cast_0000000000000003(arg0, arg1) {
7777
7902
  // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
7778
7903
  const ret = getArrayU8FromWasm0(arg0, arg1);
7779
7904
  return addHeapObject(ret);
7780
7905
  }
7781
- export function __wbindgen_cast_0000000000000003(arg0, arg1) {
7906
+ export function __wbindgen_cast_0000000000000004(arg0, arg1) {
7782
7907
  // Cast intrinsic for `Ref(String) -> Externref`.
7783
7908
  const ret = getStringFromWasm0(arg0, arg1);
7784
7909
  return addHeapObject(ret);
7785
7910
  }
7786
- export function __wbindgen_cast_0000000000000004(arg0) {
7911
+ export function __wbindgen_cast_0000000000000005(arg0) {
7787
7912
  // Cast intrinsic for `U64 -> Externref`.
7788
7913
  const ret = BigInt.asUintN(64, arg0);
7789
7914
  return addHeapObject(ret);
Binary file
@@ -2,58 +2,10 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const __wbg_addressnamespace_free: (a: number, b: number) => void;
5
- export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
6
- export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
7
- export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
8
- export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
9
- export const isInspectEnabled: () => number;
10
- export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
11
- export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
12
- export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
13
- export const wasmdimensions_empty: () => number;
14
- export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
15
- export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number, d: number) => void;
16
- export const wasmdimensions_from_output_script_length: (a: number) => number;
17
- export const wasmdimensions_from_output_script_type: (a: number, b: number, c: number) => void;
18
- export const wasmdimensions_from_psbt: (a: number, b: number) => void;
19
- export const wasmdimensions_get_input_vsize: (a: number, b: number, c: number) => number;
20
- export const wasmdimensions_get_input_weight: (a: number, b: number, c: number) => number;
21
- export const wasmdimensions_get_output_vsize: (a: number) => number;
22
- export const wasmdimensions_get_output_weight: (a: number) => number;
23
- export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
24
- export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
25
- export const wasmdimensions_has_segwit: (a: number) => number;
26
- export const wasmdimensions_plus: (a: number, b: number) => number;
27
- export const wasmdimensions_times: (a: number, b: number) => number;
28
- export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
29
- export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
30
- export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
31
- export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
32
- export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
33
- export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
34
- export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
35
- export const wrapdescriptor_descType: (a: number, b: number) => void;
36
- export const wrapdescriptor_encode: (a: number, b: number) => void;
37
- export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
38
- export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
39
- export const wrapdescriptor_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
40
- export const wrapdescriptor_hasWildcard: (a: number) => number;
41
- export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
42
- export const wrapdescriptor_node: (a: number, b: number) => void;
43
- export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
44
- export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
45
- export const wrapdescriptor_toString: (a: number, b: number) => void;
46
- export const wrapminiscript_encode: (a: number, b: number) => void;
47
- export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
48
- export const wrapminiscript_fromBitcoinScriptExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
49
- export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
50
- export const wrapminiscript_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
51
- export const wrapminiscript_node: (a: number, b: number) => void;
52
- export const wrapminiscript_toAsmString: (a: number, b: number) => void;
53
- export const wrapminiscript_toString: (a: number, b: number) => void;
5
+ export const __wbg_bip322namespace_free: (a: number, b: number) => void;
54
6
  export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
55
7
  export const __wbg_ironwoodwitness_free: (a: number, b: number) => void;
56
- export const __wbg_messagenamespace_free: (a: number, b: number) => void;
8
+ export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
57
9
  export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
58
10
  export const __wbg_wasmecpair_free: (a: number, b: number) => void;
59
11
  export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
@@ -61,13 +13,22 @@ export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
61
13
  export const __wbg_wrappsbt_free: (a: number, b: number) => void;
62
14
  export const __wbg_zcashunifiedaddress_free: (a: number, b: number) => void;
63
15
  export const __wbg_zcashv6transaction_free: (a: number, b: number) => void;
16
+ export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
17
+ export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
18
+ export const bip322namespace_add_bip322_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
19
+ export const bip322namespace_get_bip322_message: (a: number, b: number, c: number) => void;
20
+ export const bip322namespace_verify_bip322_psbt_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
21
+ export const bip322namespace_verify_bip322_psbt_input_with_pubkeys: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
22
+ export const bip322namespace_verify_bip322_tx_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
23
+ export const bip322namespace_verify_bip322_tx_input_with_pubkeys: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
64
24
  export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
65
25
  export const inscriptionsnamespace_sign_reveal_transaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: bigint) => void;
66
26
  export const ironwood_build_witness: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
27
+ export const ironwood_build_witness_from_shard: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number, h: number, i: number, j: number) => void;
67
28
  export const ironwoodwitness_auth_path: (a: number, b: number) => void;
68
29
  export const ironwoodwitness_position: (a: number) => number;
69
- export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
70
- export const messagenamespace_verify_message: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
30
+ export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
31
+ export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
71
32
  export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
72
33
  export const wasmdashtransaction_get_inputs: (a: number, b: number) => void;
73
34
  export const wasmdashtransaction_get_outputs: (a: number, b: number) => void;
@@ -187,18 +148,13 @@ export const wasmzcashtransaction_lock_time: (a: number) => number;
187
148
  export const wasmzcashtransaction_version: (a: number) => number;
188
149
  export const wrappsbt_lock_time: (a: number) => number;
189
150
  export const wrappsbt_version: (a: number) => number;
190
- export const __wbg_bip322namespace_free: (a: number, b: number) => void;
191
151
  export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
192
152
  export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
153
+ export const __wbg_messagenamespace_free: (a: number, b: number) => void;
193
154
  export const __wbg_wasmbip32_free: (a: number, b: number) => void;
155
+ export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
194
156
  export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
195
157
  export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
196
- export const bip322namespace_add_bip322_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
197
- export const bip322namespace_get_bip322_message: (a: number, b: number, c: number) => void;
198
- export const bip322namespace_verify_bip322_psbt_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
199
- export const bip322namespace_verify_bip322_psbt_input_with_pubkeys: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
200
- export const bip322namespace_verify_bip322_tx_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
201
- export const bip322namespace_verify_bip322_tx_input_with_pubkeys: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
202
158
  export const bitgopsbt_add_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number, k: number) => void;
203
159
  export const bitgopsbt_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number, j: number, k: number, l: number) => void;
204
160
  export const bitgopsbt_add_ironwood_output: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
@@ -298,6 +254,8 @@ export const fixedscriptwalletnamespace_output_script_with_network_str: (a: numb
298
254
  export const fixedscriptwalletnamespace_p2sh_p2pk_output_script: (a: number, b: number, c: number) => void;
299
255
  export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: number, c: number, d: number, e: number) => void;
300
256
  export const fixedscriptwalletnamespace_to_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
257
+ export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
258
+ export const messagenamespace_verify_message: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
301
259
  export const wasmbip32_chain_code: (a: number) => number;
302
260
  export const wasmbip32_depth: (a: number) => number;
303
261
  export const wasmbip32_derive: (a: number, b: number, c: number) => void;
@@ -320,6 +278,21 @@ export const wasmbip32_private_key: (a: number) => number;
320
278
  export const wasmbip32_public_key: (a: number) => number;
321
279
  export const wasmbip32_to_base58: (a: number, b: number) => void;
322
280
  export const wasmbip32_to_wif: (a: number, b: number) => void;
281
+ export const wasmdimensions_empty: () => number;
282
+ export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
283
+ export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number, d: number) => void;
284
+ export const wasmdimensions_from_output_script_length: (a: number) => number;
285
+ export const wasmdimensions_from_output_script_type: (a: number, b: number, c: number) => void;
286
+ export const wasmdimensions_from_psbt: (a: number, b: number) => void;
287
+ export const wasmdimensions_get_input_vsize: (a: number, b: number, c: number) => number;
288
+ export const wasmdimensions_get_input_weight: (a: number, b: number, c: number) => number;
289
+ export const wasmdimensions_get_output_vsize: (a: number) => number;
290
+ export const wasmdimensions_get_output_weight: (a: number) => number;
291
+ export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
292
+ export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
293
+ export const wasmdimensions_has_segwit: (a: number) => number;
294
+ export const wasmdimensions_plus: (a: number, b: number) => number;
295
+ export const wasmdimensions_times: (a: number, b: number) => number;
323
296
  export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
324
297
  export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
325
298
  export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
@@ -332,6 +305,34 @@ export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
332
305
  export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
333
306
  export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
334
307
  export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
308
+ export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
309
+ export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
310
+ export const isInspectEnabled: () => number;
311
+ export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
312
+ export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
313
+ export const wrapdescriptor_descType: (a: number, b: number) => void;
314
+ export const wrapdescriptor_encode: (a: number, b: number) => void;
315
+ export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
316
+ export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
317
+ export const wrapdescriptor_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
318
+ export const wrapdescriptor_hasWildcard: (a: number) => number;
319
+ export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
320
+ export const wrapdescriptor_node: (a: number, b: number) => void;
321
+ export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
322
+ export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
323
+ export const wrapdescriptor_toString: (a: number, b: number) => void;
324
+ export const wrapminiscript_encode: (a: number, b: number) => void;
325
+ export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
326
+ export const wrapminiscript_fromBitcoinScriptExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
327
+ export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
328
+ export const wrapminiscript_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
329
+ export const wrapminiscript_node: (a: number, b: number) => void;
330
+ export const wrapminiscript_toAsmString: (a: number, b: number) => void;
331
+ export const wrapminiscript_toString: (a: number, b: number) => void;
332
+ export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
333
+ export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
334
+ export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
335
+ export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
335
336
  export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
336
337
  export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
337
338
  export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitgo/wasm-utxo",
3
3
  "description": "WebAssembly wrapper for rust-bitcoin (beta)",
4
- "version": "5.3.0",
4
+ "version": "5.4.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",