@bitgo/wasm-utxo 3.1.0 → 4.0.1
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.
- package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.d.ts +18 -0
- package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.js +17 -0
- package/dist/cjs/js/fixedScriptWallet/index.d.ts +1 -1
- package/dist/cjs/js/index.d.ts +22 -1
- package/dist/cjs/js/psbt.d.ts +2 -7
- package/dist/cjs/js/transaction.d.ts +41 -23
- package/dist/cjs/js/transaction.js +69 -18
- package/dist/cjs/js/wasm/wasm_utxo.d.ts +31 -0
- package/dist/cjs/js/wasm/wasm_utxo.js +311 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +71 -49
- package/dist/esm/js/fixedScriptWallet/BitGoPsbt.d.ts +18 -0
- package/dist/esm/js/fixedScriptWallet/BitGoPsbt.js +17 -0
- package/dist/esm/js/fixedScriptWallet/index.d.ts +1 -1
- package/dist/esm/js/index.d.ts +22 -1
- package/dist/esm/js/index.js +1 -1
- package/dist/esm/js/psbt.d.ts +2 -7
- package/dist/esm/js/transaction.d.ts +41 -23
- package/dist/esm/js/transaction.js +70 -19
- package/dist/esm/js/wasm/wasm_utxo.d.ts +31 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.js +311 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +71 -49
- package/package.json +1 -1
|
@@ -98,6 +98,11 @@ export type ParseTransactionOptions = {
|
|
|
98
98
|
export type ParseOutputsOptions = {
|
|
99
99
|
payGoPubkeys?: ECPairArg[];
|
|
100
100
|
};
|
|
101
|
+
export type HydrationUnspent = {
|
|
102
|
+
chain: number;
|
|
103
|
+
index: number;
|
|
104
|
+
value: bigint;
|
|
105
|
+
};
|
|
101
106
|
export declare class BitGoPsbt implements IPsbtWithAddress {
|
|
102
107
|
protected _wasm: WasmBitGoPsbt;
|
|
103
108
|
protected constructor(_wasm: WasmBitGoPsbt);
|
|
@@ -136,6 +141,19 @@ export declare class BitGoPsbt implements IPsbtWithAddress {
|
|
|
136
141
|
* @returns A BitGoPsbt instance
|
|
137
142
|
*/
|
|
138
143
|
static fromBytes(bytes: Uint8Array, network: NetworkName): BitGoPsbt;
|
|
144
|
+
/**
|
|
145
|
+
* Convert a half-signed legacy transaction to a psbt-lite.
|
|
146
|
+
*
|
|
147
|
+
* Extracts partial signatures from scriptSig/witness and creates a PSBT
|
|
148
|
+
* with proper wallet metadata (bip32Derivation, scripts, witnessUtxo).
|
|
149
|
+
* Only supports p2sh, p2shP2wsh, and p2wsh inputs (not taproot).
|
|
150
|
+
*
|
|
151
|
+
* @param txBytes - The serialized half-signed legacy transaction
|
|
152
|
+
* @param network - Network name
|
|
153
|
+
* @param walletKeys - The wallet's root keys
|
|
154
|
+
* @param unspents - Chain, index, and value for each input
|
|
155
|
+
*/
|
|
156
|
+
static fromHalfSignedLegacyTransaction(txBytes: Uint8Array, network: NetworkName, walletKeys: WalletKeysArg, unspents: HydrationUnspent[]): BitGoPsbt;
|
|
139
157
|
/**
|
|
140
158
|
* Add an input to the PSBT
|
|
141
159
|
*
|
|
@@ -57,6 +57,23 @@ class BitGoPsbt {
|
|
|
57
57
|
const wasm = wasm_utxo_js_1.BitGoPsbt.from_bytes(bytes, network);
|
|
58
58
|
return new BitGoPsbt(wasm);
|
|
59
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Convert a half-signed legacy transaction to a psbt-lite.
|
|
62
|
+
*
|
|
63
|
+
* Extracts partial signatures from scriptSig/witness and creates a PSBT
|
|
64
|
+
* with proper wallet metadata (bip32Derivation, scripts, witnessUtxo).
|
|
65
|
+
* Only supports p2sh, p2shP2wsh, and p2wsh inputs (not taproot).
|
|
66
|
+
*
|
|
67
|
+
* @param txBytes - The serialized half-signed legacy transaction
|
|
68
|
+
* @param network - Network name
|
|
69
|
+
* @param walletKeys - The wallet's root keys
|
|
70
|
+
* @param unspents - Chain, index, and value for each input
|
|
71
|
+
*/
|
|
72
|
+
static fromHalfSignedLegacyTransaction(txBytes, network, walletKeys, unspents) {
|
|
73
|
+
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);
|
|
75
|
+
return new BitGoPsbt(wasm);
|
|
76
|
+
}
|
|
60
77
|
addInputAtIndex(index, txidOrOptions, voutOrScript, value, script, sequence) {
|
|
61
78
|
if (typeof txidOrOptions === "string") {
|
|
62
79
|
return this._wasm.add_input_at_index(index, txidOrOptions, voutOrScript, value, script, sequence);
|
|
@@ -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, 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";
|
|
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, type HydrationUnspent, } 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";
|
package/dist/cjs/js/index.d.ts
CHANGED
|
@@ -61,9 +61,30 @@ declare module "./wasm/wasm_utxo.js" {
|
|
|
61
61
|
interface PsbtOutputDataWithAddress extends PsbtOutputData {
|
|
62
62
|
address: string;
|
|
63
63
|
}
|
|
64
|
+
/** Outpoint referencing a previous transaction output */
|
|
65
|
+
interface TxOutPoint {
|
|
66
|
+
txid: string;
|
|
67
|
+
vout: number;
|
|
68
|
+
}
|
|
69
|
+
/** Raw transaction input data returned by Transaction.getInputs() */
|
|
70
|
+
interface TxInputData {
|
|
71
|
+
previousOutput: TxOutPoint;
|
|
72
|
+
sequence: number;
|
|
73
|
+
scriptSig: Uint8Array;
|
|
74
|
+
witness: Uint8Array[];
|
|
75
|
+
}
|
|
76
|
+
/** Raw transaction output data returned by Transaction.getOutputs() */
|
|
77
|
+
interface TxOutputData {
|
|
78
|
+
script: Uint8Array;
|
|
79
|
+
value: bigint;
|
|
80
|
+
}
|
|
81
|
+
/** Transaction output data with resolved address */
|
|
82
|
+
interface TxOutputDataWithAddress extends TxOutputData {
|
|
83
|
+
address: string;
|
|
84
|
+
}
|
|
64
85
|
}
|
|
65
86
|
export { WrapDescriptor as Descriptor } from "./wasm/wasm_utxo.js";
|
|
66
87
|
export { WrapMiniscript as Miniscript } from "./wasm/wasm_utxo.js";
|
|
67
88
|
export { Psbt } from "./descriptorWallet/Psbt.js";
|
|
68
|
-
export { DashTransaction, Transaction, ZcashTransaction } from "./transaction.js";
|
|
89
|
+
export { DashTransaction, Transaction, ZcashTransaction, type ITransaction, type ITransactionCommon, } from "./transaction.js";
|
|
69
90
|
export { hasPsbtMagic, type IPsbt, type IPsbtWithAddress } from "./psbt.js";
|
package/dist/cjs/js/psbt.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import type { PsbtInputData, PsbtOutputData, PsbtOutputDataWithAddress } from "./wasm/wasm_utxo.js";
|
|
2
2
|
import type { BIP32 } from "./bip32.js";
|
|
3
|
+
import type { ITransactionCommon } from "./transaction.js";
|
|
3
4
|
/** Common interface for PSBT types */
|
|
4
|
-
export interface IPsbt {
|
|
5
|
-
inputCount(): number;
|
|
6
|
-
outputCount(): number;
|
|
7
|
-
getInputs(): PsbtInputData[];
|
|
8
|
-
getOutputs(): PsbtOutputData[];
|
|
5
|
+
export interface IPsbt extends ITransactionCommon<PsbtInputData, PsbtOutputData> {
|
|
9
6
|
getGlobalXpubs(): BIP32[];
|
|
10
|
-
version(): number;
|
|
11
|
-
lockTime(): number;
|
|
12
7
|
unsignedTxId(): string;
|
|
13
8
|
addInputAtIndex(index: number, txid: string, vout: number, value: bigint, script: Uint8Array, sequence?: number): number;
|
|
14
9
|
addOutputAtIndex(index: number, script: Uint8Array, value: bigint): number;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import { WasmDashTransaction, WasmTransaction, WasmZcashTransaction } from "./wasm/wasm_utxo.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { WasmDashTransaction, WasmTransaction, WasmZcashTransaction, type TxInputData, type TxOutputData, type TxOutputDataWithAddress } from "./wasm/wasm_utxo.js";
|
|
2
|
+
import type { CoinName } from "./coinName.js";
|
|
3
|
+
/** Common read-only interface shared by transactions and PSBTs */
|
|
4
|
+
export interface ITransactionCommon<TInput, TOutput> {
|
|
5
|
+
inputCount(): number;
|
|
6
|
+
outputCount(): number;
|
|
7
|
+
version(): number;
|
|
8
|
+
lockTime(): number;
|
|
9
|
+
getInputs(): TInput[];
|
|
10
|
+
getOutputs(): TOutput[];
|
|
11
|
+
}
|
|
12
|
+
/** Common interface for all transaction types */
|
|
13
|
+
export interface ITransaction extends ITransactionCommon<TxInputData, TxOutputData> {
|
|
6
14
|
toBytes(): Uint8Array;
|
|
7
15
|
getId(): string;
|
|
16
|
+
getOutputsWithAddress(coin: CoinName): TxOutputDataWithAddress[];
|
|
8
17
|
}
|
|
9
18
|
/**
|
|
10
19
|
* Transaction wrapper (Bitcoin-like networks)
|
|
@@ -19,9 +28,7 @@ export declare class Transaction implements ITransaction {
|
|
|
19
28
|
*/
|
|
20
29
|
static create(): Transaction;
|
|
21
30
|
static fromBytes(bytes: Uint8Array): Transaction;
|
|
22
|
-
/**
|
|
23
|
-
* @internal Create from WASM instance directly (avoids re-parsing bytes)
|
|
24
|
-
*/
|
|
31
|
+
/** @internal Create from WASM instance directly (avoids re-parsing bytes) */
|
|
25
32
|
static fromWasm(wasm: WasmTransaction): Transaction;
|
|
26
33
|
/**
|
|
27
34
|
* Add an input to the transaction
|
|
@@ -52,9 +59,14 @@ export declare class Transaction implements ITransaction {
|
|
|
52
59
|
* @returns The virtual size in virtual bytes (vbytes)
|
|
53
60
|
*/
|
|
54
61
|
getVSize(): number;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
inputCount(): number;
|
|
63
|
+
outputCount(): number;
|
|
64
|
+
version(): number;
|
|
65
|
+
lockTime(): number;
|
|
66
|
+
getInputs(): TxInputData[];
|
|
67
|
+
getOutputs(): TxOutputData[];
|
|
68
|
+
getOutputsWithAddress(coin: CoinName): TxOutputDataWithAddress[];
|
|
69
|
+
/** @internal */
|
|
58
70
|
get wasm(): WasmTransaction;
|
|
59
71
|
}
|
|
60
72
|
/**
|
|
@@ -66,9 +78,7 @@ export declare class ZcashTransaction implements ITransaction {
|
|
|
66
78
|
private _wasm;
|
|
67
79
|
private constructor();
|
|
68
80
|
static fromBytes(bytes: Uint8Array): ZcashTransaction;
|
|
69
|
-
/**
|
|
70
|
-
* @internal Create from WASM instance directly (avoids re-parsing bytes)
|
|
71
|
-
*/
|
|
81
|
+
/** @internal Create from WASM instance directly (avoids re-parsing bytes) */
|
|
72
82
|
static fromWasm(wasm: WasmZcashTransaction): ZcashTransaction;
|
|
73
83
|
toBytes(): Uint8Array;
|
|
74
84
|
/**
|
|
@@ -80,9 +90,14 @@ export declare class ZcashTransaction implements ITransaction {
|
|
|
80
90
|
* @returns The transaction ID as a hex string
|
|
81
91
|
*/
|
|
82
92
|
getId(): string;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
93
|
+
inputCount(): number;
|
|
94
|
+
outputCount(): number;
|
|
95
|
+
version(): number;
|
|
96
|
+
lockTime(): number;
|
|
97
|
+
getInputs(): TxInputData[];
|
|
98
|
+
getOutputs(): TxOutputData[];
|
|
99
|
+
getOutputsWithAddress(coin: CoinName): TxOutputDataWithAddress[];
|
|
100
|
+
/** @internal */
|
|
86
101
|
get wasm(): WasmZcashTransaction;
|
|
87
102
|
}
|
|
88
103
|
/**
|
|
@@ -94,9 +109,7 @@ export declare class DashTransaction implements ITransaction {
|
|
|
94
109
|
private _wasm;
|
|
95
110
|
private constructor();
|
|
96
111
|
static fromBytes(bytes: Uint8Array): DashTransaction;
|
|
97
|
-
/**
|
|
98
|
-
* @internal Create from WASM instance directly (avoids re-parsing bytes)
|
|
99
|
-
*/
|
|
112
|
+
/** @internal Create from WASM instance directly (avoids re-parsing bytes) */
|
|
100
113
|
static fromWasm(wasm: WasmDashTransaction): DashTransaction;
|
|
101
114
|
toBytes(): Uint8Array;
|
|
102
115
|
/**
|
|
@@ -108,8 +121,13 @@ export declare class DashTransaction implements ITransaction {
|
|
|
108
121
|
* @returns The transaction ID as a hex string
|
|
109
122
|
*/
|
|
110
123
|
getId(): string;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
124
|
+
inputCount(): number;
|
|
125
|
+
outputCount(): number;
|
|
126
|
+
version(): number;
|
|
127
|
+
lockTime(): number;
|
|
128
|
+
getInputs(): TxInputData[];
|
|
129
|
+
getOutputs(): TxOutputData[];
|
|
130
|
+
getOutputsWithAddress(coin: CoinName): TxOutputDataWithAddress[];
|
|
131
|
+
/** @internal */
|
|
114
132
|
get wasm(): WasmDashTransaction;
|
|
115
133
|
}
|
|
@@ -21,9 +21,7 @@ class Transaction {
|
|
|
21
21
|
static fromBytes(bytes) {
|
|
22
22
|
return new Transaction(wasm_utxo_js_1.WasmTransaction.from_bytes(bytes));
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
25
|
-
* @internal Create from WASM instance directly (avoids re-parsing bytes)
|
|
26
|
-
*/
|
|
24
|
+
/** @internal Create from WASM instance directly (avoids re-parsing bytes) */
|
|
27
25
|
static fromWasm(wasm) {
|
|
28
26
|
return new Transaction(wasm);
|
|
29
27
|
}
|
|
@@ -70,9 +68,28 @@ class Transaction {
|
|
|
70
68
|
getVSize() {
|
|
71
69
|
return this._wasm.get_vsize();
|
|
72
70
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
inputCount() {
|
|
72
|
+
return this._wasm.input_count();
|
|
73
|
+
}
|
|
74
|
+
outputCount() {
|
|
75
|
+
return this._wasm.output_count();
|
|
76
|
+
}
|
|
77
|
+
version() {
|
|
78
|
+
return this._wasm.version();
|
|
79
|
+
}
|
|
80
|
+
lockTime() {
|
|
81
|
+
return this._wasm.lock_time();
|
|
82
|
+
}
|
|
83
|
+
getInputs() {
|
|
84
|
+
return this._wasm.get_inputs();
|
|
85
|
+
}
|
|
86
|
+
getOutputs() {
|
|
87
|
+
return this._wasm.get_outputs();
|
|
88
|
+
}
|
|
89
|
+
getOutputsWithAddress(coin) {
|
|
90
|
+
return this._wasm.get_outputs_with_address(coin);
|
|
91
|
+
}
|
|
92
|
+
/** @internal */
|
|
76
93
|
get wasm() {
|
|
77
94
|
return this._wasm;
|
|
78
95
|
}
|
|
@@ -91,9 +108,7 @@ class ZcashTransaction {
|
|
|
91
108
|
static fromBytes(bytes) {
|
|
92
109
|
return new ZcashTransaction(wasm_utxo_js_1.WasmZcashTransaction.from_bytes(bytes));
|
|
93
110
|
}
|
|
94
|
-
/**
|
|
95
|
-
* @internal Create from WASM instance directly (avoids re-parsing bytes)
|
|
96
|
-
*/
|
|
111
|
+
/** @internal Create from WASM instance directly (avoids re-parsing bytes) */
|
|
97
112
|
static fromWasm(wasm) {
|
|
98
113
|
return new ZcashTransaction(wasm);
|
|
99
114
|
}
|
|
@@ -111,9 +126,28 @@ class ZcashTransaction {
|
|
|
111
126
|
getId() {
|
|
112
127
|
return this._wasm.get_txid();
|
|
113
128
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
129
|
+
inputCount() {
|
|
130
|
+
return this._wasm.input_count();
|
|
131
|
+
}
|
|
132
|
+
outputCount() {
|
|
133
|
+
return this._wasm.output_count();
|
|
134
|
+
}
|
|
135
|
+
version() {
|
|
136
|
+
return this._wasm.version();
|
|
137
|
+
}
|
|
138
|
+
lockTime() {
|
|
139
|
+
return this._wasm.lock_time();
|
|
140
|
+
}
|
|
141
|
+
getInputs() {
|
|
142
|
+
return this._wasm.get_inputs();
|
|
143
|
+
}
|
|
144
|
+
getOutputs() {
|
|
145
|
+
return this._wasm.get_outputs();
|
|
146
|
+
}
|
|
147
|
+
getOutputsWithAddress(coin) {
|
|
148
|
+
return this._wasm.get_outputs_with_address(coin);
|
|
149
|
+
}
|
|
150
|
+
/** @internal */
|
|
117
151
|
get wasm() {
|
|
118
152
|
return this._wasm;
|
|
119
153
|
}
|
|
@@ -132,9 +166,7 @@ class DashTransaction {
|
|
|
132
166
|
static fromBytes(bytes) {
|
|
133
167
|
return new DashTransaction(wasm_utxo_js_1.WasmDashTransaction.from_bytes(bytes));
|
|
134
168
|
}
|
|
135
|
-
/**
|
|
136
|
-
* @internal Create from WASM instance directly (avoids re-parsing bytes)
|
|
137
|
-
*/
|
|
169
|
+
/** @internal Create from WASM instance directly (avoids re-parsing bytes) */
|
|
138
170
|
static fromWasm(wasm) {
|
|
139
171
|
return new DashTransaction(wasm);
|
|
140
172
|
}
|
|
@@ -152,9 +184,28 @@ class DashTransaction {
|
|
|
152
184
|
getId() {
|
|
153
185
|
return this._wasm.get_txid();
|
|
154
186
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
187
|
+
inputCount() {
|
|
188
|
+
return this._wasm.input_count();
|
|
189
|
+
}
|
|
190
|
+
outputCount() {
|
|
191
|
+
return this._wasm.output_count();
|
|
192
|
+
}
|
|
193
|
+
version() {
|
|
194
|
+
return this._wasm.version();
|
|
195
|
+
}
|
|
196
|
+
lockTime() {
|
|
197
|
+
return this._wasm.lock_time();
|
|
198
|
+
}
|
|
199
|
+
getInputs() {
|
|
200
|
+
return this._wasm.get_inputs();
|
|
201
|
+
}
|
|
202
|
+
getOutputs() {
|
|
203
|
+
return this._wasm.get_outputs();
|
|
204
|
+
}
|
|
205
|
+
getOutputsWithAddress(coin) {
|
|
206
|
+
return this._wasm.get_outputs_with_address(coin);
|
|
207
|
+
}
|
|
208
|
+
/** @internal */
|
|
158
209
|
get wasm() {
|
|
159
210
|
return this._wasm;
|
|
160
211
|
}
|
|
@@ -294,6 +294,16 @@ export class BitGoPsbt {
|
|
|
294
294
|
* Deserialize a PSBT from bytes with network-specific logic
|
|
295
295
|
*/
|
|
296
296
|
static from_bytes(bytes: Uint8Array, network: string): BitGoPsbt;
|
|
297
|
+
/**
|
|
298
|
+
* Convert a half-signed legacy transaction to a psbt-lite.
|
|
299
|
+
*
|
|
300
|
+
* # Arguments
|
|
301
|
+
* * `tx_bytes` - The serialized half-signed legacy transaction
|
|
302
|
+
* * `network` - Network name (utxolib or coin name)
|
|
303
|
+
* * `wallet_keys` - The wallet's root keys
|
|
304
|
+
* * `unspents` - Array of `{ chain: number, index: number, value: bigint }` for each input
|
|
305
|
+
*/
|
|
306
|
+
static from_half_signed_legacy_transaction(tx_bytes: Uint8Array, network: string, wallet_keys: WasmRootWalletKeys, unspents: any): BitGoPsbt;
|
|
297
307
|
/**
|
|
298
308
|
* Generate and store MuSig2 nonces for all MuSig2 inputs
|
|
299
309
|
*
|
|
@@ -904,6 +914,9 @@ export class WasmDashTransaction {
|
|
|
904
914
|
* Deserialize a Dash transaction from bytes (supports EVO special tx extra payload).
|
|
905
915
|
*/
|
|
906
916
|
static from_bytes(bytes: Uint8Array): WasmDashTransaction;
|
|
917
|
+
get_inputs(): any;
|
|
918
|
+
get_outputs(): any;
|
|
919
|
+
get_outputs_with_address(coin: string): any;
|
|
907
920
|
/**
|
|
908
921
|
* Get the transaction ID (txid)
|
|
909
922
|
*
|
|
@@ -917,10 +930,14 @@ export class WasmDashTransaction {
|
|
|
917
930
|
* Returns an error if the transaction cannot be serialized
|
|
918
931
|
*/
|
|
919
932
|
get_txid(): string;
|
|
933
|
+
input_count(): number;
|
|
934
|
+
lock_time(): number;
|
|
935
|
+
output_count(): number;
|
|
920
936
|
/**
|
|
921
937
|
* Serialize the Dash transaction to bytes (preserving tx_type and extra payload).
|
|
922
938
|
*/
|
|
923
939
|
to_bytes(): Uint8Array;
|
|
940
|
+
version(): number;
|
|
924
941
|
}
|
|
925
942
|
|
|
926
943
|
/**
|
|
@@ -1180,6 +1197,9 @@ export class WasmTransaction {
|
|
|
1180
1197
|
* Returns an error if the bytes cannot be parsed as a valid transaction
|
|
1181
1198
|
*/
|
|
1182
1199
|
static from_bytes(bytes: Uint8Array): WasmTransaction;
|
|
1200
|
+
get_inputs(): any;
|
|
1201
|
+
get_outputs(): any;
|
|
1202
|
+
get_outputs_with_address(coin: string): any;
|
|
1183
1203
|
/**
|
|
1184
1204
|
* Get the transaction ID (txid)
|
|
1185
1205
|
*
|
|
@@ -1201,6 +1221,9 @@ export class WasmTransaction {
|
|
|
1201
1221
|
* The virtual size in virtual bytes (vbytes)
|
|
1202
1222
|
*/
|
|
1203
1223
|
get_vsize(): number;
|
|
1224
|
+
input_count(): number;
|
|
1225
|
+
lock_time(): number;
|
|
1226
|
+
output_count(): number;
|
|
1204
1227
|
/**
|
|
1205
1228
|
* Serialize the transaction to bytes
|
|
1206
1229
|
*
|
|
@@ -1208,6 +1231,7 @@ export class WasmTransaction {
|
|
|
1208
1231
|
* The serialized transaction bytes
|
|
1209
1232
|
*/
|
|
1210
1233
|
to_bytes(): Uint8Array;
|
|
1234
|
+
version(): number;
|
|
1211
1235
|
}
|
|
1212
1236
|
|
|
1213
1237
|
/**
|
|
@@ -1233,6 +1257,9 @@ export class WasmZcashTransaction {
|
|
|
1233
1257
|
* Returns an error if the bytes cannot be parsed as a valid Zcash transaction
|
|
1234
1258
|
*/
|
|
1235
1259
|
static from_bytes(bytes: Uint8Array): WasmZcashTransaction;
|
|
1260
|
+
get_inputs(): any;
|
|
1261
|
+
get_outputs(): any;
|
|
1262
|
+
get_outputs_with_address(coin: string): any;
|
|
1236
1263
|
/**
|
|
1237
1264
|
* Get the transaction ID (txid)
|
|
1238
1265
|
*
|
|
@@ -1246,6 +1273,9 @@ export class WasmZcashTransaction {
|
|
|
1246
1273
|
* Returns an error if the transaction cannot be serialized
|
|
1247
1274
|
*/
|
|
1248
1275
|
get_txid(): string;
|
|
1276
|
+
input_count(): number;
|
|
1277
|
+
lock_time(): number;
|
|
1278
|
+
output_count(): number;
|
|
1249
1279
|
/**
|
|
1250
1280
|
* Serialize the transaction to bytes
|
|
1251
1281
|
*
|
|
@@ -1253,6 +1283,7 @@ export class WasmZcashTransaction {
|
|
|
1253
1283
|
* The serialized transaction bytes
|
|
1254
1284
|
*/
|
|
1255
1285
|
to_bytes(): Uint8Array;
|
|
1286
|
+
version(): number;
|
|
1256
1287
|
}
|
|
1257
1288
|
|
|
1258
1289
|
export class WrapDescriptor {
|