@bitgo/wasm-utxo 2.0.0 → 2.1.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,8 +1,8 @@
1
1
  import { BitGoPsbt as WasmBitGoPsbt, type PsbtInputData, type PsbtOutputData, type PsbtOutputDataWithAddress } from "../wasm/wasm_utxo.js";
2
2
  import type { IPsbtWithAddress } from "../psbt.js";
3
- import { type WalletKeysArg } from "./RootWalletKeys.js";
3
+ import { type WalletKeysArg, RootWalletKeys } from "./RootWalletKeys.js";
4
4
  import { type ReplayProtectionArg } from "./ReplayProtection.js";
5
- import { type BIP32Arg } from "../bip32.js";
5
+ import { type BIP32Arg, BIP32 } from "../bip32.js";
6
6
  import { type ECPairArg } from "../ecpair.js";
7
7
  import type { UtxolibName } from "../utxolibCompat.js";
8
8
  import type { CoinName } from "../coinName.js";
@@ -595,4 +595,19 @@ export declare class BitGoPsbt implements IPsbtWithAddress {
595
595
  * ```
596
596
  */
597
597
  getOutputsWithAddress(): PsbtOutputDataWithAddress[];
598
+ /**
599
+ * Returns the unordered global xpubs from this PSBT as BIP32 instances.
600
+ */
601
+ getGlobalXpubs(): BIP32[];
598
602
  }
603
+ /**
604
+ * Extract sorted wallet keys from a PSBT's global xpub fields.
605
+ *
606
+ * This should only be used in exceptional circumstances where the real wallet
607
+ * keys are not available — for example, legacy cold wallets where the PSBT
608
+ * was built with derived keys (from coldDerivationSeed) but the caller only
609
+ * has root xpubs. Prefer passing wallet keys explicitly wherever possible.
610
+ *
611
+ * @returns Sorted [user, backup, bitgo] RootWalletKeys
612
+ */
613
+ export declare function getWalletKeysFromPsbt(psbt: BitGoPsbt, xpubs: BIP32[]): RootWalletKeys;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BitGoPsbt = void 0;
4
+ exports.getWalletKeysFromPsbt = getWalletKeysFromPsbt;
4
5
  const wasm_utxo_js_1 = require("../wasm/wasm_utxo.js");
5
6
  const RootWalletKeys_js_1 = require("./RootWalletKeys.js");
6
7
  const ReplayProtection_js_1 = require("./ReplayProtection.js");
@@ -610,5 +611,26 @@ class BitGoPsbt {
610
611
  getOutputsWithAddress() {
611
612
  return this._wasm.get_outputs_with_address();
612
613
  }
614
+ /**
615
+ * Returns the unordered global xpubs from this PSBT as BIP32 instances.
616
+ */
617
+ getGlobalXpubs() {
618
+ const result = this._wasm.get_global_xpubs();
619
+ return result.map((w) => bip32_js_1.BIP32.fromWasm(w));
620
+ }
613
621
  }
614
622
  exports.BitGoPsbt = BitGoPsbt;
623
+ /**
624
+ * Extract sorted wallet keys from a PSBT's global xpub fields.
625
+ *
626
+ * This should only be used in exceptional circumstances where the real wallet
627
+ * keys are not available — for example, legacy cold wallets where the PSBT
628
+ * was built with derived keys (from coldDerivationSeed) but the caller only
629
+ * has root xpubs. Prefer passing wallet keys explicitly wherever possible.
630
+ *
631
+ * @returns Sorted [user, backup, bitgo] RootWalletKeys
632
+ */
633
+ function getWalletKeysFromPsbt(psbt, xpubs) {
634
+ const wasmKeys = wasm_utxo_js_1.FixedScriptWalletNamespace.to_wallet_keys(psbt.wasm, xpubs[0].wasm, xpubs[1].wasm, xpubs[2].wasm);
635
+ return RootWalletKeys_js_1.RootWalletKeys.fromWasm(wasmKeys);
636
+ }
@@ -23,6 +23,11 @@ Triple<string>
23
23
  export declare class RootWalletKeys {
24
24
  private _wasm;
25
25
  private constructor();
26
+ /**
27
+ * Create a RootWalletKeys instance from a WasmRootWalletKeys instance (internal use)
28
+ * @internal
29
+ */
30
+ static fromWasm(wasm: WasmRootWalletKeys): RootWalletKeys;
26
31
  /**
27
32
  * Create a RootWalletKeys from various input formats
28
33
  * @param keys - Can be a triple of xpub strings, an IWalletKeys object, or another RootWalletKeys instance
@@ -35,6 +35,13 @@ class RootWalletKeys {
35
35
  constructor(_wasm) {
36
36
  this._wasm = _wasm;
37
37
  }
38
+ /**
39
+ * Create a RootWalletKeys instance from a WasmRootWalletKeys instance (internal use)
40
+ * @internal
41
+ */
42
+ static fromWasm(wasm) {
43
+ return new RootWalletKeys(wasm);
44
+ }
38
45
  /**
39
46
  * Create a RootWalletKeys from various input formats
40
47
  * @param keys - Can be a triple of xpub strings, an IWalletKeys object, or another RootWalletKeys instance
@@ -5,7 +5,7 @@ export { outputScript, address } from "./address.js";
5
5
  export { Dimensions } from "./Dimensions.js";
6
6
  export { outputScriptTypes, inputScriptTypes, type OutputScriptType, type InputScriptType, type ScriptType, } from "./scriptType.js";
7
7
  export { ChainCode, chainCodes, assertChainCode, type Scope } from "./chains.js";
8
- export { BitGoPsbt, type NetworkName, type ScriptId, type ParsedInput, type ParsedOutput, type ParsedTransaction, type SignPath, type CreateEmptyOptions, type AddInputOptions, type AddOutputOptions, type AddWalletInputOptions, type AddWalletOutputOptions, type ParseTransactionOptions, type ParseOutputsOptions, } from "./BitGoPsbt.js";
8
+ export { BitGoPsbt, getWalletKeysFromPsbt, type NetworkName, type ScriptId, type ParsedInput, type ParsedOutput, type ParsedTransaction, type SignPath, type CreateEmptyOptions, type AddInputOptions, type AddOutputOptions, type AddWalletInputOptions, type AddWalletOutputOptions, type ParseTransactionOptions, type ParseOutputsOptions, } from "./BitGoPsbt.js";
9
9
  export { ZcashBitGoPsbt, type ZcashNetworkName, type CreateEmptyZcashOptions, } from "./ZcashBitGoPsbt.js";
10
10
  export type { PsbtBip32Derivation, PsbtInputData, PsbtOutputData, PsbtOutputDataWithAddress, PsbtWitnessUtxo, } from "../wasm/wasm_utxo.js";
11
11
  import type { ScriptType } from "./scriptType.js";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZcashBitGoPsbt = exports.BitGoPsbt = exports.assertChainCode = exports.chainCodes = exports.ChainCode = exports.inputScriptTypes = exports.outputScriptTypes = exports.Dimensions = exports.address = exports.outputScript = exports.ReplayProtection = exports.RootWalletKeys = void 0;
3
+ exports.ZcashBitGoPsbt = exports.getWalletKeysFromPsbt = exports.BitGoPsbt = exports.assertChainCode = exports.chainCodes = exports.ChainCode = exports.inputScriptTypes = exports.outputScriptTypes = exports.Dimensions = exports.address = exports.outputScript = exports.ReplayProtection = exports.RootWalletKeys = void 0;
4
4
  exports.supportsScriptType = supportsScriptType;
5
5
  exports.createOpReturnScript = createOpReturnScript;
6
6
  exports.p2shP2pkOutputScript = p2shP2pkOutputScript;
@@ -24,6 +24,7 @@ Object.defineProperty(exports, "assertChainCode", { enumerable: true, get: funct
24
24
  // Bitcoin-like PSBT (for all non-Zcash networks)
25
25
  var BitGoPsbt_js_1 = require("./BitGoPsbt.js");
26
26
  Object.defineProperty(exports, "BitGoPsbt", { enumerable: true, get: function () { return BitGoPsbt_js_1.BitGoPsbt; } });
27
+ Object.defineProperty(exports, "getWalletKeysFromPsbt", { enumerable: true, get: function () { return BitGoPsbt_js_1.getWalletKeysFromPsbt; } });
27
28
  // Zcash-specific PSBT subclass
28
29
  var ZcashBitGoPsbt_js_1 = require("./ZcashBitGoPsbt.js");
29
30
  Object.defineProperty(exports, "ZcashBitGoPsbt", { enumerable: true, get: function () { return ZcashBitGoPsbt_js_1.ZcashBitGoPsbt; } });
@@ -74,6 +74,7 @@ declare module "./wasm/wasm_utxo.js" {
74
74
  getInputs(): PsbtInputData[];
75
75
  getOutputs(): PsbtOutputData[];
76
76
  getOutputsWithAddress(coin: import("./coinName.js").CoinName): PsbtOutputDataWithAddress[];
77
+ getGlobalXpubs(): WasmBIP32[];
77
78
  getPartialSignatures(inputIndex: number): Array<{
78
79
  pubkey: Uint8Array;
79
80
  signature: Uint8Array;
@@ -1,10 +1,12 @@
1
1
  import type { PsbtInputData, PsbtOutputData, PsbtOutputDataWithAddress } from "./wasm/wasm_utxo.js";
2
+ import type { BIP32 } from "./bip32.js";
2
3
  /** Common interface for PSBT types */
3
4
  export interface IPsbt {
4
5
  inputCount(): number;
5
6
  outputCount(): number;
6
7
  getInputs(): PsbtInputData[];
7
8
  getOutputs(): PsbtOutputData[];
9
+ getGlobalXpubs(): BIP32[];
8
10
  version(): number;
9
11
  lockTime(): number;
10
12
  unsignedTxId(): string;
@@ -318,6 +318,10 @@ export class BitGoPsbt {
318
318
  * generated for security. Custom session_id is only allowed on testnets for testing purposes.
319
319
  */
320
320
  generate_musig2_nonces(xpriv: WasmBIP32, session_id_bytes?: Uint8Array | null): void;
321
+ /**
322
+ * Returns the global xpubs from the PSBT as an array of WasmBIP32 instances.
323
+ */
324
+ get_global_xpubs(): any;
321
325
  /**
322
326
  * Get all PSBT inputs as an array of PsbtInputData
323
327
  *
@@ -718,6 +722,12 @@ export class FixedScriptWalletNamespace {
718
722
  * - Dogecoin only supports legacy scripts (p2sh)
719
723
  */
720
724
  static supports_script_type(coin: string, script_type: string): boolean;
725
+ /**
726
+ * Sort an xpub triple into [user, backup, bitgo] order by validating
727
+ * against the PSBT's wallet inputs. Returns a RootWalletKeys with the
728
+ * correct ordering.
729
+ */
730
+ static to_wallet_keys(psbt: BitGoPsbt, user_or_a: WasmBIP32, backup_or_b: WasmBIP32, bitgo_or_c: WasmBIP32): WasmRootWalletKeys;
721
731
  }
722
732
 
723
733
  /**
@@ -1342,6 +1352,10 @@ export class WrapPsbt {
1342
1352
  */
1343
1353
  extractTransaction(): WasmTransaction;
1344
1354
  finalize(): void;
1355
+ /**
1356
+ * Get global xpubs from the PSBT as an array of WasmBIP32 instances.
1357
+ */
1358
+ getGlobalXpubs(): any;
1345
1359
  /**
1346
1360
  * Get all PSBT inputs as an array of PsbtInputData
1347
1361
  *
@@ -1125,6 +1125,14 @@ class BitGoPsbt {
1125
1125
  wasm.__wbindgen_add_to_stack_pointer(16);
1126
1126
  }
1127
1127
  }
1128
+ /**
1129
+ * Returns the global xpubs from the PSBT as an array of WasmBIP32 instances.
1130
+ * @returns {any}
1131
+ */
1132
+ get_global_xpubs() {
1133
+ const ret = wasm.bitgopsbt_get_global_xpubs(this.__wbg_ptr);
1134
+ return takeObject(ret);
1135
+ }
1128
1136
  /**
1129
1137
  * Get all PSBT inputs as an array of PsbtInputData
1130
1138
  *
@@ -2160,6 +2168,35 @@ class FixedScriptWalletNamespace {
2160
2168
  wasm.__wbindgen_add_to_stack_pointer(16);
2161
2169
  }
2162
2170
  }
2171
+ /**
2172
+ * Sort an xpub triple into [user, backup, bitgo] order by validating
2173
+ * against the PSBT's wallet inputs. Returns a RootWalletKeys with the
2174
+ * correct ordering.
2175
+ * @param {BitGoPsbt} psbt
2176
+ * @param {WasmBIP32} user_or_a
2177
+ * @param {WasmBIP32} backup_or_b
2178
+ * @param {WasmBIP32} bitgo_or_c
2179
+ * @returns {WasmRootWalletKeys}
2180
+ */
2181
+ static to_wallet_keys(psbt, user_or_a, backup_or_b, bitgo_or_c) {
2182
+ try {
2183
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2184
+ _assertClass(psbt, BitGoPsbt);
2185
+ _assertClass(user_or_a, WasmBIP32);
2186
+ _assertClass(backup_or_b, WasmBIP32);
2187
+ _assertClass(bitgo_or_c, WasmBIP32);
2188
+ wasm.fixedscriptwalletnamespace_to_wallet_keys(retptr, psbt.__wbg_ptr, user_or_a.__wbg_ptr, backup_or_b.__wbg_ptr, bitgo_or_c.__wbg_ptr);
2189
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2190
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2191
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2192
+ if (r2) {
2193
+ throw takeObject(r1);
2194
+ }
2195
+ return WasmRootWalletKeys.__wrap(r0);
2196
+ } finally {
2197
+ wasm.__wbindgen_add_to_stack_pointer(16);
2198
+ }
2199
+ }
2163
2200
  }
2164
2201
  if (Symbol.dispose) FixedScriptWalletNamespace.prototype[Symbol.dispose] = FixedScriptWalletNamespace.prototype.free;
2165
2202
  exports.FixedScriptWalletNamespace = FixedScriptWalletNamespace;
@@ -4590,6 +4627,14 @@ class WrapPsbt {
4590
4627
  wasm.__wbindgen_add_to_stack_pointer(16);
4591
4628
  }
4592
4629
  }
4630
+ /**
4631
+ * Get global xpubs from the PSBT as an array of WasmBIP32 instances.
4632
+ * @returns {any}
4633
+ */
4634
+ getGlobalXpubs() {
4635
+ const ret = wasm.wrappsbt_getGlobalXpubs(this.__wbg_ptr);
4636
+ return takeObject(ret);
4637
+ }
4593
4638
  /**
4594
4639
  * Get all PSBT inputs as an array of PsbtInputData
4595
4640
  *
@@ -5365,6 +5410,10 @@ function __wbg_get_imports() {
5365
5410
  const ret = getObject(arg0).versions;
5366
5411
  return addHeapObject(ret);
5367
5412
  },
5413
+ __wbg_wasmbip32_new: function(arg0) {
5414
+ const ret = WasmBIP32.__wrap(arg0);
5415
+ return addHeapObject(ret);
5416
+ },
5368
5417
  __wbg_wasmdashtransaction_new: function(arg0) {
5369
5418
  const ret = WasmDashTransaction.__wrap(arg0);
5370
5419
  return addHeapObject(ret);
Binary file
@@ -1,36 +1,19 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
5
- export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
6
- export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
7
- export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
8
- export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
9
- export const wasmdashtransaction_get_txid: (a: number, b: number) => void;
10
- export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
11
- export const wasmtransaction_add_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
12
- export const wasmtransaction_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
13
- export const wasmtransaction_add_output: (a: number, b: number, c: number, d: bigint) => number;
14
- export const wasmtransaction_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
15
- export const wasmtransaction_create: () => number;
16
- export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
17
- export const wasmtransaction_get_txid: (a: number, b: number) => void;
18
- export const wasmtransaction_get_vsize: (a: number) => number;
19
- export const wasmtransaction_to_bytes: (a: number, b: number) => void;
20
- export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
21
- export const wasmzcashtransaction_get_txid: (a: number, b: number) => void;
22
- export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
23
- export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
24
- export const wrapdescriptor_descType: (a: number, b: number) => void;
25
- export const wrapdescriptor_encode: (a: number, b: number) => void;
26
- export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
27
- export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
28
- export const wrapdescriptor_hasWildcard: (a: number) => number;
29
- export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
30
- export const wrapdescriptor_node: (a: number, b: number) => void;
31
- export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
32
- export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
33
- export const wrapdescriptor_toString: (a: number, b: number) => void;
4
+ export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
5
+ export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
6
+ export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
7
+ export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
8
+ 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;
9
+ export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
10
+ export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
11
+ export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
12
+ export const wasmrootwalletkeys_backup_key: (a: number) => number;
13
+ export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
14
+ export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
15
+ export const wasmrootwalletkeys_user_key: (a: number) => number;
16
+ 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;
34
17
  export const __wbg_addressnamespace_free: (a: number, b: number) => void;
35
18
  export const __wbg_messagenamespace_free: (a: number, b: number) => void;
36
19
  export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
@@ -67,6 +50,7 @@ export const wrappsbt_clone: (a: number) => number;
67
50
  export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
68
51
  export const wrappsbt_extractTransaction: (a: number, b: number) => void;
69
52
  export const wrappsbt_finalize: (a: number, b: number) => void;
53
+ export const wrappsbt_getGlobalXpubs: (a: number) => number;
70
54
  export const wrappsbt_getInputs: (a: number, b: number) => void;
71
55
  export const wrappsbt_getOutputs: (a: number, b: number) => void;
72
56
  export const wrappsbt_getOutputsWithAddress: (a: number, b: number, c: number, d: number) => void;
@@ -90,19 +74,36 @@ export const wrappsbt_updateOutputWithDescriptor: (a: number, b: number, c: numb
90
74
  export const wrappsbt_validateSignatureAtInput: (a: number, b: number, c: number, d: number, e: number) => void;
91
75
  export const wrappsbt_verifySignatureWithKey: (a: number, b: number, c: number, d: number) => void;
92
76
  export const wrappsbt_version: (a: number) => number;
93
- export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
94
- export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
95
- export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
96
- export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
97
- 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;
98
- export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
99
- export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
100
- export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
101
- export const wasmrootwalletkeys_backup_key: (a: number) => number;
102
- export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
103
- export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
104
- export const wasmrootwalletkeys_user_key: (a: number) => number;
105
- 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;
77
+ export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
78
+ export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
79
+ export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
80
+ export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
81
+ export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
82
+ export const wasmdashtransaction_get_txid: (a: number, b: number) => void;
83
+ export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
84
+ export const wasmtransaction_add_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
85
+ export const wasmtransaction_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
86
+ export const wasmtransaction_add_output: (a: number, b: number, c: number, d: bigint) => number;
87
+ export const wasmtransaction_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
88
+ export const wasmtransaction_create: () => number;
89
+ export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
90
+ export const wasmtransaction_get_txid: (a: number, b: number) => void;
91
+ export const wasmtransaction_get_vsize: (a: number) => number;
92
+ export const wasmtransaction_to_bytes: (a: number, b: number) => void;
93
+ export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
94
+ export const wasmzcashtransaction_get_txid: (a: number, b: number) => void;
95
+ export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
96
+ export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
97
+ export const wrapdescriptor_descType: (a: number, b: number) => void;
98
+ export const wrapdescriptor_encode: (a: number, b: number) => void;
99
+ export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
100
+ export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
101
+ export const wrapdescriptor_hasWildcard: (a: number) => number;
102
+ export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
103
+ export const wrapdescriptor_node: (a: number, b: number) => void;
104
+ export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
105
+ export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
106
+ export const wrapdescriptor_toString: (a: number, b: number) => void;
106
107
  export const __wbg_bip322namespace_free: (a: number, b: number) => void;
107
108
  export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
108
109
  export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
@@ -139,6 +140,7 @@ export const bitgopsbt_extract_zcash_transaction: (a: number, b: number) => void
139
140
  export const bitgopsbt_finalize_all_inputs: (a: number, b: number) => void;
140
141
  export const bitgopsbt_from_bytes: (a: number, b: number, c: number, d: number, e: number) => void;
141
142
  export const bitgopsbt_generate_musig2_nonces: (a: number, b: number, c: number, d: number, e: number) => void;
143
+ export const bitgopsbt_get_global_xpubs: (a: number) => number;
142
144
  export const bitgopsbt_get_inputs: (a: number, b: number) => void;
143
145
  export const bitgopsbt_get_network_type: (a: number, b: number) => void;
144
146
  export const bitgopsbt_get_outputs: (a: number, b: number) => void;
@@ -175,7 +177,7 @@ export const fixedscriptwalletnamespace_output_script: (a: number, b: number, c:
175
177
  export const fixedscriptwalletnamespace_output_script_with_network_str: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
176
178
  export const fixedscriptwalletnamespace_p2sh_p2pk_output_script: (a: number, b: number, c: number) => void;
177
179
  export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: number, c: number, d: number, e: number) => void;
178
- export const isInspectEnabled: () => number;
180
+ export const fixedscriptwalletnamespace_to_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
179
181
  export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
180
182
  export const wasmbip32_chain_code: (a: number) => number;
181
183
  export const wasmbip32_depth: (a: number) => number;
@@ -215,6 +217,7 @@ export const wasmdimensions_has_segwit: (a: number) => number;
215
217
  export const wasmdimensions_plus: (a: number, b: number) => number;
216
218
  export const wasmdimensions_times: (a: number, b: number) => number;
217
219
  export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
220
+ export const isInspectEnabled: () => number;
218
221
  export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
219
222
  export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
220
223
  export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
@@ -1,8 +1,8 @@
1
1
  import { BitGoPsbt as WasmBitGoPsbt, type PsbtInputData, type PsbtOutputData, type PsbtOutputDataWithAddress } from "../wasm/wasm_utxo.js";
2
2
  import type { IPsbtWithAddress } from "../psbt.js";
3
- import { type WalletKeysArg } from "./RootWalletKeys.js";
3
+ import { type WalletKeysArg, RootWalletKeys } from "./RootWalletKeys.js";
4
4
  import { type ReplayProtectionArg } from "./ReplayProtection.js";
5
- import { type BIP32Arg } from "../bip32.js";
5
+ import { type BIP32Arg, BIP32 } from "../bip32.js";
6
6
  import { type ECPairArg } from "../ecpair.js";
7
7
  import type { UtxolibName } from "../utxolibCompat.js";
8
8
  import type { CoinName } from "../coinName.js";
@@ -595,4 +595,19 @@ export declare class BitGoPsbt implements IPsbtWithAddress {
595
595
  * ```
596
596
  */
597
597
  getOutputsWithAddress(): PsbtOutputDataWithAddress[];
598
+ /**
599
+ * Returns the unordered global xpubs from this PSBT as BIP32 instances.
600
+ */
601
+ getGlobalXpubs(): BIP32[];
598
602
  }
