@bitgo/wasm-utxo 4.17.0 → 4.18.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.
@@ -546,6 +546,19 @@ export declare class BitGoPsbt extends PsbtBase<WasmBitGoPsbt> implements IPsbtW
546
546
  * ```
547
547
  */
548
548
  combineMusig2Nonces(sourcePsbt: BitGoPsbt): void;
549
+ /**
550
+ * Merge all input fields from a raw PSBT (bytes) into this PSBT.
551
+ *
552
+ * The source bytes are parsed with the underlying bitcoin PSBT deserializer,
553
+ * bypassing network-specific validation (e.g. ZCash consensusBranchId), so the
554
+ * source may be a stripped PSBT that lacks those fields.
555
+ *
556
+ * Copies per input: partial_sigs, tap_key_sig, tap_script_sigs, proprietary.
557
+ *
558
+ * @param otherPsbtBytes - Raw bytes of the PSBT to merge signatures from
559
+ * @throws Error if PSBT parsing fails or input counts don't match
560
+ */
561
+ combineInputs(otherPsbtBytes: Uint8Array): void;
549
562
  /**
550
563
  * Finalize all inputs in the PSBT
551
564
  *
@@ -543,6 +543,21 @@ class BitGoPsbt extends psbtBase_js_1.PsbtBase {
543
543
  combineMusig2Nonces(sourcePsbt) {
544
544
  this._wasm.combine_musig2_nonces(sourcePsbt.wasm);
545
545
  }
546
+ /**
547
+ * Merge all input fields from a raw PSBT (bytes) into this PSBT.
548
+ *
549
+ * The source bytes are parsed with the underlying bitcoin PSBT deserializer,
550
+ * bypassing network-specific validation (e.g. ZCash consensusBranchId), so the
551
+ * source may be a stripped PSBT that lacks those fields.
552
+ *
553
+ * Copies per input: partial_sigs, tap_key_sig, tap_script_sigs, proprietary.
554
+ *
555
+ * @param otherPsbtBytes - Raw bytes of the PSBT to merge signatures from
556
+ * @throws Error if PSBT parsing fails or input counts don't match
557
+ */
558
+ combineInputs(otherPsbtBytes) {
559
+ this._wasm.combine_inputs(otherPsbtBytes);
560
+ }
546
561
  /**
547
562
  * Finalize all inputs in the PSBT
548
563
  *
@@ -159,6 +159,17 @@ export class BitGoPsbt {
159
159
  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;
160
160
  add_wallet_output(chain: number, index: number, value: bigint, wallet_keys: WasmRootWalletKeys): number;
161
161
  add_wallet_output_at_index(index: number, chain: number, derivation_index: number, value: bigint, wallet_keys: WasmRootWalletKeys): number;
162
+ /**
163
+ * Merge all input fields from a raw PSBT (given as bytes) into this PSBT.
164
+ *
165
+ * The source bytes are parsed with the underlying bitcoin PSBT deserializer,
166
+ * bypassing any network-specific validation, so the source may be a partial
167
+ * PSBT that lacks fields like ZecConsensusBranchId.
168
+ *
169
+ * # Errors
170
+ * Returns error if PSBT parsing fails or input counts don't match
171
+ */
172
+ combine_inputs(other_bytes: Uint8Array): void;
162
173
  /**
163
174
  * Combine/merge data from another PSBT into this one
164
175
  *
@@ -772,6 +772,32 @@ class BitGoPsbt {
772
772
  wasm.__wbindgen_add_to_stack_pointer(16);
773
773
  }
774
774
  }
775
+ /**
776
+ * Merge all input fields from a raw PSBT (given as bytes) into this PSBT.
777
+ *
778
+ * The source bytes are parsed with the underlying bitcoin PSBT deserializer,
779
+ * bypassing any network-specific validation, so the source may be a partial
780
+ * PSBT that lacks fields like ZecConsensusBranchId.
781
+ *
782
+ * # Errors
783
+ * Returns error if PSBT parsing fails or input counts don't match
784
+ * @param {Uint8Array} other_bytes
785
+ */
786
+ combine_inputs(other_bytes) {
787
+ try {
788
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
789
+ const ptr0 = passArray8ToWasm0(other_bytes, wasm.__wbindgen_export);
790
+ const len0 = WASM_VECTOR_LEN;
791
+ wasm.bitgopsbt_combine_inputs(retptr, this.__wbg_ptr, ptr0, len0);
792
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
793
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
794
+ if (r1) {
795
+ throw takeObject(r0);
796
+ }
797
+ } finally {
798
+ wasm.__wbindgen_add_to_stack_pointer(16);
799
+ }
800
+ }
775
801
  /**
776
802
  * Combine/merge data from another PSBT into this one
777
803
  *
Binary file
@@ -115,6 +115,7 @@ export const wrappsbt_lock_time: (a: number) => number;
115
115
  export const wrappsbt_version: (a: number) => number;
116
116
  export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
117
117
  export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
118
+ export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
118
119
  export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
119
120
  export const wrapdescriptor_descType: (a: number, b: number) => void;
120
121
  export const wrapdescriptor_encode: (a: number, b: number) => void;
@@ -135,13 +136,17 @@ export const wrapminiscript_fromStringExt: (a: number, b: number, c: number, d:
135
136
  export const wrapminiscript_node: (a: number, b: number) => void;
136
137
  export const wrapminiscript_toAsmString: (a: number, b: number) => void;
137
138
  export const wrapminiscript_toString: (a: number, b: number) => void;
139
+ export const isInspectEnabled: () => number;
140
+ export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
141
+ export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
142
+ export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
143
+ export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
138
144
  export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
139
145
  export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
140
146
  export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
141
147
  export const __wbg_wasmbip32_free: (a: number, b: number) => void;
142
148
  export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
143
149
  export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
144
- export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
145
150
  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;
146
151
  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;
147
152
  export const bitgopsbt_add_output: (a: number, b: number, c: number, d: number, e: bigint) => void;
@@ -155,6 +160,7 @@ export const bitgopsbt_add_wallet_input: (a: number, b: number, c: number, d: nu
155
160
  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;
156
161
  export const bitgopsbt_add_wallet_output: (a: number, b: number, c: number, d: number, e: bigint, f: number) => void;
157
162
  export const bitgopsbt_add_wallet_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number) => void;
163
+ export const bitgopsbt_combine_inputs: (a: number, b: number, c: number, d: number) => void;
158
164
  export const bitgopsbt_combine_musig2_nonces: (a: number, b: number, c: number) => void;
159
165
  export const bitgopsbt_consensus_branch_id: (a: number) => number;
160
166
  export const bitgopsbt_create_empty: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
@@ -226,8 +232,6 @@ export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: num
226
232
  export const fixedscriptwalletnamespace_to_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
227
233
  export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
228
234
  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;
229
- export const isInspectEnabled: () => number;
230
- export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
231
235
  export const wasmbip32_chain_code: (a: number) => number;
232
236
  export const wasmbip32_depth: (a: number) => number;
233
237
  export const wasmbip32_derive: (a: number, b: number, c: number) => void;
@@ -270,14 +274,11 @@ export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
270
274
  export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
271
275
  export const wasmrootwalletkeys_user_key: (a: number) => number;
272
276
  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;
273
- export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
274
277
  export const zcash_branch_id_for_height: (a: number, b: number, c: number, d: number) => void;
275
278
  export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
276
- export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
277
- export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
278
- export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
279
- export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
280
279
  export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
280
+ export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
281
+ export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
281
282
  export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
282
283
  export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
283
284
  export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
@@ -546,6 +546,19 @@ export declare class BitGoPsbt extends PsbtBase<WasmBitGoPsbt> implements IPsbtW
546
546
  * ```
