@bitgo/wasm-utxo 1.33.0 → 1.35.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.
@@ -497,13 +497,15 @@ class BitGoPsbt {
497
497
  */
498
498
  extractTransaction() {
499
499
  const networkType = this._wasm.get_network_type();
500
- if (networkType === "dash") {
501
- return transaction_js_1.DashTransaction.fromWasm(this._wasm.extract_dash_transaction());
500
+ const wasm = this._wasm.extract_transaction();
501
+ switch (networkType) {
502
+ case "dash":
503
+ return transaction_js_1.DashTransaction.fromWasm(wasm);
504
+ case "zcash":
505
+ return transaction_js_1.ZcashTransaction.fromWasm(wasm);
506
+ default:
507
+ return transaction_js_1.Transaction.fromWasm(wasm);
502
508
  }
503
- if (networkType === "zcash") {
504
- return transaction_js_1.ZcashTransaction.fromWasm(this._wasm.extract_zcash_transaction());
505
- }
506
- return transaction_js_1.Transaction.fromWasm(this._wasm.extract_bitcoin_transaction());
507
509
  }
508
510
  /**
509
511
  * Extract a half-signed transaction in legacy format for p2ms-based script types.
@@ -76,6 +76,7 @@ declare module "./wasm/wasm_utxo.js" {
76
76
  hasPartialSignatures(inputIndex: number): boolean;
77
77
  validateSignatureAtInput(inputIndex: number, pubkey: Uint8Array): boolean;
78
78
  verifySignatureWithKey(inputIndex: number, key: WasmBIP32): boolean;
79
+ extractTransaction(): WasmTransaction;
79
80
  unsignedTxId(): string;
80
81
  lockTime(): number;
81
82
  version(): number;