603
+ /**
604
+ * Extract sorted wallet keys from a PSBT's global xpub fields.
605
+ *
606
+ * This should only be used in exceptional circumstances where the real wallet
607
+ * keys are not available — for example, legacy cold wallets where the PSBT
608
+ * was built with derived keys (from coldDerivationSeed) but the caller only
609
+ * has root xpubs. Prefer passing wallet keys explicitly wherever possible.
610
+ *
611
+ * @returns Sorted [user, backup, bitgo] RootWalletKeys
612
+ */
613
+ export declare function getWalletKeysFromPsbt(psbt: BitGoPsbt, xpubs: BIP32[]): RootWalletKeys;
@@ -1,4 +1,4 @@
1
- import { BitGoPsbt as WasmBitGoPsbt, } from "../wasm/wasm_utxo.js";
1
+ import { BitGoPsbt as WasmBitGoPsbt, FixedScriptWalletNamespace, } from "../wasm/wasm_utxo.js";
2
2
  import { RootWalletKeys } from "./RootWalletKeys.js";
3
3
  import { ReplayProtection } from "./ReplayProtection.js";
4
4
  import { BIP32, isBIP32Arg } from "../bip32.js";
@@ -607,4 +607,25 @@ export class BitGoPsbt {
607
607
  getOutputsWithAddress() {
608
608
  return this._wasm.get_outputs_with_address();
609
609
  }
610
+ /**
611
+ * Returns the unordered global xpubs from this PSBT as BIP32 instances.
612
+ */
613
+ getGlobalXpubs() {
614
+ const result = this._wasm.get_global_xpubs();
615
+ return result.map((w) => BIP32.fromWasm(w));
616
+ }
617
+ }
618
+ /**
619
+ * Extract sorted wallet keys from a PSBT's global xpub fields.
620
+ *
621
+ * This should only be used in exceptional circumstances where the real wallet
622
+ * keys are not available — for example, legacy cold wallets where the PSBT
623
+ * was built with derived keys (from coldDerivationSeed) but the caller only
624
+ * has root xpubs. Prefer passing wallet keys explicitly wherever possible.
625
+ *
626
+ * @returns Sorted [user, backup, bitgo] RootWalletKeys
627
+ */
628
+ export function getWalletKeysFromPsbt(psbt, xpubs) {
629
+ const wasmKeys = FixedScriptWalletNamespace.to_wallet_keys(psbt.wasm, xpubs[0].wasm, xpubs[1].wasm, xpubs[2].wasm);
630
+ return RootWalletKeys.fromWasm(wasmKeys);
610
631
  }