547
547
  */
548
548
  combineMusig2Nonces(sourcePsbt: BitGoPsbt): void;
549
+ /**
550
+ * Merge all input fields from a raw PSBT (bytes) into this PSBT.
551
+ *
552
+ * The source bytes are parsed with the underlying bitcoin PSBT deserializer,
553
+ * bypassing network-specific validation (e.g. ZCash consensusBranchId), so the
554
+ * source may be a stripped PSBT that lacks those fields.
555
+ *
556
+ * Copies per input: partial_sigs, tap_key_sig, tap_script_sigs, proprietary.
557
+ *
558
+ * @param otherPsbtBytes - Raw bytes of the PSBT to merge signatures from
559
+ * @throws Error if PSBT parsing fails or input counts don't match
560
+ */
561
+ combineInputs(otherPsbtBytes: Uint8Array): void;
549
562
  /**
550
563
  * Finalize all inputs in the PSBT
551
564
  *
@@ -539,6 +539,21 @@ export class BitGoPsbt extends PsbtBase {
539
539
  combineMusig2Nonces(sourcePsbt) {
540
540
  this._wasm.combine_musig2_nonces(sourcePsbt.wasm);
541
541
  }
542
+ /**
543
+ * Merge all input fields from a raw PSBT (bytes) into this PSBT.
544
+ *
545
+ * The source bytes are parsed with the underlying bitcoin PSBT deserializer,
546
+ * bypassing network-specific validation (e.g. ZCash consensusBranchId), so the
547
+ * source may be a stripped PSBT that lacks those fields.
548
+ *
549
+ * Copies per input: partial_sigs, tap_key_sig, tap_script_sigs, proprietary.
550
+ *
551
+ * @param otherPsbtBytes - Raw bytes of the PSBT to merge signatures from
552
+ * @throws Error if PSBT parsing fails or input counts don't match
553
+ */
554
+ combineInputs(otherPsbtBytes) {
555
+ this._wasm.combine_inputs(otherPsbtBytes);
556
+ }
542
557
  /**
543
558
  * Finalize all inputs in the PSBT
544
559
  *
@@ -159,6 +159,17 @@ export class BitGoPsbt {
159
159
  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;
160
160
  add_wallet_output(chain: number, index: number, value: bigint, wallet_keys: WasmRootWalletKeys): number;
161
161
  add_wallet_output_at_index(index: number, chain: number, derivation_index: number, value: bigint, wallet_keys: WasmRootWalletKeys): number;
162
+ /**
163
+ * Merge all input fields from a raw PSBT (given as bytes) into this PSBT.
164
+ *
165
+ * The source bytes are parsed with the underlying bitcoin PSBT deserializer,
166
+ * bypassing any network-specific validation, so the source may be a partial
167
+ * PSBT that lacks fields like ZecConsensusBranchId.
168
+ *
169
+ * # Errors
170
+ * Returns error if PSBT parsing fails or input counts don't match
171
+ */
172
+ combine_inputs(other_bytes: Uint8Array): void;
162
173
  /**
163
174
  * Combine/merge data from another PSBT into this one
164
175
  *
@@ -768,6 +768,32 @@ export class BitGoPsbt {
768
768
  wasm.__wbindgen_add_to_stack_pointer(16);
769
769
  }
770
770
  }
771
+ /**
772
+ * Merge all input fields from a raw PSBT (given as bytes) into this PSBT.
773
+ *
774
+ * The source bytes are parsed with the underlying bitcoin PSBT deserializer,
775
+ * bypassing any network-specific validation, so the source may be a partial
776
+ * PSBT that lacks fields like ZecConsensusBranchId.
777
+ *
778
+ * # Errors
779
+ * Returns error if PSBT parsing fails or input counts don't match
780
+ * @param {Uint8Array} other_bytes
781
+ */
782
+ combine_inputs(other_bytes) {
783
+ try {
784
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
785
+ const ptr0 = passArray8ToWasm0(other_bytes, wasm.__wbindgen_export);
786
+ const len0 = WASM_VECTOR_LEN;
787
+ wasm.bitgopsbt_combine_inputs(retptr, this.__wbg_ptr, ptr0, len0);
788
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
789
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
790
+ if (r1) {
791
+ throw takeObject(r0);
792
+ }
793
+ } finally {
794
+ wasm.__wbindgen_add_to_stack_pointer(16);
795
+ }
796
+ }
771
797
  /**
772
798
  * Combine/merge data from another PSBT into this one
773
799
  *
Binary file
@@ -115,6 +115,7 @@ export const wrappsbt_lock_time: (a: number) => number;
115
115
  export const wrappsbt_version: (a: number) => number;
116
116
  export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
117
117
  export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
118
+ export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
118
119
  export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
119
120
  export const wrapdescriptor_descType: (a: number, b: number) => void;
120
121
  export const wrapdescriptor_encode: (a: number, b: number) => void;
@@ -135,13 +136,17 @@ export const wrapminiscript_fromStringExt: (a: number, b: number, c: number, d:
135
136
  export const wrapminiscript_node: (a: number, b: number) => void;
136
137
  export const wrapminiscript_toAsmString: (a: number, b: number) => void;
137
138
  export const wrapminiscript_toString: (a: number, b: number) => void;
139
+ export const isInspectEnabled: () => number;
140
+ export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
141
+ export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
142
+ export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
143
+ export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
138
144
  export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
139
145
  export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
140
146
  export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
141
147
  export const __wbg_wasmbip32_free: (a: number, b: number) => void;
142
148
  export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
143
149
  export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
144
- export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
145
150
  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;
146
151
  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;
147
152
  export const bitgopsbt_add_output: (a: number, b: number, c: number, d: number, e: bigint) => void;
@@ -155,6 +160,7 @@ export const bitgopsbt_add_wallet_input: (a: number, b: number, c: number, d: nu
155
160
  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;
156
161
  export const bitgopsbt_add_wallet_output: (a: number, b: number, c: number, d: number, e: bigint, f: number) => void;
157
162
  export const bitgopsbt_add_wallet_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number) => void;
163
+ export const bitgopsbt_combine_inputs: (a: number, b: number, c: number, d: number) => void;
158
164
  export const bitgopsbt_combine_musig2_nonces: (a: number, b: number, c: number) => void;
159
165
  export const bitgopsbt_consensus_branch_id: (a: number) => number;
160
166
  export const bitgopsbt_create_empty: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
@@ -226,8 +232,6 @@ export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: num
226
232
  export const fixedscriptwalletnamespace_to_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
227
233
  export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
228
234
  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;
229
- export const isInspectEnabled: () => number;
230
- export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
231
235
  export const wasmbip32_chain_code: (a: number) => number;
232
236
  export const wasmbip32_depth: (a: number) => number;
233
237
  export const wasmbip32_derive: (a: number, b: number, c: number) => void;
@@ -270,14 +274,11 @@ export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
270
274
  export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
271
275
  export const wasmrootwalletkeys_user_key: (a: number) => number;
272
276
  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;
273
- export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
274
277
  export const zcash_branch_id_for_height: (a: number, b: number, c: number, d: number) => void;
275
278
  export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
276
- export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
277
- export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
278
- export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
279
- export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
280
279
  export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
280
+ export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
281
+ export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
281
282
  export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
282
283
  export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
283
284
  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.17.0",
4
+ "version": "4.18.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",