@bitgo/wasm-utxo 4.39.0 → 4.41.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.
@@ -198,4 +198,28 @@ export declare class ZcashBitGoPsbt extends BitGoPsbt<ZcashParsedOutput> {
198
198
  * @throws Error if the PSBT is not fully finalized or extraction fails
199
199
  */
200
200
  extractTransaction(maxFeeRate?: number): ZcashTransaction;
201
+ /**
202
+ * Add a plain transparent output. Just `script`/`value` (no `unifiedAddress`) is the same as
203
+ * the generic {@link BitGoPsbt.addOutput}, unchanged.
204
+ *
205
+ * If `unifiedAddress` is given, it must be a Unified Address whose transparent receiver is
206
+ * exactly `script` — mismatches throw rather than being silently stored. It is then kept
207
+ * verbatim, keyed by this output's index, so {@link ZcashBitGoPsbt.transparentOutputUnifiedAddress}
208
+ * can later return the original UA string rather than just the bare scriptPubkey.
209
+ *
210
+ * `unifiedAddress` is only supported on a legacy v4 `ZcashBitGoPsbt` — the v6 (Ironwood)
211
+ * shielded side has its own UA path (`ZcashIronwoodBitGoPsbt.addShieldedOutput`'s
212
+ * `unifiedAddress` option).
213
+ *
214
+ * @param script - The output scriptPubkey
215
+ * @param value - The value in zatoshi
216
+ * @param unifiedAddress - Optional full Unified Address `script` was resolved from
217
+ * @returns The index of the newly added output
218
+ */
219
+ addTransparentOutput(script: Uint8Array, value: bigint, unifiedAddress?: string): number;
220
+ /**
221
+ * The Unified Address stored by {@link ZcashBitGoPsbt.addTransparentOutput} for output `index`,
222
+ * if one was supplied — `undefined` otherwise.
223
+ */
224
+ transparentOutputUnifiedAddress(index: number): string | undefined;
201
225
  }
@@ -211,4 +211,32 @@ export class ZcashBitGoPsbt extends BitGoPsbt {
211
211
  extractTransaction(maxFeeRate) {
212
212
  return ZcashTransaction.fromWasm(this.wasm.extract_zcash_transaction(maxFeeRate));
213
213
  }
214
+ /**
215
+ * Add a plain transparent output. Just `script`/`value` (no `unifiedAddress`) is the same as
216
+ * the generic {@link BitGoPsbt.addOutput}, unchanged.
217
+ *
218
+ * If `unifiedAddress` is given, it must be a Unified Address whose transparent receiver is
219
+ * exactly `script` — mismatches throw rather than being silently stored. It is then kept
220
+ * verbatim, keyed by this output's index, so {@link ZcashBitGoPsbt.transparentOutputUnifiedAddress}
221
+ * can later return the original UA string rather than just the bare scriptPubkey.
222
+ *
223
+ * `unifiedAddress` is only supported on a legacy v4 `ZcashBitGoPsbt` — the v6 (Ironwood)
224
+ * shielded side has its own UA path (`ZcashIronwoodBitGoPsbt.addShieldedOutput`'s
225
+ * `unifiedAddress` option).
226
+ *
227
+ * @param script - The output scriptPubkey
228
+ * @param value - The value in zatoshi
229
+ * @param unifiedAddress - Optional full Unified Address `script` was resolved from
230
+ * @returns The index of the newly added output
231
+ */
232
+ addTransparentOutput(script, value, unifiedAddress) {
233
+ return this.wasm.add_transparent_output(script, value, unifiedAddress);
234
+ }
235
+ /**
236
+ * The Unified Address stored by {@link ZcashBitGoPsbt.addTransparentOutput} for output `index`,
237
+ * if one was supplied — `undefined` otherwise.
238
+ */
239
+ transparentOutputUnifiedAddress(index) {
240
+ return this.wasm.transparent_output_unified_address(index);
241
+ }
214
242
  }