@@ -23,6 +23,11 @@ Triple<string>
23
23
  export declare class RootWalletKeys {
24
24
  private _wasm;
25
25
  private constructor();
26
+ /**
27
+ * Create a RootWalletKeys instance from a WasmRootWalletKeys instance (internal use)
28
+ * @internal
29
+ */
30
+ static fromWasm(wasm: WasmRootWalletKeys): RootWalletKeys;
26
31
  /**
27
32
  * Create a RootWalletKeys from various input formats
28
33
  * @param keys - Can be a triple of xpub strings, an IWalletKeys object, or another RootWalletKeys instance
@@ -32,6 +32,13 @@ export class RootWalletKeys {
32
32
  constructor(_wasm) {
33
33
  this._wasm = _wasm;
34
34
  }
35
+ /**
36
+ * Create a RootWalletKeys instance from a WasmRootWalletKeys instance (internal use)
37
+ * @internal
38
+ */
39
+ static fromWasm(wasm) {
40
+ return new RootWalletKeys(wasm);
41
+ }
35
42
  /**
36
43
  * Create a RootWalletKeys from various input formats
37
44
  * @param keys - Can be a triple of xpub strings, an IWalletKeys object, or another RootWalletKeys instance
@@ -5,7 +5,7 @@ export { outputScript, address } from "./address.js";
5
5
  export { Dimensions } from "./Dimensions.js";
6
6
  export { outputScriptTypes, inputScriptTypes, type OutputScriptType, type InputScriptType, type ScriptType, } from "./scriptType.js";
7
7
  export { ChainCode, chainCodes, assertChainCode, type Scope } from "./chains.js";
8
- export { BitGoPsbt, type NetworkName, type ScriptId, type ParsedInput, type ParsedOutput, type ParsedTransaction, type SignPath, type CreateEmptyOptions, type AddInputOptions, type AddOutputOptions, type AddWalletInputOptions, type AddWalletOutputOptions, type ParseTransactionOptions, type ParseOutputsOptions, } from "./BitGoPsbt.js";
8
+ export { BitGoPsbt, getWalletKeysFromPsbt, type NetworkName, type ScriptId, type ParsedInput, type ParsedOutput, type ParsedTransaction, type SignPath, type CreateEmptyOptions, type AddInputOptions, type AddOutputOptions, type AddWalletInputOptions, type AddWalletOutputOptions, type ParseTransactionOptions, type ParseOutputsOptions, } from "./BitGoPsbt.js";
9
9
  export { ZcashBitGoPsbt, type ZcashNetworkName, type CreateEmptyZcashOptions, } from "./ZcashBitGoPsbt.js";
10
10
  export type { PsbtBip32Derivation, PsbtInputData, PsbtOutputData, PsbtOutputDataWithAddress, PsbtWitnessUtxo, } from "../wasm/wasm_utxo.js";
11
11
  import type { ScriptType } from "./scriptType.js";
@@ -6,7 +6,7 @@ export { Dimensions } from "./Dimensions.js";
6
6
  export { outputScriptTypes, inputScriptTypes, } from "./scriptType.js";
7
7
  export { ChainCode, chainCodes, assertChainCode } from "./chains.js";
8
8
  // Bitcoin-like PSBT (for all non-Zcash networks)
9
- export { BitGoPsbt, } from "./BitGoPsbt.js";
9
+ export { BitGoPsbt, getWalletKeysFromPsbt, } from "./BitGoPsbt.js";
10
10
  // Zcash-specific PSBT subclass
11
11
  export { ZcashBitGoPsbt, } from "./ZcashBitGoPsbt.js";
12
12
  /**
@@ -74,6 +74,7 @@ declare module "./wasm/wasm_utxo.js" {
74
74
  getInputs(): PsbtInputData[];
75
75
  getOutputs(): PsbtOutputData[];
76
76
  getOutputsWithAddress(coin: import("./coinName.js").CoinName): PsbtOutputDataWithAddress[];
77
+ getGlobalXpubs(): WasmBIP32[];
77
78
  getPartialSignatures(inputIndex: number): Array<{
78
79
  pubkey: Uint8Array;
79
80
  signature: Uint8Array;
@@ -1,10 +1,12 @@
1
1
  import type { PsbtInputData, PsbtOutputData, PsbtOutputDataWithAddress } from "./wasm/wasm_utxo.js";
2
+ import type { BIP32 } from "./bip32.js";
2
3
  /** Common interface for PSBT types */
3
4
  export interface IPsbt {
4
5
  inputCount(): number;
5
6
  outputCount(): number;
6
7
  getInputs(): PsbtInputData[];
7
8
  getOutputs(): PsbtOutputData[];
9
+ getGlobalXpubs(): BIP32[];
8
10
  version(): number;
9
11
  lockTime(): number;
10
12
  unsignedTxId(): string;
@@ -318,6 +318,10 @@ export class BitGoPsbt {
318
318
  * generated for security. Custom session_id is only allowed on testnets for testing purposes.
319
319
  */
320
320
  generate_musig2_nonces(xpriv: WasmBIP32, session_id_bytes?: Uint8Array | null): void;
321
+ /**
322
+ * Returns the global xpubs from the PSBT as an array of WasmBIP32 instances.
323
+ */
324
+ get_global_xpubs(): any;
321
325
  /**
322
326
  * Get all PSBT inputs as an array of PsbtInputData
323
327
  *
@@ -718,6 +722,12 @@ export class FixedScriptWalletNamespace {
718
722
  * - Dogecoin only supports legacy scripts (p2sh)
719
723
  */
720
724
  static supports_script_type(coin: string, script_type: string): boolean;
725
+ /**
726
+ * Sort an xpub triple into [user, backup, bitgo] order by validating
727
+ * against the PSBT's wallet inputs. Returns a RootWalletKeys with the
728
+ * correct ordering.
729
+ */
730
+ static to_wallet_keys(psbt: BitGoPsbt, user_or_a: WasmBIP32, backup_or_b: WasmBIP32, bitgo_or_c: WasmBIP32): WasmRootWalletKeys;
721
731
  }
722
732
 
723
733
  /**
@@ -1342,6 +1352,10 @@ export class WrapPsbt {
1342
1352
  */
1343
1353
  extractTransaction(): WasmTransaction;
1344
1354
  finalize(): void;
1355
+ /**
1356
+ * Get global xpubs from the PSBT as an array of WasmBIP32 instances.
1357
+ */
1358
+ getGlobalXpubs(): any;
1345
1359
  /**
1346
1360
  * Get all PSBT inputs as an array of PsbtInputData
1347
1361
  *
@@ -1121,6 +1121,14 @@ export class BitGoPsbt {
1121
1121
  wasm.__wbindgen_add_to_stack_pointer(16);
1122
1122
  }
1123
1123
  }
1124
+ /**
1125
+ * Returns the global xpubs from the PSBT as an array of WasmBIP32 instances.
1126
+ * @returns {any}
1127
+ */
1128
+ get_global_xpubs() {
1129
+ const ret = wasm.bitgopsbt_get_global_xpubs(this.__wbg_ptr);
1130
+ return takeObject(ret);
1131
+ }
1124
1132
  /**
1125
1133
  * Get all PSBT inputs as an array of PsbtInputData
1126
1134
  *
@@ -2155,6 +2163,35 @@ export class FixedScriptWalletNamespace {
2155
2163
  wasm.__wbindgen_add_to_stack_pointer(16);
2156
2164
  }
2157
2165
  }
2166
+ /**
2167
+ * Sort an xpub triple into [user, backup, bitgo] order by validating
2168
+ * against the PSBT's wallet inputs. Returns a RootWalletKeys with the
2169
+ * correct ordering.
2170
+ * @param {BitGoPsbt} psbt
2171
+ * @param {WasmBIP32} user_or_a
2172
+ * @param {WasmBIP32} backup_or_b
2173
+ * @param {WasmBIP32} bitgo_or_c
2174
+ * @returns {WasmRootWalletKeys}
2175
+ */
2176
+ static to_wallet_keys(psbt, user_or_a, backup_or_b, bitgo_or_c) {
2177
+ try {
2178
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2179
+ _assertClass(psbt, BitGoPsbt);
2180
+ _assertClass(user_or_a, WasmBIP32);
2181
+ _assertClass(backup_or_b, WasmBIP32);
2182
+ _assertClass(bitgo_or_c, WasmBIP32);
2183
+ wasm.fixedscriptwalletnamespace_to_wallet_keys(retptr, psbt.__wbg_ptr, user_or_a.__wbg_ptr, backup_or_b.__wbg_ptr, bitgo_or_c.__wbg_ptr);
2184
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2185
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2186
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2187
+ if (r2) {
2188
+ throw takeObject(r1);
2189
+ }
2190
+ return WasmRootWalletKeys.__wrap(r0);
2191
+ } finally {
2192
+ wasm.__wbindgen_add_to_stack_pointer(16);
2193
+ }
2194
+ }
2158
2195
  }
2159
2196
  if (Symbol.dispose) FixedScriptWalletNamespace.prototype[Symbol.dispose] = FixedScriptWalletNamespace.prototype.free;
2160
2197
 
@@ -4571,6 +4608,14 @@ export class WrapPsbt {
4571
4608
  wasm.__wbindgen_add_to_stack_pointer(16);
4572
4609
  }
4573
4610
  }
