@bitgo/wasm-utxo 1.15.0 → 1.17.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 (30) hide show
  1. package/README.md +10 -1
  2. package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.d.ts +5 -2
  3. package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.js +2 -0
  4. package/dist/cjs/js/fixedScriptWallet/ZcashBitGoPsbt.d.ts +113 -0
  5. package/dist/cjs/js/fixedScriptWallet/ZcashBitGoPsbt.js +114 -0
  6. package/dist/cjs/js/fixedScriptWallet/index.d.ts +2 -1
  7. package/dist/cjs/js/fixedScriptWallet/index.js +5 -1
  8. package/dist/cjs/js/index.d.ts +1 -0
  9. package/dist/cjs/js/index.js +5 -1
  10. package/dist/cjs/js/transaction.d.ts +46 -0
  11. package/dist/cjs/js/transaction.js +76 -0
  12. package/dist/cjs/js/wasm/wasm_utxo.d.ts +109 -0
  13. package/dist/cjs/js/wasm/wasm_utxo.js +345 -0
  14. package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
  15. package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +54 -41
  16. package/dist/esm/js/fixedScriptWallet/BitGoPsbt.d.ts +5 -2
  17. package/dist/esm/js/fixedScriptWallet/BitGoPsbt.js +2 -0
  18. package/dist/esm/js/fixedScriptWallet/ZcashBitGoPsbt.d.ts +113 -0
  19. package/dist/esm/js/fixedScriptWallet/ZcashBitGoPsbt.js +110 -0
  20. package/dist/esm/js/fixedScriptWallet/index.d.ts +2 -1
  21. package/dist/esm/js/fixedScriptWallet/index.js +3 -0
  22. package/dist/esm/js/index.d.ts +1 -0
  23. package/dist/esm/js/index.js +1 -0
  24. package/dist/esm/js/transaction.d.ts +46 -0
  25. package/dist/esm/js/transaction.js +70 -0
  26. package/dist/esm/js/wasm/wasm_utxo.d.ts +109 -0
  27. package/dist/esm/js/wasm/wasm_utxo_bg.js +342 -0
  28. package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
  29. package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +54 -41
  30. package/package.json +1 -1
