@bitgo/wasm-utxo 3.0.0 → 4.0.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.
- package/dist/cjs/js/bip322/index.d.ts +5 -0
- package/dist/cjs/js/bip322/index.js +8 -0
- 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 +36 -0
- package/dist/cjs/js/wasm/wasm_utxo.js +330 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +122 -99
- package/dist/esm/js/bip322/index.d.ts +5 -0
- package/dist/esm/js/bip322/index.js +7 -0
- 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 +36 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.js +330 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +122 -99
- package/package.json +1 -1
|
@@ -106,6 +106,11 @@ export type VerifyBip322TxInputParams = VerifyBip322InputParams & {
|
|
|
106
106
|
* ```
|
|
107
107
|
*/
|
|
108
108
|
export declare function addBip322Input(psbt: BitGoPsbt, params: AddBip322InputParams): number;
|
|
109
|
+
/**
|
|
110
|
+
* Get the BIP322 message stored at a PSBT input index.
|
|
111
|
+
* Returns null if no message is stored.
|
|
112
|
+
*/
|
|
113
|
+
export declare function getBip322Message(psbt: BitGoPsbt, inputIndex: number): string | null;
|
|
109
114
|
/**
|
|
110
115
|
* Verify a single input of a BIP-0322 transaction proof
|
|
111
116
|
*
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
*/
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.addBip322Input = addBip322Input;
|
|
39
|
+
exports.getBip322Message = getBip322Message;
|
|
39
40
|
exports.verifyBip322TxInput = verifyBip322TxInput;
|
|
40
41
|
exports.verifyBip322PsbtInput = verifyBip322PsbtInput;
|
|
41
42
|
exports.verifyBip322PsbtInputWithPubkeys = verifyBip322PsbtInputWithPubkeys;
|
|
@@ -75,6 +76,13 @@ function addBip322Input(psbt, params) {
|
|
|
75
76
|
const keys = RootWalletKeys_js_1.RootWalletKeys.from(params.rootWalletKeys);
|
|
76
77
|
return wasm_utxo_js_1.Bip322Namespace.add_bip322_input(psbt.wasm, params.message, params.scriptId.chain, params.scriptId.index, keys.wasm, params.signPath?.signer, params.signPath?.cosigner, params.tag);
|
|
77
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Get the BIP322 message stored at a PSBT input index.
|
|
81
|
+
* Returns null if no message is stored.
|
|
82
|
+
*/
|
|
83
|
+
function getBip322Message(psbt, inputIndex) {
|
|
84
|
+
return wasm_utxo_js_1.Bip322Namespace.get_bip322_message(psbt.wasm, inputIndex) ?? null;
|
|
85
|
+
}
|
|
78
86
|
/**
|
|
79
87
|
* Verify a single input of a BIP-0322 transaction proof
|
|
80
88
|
*
|
|
@@ -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
|
}
|
|
@@ -36,6 +36,11 @@ export class Bip322Namespace {
|
|
|
36
36
|
* The index of the added input
|
|
37
37
|
*/
|
|
38
38
|
static add_bip322_input(psbt: BitGoPsbt, message: string, chain: number, index: number, wallet_keys: WasmRootWalletKeys, signer?: string | null, cosigner?: string | null, tag?: string | null): number;
|
|
39
|
+
/**
|
|
40
|
+
* Get the BIP322 message stored at a PSBT input index.
|
|
41
|
+
* Returns null if no message is stored.
|
|
42
|
+
*/
|
|
43
|
+
static get_bip322_message(psbt: BitGoPsbt, input_index: number): string | undefined;
|
|
39
44
|
/**
|
|
40
45
|
* Verify a single input of a BIP-0322 PSBT proof
|
|
41
46
|
*
|
|
@@ -289,6 +294,16 @@ export class BitGoPsbt {
|
|
|
289
294
|
* Deserialize a PSBT from bytes with network-specific logic
|
|
290
295
|
*/
|
|
291
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;
|
|
292
307
|
/**
|
|
293
308
|
* Generate and store MuSig2 nonces for all MuSig2 inputs
|
|
294
309
|
*
|
|
@@ -899,6 +914,9 @@ export class WasmDashTransaction {
|
|
|
899
914
|
* Deserialize a Dash transaction from bytes (supports EVO special tx extra payload).
|
|
900
915
|
*/
|
|
901
916
|
static from_bytes(bytes: Uint8Array): WasmDashTransaction;
|
|
917
|
+
get_inputs(): any;
|
|
918
|
+
get_outputs(): any;
|
|
919
|
+
get_outputs_with_address(coin: string): any;
|
|
902
920
|
/**
|
|
903
921
|
* Get the transaction ID (txid)
|
|
904
922
|
*
|
|
@@ -912,10 +930,14 @@ export class WasmDashTransaction {
|
|
|
912
930
|
* Returns an error if the transaction cannot be serialized
|
|
913
931
|
*/
|
|
914
932
|
get_txid(): string;
|
|
933
|
+
input_count(): number;
|
|
934
|
+
lock_time(): number;
|
|
935
|
+
output_count(): number;
|
|
915
936
|
/**
|
|
916
937
|
* Serialize the Dash transaction to bytes (preserving tx_type and extra payload).
|
|
917
938
|
*/
|
|
918
939
|
to_bytes(): Uint8Array;
|
|
940
|
+
version(): number;
|
|
919
941
|
}
|
|
920
942
|
|
|
921
943
|
/**
|
|
@@ -1175,6 +1197,9 @@ export class WasmTransaction {
|
|
|
1175
1197
|
* Returns an error if the bytes cannot be parsed as a valid transaction
|
|
1176
1198
|
*/
|
|
1177
1199
|
static from_bytes(bytes: Uint8Array): WasmTransaction;
|
|
1200
|
+
get_inputs(): any;
|
|
1201
|
+
get_outputs(): any;
|
|
1202
|
+
get_outputs_with_address(coin: string): any;
|
|
1178
1203
|
/**
|
|
1179
1204
|
* Get the transaction ID (txid)
|
|
1180
1205
|
*
|
|
@@ -1196,6 +1221,9 @@ export class WasmTransaction {
|
|
|
1196
1221
|
* The virtual size in virtual bytes (vbytes)
|
|
1197
1222
|
*/
|
|
1198
1223
|
get_vsize(): number;
|
|
1224
|
+
input_count(): number;
|
|
1225
|
+
lock_time(): number;
|
|
1226
|
+
output_count(): number;
|
|
1199
1227
|
/**
|
|
1200
1228
|
* Serialize the transaction to bytes
|
|
1201
1229
|
*
|
|
@@ -1203,6 +1231,7 @@ export class WasmTransaction {
|
|
|
1203
1231
|
* The serialized transaction bytes
|
|
1204
1232
|
*/
|
|
1205
1233
|
to_bytes(): Uint8Array;
|
|
1234
|
+
version(): number;
|
|
1206
1235
|
}
|
|
1207
1236
|
|
|
1208
1237
|
/**
|
|
@@ -1228,6 +1257,9 @@ export class WasmZcashTransaction {
|
|
|
1228
1257
|
* Returns an error if the bytes cannot be parsed as a valid Zcash transaction
|
|
1229
1258
|
*/
|
|
1230
1259
|
static from_bytes(bytes: Uint8Array): WasmZcashTransaction;
|
|
1260
|
+
get_inputs(): any;
|
|
1261
|
+
get_outputs(): any;
|
|
1262
|
+
get_outputs_with_address(coin: string): any;
|
|
1231
1263
|
/**
|
|
1232
1264
|
* Get the transaction ID (txid)
|
|
1233
1265
|
*
|
|
@@ -1241,6 +1273,9 @@ export class WasmZcashTransaction {
|
|
|
1241
1273
|
* Returns an error if the transaction cannot be serialized
|
|
1242
1274
|
*/
|
|
1243
1275
|
get_txid(): string;
|
|
1276
|
+
input_count(): number;
|
|
1277
|
+
lock_time(): number;
|
|
1278
|
+
output_count(): number;
|
|
1244
1279
|
/**
|
|
1245
1280
|
* Serialize the transaction to bytes
|
|
1246
1281
|
*
|
|
@@ -1248,6 +1283,7 @@ export class WasmZcashTransaction {
|
|
|
1248
1283
|
* The serialized transaction bytes
|
|
1249
1284
|
*/
|
|
1250
1285
|
to_bytes(): Uint8Array;
|
|
1286
|
+
version(): number;
|
|
1251
1287
|
}
|
|
1252
1288
|
|
|
1253
1289
|
export class WrapDescriptor {
|