4611
+ /**
4612
+ * Get global xpubs from the PSBT as an array of WasmBIP32 instances.
4613
+ * @returns {any}
4614
+ */
4615
+ getGlobalXpubs() {
4616
+ const ret = wasm.wrappsbt_getGlobalXpubs(this.__wbg_ptr);
4617
+ return takeObject(ret);
4618
+ }
4574
4619
  /**
4575
4620
  * Get all PSBT inputs as an array of PsbtInputData
4576
4621
  *
@@ -5337,6 +5382,10 @@ export function __wbg_versions_c01dfd4722a88165(arg0) {
5337
5382
  const ret = getObject(arg0).versions;
5338
5383
  return addHeapObject(ret);
5339
5384
  }
5385
+ export function __wbg_wasmbip32_new(arg0) {
5386
+ const ret = WasmBIP32.__wrap(arg0);
5387
+ return addHeapObject(ret);
5388
+ }
5340
5389
  export function __wbg_wasmdashtransaction_new(arg0) {
5341
5390
  const ret = WasmDashTransaction.__wrap(arg0);
5342
5391
  return addHeapObject(ret);
Binary file
@@ -1,36 +1,19 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
5
- export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
6
- export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
7
- export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
8
- export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
9
- export const wasmdashtransaction_get_txid: (a: number, b: number) => void;
10
- export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
11
- export const wasmtransaction_add_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
12
- export const wasmtransaction_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
13
- export const wasmtransaction_add_output: (a: number, b: number, c: number, d: bigint) => number;
14
- export const wasmtransaction_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
15
- export const wasmtransaction_create: () => number;
16
- export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
17
- export const wasmtransaction_get_txid: (a: number, b: number) => void;
18
- export const wasmtransaction_get_vsize: (a: number) => number;
19
- export const wasmtransaction_to_bytes: (a: number, b: number) => void;
20
- export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
21
- export const wasmzcashtransaction_get_txid: (a: number, b: number) => void;
22
- export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
23
- export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
24
- export const wrapdescriptor_descType: (a: number, b: number) => void;
25
- export const wrapdescriptor_encode: (a: number, b: number) => void;
26
- export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
27
- export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
28
- export const wrapdescriptor_hasWildcard: (a: number) => number;
29
- export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
30
- export const wrapdescriptor_node: (a: number, b: number) => void;
31
- export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
32
- export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
33
- export const wrapdescriptor_toString: (a: number, b: number) => void;
4
+ export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
5
+ export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
6
+ export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
7
+ export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
8
+ 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;
9
+ export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
10
+ export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
11
+ export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
12
+ export const wasmrootwalletkeys_backup_key: (a: number) => number;
13
+ export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
14
+ export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
15
+ export const wasmrootwalletkeys_user_key: (a: number) => number;
16
+ 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;
34
17
  export const __wbg_addressnamespace_free: (a: number, b: number) => void;
35
18
  export const __wbg_messagenamespace_free: (a: number, b: number) => void;
36
19
  export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
@@ -67,6 +50,7 @@ export const wrappsbt_clone: (a: number) => number;
67
50
  export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
68
51
  export const wrappsbt_extractTransaction: (a: number, b: number) => void;
69
52
  export const wrappsbt_finalize: (a: number, b: number) => void;
53
+ export const wrappsbt_getGlobalXpubs: (a: number) => number;
70
54
  export const wrappsbt_getInputs: (a: number, b: number) => void;
71
55
  export const wrappsbt_getOutputs: (a: number, b: number) => void;
72
56
  export const wrappsbt_getOutputsWithAddress: (a: number, b: number, c: number, d: number) => void;
@@ -90,19 +74,36 @@ export const wrappsbt_updateOutputWithDescriptor: (a: number, b: number, c: numb
90
74
  export const wrappsbt_validateSignatureAtInput: (a: number, b: number, c: number, d: number, e: number) => void;
91
75
  export const wrappsbt_verifySignatureWithKey: (a: number, b: number, c: number, d: number) => void;
92
76
  export const wrappsbt_version: (a: number) => number;
93
- export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
94
- export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
95
- export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
96
- export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
97
- 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;
98
- export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
99
- export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
100
- export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
101
- export const wasmrootwalletkeys_backup_key: (a: number) => number;
102
- export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
103
- export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
104
- export const wasmrootwalletkeys_user_key: (a: number) => number;
105
- 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;
77
+ export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
78
+ export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
79
+ export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
80
+ export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
81
+ export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
82
+ export const wasmdashtransaction_get_txid: (a: number, b: number) => void;
83
+ export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
84
+ export const wasmtransaction_add_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
85
+ export const wasmtransaction_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
86
+ export const wasmtransaction_add_output: (a: number, b: number, c: number, d: bigint) => number;
87
+ export const wasmtransaction_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
88
+ export const wasmtransaction_create: () => number;
89
+ export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
90
+ export const wasmtransaction_get_txid: (a: number, b: number) => void;
91
+ export const wasmtransaction_get_vsize: (a: number) => number;
92
+ export const wasmtransaction_to_bytes: (a: number, b: number) => void;
93
+ export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
94
+ export const wasmzcashtransaction_get_txid: (a: number, b: number) => void;
95
+ export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
96
+ export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
97
+ export const wrapdescriptor_descType: (a: number, b: number) => void;
98
+ export const wrapdescriptor_encode: (a: number, b: number) => void;
99
+ export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
100
+ export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
101
+ export const wrapdescriptor_hasWildcard: (a: number) => number;
102
+ export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
103
+ export const wrapdescriptor_node: (a: number, b: number) => void;
104
+ export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
105
+ export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
106
+ export const wrapdescriptor_toString: (a: number, b: number) => void;
106
107
  export const __wbg_bip322namespace_free: (a: number, b: number) => void;
107
108
  export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
108
109
  export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
@@ -139,6 +140,7 @@ export const bitgopsbt_extract_zcash_transaction: (a: number, b: number) => void
139
140
  export const bitgopsbt_finalize_all_inputs: (a: number, b: number) => void;
140
141
  export const bitgopsbt_from_bytes: (a: number, b: number, c: number, d: number, e: number) => void;
141
142
  export const bitgopsbt_generate_musig2_nonces: (a: number, b: number, c: number, d: number, e: number) => void;
143
+ export const bitgopsbt_get_global_xpubs: (a: number) => number;
142
144
  export const bitgopsbt_get_inputs: (a: number, b: number) => void;
143
145
  export const bitgopsbt_get_network_type: (a: number, b: number) => void;
144
146
  export const bitgopsbt_get_outputs: (a: number, b: number) => void;
@@ -175,7 +177,7 @@ export const fixedscriptwalletnamespace_output_script: (a: number, b: number, c:
175
177
  export const fixedscriptwalletnamespace_output_script_with_network_str: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
176
178
  export const fixedscriptwalletnamespace_p2sh_p2pk_output_script: (a: number, b: number, c: number) => void;
177
179
  export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: number, c: number, d: number, e: number) => void;
178
- export const isInspectEnabled: () => number;
180
+ export const fixedscriptwalletnamespace_to_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
179
181
  export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
180
182
  export const wasmbip32_chain_code: (a: number) => number;
181
183
  export const wasmbip32_depth: (a: number) => number;
@@ -215,6 +217,7 @@ export const wasmdimensions_has_segwit: (a: number) => number;
215
217
  export const wasmdimensions_plus: (a: number, b: number) => number;
216
218
  export const wasmdimensions_times: (a: number, b: number) => number;
217
219
  export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
220
+ export const isInspectEnabled: () => number;
218
221
  export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
219
222
  export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
220
223
  export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: 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": "2.0.0",
4
+ "version": "2.1.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",