@bitgo/wasm-utxo 4.3.0 → 4.5.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.
Files changed (31) hide show
  1. package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.d.ts +8 -3
  2. package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.js +22 -3
  3. package/dist/cjs/js/fixedScriptWallet/ZcashBitGoPsbt.d.ts +47 -2
  4. package/dist/cjs/js/fixedScriptWallet/ZcashBitGoPsbt.js +54 -0
  5. package/dist/cjs/js/fixedScriptWallet/chains.d.ts +1 -1
  6. package/dist/cjs/js/fixedScriptWallet/chains.js +1 -1
  7. package/dist/cjs/js/psbt.d.ts +3 -0
  8. package/dist/cjs/js/psbtBase.d.ts +6 -0
  9. package/dist/cjs/js/psbtBase.js +9 -0
  10. package/dist/cjs/js/transaction.d.ts +18 -0
  11. package/dist/cjs/js/transaction.js +28 -1
  12. package/dist/cjs/js/wasm/wasm_utxo.d.ts +41 -2
  13. package/dist/cjs/js/wasm/wasm_utxo.js +210 -7
  14. package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
  15. package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +45 -36
  16. package/dist/esm/js/fixedScriptWallet/BitGoPsbt.d.ts +8 -3
  17. package/dist/esm/js/fixedScriptWallet/BitGoPsbt.js +22 -3
  18. package/dist/esm/js/fixedScriptWallet/ZcashBitGoPsbt.d.ts +47 -2
  19. package/dist/esm/js/fixedScriptWallet/ZcashBitGoPsbt.js +54 -0
  20. package/dist/esm/js/fixedScriptWallet/chains.d.ts +1 -1
  21. package/dist/esm/js/fixedScriptWallet/chains.js +1 -1
  22. package/dist/esm/js/psbt.d.ts +3 -0
  23. package/dist/esm/js/psbtBase.d.ts +6 -0
  24. package/dist/esm/js/psbtBase.js +9 -0
  25. package/dist/esm/js/transaction.d.ts +18 -0
  26. package/dist/esm/js/transaction.js +28 -1
  27. package/dist/esm/js/wasm/wasm_utxo.d.ts +41 -2
  28. package/dist/esm/js/wasm/wasm_utxo_bg.js +210 -7
  29. package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
  30. package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +45 -36
  31. package/package.json +1 -1
@@ -8,7 +8,7 @@ import { type ECPairArg } from "../ecpair.js";
8
8
  import type { UtxolibName } from "../utxolibCompat.js";
9
9
  import type { CoinName } from "../coinName.js";
10
10
  import type { InputScriptType } from "./scriptType.js";
11
- import { type ITransaction } from "../transaction.js";
11
+ import { Transaction, DashTransaction, type ITransaction } from "../transaction.js";
12
12
  export type { InputScriptType };
13
13
  export type NetworkName = UtxolibName | CoinName;