@@ -0,0 +1,31 @@
1
+ import { IronwoodWitness as WasmIronwoodWitness } from "../wasm/wasm_utxo.js";
2
+ /**
3
+ * A validated Merkle witness for an Ironwood/Orchard note commitment.
4
+ *
5
+ * Build with {@link ZcashIronwoodWitness.build}: `cmx` is the note commitment being
6
+ * witnessed, `authPath` must be exactly 32 sibling hashes (32 bytes each, leaf-to-root
7
+ * order), and `anchor` is the expected note-commitment-tree root. Throws if any input
8
+ * isn't a canonical field element, or if the witness doesn't recompute to `anchor`.
9
+ *
10
+ * wasm-utxo has no chain state, so the raw sibling-hash path must be supplied by the
11
+ * caller (typically BitGo's backend, querying a Zcash-aware service).
12
+ */
13
+ export declare class ZcashIronwoodWitness {
14
+ private _wasm;
15
+ private constructor();
16
+ /**
17
+ * Build and validate a Merkle witness for an Ironwood/Orchard note commitment.
18
+ * @throws If any input isn't a canonical field element, or the witness doesn't
19
+ * recompute to `anchor`
20
+ */
21
+ static build(cmx: Uint8Array, position: number, authPath: Uint8Array[], anchor: Uint8Array): ZcashIronwoodWitness;
22
+ /** The leaf's position in the note commitment tree. */
23
+ get position(): number;
24
+ /**
25
+ * The 32 sibling hashes (leaf-to-root order), flattened into a single 1024-byte array
26
+ * (32 hashes × 32 bytes each).
27
+ */
28
+ get authPath(): Uint8Array;
29
+ /** @internal */
30
+ get wasm(): WasmIronwoodWitness;
31
+ }
@@ -0,0 +1,41 @@
1
+ import { ironwood_build_witness, } from "../wasm/wasm_utxo.js";
2
+ /**
3
+ * A validated Merkle witness for an Ironwood/Orchard note commitment.
4
+ *
5
+ * Build with {@link ZcashIronwoodWitness.build}: `cmx` is the note commitment being
6
+ * witnessed, `authPath` must be exactly 32 sibling hashes (32 bytes each, leaf-to-root
7
+ * order), and `anchor` is the expected note-commitment-tree root. Throws if any input
8
+ * isn't a canonical field element, or if the witness doesn't recompute to `anchor`.
9
+ *
10
+ * wasm-utxo has no chain state, so the raw sibling-hash path must be supplied by the
11
+ * caller (typically BitGo's backend, querying a Zcash-aware service).
12
+ */
13
+ export class ZcashIronwoodWitness {
14
+ _wasm;
15
+ constructor(_wasm) {
16
+ this._wasm = _wasm;
17
+ }
18
+ /**
19
+ * Build and validate a Merkle witness for an Ironwood/Orchard note commitment.
20
+ * @throws If any input isn't a canonical field element, or the witness doesn't
21
+ * recompute to `anchor`
22
+ */
23
+ static build(cmx, position, authPath, anchor) {
24
+ return new ZcashIronwoodWitness(ironwood_build_witness(cmx, position, authPath, anchor));
25
+ }
26
+ /** The leaf's position in the note commitment tree. */
27
+ get position() {
28
+ return this._wasm.position;
29
+ }
30
+ /**
31
+ * The 32 sibling hashes (leaf-to-root order), flattened into a single 1024-byte array
32
+ * (32 hashes × 32 bytes each).
33
+ */
34
+ get authPath() {
35
+ return this._wasm.auth_path;
36
+ }
37
+ /** @internal */
38
+ get wasm() {
39
+ return this._wasm;
40
+ }
41
+ }
@@ -12,6 +12,7 @@ export { ZcashBitGoPsbt, type ZcashNetworkName, type ZcashParsedOutput, type Cre
12
12
  export { ZcashIronwoodBitGoPsbt, zip302NoMemo, type CreateEmptyIronwoodOptions, type CreateEmptyIronwoodWithConsensusBranchIdOptions, } from "./ZcashIronwoodBitGoPsbt.js";
13
13
  export { ZcashUnifiedAddress } from "./ZcashUnifiedAddress.js";
14
14
  export { ZcashV6Transaction } from "./ZcashV6Transaction.js";
15
+ export { ZcashIronwoodWitness } from "./ZcashIronwoodWitness.js";
15
16
  import type { ScriptType } from "./scriptType.js";
16
17
  /**
17
18
  * Check if a network supports a given fixed-script wallet script type
@@ -18,6 +18,8 @@ export { ZcashIronwoodBitGoPsbt, zip302NoMemo, } from "./ZcashIronwoodBitGoPsbt.
18
18
  export { ZcashUnifiedAddress } from "./ZcashUnifiedAddress.js";
19
19
  // Zcash v6 (Ironwood / NU6.3) transaction
20
20
  export { ZcashV6Transaction } from "./ZcashV6Transaction.js";
21
+ // Zcash v6 (Ironwood / NU6.3) Merkle witness
22
+ export { ZcashIronwoodWitness } from "./ZcashIronwoodWitness.js";
21
23
  /**
22
24
  * Check if a network supports a given fixed-script wallet script type
23
25
  *
@@ -200,6 +200,18 @@ export class BitGoPsbt {
200
200
  add_paygo_attestation(output_index: number, entropy: Uint8Array, signature: Uint8Array): void;
201
201
  add_replay_protection_input(ecpair: WasmECPair, txid: string, vout: number, value: bigint, sequence?: number | null, prev_tx?: Uint8Array | null): number;
202
202
  add_replay_protection_input_at_index(index: number, ecpair: WasmECPair, txid: string, vout: number, value: bigint, sequence?: number | null, prev_tx?: Uint8Array | null): number;
203
+ /**
204
+ * Zcash-only: add a plain transparent output. Just `script`/`value`
205
+ * (`unified_address: undefined`) is the legacy `add_output` behavior, unchanged.
206
+ *
207
+ * If `unified_address` is given, this PSBT must be a legacy v4 Zcash PSBT — a v6 (Ironwood)
208
+ * PSBT's shielded side already has its own UA path (`add_ironwood_output`). The UA must be a
209
+ * Unified Address whose transparent receiver is exactly `script`; mismatches are rejected
210
+ * rather than silently stored. It is then kept verbatim, keyed by this output's index, so
211
+ * `transparent_output_unified_address` can later return the original UA string rather than
212
+ * just the bare scriptPubkey.
213
+ */
214
+ add_transparent_output(script: Uint8Array, value: bigint, unified_address?: string | null): number;
203
215
  add_wallet_input(txid: string, vout: number, value: bigint, wallet_keys: WasmRootWalletKeys, chain: number, index: number, signer?: string | null, cosigner?: string | null, sequence?: number | null, prev_tx?: Uint8Array | null): number;
204
216
  add_wallet_input_at_index(index: number, txid: string, vout: number, value: bigint, wallet_keys: WasmRootWalletKeys, chain: number, derivation_index: number, signer?: string | null, cosigner?: string | null, sequence?: number | null, prev_tx?: Uint8Array | null): number;
205
217
  add_wallet_output(chain: number, index: number, value: bigint, wallet_keys: WasmRootWalletKeys): number;
@@ -796,6 +808,12 @@ export class BitGoPsbt {
796
808
  * - `Err(WasmUtxoError)` if signing fails
797
809
  */
798
810
  sign_with_xpriv(input_index: number, xpriv: WasmBIP32): void;
811
+ /**
812
+ * Zcash-only: the Unified Address stored by [`Self::add_transparent_output`] for output
813
+ * `index`, if the caller supplied one — `undefined` otherwise (including for a non-Zcash
814
+ * PSBT).
815
+ */
816
+ transparent_output_unified_address(index: number): string | undefined;
799
817
  unsigned_tx_id(): string;
800
818
  /**
801
819
  * Verify if a replay protection input has a valid signature
@@ -966,6 +984,27 @@ export class InscriptionsNamespace {
966
984
  static sign_reveal_transaction(private_key: Uint8Array, tap_leaf_script: any, commit_tx: WasmTransaction, commit_output_script: Uint8Array, recipient_output_script: Uint8Array, output_value_sats: bigint): Uint8Array;
967
985
  }
968
986
 
987
+ /**
988
+ * A validated Merkle witness for an Ironwood/Orchard note commitment, from
989
+ * [`ironwood_build_witness`].
990
+ *
991
+ * Not yet installed anywhere — see [`ironwood_build_witness`]'s docs.
992
+ */
993
+ export class IronwoodWitness {
994
+ private constructor();
995
+ free(): void;
996
+ [Symbol.dispose](): void;
997
+ /**
998
+ * The 32 sibling hashes (leaf-to-root order), flattened into a single 1024-byte array
999
+ * (32 hashes × 32 bytes each).
1000
+ */
1001
+ readonly auth_path: Uint8Array;
1002
+ /**
1003
+ * The leaf's position in the note commitment tree.
1004
+ */
1005
+ readonly position: number;
1006
+ }
1007
+
969
1008
  export class MessageNamespace {
970
1009
  private constructor();
971
1010
  free(): void;
@@ -1843,6 +1882,19 @@ export class ZcashV6Transaction {
1843
1882
  readonly ironwoodValueBalance: bigint;
1844
1883
  }
1845
1884
 
1885
+ /**
1886
+ * Build and validate a Merkle witness for an Ironwood/Orchard note commitment.
1887
+ *
1888
+ * `cmx` is the note commitment being witnessed; `auth_path` must be exactly 32 sibling hashes (32
1889
+ * bytes each), leaf-to-root order; `anchor` is the expected note-commitment-tree root. Throws if
1890
+ * any input isn't a canonical field element, or if the witness doesn't recompute to `anchor`.
1891
+ *
1892
+ * This crate has no chain state, so the raw sibling-hash path must be supplied by the caller
1893
+ * (typically BitGo's backend, querying a Zcash-aware service). The returned witness is not yet
1894
+ * installed anywhere — hook it into a spend once real-spend construction exists.
1895
+ */
1896
+ export function ironwood_build_witness(cmx: Uint8Array, position: number, auth_path: Uint8Array[], anchor: Uint8Array): IronwoodWitness;
1897
+
1846
1898
  /**
1847
1899
  * Check if the inspect feature is enabled.
1848
1900
  *
@@ -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, MessageNamespace, UtxolibCompatNamespace, WasmBIP32, WasmDashTransaction, WasmDimensions, WasmECPair, WasmReplayProtection, WasmRootWalletKeys, WasmTransaction, WasmUtxoNamespace, WasmZcashTransaction, WrapDescriptor, WrapMiniscript, WrapPsbt, ZcashUnifiedAddress, ZcashV6Transaction, isInspectEnabled, parsePsbtRawToJson, parsePsbtToJson, parseTxToJson, 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, isInspectEnabled, parsePsbtRawToJson, parsePsbtToJson, parseTxToJson, zcash_branch_id_for_height, zcash_ironwood_version_group_id
9
9
  } from "./wasm_utxo_bg.js";
@@ -759,6 +759,40 @@ export class BitGoPsbt {
759
759
  wasm.__wbindgen_add_to_stack_pointer(16);
760
760
  }
761
761
  }
762
+ /**
763
+ * Zcash-only: add a plain transparent output. Just `script`/`value`
764
+ * (`unified_address: undefined`) is the legacy `add_output` behavior, unchanged.
765
+ *
766
+ * If `unified_address` is given, this PSBT must be a legacy v4 Zcash PSBT — a v6 (Ironwood)
767
+ * PSBT's shielded side already has its own UA path (`add_ironwood_output`). The UA must be a
768
+ * Unified Address whose transparent receiver is exactly `script`; mismatches are rejected
769
+ * rather than silently stored. It is then kept verbatim, keyed by this output's index, so
770
+ * `transparent_output_unified_address` can later return the original UA string rather than
771
+ * just the bare scriptPubkey.
772
+ * @param {Uint8Array} script
773
+ * @param {bigint} value
774
+ * @param {string | null} [unified_address]
775
+ * @returns {number}
776
+ */
777
+ add_transparent_output(script, value, unified_address) {
778
+ try {
779
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
780
+ const ptr0 = passArray8ToWasm0(script, wasm.__wbindgen_export);
781
+ const len0 = WASM_VECTOR_LEN;
782
+ var ptr1 = isLikeNone(unified_address) ? 0 : passStringToWasm0(unified_address, wasm.__wbindgen_export, wasm.__wbindgen_export2);
783
+ var len1 = WASM_VECTOR_LEN;
784
+ wasm.bitgopsbt_add_transparent_output(retptr, this.__wbg_ptr, ptr0, len0, value, ptr1, len1);
785
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
786
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
787
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
788
+ if (r2) {
789
+ throw takeObject(r1);
790
+ }
791
+ return r0 >>> 0;
792
+ } finally {
793
+ wasm.__wbindgen_add_to_stack_pointer(16);
794
+ }
795
+ }
762
796
  /**
763
797
  * @param {string} txid
764
798
  * @param {number} vout
@@ -2586,6 +2620,29 @@ export class BitGoPsbt {
2586
2620
  wasm.__wbindgen_add_to_stack_pointer(16);
2587
2621
  }
2588
2622
  }
2623
+ /**
2624
+ * Zcash-only: the Unified Address stored by [`Self::add_transparent_output`] for output
2625
+ * `index`, if the caller supplied one — `undefined` otherwise (including for a non-Zcash
2626
+ * PSBT).
2627
+ * @param {number} index
2628
+ * @returns {string | undefined}
2629
+ */
2630
+ transparent_output_unified_address(index) {
2631
+ try {
2632
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2633
+ wasm.bitgopsbt_transparent_output_unified_address(retptr, this.__wbg_ptr, index);
2634
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2635
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2636
+ let v1;
2637
+ if (r0 !== 0) {
2638
+ v1 = getStringFromWasm0(r0, r1).slice();
2639
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2640
+ }
2641
+ return v1;
2642
+ } finally {
2643
+ wasm.__wbindgen_add_to_stack_pointer(16);
2644
+ }
2645
+ }
2589
2646
  /**
2590
2647
  * @returns {string}
2591
2648
  */
@@ -3126,6 +3183,59 @@ export class InscriptionsNamespace {
3126
3183
  }
3127
3184
  if (Symbol.dispose) InscriptionsNamespace.prototype[Symbol.dispose] = InscriptionsNamespace.prototype.free;
3128
3185
 
3186
+ /**
3187
+ * A validated Merkle witness for an Ironwood/Orchard note commitment, from
3188
+ * [`ironwood_build_witness`].
3189
+ *
3190
+ * Not yet installed anywhere — see [`ironwood_build_witness`]'s docs.
3191
+ */
3192
+ export class IronwoodWitness {
3193
+ static __wrap(ptr) {
3194
+ ptr = ptr >>> 0;
3195
+ const obj = Object.create(IronwoodWitness.prototype);
3196
+ obj.__wbg_ptr = ptr;
3197
+ IronwoodWitnessFinalization.register(obj, obj.__wbg_ptr, obj);
3198
+ return obj;
3199
+ }
3200
+ __destroy_into_raw() {
3201
+ const ptr = this.__wbg_ptr;
3202
+ this.__wbg_ptr = 0;
3203
+ IronwoodWitnessFinalization.unregister(this);
3204
+ return ptr;
3205
+ }
3206
+ free() {
3207
+ const ptr = this.__destroy_into_raw();
3208
+ wasm.__wbg_ironwoodwitness_free(ptr, 0);
3209
+ }
3210
+ /**
3211
+ * The 32 sibling hashes (leaf-to-root order), flattened into a single 1024-byte array
3212
+ * (32 hashes × 32 bytes each).
3213
+ * @returns {Uint8Array}
3214
+ */
3215
+ get auth_path() {
3216
+ try {
3217
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3218
+ wasm.ironwoodwitness_auth_path(retptr, this.__wbg_ptr);
3219
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3220
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3221
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
3222
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
3223
+ return v1;
3224
+ } finally {
3225
+ wasm.__wbindgen_add_to_stack_pointer(16);
3226
+ }
3227
+ }
3228
+ /**
3229
+ * The leaf's position in the note commitment tree.
3230
+ * @returns {number}
3231
+ */
3232
+ get position() {
3233
+ const ret = wasm.ironwoodwitness_position(this.__wbg_ptr);
3234
+ return ret >>> 0;
3235
+ }
3236
+ }
3237
+ if (Symbol.dispose) IronwoodWitness.prototype[Symbol.dispose] = IronwoodWitness.prototype.free;
3238
+
3129
3239
  export class MessageNamespace {
3130
3240
  __destroy_into_raw() {
3131
3241
  const ptr = this.__wbg_ptr;
@@ -6988,6 +7098,44 @@ export class ZcashV6Transaction {
6988
7098
  }
6989
7099
  if (Symbol.dispose) ZcashV6Transaction.prototype[Symbol.dispose] = ZcashV6Transaction.prototype.free;
6990
7100
 
7101
+ /**
7102
+ * Build and validate a Merkle witness for an Ironwood/Orchard note commitment.
7103
+ *
7104
+ * `cmx` is the note commitment being witnessed; `auth_path` must be exactly 32 sibling hashes (32
7105
+ * bytes each), leaf-to-root order; `anchor` is the expected note-commitment-tree root. Throws if
7106
+ * any input isn't a canonical field element, or if the witness doesn't recompute to `anchor`.
7107
+ *
7108
+ * This crate has no chain state, so the raw sibling-hash path must be supplied by the caller
7109
+ * (typically BitGo's backend, querying a Zcash-aware service). The returned witness is not yet
7110
+ * installed anywhere — hook it into a spend once real-spend construction exists.
7111
+ * @param {Uint8Array} cmx
7112
+ * @param {number} position
7113
+ * @param {Uint8Array[]} auth_path
7114
+ * @param {Uint8Array} anchor
7115
+ * @returns {IronwoodWitness}
7116
+ */
7117
+ export function ironwood_build_witness(cmx, position, auth_path, anchor) {
7118
+ try {
7119
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
7120
+ const ptr0 = passArray8ToWasm0(cmx, wasm.__wbindgen_export);
7121
+ const len0 = WASM_VECTOR_LEN;
7122
+ const ptr1 = passArrayJsValueToWasm0(auth_path, wasm.__wbindgen_export);
7123
+ const len1 = WASM_VECTOR_LEN;
7124
+ const ptr2 = passArray8ToWasm0(anchor, wasm.__wbindgen_export);
7125
+ const len2 = WASM_VECTOR_LEN;
7126
+ wasm.ironwood_build_witness(retptr, ptr0, len0, position, ptr1, len1, ptr2, len2);
7127
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
7128
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
7129
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
7130
+ if (r2) {
7131
+ throw takeObject(r1);
7132
+ }
7133
+ return IronwoodWitness.__wrap(r0);
7134
+ } finally {
7135
+ wasm.__wbindgen_add_to_stack_pointer(16);
7136
+ }
7137
+ }
7138
+
6991
7139
  /**
6992
7140
  * Check if the inspect feature is enabled.
6993
7141
  *
@@ -7447,6 +7595,9 @@ const FixedScriptWalletNamespaceFinalization = (typeof FinalizationRegistry ===
7447
7595
  const InscriptionsNamespaceFinalization = (typeof FinalizationRegistry === 'undefined')
7448
7596
  ? { register: () => {}, unregister: () => {} }
7449
7597
  : new FinalizationRegistry(ptr => wasm.__wbg_inscriptionsnamespace_free(ptr >>> 0, 1));
7598
+ const IronwoodWitnessFinalization = (typeof FinalizationRegistry === 'undefined')
7599
+ ? { register: () => {}, unregister: () => {} }
7600
+ : new FinalizationRegistry(ptr => wasm.__wbg_ironwoodwitness_free(ptr >>> 0, 1));
7450
7601
  const MessageNamespaceFinalization = (typeof FinalizationRegistry === 'undefined')
7451
7602
  ? { register: () => {}, unregister: () => {} }
7452
7603
  : new FinalizationRegistry(ptr => wasm.__wbg_messagenamespace_free(ptr >>> 0, 1));
Binary file
@@ -1,42 +1,25 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
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, f: number) => void;
9
- export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
10
- export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
11
- export const wasmdimensions_empty: () => number;
12
- export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
13
- export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number, d: number) => void;
14
- export const wasmdimensions_from_output_script_length: (a: number) => number;
15
- export const wasmdimensions_from_output_script_type: (a: number, b: number, c: number) => void;
16
- export const wasmdimensions_from_psbt: (a: number, b: number) => void;
17
- export const wasmdimensions_get_input_vsize: (a: number, b: number, c: number) => number;
18
- export const wasmdimensions_get_input_weight: (a: number, b: number, c: number) => number;
19
- export const wasmdimensions_get_output_vsize: (a: number) => number;
20
- export const wasmdimensions_get_output_weight: (a: number) => number;
21
- export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
22
- export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
23
- export const wasmdimensions_has_segwit: (a: number) => number;
24
- export const wasmdimensions_plus: (a: number, b: number) => number;
25
- export const wasmdimensions_times: (a: number, b: number) => number;
26
- export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
27
- export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
28
- export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
29
- export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
30
- export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
4
+ export const __wbg_bip322namespace_free: (a: number, b: number) => void;
5
+ 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;
6
+ export const bip322namespace_get_bip322_message: (a: number, b: number, c: number) => void;
7
+ 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;
8
+ 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;
9
+ 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;
10
+ 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;
11
+ export const __wbg_ironwoodwitness_free: (a: number, b: number) => void;
31
12
  export const __wbg_messagenamespace_free: (a: number, b: number) => void;
32
13
  export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
14
+ export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
33
15
  export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
34
16
  export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
35
17
  export const __wbg_wrappsbt_free: (a: number, b: number) => void;
36
18
  export const __wbg_zcashunifiedaddress_free: (a: number, b: number) => void;
37
19
  export const __wbg_zcashv6transaction_free: (a: number, b: number) => void;
38
- export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
39
- 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;
20
+ export const ironwood_build_witness: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
21
+ export const ironwoodwitness_auth_path: (a: number, b: number) => void;
22
+ export const ironwoodwitness_position: (a: number) => number;
40
23
  export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
41
24
  export const messagenamespace_verify_message: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
42
25
  export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
@@ -49,6 +32,9 @@ export const wasmdashtransaction_lock_time: (a: number) => number;
49
32
  export const wasmdashtransaction_output_count: (a: number) => number;
50
33
  export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
51
34
  export const wasmdashtransaction_version: (a: number) => number;
35
+ export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
36
+ export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
37
+ export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
52
38
  export const wasmtransaction_add_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
53
39
  export const wasmtransaction_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
54
40
  export const wasmtransaction_add_output: (a: number, b: number, c: number, d: bigint) => number;
@@ -141,6 +127,31 @@ export const wasmzcashtransaction_lock_time: (a: number) => number;
141
127
  export const wasmzcashtransaction_version: (a: number) => number;
142
128
  export const wrappsbt_lock_time: (a: number) => number;
143
129
  export const wrappsbt_version: (a: number) => number;
130
+ export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
131
+ export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
132
+ export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
133
+ export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
134
+ 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;
135
+ export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
136
+ export const wrapdescriptor_descType: (a: number, b: number) => void;
137
+ export const wrapdescriptor_encode: (a: number, b: number) => void;
138
+ export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
139
+ export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
140
+ export const wrapdescriptor_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
141
+ export const wrapdescriptor_hasWildcard: (a: number) => number;
142
+ export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
143
+ export const wrapdescriptor_node: (a: number, b: number) => void;
144
+ export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
145
+ export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
146
+ export const wrapdescriptor_toString: (a: number, b: number) => void;
147
+ export const wrapminiscript_encode: (a: number, b: number) => void;
148
+ export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
149
+ export const wrapminiscript_fromBitcoinScriptExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
150
+ export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
151
+ export const wrapminiscript_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
152
+ export const wrapminiscript_node: (a: number, b: number) => void;
153
+ export const wrapminiscript_toAsmString: (a: number, b: number) => void;
154
+ export const wrapminiscript_toString: (a: number, b: number) => void;
144
155
  export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
145
156
  export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
146
157
  export const __wbg_wasmbip32_free: (a: number, b: number) => void;
@@ -158,6 +169,7 @@ export const bitgopsbt_add_output_with_address_at_index: (a: number, b: number,
158
169
  export const bitgopsbt_add_paygo_attestation: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
159
170
  export const bitgopsbt_add_replay_protection_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number, j: number) => void;
160
171
  export const bitgopsbt_add_replay_protection_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: bigint, i: number, j: number, k: number) => void;
172
+ export const bitgopsbt_add_transparent_output: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: number) => void;
161
173
  export const bitgopsbt_add_wallet_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => void;
162
174
  export const bitgopsbt_add_wallet_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, m: number, n: number, o: number, p: number, q: number) => void;
163
175
  export const bitgopsbt_add_wallet_output: (a: number, b: number, c: number, d: number, e: bigint, f: number) => void;
@@ -224,6 +236,7 @@ export const bitgopsbt_sign_single_input_with_privkey: (a: number, b: number, c:
224
236
  export const bitgopsbt_sign_single_input_with_xpriv: (a: number, b: number, c: number, d: number) => void;
225
237
  export const bitgopsbt_sign_with_privkey: (a: number, b: number, c: number, d: number) => void;
226
238
  export const bitgopsbt_sign_with_xpriv: (a: number, b: number, c: number, d: number) => void;
239
+ export const bitgopsbt_transparent_output_unified_address: (a: number, b: number, c: number) => void;
227
240
  export const bitgopsbt_unsigned_tx_id: (a: number, b: number) => void;
228
241
  export const bitgopsbt_verify_replay_protection_signature: (a: number, b: number, c: number, d: number) => void;
229
242
  export const bitgopsbt_verify_signature_with_pub: (a: number, b: number, c: number, d: number) => void;
@@ -240,7 +253,6 @@ export const fixedscriptwalletnamespace_output_script_with_network_str: (a: numb
240
253
  export const fixedscriptwalletnamespace_p2sh_p2pk_output_script: (a: number, b: number, c: number) => void;
241
254
  export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: number, c: number, d: number, e: number) => void;
242
255
  export const fixedscriptwalletnamespace_to_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
243
- export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
244
256
  export const wasmbip32_chain_code: (a: number) => number;
245
257
  export const wasmbip32_depth: (a: number) => number;
246
258
  export const wasmbip32_derive: (a: number, b: number, c: number) => void;
@@ -279,43 +291,37 @@ export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number
279
291
  export const wasmrootwalletkeys_user_key: (a: number) => number;
280
292
  export const wasmrootwalletkeys_with_derivation_prefixes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
281
293
  export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
282
- export const isInspectEnabled: () => number;
283
- export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
284
- export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
285
294
  export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
286
295
  export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
287
296
  export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
288
- export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
289
- export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
290
- export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
291
- export const wrapdescriptor_descType: (a: number, b: number) => void;
292
- export const wrapdescriptor_encode: (a: number, b: number) => void;
293
- export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
294
- export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
295
- export const wrapdescriptor_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
296
- export const wrapdescriptor_hasWildcard: (a: number) => number;
297
- export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
298
- export const wrapdescriptor_node: (a: number, b: number) => void;
299
- export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
300
- export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
301
- export const wrapdescriptor_toString: (a: number, b: number) => void;
302
- export const wrapminiscript_encode: (a: number, b: number) => void;
303
- export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
304
- export const wrapminiscript_fromBitcoinScriptExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
305
- export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
306
- export const wrapminiscript_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
307
- export const wrapminiscript_node: (a: number, b: number) => void;
308
- export const wrapminiscript_toAsmString: (a: number, b: number) => void;
309
- export const wrapminiscript_toString: (a: number, b: number) => void;
310
- export const __wbg_bip322namespace_free: (a: number, b: number) => void;
297
+ export const __wbg_addressnamespace_free: (a: number, b: number) => void;
298
+ export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
299
+ export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
311
300
  export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
312
- 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;
313
- export const bip322namespace_get_bip322_message: (a: number, b: number, c: number) => void;
314
- 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;
315
- 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;
316
- 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;
317
- 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;
301
+ export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
302
+ export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
303
+ export const isInspectEnabled: () => number;
304
+ export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
305
+ export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
306
+ export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
307
+ export const wasmdimensions_empty: () => number;
308
+ export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
309
+ export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number, d: number) => void;
310
+ export const wasmdimensions_from_output_script_length: (a: number) => number;
311
+ export const wasmdimensions_from_output_script_type: (a: number, b: number, c: number) => void;
312
+ export const wasmdimensions_from_psbt: (a: number, b: number) => void;
313
+ export const wasmdimensions_get_input_vsize: (a: number, b: number, c: number) => number;
314
+ export const wasmdimensions_get_input_weight: (a: number, b: number, c: number) => number;
315
+ export const wasmdimensions_get_output_vsize: (a: number) => number;
316
+ export const wasmdimensions_get_output_weight: (a: number) => number;
317
+ export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
318
+ export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
319
+ export const wasmdimensions_has_segwit: (a: number) => number;
320
+ export const wasmdimensions_plus: (a: number, b: number) => number;
321
+ export const wasmdimensions_times: (a: number, b: number) => number;
318
322
  export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
323
+ export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
324
+ export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
319
325
  export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
320
326
  export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
321
327
  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": "4.39.0",
4
+ "version": "4.41.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",