@@ -0,0 +1,113 @@
1
+ import { type WalletKeysArg } from "./RootWalletKeys.js";
2
+ import { BitGoPsbt, type CreateEmptyOptions } from "./BitGoPsbt.js";
3
+ /** Zcash network names */
4
+ export type ZcashNetworkName = "zcash" | "zcashTest" | "zec" | "tzec";
5
+ /** Options for creating an empty Zcash PSBT (preferred method using block height) */
6
+ export type CreateEmptyZcashOptions = CreateEmptyOptions & {
7
+ /** Block height to determine consensus branch ID automatically */
8
+ blockHeight: number;
9
+ /** Zcash version group ID (defaults to Sapling: 0x892F2085) */
10
+ versionGroupId?: number;
11
+ /** Zcash transaction expiry height */
12
+ expiryHeight?: number;
13
+ };
14
+ /** Options for creating an empty Zcash PSBT with explicit consensus branch ID (advanced use) */
15
+ export type CreateEmptyZcashWithConsensusBranchIdOptions = CreateEmptyOptions & {
16
+ /** Zcash consensus branch ID (required, e.g., 0xC2D6D0B4 for NU5, 0x76B809BB for Sapling) */
17
+ consensusBranchId: number;
18
+ /** Zcash version group ID (defaults to Sapling: 0x892F2085) */
19
+ versionGroupId?: number;
20
+ /** Zcash transaction expiry height */
21
+ expiryHeight?: number;
22
+ };
23
+ /**
24
+ * Zcash-specific PSBT implementation
25
+ *
26
+ * This class extends BitGoPsbt with Zcash-specific functionality:
27
+ * - Required consensus branch ID for sighash computation
28
+ * - Version group ID for Zcash transaction format
29
+ * - Expiry height for transaction validity
30
+ *
31
+ * All Zcash-specific getters return non-optional types since they're
32
+ * guaranteed to be present for Zcash PSBTs.
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * // Create a new Zcash PSBT
37
+ * const psbt = ZcashBitGoPsbt.createEmpty("zcash", walletKeys, {
38
+ * consensusBranchId: 0x76B809BB, // Sapling
39
+ * });
40
+ *
41
+ * // Deserialize from bytes
42
+ * const psbt = ZcashBitGoPsbt.fromBytes(bytes, "zcash");
43
+ * ```
44
+ */
45
+ export declare class ZcashBitGoPsbt extends BitGoPsbt {
46
+ /**
47
+ * Create an empty Zcash PSBT with consensus branch ID determined from block height
48
+ *
49
+ * **This is the preferred method for creating Zcash PSBTs.** It automatically determines
50
+ * the correct consensus branch ID based on the network and block height using Zcash
51
+ * network upgrade activation heights, eliminating the need to manually look up branch IDs.
52
+ *
53
+ * @param network - Zcash network name ("zcash", "zcashTest", "zec", "tzec")
54
+ * @param walletKeys - The wallet's root keys (sets global xpubs in the PSBT)
55
+ * @param options - Options including blockHeight to determine consensus rules
56
+ * @returns A new ZcashBitGoPsbt instance
57
+ * @throws Error if block height is before Overwinter activation
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * // Create PSBT for a specific block height (recommended)
62
+ * const psbt = ZcashBitGoPsbt.createEmpty("zcash", walletKeys, {
63
+ * blockHeight: 1687104, // Automatically uses Nu5 branch ID
64
+ * });
65
+ *
66
+ * // Create PSBT for current block height
67
+ * const currentHeight = await getBlockHeight();
68
+ * const psbt = ZcashBitGoPsbt.createEmpty("zcash", walletKeys, {
69
+ * blockHeight: currentHeight,
70
+ * });
71
+ * ```
72
+ */
73
+ static createEmpty(network: ZcashNetworkName, walletKeys: WalletKeysArg, options: CreateEmptyZcashOptions): ZcashBitGoPsbt;
74
+ /**
75
+ * Create an empty Zcash PSBT with explicit consensus branch ID
76
+ *
77
+ * **Advanced use only.** This method requires manually specifying the consensus branch ID.
78
+ * In most cases, you should use `createEmpty()` instead, which automatically determines
79
+ * the correct branch ID from the block height.
80
+ *
81
+ * @param network - Zcash network name ("zcash", "zcashTest", "zec", "tzec")
82
+ * @param walletKeys - The wallet's root keys (sets global xpubs in the PSBT)
83
+ * @param options - Zcash-specific options including required consensusBranchId
84
+ * @returns A new ZcashBitGoPsbt instance
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * // Only use this if you need explicit control over the branch ID
89
+ * const psbt = ZcashBitGoPsbt.createEmptyWithConsensusBranchId("zcash", walletKeys, {
90
+ * consensusBranchId: 0xC2D6D0B4, // Nu5 branch ID
91
+ * });
92
+ * ```
93
+ */
94
+ static createEmptyWithConsensusBranchId(network: ZcashNetworkName, walletKeys: WalletKeysArg, options: CreateEmptyZcashWithConsensusBranchIdOptions): ZcashBitGoPsbt;
95
+ /**
96
+ * Deserialize a Zcash PSBT from bytes
97
+ *
98
+ * @param bytes - The PSBT bytes
99
+ * @param network - Zcash network name ("zcash", "zcashTest", "zec", "tzec")
100
+ * @returns A ZcashBitGoPsbt instance
101
+ */
102
+ static fromBytes(bytes: Uint8Array, network: ZcashNetworkName): ZcashBitGoPsbt;
103
+ /**
104
+ * Get the Zcash version group ID
105
+ * @returns The version group ID (e.g., 0x892F2085 for Sapling)
106
+ */
107
+ get versionGroupId(): number;
108
+ /**
109
+ * Get the Zcash expiry height
110
+ * @returns The expiry height (0 if not set)
111
+ */
112
+ get expiryHeight(): number;
113
+ }
@@ -0,0 +1,110 @@
1
+ import { BitGoPsbt as WasmBitGoPsbt } from "../wasm/wasm_utxo.js";
2
+ import { RootWalletKeys } from "./RootWalletKeys.js";
3
+ import { BitGoPsbt } from "./BitGoPsbt.js";
4
+ /**
5
+ * Zcash-specific PSBT implementation
6
+ *
7
+ * This class extends BitGoPsbt with Zcash-specific functionality:
8
+ * - Required consensus branch ID for sighash computation
9
+ * - Version group ID for Zcash transaction format
10
+ * - Expiry height for transaction validity
11
+ *
12
+ * All Zcash-specific getters return non-optional types since they're
13
+ * guaranteed to be present for Zcash PSBTs.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * // Create a new Zcash PSBT
18
+ * const psbt = ZcashBitGoPsbt.createEmpty("zcash", walletKeys, {
19
+ * consensusBranchId: 0x76B809BB, // Sapling
20
+ * });
21
+ *
22
+ * // Deserialize from bytes
23
+ * const psbt = ZcashBitGoPsbt.fromBytes(bytes, "zcash");
24
+ * ```
25
+ */
26
+ export class ZcashBitGoPsbt extends BitGoPsbt {
27
+ /**
28
+ * Create an empty Zcash PSBT with consensus branch ID determined from block height
29
+ *
30
+ * **This is the preferred method for creating Zcash PSBTs.** It automatically determines
31
+ * the correct consensus branch ID based on the network and block height using Zcash
32
+ * network upgrade activation heights, eliminating the need to manually look up branch IDs.
33
+ *
34
+ * @param network - Zcash network name ("zcash", "zcashTest", "zec", "tzec")
35
+ * @param walletKeys - The wallet's root keys (sets global xpubs in the PSBT)
36
+ * @param options - Options including blockHeight to determine consensus rules
37
+ * @returns A new ZcashBitGoPsbt instance
38
+ * @throws Error if block height is before Overwinter activation
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * // Create PSBT for a specific block height (recommended)
43
+ * const psbt = ZcashBitGoPsbt.createEmpty("zcash", walletKeys, {
44
+ * blockHeight: 1687104, // Automatically uses Nu5 branch ID
45
+ * });
46
+ *
47
+ * // Create PSBT for current block height
48
+ * const currentHeight = await getBlockHeight();
49
+ * const psbt = ZcashBitGoPsbt.createEmpty("zcash", walletKeys, {
50
+ * blockHeight: currentHeight,
51
+ * });
52
+ * ```
53
+ */
54
+ static createEmpty(network, walletKeys, options) {
55
+ const keys = RootWalletKeys.from(walletKeys);
56
+ const wasm = WasmBitGoPsbt.create_empty_zcash_at_height(network, keys.wasm, options.blockHeight, options.version, options.lockTime, options.versionGroupId, options.expiryHeight);
57
+ return new ZcashBitGoPsbt(wasm);
58
+ }
59
+ /**
60
+ * Create an empty Zcash PSBT with explicit consensus branch ID
61
+ *
62
+ * **Advanced use only.** This method requires manually specifying the consensus branch ID.
63
+ * In most cases, you should use `createEmpty()` instead, which automatically determines
64
+ * the correct branch ID from the block height.
65
+ *
66
+ * @param network - Zcash network name ("zcash", "zcashTest", "zec", "tzec")
67
+ * @param walletKeys - The wallet's root keys (sets global xpubs in the PSBT)
68
+ * @param options - Zcash-specific options including required consensusBranchId
69
+ * @returns A new ZcashBitGoPsbt instance
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * // Only use this if you need explicit control over the branch ID
74
+ * const psbt = ZcashBitGoPsbt.createEmptyWithConsensusBranchId("zcash", walletKeys, {
75
+ * consensusBranchId: 0xC2D6D0B4, // Nu5 branch ID
76
+ * });
77
+ * ```
78
+ */
79
+ static createEmptyWithConsensusBranchId(network, walletKeys, options) {
80
+ const keys = RootWalletKeys.from(walletKeys);
81
+ const wasm = WasmBitGoPsbt.create_empty_zcash(network, keys.wasm, options.consensusBranchId, options.version, options.lockTime, options.versionGroupId, options.expiryHeight);
82
+ return new ZcashBitGoPsbt(wasm);
83
+ }
84
+ /**
85
+ * Deserialize a Zcash PSBT from bytes
86
+ *
87
+ * @param bytes - The PSBT bytes
88
+ * @param network - Zcash network name ("zcash", "zcashTest", "zec", "tzec")
89
+ * @returns A ZcashBitGoPsbt instance
90
+ */
91
+ static fromBytes(bytes, network) {
92
+ const wasm = WasmBitGoPsbt.from_bytes(bytes, network);
93
+ return new ZcashBitGoPsbt(wasm);
94
+ }
95
+ // --- Zcash-specific getters ---
96
+ /**
97
+ * Get the Zcash version group ID
98
+ * @returns The version group ID (e.g., 0x892F2085 for Sapling)
99
+ */
100
+ get versionGroupId() {
101
+ return this.wasm.version_group_id();
102
+ }
103
+ /**
104
+ * Get the Zcash expiry height
105
+ * @returns The expiry height (0 if not set)
106
+ */
107
+ get expiryHeight() {
108
+ return this.wasm.expiry_height();
109
+ }
110
+ }
@@ -1,4 +1,5 @@
1
1
  export { RootWalletKeys, type WalletKeysArg, type IWalletKeys } from "./RootWalletKeys.js";