14
14
  export type ScriptId = {
@@ -151,12 +151,17 @@ export declare class BitGoPsbt extends PsbtBase<WasmBitGoPsbt> implements IPsbtW
151
151
  * with proper wallet metadata (bip32Derivation, scripts, witnessUtxo).
152
152
  * Only supports p2sh, p2shP2wsh, and p2wsh inputs (not taproot).
153
153
  *
154
- * @param txBytes - The serialized half-signed legacy transaction
154
+ * Supports both Bitcoin-like coins (BTC, LTC, DOGE) and Dash (DASH).
155
+ * Zcash is NOT supported; use ZcashBitGoPsbt.fromHalfSignedLegacyTransaction instead.
156
+ *
157
+ * @param txBytesOrTx - Transaction bytes or decoded transaction instance (Bitcoin-like or Dash)
155
158
  * @param network - Network name
156
159
  * @param walletKeys - The wallet's root keys
157
160
  * @param unspents - Chain, index, and value for each input
161
+ * @param _options - Reserved for future use and signature compatibility with subclasses
162
+ * @throws Error if transaction is Zcash (use ZcashBitGoPsbt.fromHalfSignedLegacyTransaction instead)
158
163
  */
159
- static fromHalfSignedLegacyTransaction(txBytes: Uint8Array, network: NetworkName, walletKeys: WalletKeysArg, unspents: HydrationUnspent[]): BitGoPsbt;
164
+ static fromHalfSignedLegacyTransaction(txBytesOrTx: Uint8Array | Transaction | DashTransaction, network: NetworkName, walletKeys: WalletKeysArg, unspents: HydrationUnspent[], _options?: unknown): BitGoPsbt;
160
165
  /**
161
166
  * Add an input to the PSBT
162
167
  *
@@ -8,6 +8,7 @@ const RootWalletKeys_js_1 = require("./RootWalletKeys.js");
8
8
  const ReplayProtection_js_1 = require("./ReplayProtection.js");
9
9
  const bip32_js_1 = require("../bip32.js");
10
10
  const ecpair_js_1 = require("../ecpair.js");
11
+ const coinName_js_1 = require("../coinName.js");
11
12
  const transaction_js_1 = require("../transaction.js");
12
13
  class BitGoPsbt extends psbtBase_js_1.PsbtBase {
13
14
  constructor(wasm) {
@@ -64,14 +65,32 @@ class BitGoPsbt extends psbtBase_js_1.PsbtBase {
64
65
  * with proper wallet metadata (bip32Derivation, scripts, witnessUtxo).
65
66
  * Only supports p2sh, p2shP2wsh, and p2wsh inputs (not taproot).
66
67
  *
67
- * @param txBytes - The serialized half-signed legacy transaction
68
+ * Supports both Bitcoin-like coins (BTC, LTC, DOGE) and Dash (DASH).
69
+ * Zcash is NOT supported; use ZcashBitGoPsbt.fromHalfSignedLegacyTransaction instead.
70
+ *
71
+ * @param txBytesOrTx - Transaction bytes or decoded transaction instance (Bitcoin-like or Dash)
68
72
  * @param network - Network name
69
73
  * @param walletKeys - The wallet's root keys
70
74
  * @param unspents - Chain, index, and value for each input
75
+ * @param _options - Reserved for future use and signature compatibility with subclasses
76
+ * @throws Error if transaction is Zcash (use ZcashBitGoPsbt.fromHalfSignedLegacyTransaction instead)
71
77
  */
72
- static fromHalfSignedLegacyTransaction(txBytes, network, walletKeys, unspents) {
78
+ static fromHalfSignedLegacyTransaction(txBytesOrTx, network, walletKeys, unspents,
79
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
80
+ _options) {
73
81
  const keys = RootWalletKeys_js_1.RootWalletKeys.from(walletKeys);
74
- const wasm = wasm_utxo_js_1.BitGoPsbt.from_half_signed_legacy_transaction(txBytes, network, keys.wasm, unspents);
82
+ // Parse bytes to Transaction if needed
83
+ const tx = txBytesOrTx instanceof Uint8Array
84
+ ? transaction_js_1.Transaction.fromBytes(txBytesOrTx, (0, coinName_js_1.toCoinName)(network))
85
+ : txBytesOrTx;
86
+ // Validate that this is not a Zcash transaction
87
+ if (tx instanceof transaction_js_1.ZcashTransaction) {
88
+ throw new Error("Use ZcashBitGoPsbt.fromHalfSignedLegacyTransaction() for Zcash transactions");
89
+ }
90
+ // Pass WASM transaction directly to avoid serialization round-trip
91
+ const wasm = tx instanceof transaction_js_1.DashTransaction
92
+ ? wasm_utxo_js_1.BitGoPsbt.from_half_signed_legacy_transaction_dash(tx.wasm, network, keys.wasm, unspents)
93
+ : wasm_utxo_js_1.BitGoPsbt.from_half_signed_legacy_transaction(tx.wasm, network, keys.wasm, unspents);
75
94
  return new BitGoPsbt(wasm);
76
95
  }
77
96
  addInputAtIndex(index, txidOrOptions, voutOrScript, value, script, sequence) {
@@ -1,6 +1,6 @@
1
1
  import { type WalletKeysArg } from "./RootWalletKeys.js";
2
- import { BitGoPsbt, type CreateEmptyOptions } from "./BitGoPsbt.js";
3
- import { ZcashTransaction } from "../transaction.js";
2
+ import { BitGoPsbt, type CreateEmptyOptions, type HydrationUnspent } from "./BitGoPsbt.js";
3
+ import { ZcashTransaction, type ITransaction } from "../transaction.js";
4
4
  /** Zcash network names */
5
5
  export type ZcashNetworkName = "zcash" | "zcashTest" | "zec" | "tzec";
6
6
  /** Options for creating an empty Zcash PSBT (preferred method using block height) */
@@ -101,6 +101,51 @@ export declare class ZcashBitGoPsbt extends BitGoPsbt {
101
101
  * @returns A ZcashBitGoPsbt instance
102
102
  */
103
103
  static fromBytes(bytes: Uint8Array, network: ZcashNetworkName): ZcashBitGoPsbt;
104
+ /**
105
+ * Reconstruct a Zcash PSBT from a half-signed legacy transaction
106
+ *
107
+ * This is the inverse of `getHalfSignedLegacyFormat()` for Zcash. It decodes the Zcash wire
108
+ * format (which includes version_group_id, expiry_height, and sapling fields), extracts
109
+ * partial signatures, and reconstructs a proper Zcash PSBT with consensus metadata.
110
+ *
111
+ * Supports two modes for determining consensus_branch_id:
112
+ * - **Recommended**: Pass `blockHeight` to auto-determine consensus_branch_id via network upgrade activation heights
113
+ * - **Advanced**: Pass `consensusBranchId` directly if you already know it (e.g., 0xC2D6D0B4 for NU5)
114
+ *
115
+ * @param txBytesOrTx - Either serialized Zcash transaction bytes or a decoded ZcashTransaction instance
116
+ * @param network - Zcash network name ("zcash", "zcashTest", "zec", "tzec")
117
+ * @param walletKeys - The wallet's root keys
118
+ * @param unspents - Chain, index, and value for each input
119
+ * @param options - Either `{ blockHeight: number }` or `{ consensusBranchId: number }`
120
+ * @returns A ZcashBitGoPsbt instance
121
+ *
122
+ * @example
123
+ * ```typescript
124
+ * // Round-trip with block height (recommended)
125
+ * const legacyBytes = psbt.getHalfSignedLegacyFormat();
126
+ * const reconstructed = ZcashBitGoPsbt.fromHalfSignedLegacyTransaction(
127
+ * legacyBytes,
128
+ * "zec",
129
+ * walletKeys,
130
+ * unspents,
131
+ * { blockHeight: 1687105 } // NU5 activation height
132
+ * );
133
+ *
134
+ * // Or with explicit consensus branch ID
135
+ * const reconstructed = ZcashBitGoPsbt.fromHalfSignedLegacyTransaction(
136
+ * legacyBytes,
137
+ * "zec",
138
+ * walletKeys,
139
+ * unspents,
140
+ * { consensusBranchId: 0xC2D6D0B4 } // NU5 branch ID
141
+ * );
142
+ * ```
143
+ */
144
+ static fromHalfSignedLegacyTransaction(txBytesOrTx: Uint8Array | ITransaction, network: ZcashNetworkName, walletKeys: WalletKeysArg, unspents: HydrationUnspent[], options: {
145
+ blockHeight: number;
146
+ } | {
147
+ consensusBranchId: number;
148
+ }): ZcashBitGoPsbt;
104
149
  /**
105
150
  * Get the Zcash version group ID
106
151
  * @returns The version group ID (e.g., 0x892F2085 for Sapling)
@@ -96,6 +96,60 @@ class ZcashBitGoPsbt extends BitGoPsbt_js_1.BitGoPsbt {
96
96
  const wasm = wasm_utxo_js_1.BitGoPsbt.from_bytes(bytes, network);
97
97
  return new ZcashBitGoPsbt(wasm);
98
98
  }
99
+ /**
100
+ * Reconstruct a Zcash PSBT from a half-signed legacy transaction
101
+ *
102
+ * This is the inverse of `getHalfSignedLegacyFormat()` for Zcash. It decodes the Zcash wire
103
+ * format (which includes version_group_id, expiry_height, and sapling fields), extracts
104
+ * partial signatures, and reconstructs a proper Zcash PSBT with consensus metadata.
105
+ *
106
+ * Supports two modes for determining consensus_branch_id:
107
+ * - **Recommended**: Pass `blockHeight` to auto-determine consensus_branch_id via network upgrade activation heights
108
+ * - **Advanced**: Pass `consensusBranchId` directly if you already know it (e.g., 0xC2D6D0B4 for NU5)
109
+ *
110
+ * @param txBytesOrTx - Either serialized Zcash transaction bytes or a decoded ZcashTransaction instance
111
+ * @param network - Zcash network name ("zcash", "zcashTest", "zec", "tzec")
112
+ * @param walletKeys - The wallet's root keys
113
+ * @param unspents - Chain, index, and value for each input
114
+ * @param options - Either `{ blockHeight: number }` or `{ consensusBranchId: number }`
115
+ * @returns A ZcashBitGoPsbt instance
116
+ *
117
+ * @example
118
+ * ```typescript
119
+ * // Round-trip with block height (recommended)
120
+ * const legacyBytes = psbt.getHalfSignedLegacyFormat();
121
+ * const reconstructed = ZcashBitGoPsbt.fromHalfSignedLegacyTransaction(
122
+ * legacyBytes,
123
+ * "zec",
124
+ * walletKeys,
125
+ * unspents,
126
+ * { blockHeight: 1687105 } // NU5 activation height
127
+ * );
128
+ *
129
+ * // Or with explicit consensus branch ID
130
+ * const reconstructed = ZcashBitGoPsbt.fromHalfSignedLegacyTransaction(
131
+ * legacyBytes,
132
+ * "zec",
133
+ * walletKeys,
134
+ * unspents,
135
+ * { consensusBranchId: 0xC2D6D0B4 } // NU5 branch ID
136
+ * );
137
+ * ```
138
+ */
139
+ static fromHalfSignedLegacyTransaction(txBytesOrTx, network, walletKeys, unspents, options) {
140
+ const keys = RootWalletKeys_js_1.RootWalletKeys.from(walletKeys);
141
+ const tx = txBytesOrTx instanceof Uint8Array
142
+ ? transaction_js_1.ZcashTransaction.fromBytes(txBytesOrTx)
143
+ : txBytesOrTx;
144
+ if ("blockHeight" in options) {
145
+ const wasm = wasm_utxo_js_1.BitGoPsbt.from_half_signed_legacy_transaction_zcash_with_block_height(tx.wasm, network, keys.wasm, unspents, options.blockHeight);
146
+ return new ZcashBitGoPsbt(wasm);
147
+ }
148
+ else {
149
+ const wasm = wasm_utxo_js_1.BitGoPsbt.from_half_signed_legacy_transaction_zcash_with_branch_id(tx.wasm, network, keys.wasm, unspents, options.consensusBranchId);
150
+ return new ZcashBitGoPsbt(wasm);
151
+ }
152
+ }
99
153
  // --- Zcash-specific getters ---
100
154
  /**
101
155
  * Get the Zcash version group ID
@@ -1,6 +1,6 @@
1
1
  import type { OutputScriptType } from "./scriptType.js";
2
2
  /** All valid chain codes as a const tuple */
3
- export declare const chainCodes: readonly [0, 1, 10, 11, 20, 21, 30, 31, 40, 41];
3
+ export declare const chainCodes: readonly [0, 1, 10, 11, 20, 21, 30, 31, 40, 41, 360, 361];
4
4
  /** A valid chain code value */
5
5
  export type ChainCode = (typeof chainCodes)[number];
6
6
  /** Whether a chain is for receiving (external) or change (internal) addresses */
@@ -10,7 +10,7 @@ exports.assertChainCode = assertChainCode;
10
10
  */
11
11
  const wasm_utxo_js_1 = require("../wasm/wasm_utxo.js");
12
12
  /** All valid chain codes as a const tuple */
13
- exports.chainCodes = [0, 1, 10, 11, 20, 21, 30, 31, 40, 41];
13
+ exports.chainCodes = [0, 1, 10, 11, 20, 21, 30, 31, 40, 41, 360, 361];
14
14
  // Build static lookup tables once at module load time
15
15
  const chainCodeSet = new Set(exports.chainCodes);
16
16
  const chainToMeta = new Map();
@@ -12,10 +12,13 @@ export interface IPsbt extends ITransactionCommon<PsbtInputData, PsbtOutputData>
12
12
  removeOutput(index: number): void;
13
13
  setKV(key: PsbtKvKey, value: Uint8Array): void;
14
14
  getKV(key: PsbtKvKey): Uint8Array | undefined;
15
+ deleteKV(key: PsbtKvKey): void;
15
16
  setInputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
16
17
  getInputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
18
+ deleteInputKV(index: number, key: PsbtKvKey): void;
17
19
  setOutputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
18
20
  getOutputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
21
+ deleteOutputKV(index: number, key: PsbtKvKey): void;
19
22
  }
20
23
  /** Extended PSBT with address resolution (no coin parameter needed) */
21
24
  export interface IPsbtWithAddress extends IPsbt {
@@ -15,10 +15,13 @@ interface WasmPsbtBase {
15
15
  remove_output(index: number): void;
16
16
  set_kv(key: unknown, value: Uint8Array): void;
17
17
  get_kv(key: unknown): Uint8Array | null | undefined;
18
+ delete_kv(key: unknown): void;
18
19
  set_input_kv(index: number, key: unknown, value: Uint8Array): void;
19
20
  get_input_kv(index: number, key: unknown): Uint8Array | null | undefined;
21
+ delete_input_kv(index: number, key: unknown): void;
20
22
  set_output_kv(index: number, key: unknown, value: Uint8Array): void;
21
23
  get_output_kv(index: number, key: unknown): Uint8Array | null | undefined;
24
+ delete_output_kv(index: number, key: unknown): void;
22
25
  }
23
26
  export declare abstract class PsbtBase<W extends WasmPsbtBase> {
24
27
  protected _wasm: W;
@@ -40,5 +43,8 @@ export declare abstract class PsbtBase<W extends WasmPsbtBase> {
40
43
  getInputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
41
44
  setOutputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
42
45
  getOutputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
46
+ deleteKV(key: PsbtKvKey): void;
47
+ deleteInputKV(index: number, key: PsbtKvKey): void;
48
+ deleteOutputKV(index: number, key: PsbtKvKey): void;
43
49
  }
44
50
  export {};
@@ -58,5 +58,14 @@ class PsbtBase {
58
58
  getOutputKV(index, key) {
59
59
  return this._wasm.get_output_kv(index, key) ?? undefined;
60
60
  }
61
+ deleteKV(key) {
62
+ this._wasm.delete_kv(key);
63
+ }
64
+ deleteInputKV(index, key) {
65
+ this._wasm.delete_input_kv(index, key);
66
+ }
67
+ deleteOutputKV(index, key) {
68
+ this._wasm.delete_output_kv(index, key);
69
+ }
61
70
  }
62
71
  exports.PsbtBase = PsbtBase;
@@ -24,11 +24,19 @@ export interface ITransaction extends ITransactionCommon<TxInputData, TxOutputDa
24
24
  */
25
25
  export declare class Transaction extends TransactionBase<WasmTransaction> {
26
26
  private constructor();
27
+ /**
28
+ * Check if a coin is supported by this transaction class.
29
+ * Bitcoin-like transactions support all coins except Zcash and Dash.
30
+ */
31
+ static supportsCoin(coin: CoinName): boolean;
27
32
  /**
28
33
  * Create an empty transaction (version 1, locktime 0)
29
34
  */
30
35
  static create(): Transaction;
31
36
  static fromBytes(bytes: Uint8Array): Transaction;
37
+ static fromBytes(bytes: Uint8Array, coin: "zec" | "tzec"): ZcashTransaction;
38
+ static fromBytes(bytes: Uint8Array, coin: "dash" | "tdash"): DashTransaction;
39
+ static fromBytes(bytes: Uint8Array, coin: CoinName): Transaction | ZcashTransaction | DashTransaction;
32
40
  /** @internal Create from WASM instance directly (avoids re-parsing bytes) */
33
41
  static fromWasm(wasm: WasmTransaction): Transaction;
34
42
  /**
@@ -60,6 +68,11 @@ export declare class Transaction extends TransactionBase<WasmTransaction> {
60
68
  */
61
69
  export declare class ZcashTransaction extends TransactionBase<WasmZcashTransaction> {
62
70
  private constructor();
71
+ /**
72
+ * Check if a coin is supported by this transaction class.
73
+ * Zcash transactions support Zcash mainnet and testnet.
74
+ */
75
+ static supportsCoin(coin: CoinName): boolean;
63
76
  static fromBytes(bytes: Uint8Array): ZcashTransaction;
64
77
  /** @internal Create from WASM instance directly (avoids re-parsing bytes) */
65
78
  static fromWasm(wasm: WasmZcashTransaction): ZcashTransaction;
@@ -73,6 +86,11 @@ export declare class ZcashTransaction extends TransactionBase<WasmZcashTransacti
73
86
  */
74
87
  export declare class DashTransaction extends TransactionBase<WasmDashTransaction> {
75
88
  private constructor();
89
+ /**
90
+ * Check if a coin is supported by this transaction class.
91
+ * Dash transactions support Dash mainnet and testnet.
92
+ */
93
+ static supportsCoin(coin: CoinName): boolean;
76
94
  static fromBytes(bytes: Uint8Array): DashTransaction;
77
95
  /** @internal Create from WASM instance directly (avoids re-parsing bytes) */
78
96
  static fromWasm(wasm: WasmDashTransaction): DashTransaction;
@@ -12,13 +12,26 @@ class Transaction extends transactionBase_js_1.TransactionBase {
12
12
  constructor(wasm) {
13
13
  super(wasm);
14
14
  }
15
+ /**
16
+ * Check if a coin is supported by this transaction class.
17
+ * Bitcoin-like transactions support all coins except Zcash and Dash.
18
+ */
19
+ static supportsCoin(coin) {
20
+ return !ZcashTransaction.supportsCoin(coin) && !DashTransaction.supportsCoin(coin);
21
+ }
15
22
  /**
16
23
  * Create an empty transaction (version 1, locktime 0)
17
24
  */
18
25
  static create() {
19
26
  return new Transaction(wasm_utxo_js_1.WasmTransaction.create());
20
27
  }
21
- static fromBytes(bytes) {
28
+ static fromBytes(bytes, coin) {
29
+ if (coin !== undefined) {
30
+ if (ZcashTransaction.supportsCoin(coin))
31
+ return ZcashTransaction.fromBytes(bytes);
32
+ if (DashTransaction.supportsCoin(coin))
33
+ return DashTransaction.fromBytes(bytes);
34
+ }
22
35
  return new Transaction(wasm_utxo_js_1.WasmTransaction.from_bytes(bytes));
23
36
  }
24
37
  /** @internal Create from WASM instance directly (avoids re-parsing bytes) */
@@ -69,6 +82,13 @@ class ZcashTransaction extends transactionBase_js_1.TransactionBase {
69
82
  constructor(wasm) {
70
83
  super(wasm);
71
84
  }
85
+ /**
86
+ * Check if a coin is supported by this transaction class.
87
+ * Zcash transactions support Zcash mainnet and testnet.
88
+ */
89
+ static supportsCoin(coin) {
90
+ return coin === "zec" || coin === "tzec";
91
+ }
72
92
  static fromBytes(bytes) {
73
93
  return new ZcashTransaction(wasm_utxo_js_1.WasmZcashTransaction.from_bytes(bytes));
74
94
  }
@@ -91,6 +111,13 @@ class DashTransaction extends transactionBase_js_1.TransactionBase {
91
111
  constructor(wasm) {
92
112
  super(wasm);
93
113
  }
114
+ /**
115
+ * Check if a coin is supported by this transaction class.
116
+ * Dash transactions support Dash mainnet and testnet.
117
+ */
118
+ static supportsCoin(coin) {
119
+ return coin === "dash" || coin === "tdash";
120
+ }
94
121
  static fromBytes(bytes) {
95
122
  return new DashTransaction(wasm_utxo_js_1.WasmDashTransaction.from_bytes(bytes));
96
123
  }
@@ -221,6 +221,9 @@ export class BitGoPsbt {
221
221
  * Returns error if block height is before Overwinter activation
222
222
  */
223
223
  static create_empty_zcash_at_height(network: string, wallet_keys: WasmRootWalletKeys, block_height: number, version?: number | null, lock_time?: number | null, version_group_id?: number | null, expiry_height?: number | null): BitGoPsbt;
224
+ delete_input_kv(index: number, key: any): void;
225
+ delete_kv(key: any): void;
226
+ delete_output_kv(index: number, key: any): void;
224
227
  /**
225
228
  * Get the Zcash expiry height (returns None for non-Zcash PSBTs)
226
229
  */
@@ -298,12 +301,45 @@ export class BitGoPsbt {
298
301
  * Convert a half-signed legacy transaction to a psbt-lite.
299
302
  *
300
303
  * # Arguments
301
- * * `tx_bytes` - The serialized half-signed legacy transaction
304
+ * * `tx` - The decoded half-signed legacy transaction
302
305
  * * `network` - Network name (utxolib or coin name)
303
306
  * * `wallet_keys` - The wallet's root keys
304
307
  * * `unspents` - Array of `{ chain: number, index: number, value: bigint }` for each input
305
308
  */
306
- static from_half_signed_legacy_transaction(tx_bytes: Uint8Array, network: string, wallet_keys: WasmRootWalletKeys, unspents: any): BitGoPsbt;
309
+ static from_half_signed_legacy_transaction(tx: WasmTransaction, network: string, wallet_keys: WasmRootWalletKeys, unspents: any): BitGoPsbt;
310
+ /**
311
+ * Convert a half-signed legacy Dash transaction to a psbt-lite.
312
+ *
313
+ * # Arguments
314
+ * * `tx` - The decoded Dash transaction
315
+ * * `network` - Network name ("dash" or "tdash")
316
+ * * `wallet_keys` - The wallet's root keys
317
+ * * `unspents` - Array of `{ chain: number, index: number, value: bigint }` for each input
318
+ */
319
+ static from_half_signed_legacy_transaction_dash(tx: WasmDashTransaction, network: string, wallet_keys: WasmRootWalletKeys, unspents: any): BitGoPsbt;
320
+ /**
321
+ * Convert a half-signed legacy Zcash transaction to a psbt-lite (with block height).
322
+ * Thin wrapper: resolves block_height → consensus_branch_id and delegates to the explicit variant.
323
+ *
324
+ * # Arguments
325
+ * * `tx` - The decoded Zcash transaction
326
+ * * `network` - Network name ("zec" or "tzec")
327
+ * * `wallet_keys` - The wallet's root keys
328
+ * * `unspents` - Array of `{ chain: number, index: number, value: bigint }` for each input
329
+ * * `block_height` - Block height to determine consensus branch ID
330
+ */
331
+ static from_half_signed_legacy_transaction_zcash_with_block_height(tx: WasmZcashTransaction, network: string, wallet_keys: WasmRootWalletKeys, unspents: any, block_height: number): BitGoPsbt;
332
+ /**
333
+ * Convert a half-signed legacy Zcash transaction to a psbt-lite (with consensus branch ID).
334
+ *
335
+ * # Arguments
336
+ * * `tx` - The decoded Zcash transaction
337
+ * * `network` - Network name ("zec" or "tzec")
338
+ * * `wallet_keys` - The wallet's root keys
339
+ * * `unspents` - Array of `{ chain: number, index: number, value: bigint }` for each input
340
+ * * `consensus_branch_id` - Zcash consensus branch ID
341
+ */
342
+ static from_half_signed_legacy_transaction_zcash_with_branch_id(tx: WasmZcashTransaction, network: string, wallet_keys: WasmRootWalletKeys, unspents: any, consensus_branch_id: number): BitGoPsbt;
307
343
  /**
308
344
  * Generate and store MuSig2 nonces for all MuSig2 inputs
309
345
  *
@@ -1363,6 +1399,9 @@ export class WrapPsbt {
1363
1399
  */
1364
1400
  add_output_at_index(index: number, script: Uint8Array, value: bigint): number;
1365
1401
  clone(): WrapPsbt;
1402
+ delete_input_kv(index: number, key: any): void;
1403
+ delete_kv(key: any): void;
1404
+ delete_output_kv(index: number, key: any): void;
1366
1405
  static deserialize(psbt: Uint8Array): WrapPsbt;
1367
1406
  /**
1368
1407
  * Extract the final transaction from a finalized PSBT