2
2
  export { ReplayProtection, type ReplayProtectionArg } from "./ReplayProtection.js";
3
3
  export { outputScript, address } from "./address.js";
4
- export { BitGoPsbt, type NetworkName, type ScriptId, type InputScriptType, type ParsedInput, type ParsedOutput, type ParsedTransaction, type SignPath, } from "./BitGoPsbt.js";
4
+ export { BitGoPsbt, type NetworkName, type ScriptId, type InputScriptType, type ParsedInput, type ParsedOutput, type ParsedTransaction, type SignPath, type CreateEmptyOptions, type AddInputOptions, type AddOutputOptions, type AddWalletInputOptions, type AddWalletOutputOptions, } from "./BitGoPsbt.js";
5
+ export { ZcashBitGoPsbt, type ZcashNetworkName, type CreateEmptyZcashOptions, } from "./ZcashBitGoPsbt.js";
@@ -1,4 +1,7 @@
1
1
  export { RootWalletKeys } from "./RootWalletKeys.js";
2
2
  export { ReplayProtection } from "./ReplayProtection.js";
3
3
  export { outputScript, address } from "./address.js";
4
+ // Bitcoin-like PSBT (for all non-Zcash networks)
4
5
  export { BitGoPsbt, } from "./BitGoPsbt.js";
6
+ // Zcash-specific PSBT subclass
7
+ export { ZcashBitGoPsbt, } from "./ZcashBitGoPsbt.js";
@@ -39,3 +39,4 @@ declare module "./wasm/wasm_utxo.js" {
39
39
  export { WrapDescriptor as Descriptor } from "./wasm/wasm_utxo.js";
40
40
  export { WrapMiniscript as Miniscript } from "./wasm/wasm_utxo.js";
41
41
  export { WrapPsbt as Psbt } from "./wasm/wasm_utxo.js";
42
+ export { DashTransaction, Transaction, ZcashTransaction } from "./transaction.js";
@@ -16,3 +16,4 @@ export { BIP32 } from "./bip32.js";
16
16
  export { WrapDescriptor as Descriptor } from "./wasm/wasm_utxo.js";
17
17
  export { WrapMiniscript as Miniscript } from "./wasm/wasm_utxo.js";
18
18
  export { WrapPsbt as Psbt } from "./wasm/wasm_utxo.js";
19
+ export { DashTransaction, Transaction, ZcashTransaction } from "./transaction.js";
@@ -0,0 +1,46 @@
1
+ import { WasmDashTransaction, WasmTransaction, WasmZcashTransaction } from "./wasm/wasm_utxo.js";
2
+ /**
3
+ * Transaction wrapper (Bitcoin-like networks)
4
+ *
5
+ * Provides a camelCase, strongly-typed API over the snake_case WASM bindings.
6
+ */
7
+ export declare class Transaction {
8
+ private _wasm;
9
+ private constructor();
10
+ static fromBytes(bytes: Uint8Array): Transaction;
11
+ toBytes(): Uint8Array;
12
+ /**
13
+ * @internal
14
+ */
15
+ get wasm(): WasmTransaction;
16
+ }
17
+ /**
18
+ * Zcash Transaction wrapper
19
+ *
20
+ * Provides a camelCase, strongly-typed API over the snake_case WASM bindings.
21
+ */
22
+ export declare class ZcashTransaction {
23
+ private _wasm;
24
+ private constructor();
25
+ static fromBytes(bytes: Uint8Array): ZcashTransaction;
26
+ toBytes(): Uint8Array;
27
+ /**
28
+ * @internal
29
+ */
30
+ get wasm(): WasmZcashTransaction;
31
+ }
32
+ /**
33
+ * Dash Transaction wrapper (supports EVO special transactions)
34
+ *
35
+ * Round-trip only: bytes -> parse -> bytes.
36
+ */
37
+ export declare class DashTransaction {
38
+ private _wasm;
39
+ private constructor();
40
+ static fromBytes(bytes: Uint8Array): DashTransaction;
41
+ toBytes(): Uint8Array;
42
+ /**
43
+ * @internal
44
+ */
45
+ get wasm(): WasmDashTransaction;
46
+ }
@@ -0,0 +1,70 @@
1
+ import { WasmDashTransaction, WasmTransaction, WasmZcashTransaction } from "./wasm/wasm_utxo.js";
2
+ /**
3
+ * Transaction wrapper (Bitcoin-like networks)
4
+ *
5
+ * Provides a camelCase, strongly-typed API over the snake_case WASM bindings.
6
+ */
7
+ export class Transaction {
8
+ _wasm;
9
+ constructor(_wasm) {
10
+ this._wasm = _wasm;
11
+ }
12
+ static fromBytes(bytes) {
13
+ return new Transaction(WasmTransaction.from_bytes(bytes));
14
+ }
15
+ toBytes() {
16
+ return this._wasm.to_bytes();
17
+ }
18
+ /**
19
+ * @internal
20
+ */
21
+ get wasm() {
22
+ return this._wasm;
23
+ }
24
+ }
25
+ /**
26
+ * Zcash Transaction wrapper
27
+ *
28
+ * Provides a camelCase, strongly-typed API over the snake_case WASM bindings.
29
+ */
30
+ export class ZcashTransaction {
31
+ _wasm;
32
+ constructor(_wasm) {
33
+ this._wasm = _wasm;
34
+ }
35
+ static fromBytes(bytes) {
36
+ return new ZcashTransaction(WasmZcashTransaction.from_bytes(bytes));
37
+ }
38
+ toBytes() {
39
+ return this._wasm.to_bytes();
40
+ }
41
+ /**
42
+ * @internal
43
+ */
44
+ get wasm() {
45
+ return this._wasm;
46
+ }
47
+ }
48
+ /**
49
+ * Dash Transaction wrapper (supports EVO special transactions)
50
+ *
51
+ * Round-trip only: bytes -> parse -> bytes.
52
+ */
53
+ export class DashTransaction {
54
+ _wasm;
55
+ constructor(_wasm) {
56
+ this._wasm = _wasm;
57
+ }
58
+ static fromBytes(bytes) {
59
+ return new DashTransaction(WasmDashTransaction.from_bytes(bytes));
60
+ }
61
+ toBytes() {
62
+ return this._wasm.to_bytes();
63
+ }
64
+ /**
65
+ * @internal
66
+ */
67
+ get wasm() {
68
+ return this._wasm;
69
+ }
70
+ }
@@ -38,6 +38,10 @@ export class BitGoPsbt {
38
38
  * * `lock_time` - Optional lock time (default: 0)
39
39
  */
40
40
  static create_empty(network: string, wallet_keys: WasmRootWalletKeys, version?: number | null, lock_time?: number | null): BitGoPsbt;
41
+ /**
42
+ * Get the Zcash expiry height (returns None for non-Zcash PSBTs)
43
+ */
44
+ expiry_height(): number | undefined;
41
45
  /**
42
46
  * Get the unsigned transaction ID
43
47
  */
@@ -84,6 +88,10 @@ export class BitGoPsbt {
84
88
  * The index of the newly added input
85
89
  */
86
90
  add_wallet_input(txid: string, vout: number, value: bigint, wallet_keys: WasmRootWalletKeys, chain: number, index: number, signer?: string | null, cosigner?: string | null, sequence?: number | null, prev_tx?: Uint8Array | null): number;
91
+ /**
92
+ * Get the Zcash version group ID (returns None for non-Zcash PSBTs)
93
+ */
94
+ version_group_id(): number | undefined;
87
95
  /**
88
96
  * Add a wallet output with full PSBT metadata
89
97
  *
@@ -120,6 +128,22 @@ export class BitGoPsbt {
120
128
  * - `Err(WasmUtxoError)` if signing fails
121
129
  */
122
130
  sign_with_privkey(input_index: number, ecpair: WasmECPair): void;
131
+ /**
132
+ * Create an empty Zcash PSBT with the required consensus branch ID
133
+ *
134
+ * This method is specifically for Zcash networks which require additional
135
+ * parameters for sighash computation.
136
+ *
137
+ * # Arguments
138
+ * * `network` - Network name (must be "zcash" or "zcashTest")
139
+ * * `wallet_keys` - The wallet's root keys (used to set global xpubs)
140
+ * * `consensus_branch_id` - Zcash consensus branch ID (e.g., 0xC2D6D0B4 for NU5)
141
+ * * `version` - Optional transaction version (default: 4 for Zcash Sapling+)
142
+ * * `lock_time` - Optional lock time (default: 0)
143
+ * * `version_group_id` - Optional version group ID (defaults to Sapling: 0x892F2085)
144
+ * * `expiry_height` - Optional expiry height
145
+ */
146
+ static create_empty_zcash(network: string, wallet_keys: WasmRootWalletKeys, consensus_branch_id: number, version?: number | null, lock_time?: number | null, version_group_id?: number | null, expiry_height?: number | null): BitGoPsbt;
123
147
  /**
124
148
  * Extract the final transaction from a finalized PSBT
125
149
  *
@@ -257,6 +281,25 @@ export class BitGoPsbt {
257
281
  * The index of the newly added input
258
282
  */
259
283
  add_replay_protection_input(ecpair: WasmECPair, txid: string, vout: number, value: bigint, sequence?: number | null): number;
284
+ /**
285
+ * Create an empty Zcash PSBT with consensus branch ID determined from block height
286
+ *
287
+ * This method automatically determines the correct consensus branch ID based on
288
+ * the network and block height using the network upgrade activation heights.
289
+ *
290
+ * # Arguments
291
+ * * `network` - Network name (must be "zcash" or "zcashTest")
292
+ * * `wallet_keys` - The wallet's root keys (used to set global xpubs)
293
+ * * `block_height` - Block height to determine consensus rules
294
+ * * `version` - Optional transaction version (default: 4 for Zcash Sapling+)
295
+ * * `lock_time` - Optional lock time (default: 0)
296
+ * * `version_group_id` - Optional version group ID (defaults to Sapling: 0x892F2085)
297
+ * * `expiry_height` - Optional expiry height
298
+ *
299
+ * # Errors
300
+ * Returns error if block height is before Overwinter activation
301
+ */
302
+ 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;
260
303
  /**
261
304
  * Parse outputs with wallet keys to identify which outputs belong to a wallet
262
305
  *
@@ -445,6 +488,20 @@ export class WasmBIP32 {
445
488
  readonly index: number;
446
489
  }
447
490
 
491
+ export class WasmDashTransaction {
492
+ private constructor();
493
+ free(): void;
494
+ [Symbol.dispose](): void;
495
+ /**
496
+ * Deserialize a Dash transaction from bytes (supports EVO special tx extra payload).
497
+ */
498
+ static from_bytes(bytes: Uint8Array): WasmDashTransaction;
499
+ /**
500
+ * Serialize the Dash transaction to bytes (preserving tx_type and extra payload).
501
+ */
502
+ to_bytes(): Uint8Array;
503
+ }
504
+
448
505
  export class WasmECPair {
449
506
  private constructor();
450
507
  free(): void;
@@ -548,6 +605,58 @@ export class WasmRootWalletKeys {
548
605
  bitgo_key(): WasmBIP32;
549
606
  }
550
607
 
608
+ export class WasmTransaction {
609
+ private constructor();
610
+ free(): void;
611
+ [Symbol.dispose](): void;
612
+ /**
613
+ * Deserialize a transaction from bytes
614
+ *
615
+ * # Arguments
616
+ * * `bytes` - The serialized transaction bytes
617
+ *
618
+ * # Returns
619
+ * A WasmTransaction instance
620
+ *
621
+ * # Errors
622
+ * Returns an error if the bytes cannot be parsed as a valid transaction
623
+ */
624
+ static from_bytes(bytes: Uint8Array): WasmTransaction;
625
+ /**
626
+ * Serialize the transaction to bytes
627
+ *
628
+ * # Returns
629
+ * The serialized transaction bytes
630
+ */
631
+ to_bytes(): Uint8Array;
632
+ }
633
+
634
+ export class WasmZcashTransaction {
635
+ private constructor();
636
+ free(): void;
637
+ [Symbol.dispose](): void;
638
+ /**
639
+ * Deserialize a Zcash transaction from bytes
640
+ *
641
+ * # Arguments
642
+ * * `bytes` - The serialized transaction bytes
643
+ *
644
+ * # Returns
645
+ * A WasmZcashTransaction instance
646
+ *
647
+ * # Errors
648
+ * Returns an error if the bytes cannot be parsed as a valid Zcash transaction
649
+ */
650
+ static from_bytes(bytes: Uint8Array): WasmZcashTransaction;
651
+ /**
652
+ * Serialize the transaction to bytes
653
+ *
654
+ * # Returns
655
+ * The serialized transaction bytes
656
+ */
657
+ to_bytes(): Uint8Array;
658
+ }
659
+
551
660
  export class WrapDescriptor {
552
661
  private constructor();
553
662
  free(): void;