@bitgo/wasm-utxo 4.0.2 → 4.1.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/descriptorWallet/Psbt.d.ts +7 -0
- package/dist/cjs/js/descriptorWallet/Psbt.js +18 -0
- package/dist/cjs/js/fixedScriptWallet/BitGoKeySubtype.d.ts +37 -0
- package/dist/cjs/js/fixedScriptWallet/BitGoKeySubtype.js +5 -0
- package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.d.ts +13 -0
- package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.js +24 -0
- package/dist/cjs/js/fixedScriptWallet/index.d.ts +1 -1
- package/dist/cjs/js/fixedScriptWallet/index.js +3 -1
- package/dist/cjs/js/index.d.ts +5 -0
- package/dist/cjs/js/index.js +8 -3
- package/dist/cjs/js/psbt.d.ts +7 -0
- package/dist/cjs/js/wasm/wasm_utxo.d.ts +51 -0
- package/dist/cjs/js/wasm/wasm_utxo.js +340 -10
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +156 -141
- package/dist/esm/js/descriptorWallet/Psbt.d.ts +7 -0
- package/dist/esm/js/descriptorWallet/Psbt.js +18 -0
- package/dist/esm/js/fixedScriptWallet/BitGoKeySubtype.d.ts +37 -0
- package/dist/esm/js/fixedScriptWallet/BitGoKeySubtype.js +2 -0
- package/dist/esm/js/fixedScriptWallet/BitGoPsbt.d.ts +13 -0
- package/dist/esm/js/fixedScriptWallet/BitGoPsbt.js +24 -0
- package/dist/esm/js/fixedScriptWallet/index.d.ts +1 -1
- package/dist/esm/js/fixedScriptWallet/index.js +1 -0
- package/dist/esm/js/index.d.ts +5 -0
- package/dist/esm/js/index.js +4 -0
- package/dist/esm/js/psbt.d.ts +7 -0
- package/dist/esm/js/wasm/wasm_utxo.d.ts +51 -0
- package/dist/esm/js/wasm/wasm_utxo.js +1 -1
- package/dist/esm/js/wasm/wasm_utxo_bg.js +339 -10
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +156 -141
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WrapPsbt as WasmPsbt, type WasmBIP32, type WasmECPair, type WrapDescriptor, type PsbtInputData, type PsbtOutputData, type PsbtOutputDataWithAddress } from "../wasm/wasm_utxo.js";
|
|
2
2
|
import type { IPsbt } from "../psbt.js";
|
|
3
|
+
import type { PsbtKvKey } from "../fixedScriptWallet/BitGoKeySubtype.js";
|
|
3
4
|
import type { CoinName } from "../coinName.js";
|
|
4
5
|
import type { BIP32 } from "../bip32.js";
|
|
5
6
|
import { Transaction } from "../transaction.js";
|
|
@@ -30,6 +31,12 @@ export declare class Psbt implements IPsbt {
|
|
|
30
31
|
addOutput(script: Uint8Array, value: bigint): number;
|
|
31
32
|
removeInput(index: number): void;
|
|
32
33
|
removeOutput(index: number): void;
|
|
34
|
+
setKV(key: PsbtKvKey, value: Uint8Array): void;
|
|
35
|
+
getKV(key: PsbtKvKey): Uint8Array | undefined;
|
|
36
|
+
setInputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
|
|
37
|
+
getInputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
|
|
38
|
+
setOutputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
|
|
39
|
+
getOutputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
|
|
33
40
|
updateInputWithDescriptor(inputIndex: number, descriptor: WrapDescriptor): void;
|
|
34
41
|
updateOutputWithDescriptor(outputIndex: number, descriptor: WrapDescriptor): void;
|
|
35
42
|
signWithXprv(xprv: string): SignPsbtResult;
|
|
@@ -78,6 +78,24 @@ class Psbt {
|
|
|
78
78
|
removeOutput(index) {
|
|
79
79
|
this._wasm.remove_output(index);
|
|
80
80
|
}
|
|
81
|
+
setKV(key, value) {
|
|
82
|
+
this._wasm.set_kv(key, value);
|
|
83
|
+
}
|
|
84
|
+
getKV(key) {
|
|
85
|
+
return this._wasm.get_kv(key) ?? undefined;
|
|
86
|
+
}
|
|
87
|
+
setInputKV(index, key, value) {
|
|
88
|
+
this._wasm.set_input_kv(index, key, value);
|
|
89
|
+
}
|
|
90
|
+
getInputKV(index, key) {
|
|
91
|
+
return this._wasm.get_input_kv(index, key) ?? undefined;
|
|
92
|
+
}
|
|
93
|
+
setOutputKV(index, key, value) {
|
|
94
|
+
this._wasm.set_output_kv(index, key, value);
|
|
95
|
+
}
|
|
96
|
+
getOutputKV(index, key) {
|
|
97
|
+
return this._wasm.get_output_kv(index, key) ?? undefined;
|
|
98
|
+
}
|
|
81
99
|
// -- Descriptor updates --
|
|
82
100
|
updateInputWithDescriptor(inputIndex, descriptor) {
|
|
83
101
|
this._wasm.update_input_with_descriptor(inputIndex, descriptor);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subtype constants for BitGo proprietary PSBT key-values.
|
|
3
|
+
* Values are loaded from the Rust enum at module init time — no duplication.
|
|
4
|
+
* The type shape is declared here for IDE support.
|
|
5
|
+
*/
|
|
6
|
+
export type BitGoKeySubtypeMap = {
|
|
7
|
+
readonly ZecConsensusBranchId: number;
|
|
8
|
+
readonly Musig2ParticipantPubKeys: number;
|
|
9
|
+
readonly Musig2PubNonce: number;
|
|
10
|
+
readonly Musig2PartialSig: number;
|
|
11
|
+
readonly PayGoAddressAttestationProof: number;
|
|
12
|
+
readonly Bip322Message: number;
|
|
13
|
+
readonly WasmUtxoSignedWith: number;
|
|
14
|
+
};
|
|
15
|
+
export declare const BitGoKeySubtype: BitGoKeySubtypeMap;
|
|
16
|
+
export type BitGoKeySubtype = BitGoKeySubtypeMap[keyof BitGoKeySubtypeMap];
|
|
17
|
+
/**
|
|
18
|
+
* A composable PSBT key for use with `setKV` / `getKV` / `setInputKV` / `getInputKV` etc.
|
|
19
|
+
*
|
|
20
|
+
* - `"unknown"`: stored in the PSBT `unknown` map (raw BIP-174 key-value pair)
|
|
21
|
+
* - `"proprietary"`: stored in the PSBT `proprietary` map with an arbitrary prefix
|
|
22
|
+
* - `"bitgo"`: stored in the PSBT `proprietary` map with the `BITGO` prefix
|
|
23
|
+
*/
|
|
24
|
+
export type PsbtKvKey = {
|
|
25
|
+
type: "unknown";
|
|
26
|
+
keyType: number;
|
|
27
|
+
data?: Uint8Array;
|
|
28
|
+
} | {
|
|
29
|
+
type: "proprietary";
|
|
30
|
+
prefix: Uint8Array;
|
|
31
|
+
subtype: number;
|
|
32
|
+
key?: Uint8Array;
|
|
33
|
+
} | {
|
|
34
|
+
type: "bitgo";
|
|
35
|
+
subtype: number;
|
|
36
|
+
key?: Uint8Array;
|
|
37
|
+
};
|
|
@@ -7,6 +7,7 @@ import { type ECPairArg } from "../ecpair.js";
|
|
|
7
7
|
import type { UtxolibName } from "../utxolibCompat.js";
|
|
8
8
|
import type { CoinName } from "../coinName.js";
|
|
9
9
|
import type { InputScriptType } from "./scriptType.js";
|
|
10
|
+
import type { PsbtKvKey } from "./BitGoKeySubtype.js";
|
|
10
11
|
import { type ITransaction } from "../transaction.js";
|
|
11
12
|
export type { InputScriptType };
|
|
12
13
|
export type NetworkName = UtxolibName | CoinName;
|
|
@@ -301,6 +302,18 @@ export declare class BitGoPsbt implements IPsbtWithAddress {
|
|
|
301
302
|
*/
|
|
302
303
|
version(): number;
|
|
303
304
|
lockTime(): number;
|
|
305
|
+
/** Set an arbitrary KV pair on the PSBT global map. */
|
|
306
|
+
setKV(key: PsbtKvKey, value: Uint8Array): void;
|
|
307
|
+
/** Get a KV value from the PSBT global map. Returns `undefined` if not present. */
|
|
308
|
+
getKV(key: PsbtKvKey): Uint8Array | undefined;
|
|
309
|
+
/** Set an arbitrary KV pair on a specific PSBT input. */
|
|
310
|
+
setInputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
|
|
311
|
+
/** Get a KV value from a specific PSBT input. Returns `undefined` if not present. */
|
|
312
|
+
getInputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
|
|
313
|
+
/** Set an arbitrary KV pair on a specific PSBT output. */
|
|
314
|
+
setOutputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
|
|
315
|
+
/** Get a KV value from a specific PSBT output. Returns `undefined` if not present. */
|
|
316
|
+
getOutputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
|
|
304
317
|
/**
|
|
305
318
|
* Parse transaction with wallet keys to identify wallet inputs/outputs
|
|
306
319
|
* @param walletKeys - The wallet keys to use for identification
|
|
@@ -257,6 +257,30 @@ class BitGoPsbt {
|
|
|
257
257
|
lockTime() {
|
|
258
258
|
return this._wasm.lock_time();
|
|
259
259
|
}
|
|
260
|
+
/** Set an arbitrary KV pair on the PSBT global map. */
|
|
261
|
+
setKV(key, value) {
|
|
262
|
+
this._wasm.set_kv(key, value);
|
|
263
|
+
}
|
|
264
|
+
/** Get a KV value from the PSBT global map. Returns `undefined` if not present. */
|
|
265
|
+
getKV(key) {
|
|
266
|
+
return this._wasm.get_kv(key) ?? undefined;
|
|
267
|
+
}
|
|
268
|
+
/** Set an arbitrary KV pair on a specific PSBT input. */
|
|
269
|
+
setInputKV(index, key, value) {
|
|
270
|
+
this._wasm.set_input_kv(index, key, value);
|
|
271
|
+
}
|
|
272
|
+
/** Get a KV value from a specific PSBT input. Returns `undefined` if not present. */
|
|
273
|
+
getInputKV(index, key) {
|
|
274
|
+
return this._wasm.get_input_kv(index, key) ?? undefined;
|
|
275
|
+
}
|
|
276
|
+
/** Set an arbitrary KV pair on a specific PSBT output. */
|
|
277
|
+
setOutputKV(index, key, value) {
|
|
278
|
+
this._wasm.set_output_kv(index, key, value);
|
|
279
|
+
}
|
|
280
|
+
/** Get a KV value from a specific PSBT output. Returns `undefined` if not present. */
|
|
281
|
+
getOutputKV(index, key) {
|
|
282
|
+
return this._wasm.get_output_kv(index, key) ?? undefined;
|
|
283
|
+
}
|
|
260
284
|
/**
|
|
261
285
|
* Parse transaction with wallet keys to identify wallet inputs/outputs
|
|
262
286
|
* @param walletKeys - The wallet keys to use for identification
|
|
@@ -6,8 +6,8 @@ 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
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
|
+
export { BitGoKeySubtype, type PsbtKvKey } from "./BitGoKeySubtype.js";
|
|
9
10
|
export { ZcashBitGoPsbt, type ZcashNetworkName, type CreateEmptyZcashOptions, } from "./ZcashBitGoPsbt.js";
|
|
10
|
-
export type { PsbtBip32Derivation, PsbtInputData, PsbtOutputData, PsbtOutputDataWithAddress, PsbtWitnessUtxo, } from "../wasm/wasm_utxo.js";
|
|
11
11
|
import type { ScriptType } from "./scriptType.js";
|
|
12
12
|
/**
|
|
13
13
|
* Check if a network supports a given fixed-script wallet script type
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZcashBitGoPsbt = exports.getWalletKeysFromPsbt = exports.BitGoPsbt = exports.assertChainCode = exports.chainCodes = exports.ChainCode = exports.inputScriptTypes = exports.outputScriptTypes = exports.Dimensions = exports.address = exports.outputScript = exports.ReplayProtection = exports.RootWalletKeys = void 0;
|
|
3
|
+
exports.ZcashBitGoPsbt = exports.BitGoKeySubtype = exports.getWalletKeysFromPsbt = exports.BitGoPsbt = exports.assertChainCode = exports.chainCodes = exports.ChainCode = exports.inputScriptTypes = exports.outputScriptTypes = exports.Dimensions = exports.address = exports.outputScript = exports.ReplayProtection = exports.RootWalletKeys = void 0;
|
|
4
4
|
exports.supportsScriptType = supportsScriptType;
|
|
5
5
|
exports.createOpReturnScript = createOpReturnScript;
|
|
6
6
|
exports.p2shP2pkOutputScript = p2shP2pkOutputScript;
|
|
@@ -25,6 +25,8 @@ Object.defineProperty(exports, "assertChainCode", { enumerable: true, get: funct
|
|
|
25
25
|
var BitGoPsbt_js_1 = require("./BitGoPsbt.js");
|
|
26
26
|
Object.defineProperty(exports, "BitGoPsbt", { enumerable: true, get: function () { return BitGoPsbt_js_1.BitGoPsbt; } });
|
|
27
27
|
Object.defineProperty(exports, "getWalletKeysFromPsbt", { enumerable: true, get: function () { return BitGoPsbt_js_1.getWalletKeysFromPsbt; } });
|
|
28
|
+
var BitGoKeySubtype_js_1 = require("./BitGoKeySubtype.js");
|
|
29
|
+
Object.defineProperty(exports, "BitGoKeySubtype", { enumerable: true, get: function () { return BitGoKeySubtype_js_1.BitGoKeySubtype; } });
|
|
28
30
|
// Zcash-specific PSBT subclass
|
|
29
31
|
var ZcashBitGoPsbt_js_1 = require("./ZcashBitGoPsbt.js");
|
|
30
32
|
Object.defineProperty(exports, "ZcashBitGoPsbt", { enumerable: true, get: function () { return ZcashBitGoPsbt_js_1.ZcashBitGoPsbt; } });
|
package/dist/cjs/js/index.d.ts
CHANGED
|
@@ -11,6 +11,11 @@ export * as ecpair from "./ecpair.js";
|
|
|
11
11
|
export { ECPair } from "./ecpair.js";
|
|
12
12
|
export { BIP32 } from "./bip32.js";
|
|
13
13
|
export { Dimensions } from "./fixedScriptWallet/Dimensions.js";
|
|
14
|
+
export type WasmUtxoVersionInfo = {
|
|
15
|
+
version: string;
|
|
16
|
+
gitHash: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function getWasmUtxoVersion(): WasmUtxoVersionInfo;
|
|
14
19
|
export { type CoinName, getMainnet, isMainnet, isTestnet, isCoinName } from "./coinName.js";
|
|
15
20
|
export type { Triple } from "./triple.js";
|
|
16
21
|
export type { AddressFormat } from "./address.js";
|
package/dist/cjs/js/index.js
CHANGED
|
@@ -34,7 +34,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.hasPsbtMagic = exports.ZcashTransaction = exports.Transaction = exports.DashTransaction = exports.Psbt = exports.Miniscript = exports.Descriptor = exports.isCoinName = exports.isTestnet = exports.isMainnet = exports.getMainnet = exports.Dimensions = exports.BIP32 = exports.ECPair = exports.ecpair = exports.bip32 = exports.descriptorWallet = exports.fixedScriptWallet = exports.utxolibCompat = exports.message = exports.inscriptions = exports.bip322 = exports.ast = exports.address = void 0;
|
|
37
|
+
exports.getWasmUtxoVersion = getWasmUtxoVersion;
|
|
37
38
|
const wasm = __importStar(require("./wasm/wasm_utxo.js"));
|
|
39
|
+
const wasm_utxo_js_1 = require("./wasm/wasm_utxo.js");
|
|
38
40
|
// we need to access the wasm module here, otherwise webpack gets all weird
|
|
39
41
|
// and forgets to include it in the bundle
|
|
40
42
|
void wasm;
|
|
@@ -57,15 +59,18 @@ var bip32_js_1 = require("./bip32.js");
|
|
|
57
59
|
Object.defineProperty(exports, "BIP32", { enumerable: true, get: function () { return bip32_js_1.BIP32; } });
|
|
58
60
|
var Dimensions_js_1 = require("./fixedScriptWallet/Dimensions.js");
|
|
59
61
|
Object.defineProperty(exports, "Dimensions", { enumerable: true, get: function () { return Dimensions_js_1.Dimensions; } });
|
|
62
|
+
function getWasmUtxoVersion() {
|
|
63
|
+
return wasm_utxo_js_1.WasmUtxoNamespace.get_wasm_utxo_version();
|
|
64
|
+
}
|
|
60
65
|
var coinName_js_1 = require("./coinName.js");
|
|
61
66
|
Object.defineProperty(exports, "getMainnet", { enumerable: true, get: function () { return coinName_js_1.getMainnet; } });
|
|
62
67
|
Object.defineProperty(exports, "isMainnet", { enumerable: true, get: function () { return coinName_js_1.isMainnet; } });
|
|
63
68
|
Object.defineProperty(exports, "isTestnet", { enumerable: true, get: function () { return coinName_js_1.isTestnet; } });
|
|
64
69
|
Object.defineProperty(exports, "isCoinName", { enumerable: true, get: function () { return coinName_js_1.isCoinName; } });
|
|
65
|
-
var wasm_utxo_js_1 = require("./wasm/wasm_utxo.js");
|
|
66
|
-
Object.defineProperty(exports, "Descriptor", { enumerable: true, get: function () { return wasm_utxo_js_1.WrapDescriptor; } });
|
|
67
70
|
var wasm_utxo_js_2 = require("./wasm/wasm_utxo.js");
|
|
68
|
-
Object.defineProperty(exports, "
|
|
71
|
+
Object.defineProperty(exports, "Descriptor", { enumerable: true, get: function () { return wasm_utxo_js_2.WrapDescriptor; } });
|
|
72
|
+
var wasm_utxo_js_3 = require("./wasm/wasm_utxo.js");
|
|
73
|
+
Object.defineProperty(exports, "Miniscript", { enumerable: true, get: function () { return wasm_utxo_js_3.WrapMiniscript; } });
|
|
69
74
|
var Psbt_js_1 = require("./descriptorWallet/Psbt.js");
|
|
70
75
|
Object.defineProperty(exports, "Psbt", { enumerable: true, get: function () { return Psbt_js_1.Psbt; } });
|
|
71
76
|
var transaction_js_1 = require("./transaction.js");
|
package/dist/cjs/js/psbt.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PsbtInputData, PsbtOutputData, PsbtOutputDataWithAddress } from "./wasm/wasm_utxo.js";
|
|
2
2
|
import type { BIP32 } from "./bip32.js";
|
|
3
3
|
import type { ITransactionCommon } from "./transaction.js";
|
|
4
|
+
import type { PsbtKvKey } from "./fixedScriptWallet/BitGoKeySubtype.js";
|
|
4
5
|
/** Common interface for PSBT types */
|
|
5
6
|
export interface IPsbt extends ITransactionCommon<PsbtInputData, PsbtOutputData> {
|
|
6
7
|
getGlobalXpubs(): BIP32[];
|
|
@@ -9,6 +10,12 @@ export interface IPsbt extends ITransactionCommon<PsbtInputData, PsbtOutputData>
|
|
|
9
10
|
addOutputAtIndex(index: number, script: Uint8Array, value: bigint): number;
|
|
10
11
|
removeInput(index: number): void;
|
|
11
12
|
removeOutput(index: number): void;
|
|
13
|
+
setKV(key: PsbtKvKey, value: Uint8Array): void;
|
|
14
|
+
getKV(key: PsbtKvKey): Uint8Array | undefined;
|
|
15
|
+
setInputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
|
|
16
|
+
getInputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
|
|
17
|
+
setOutputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
|
|
18
|
+
getOutputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
|
|
12
19
|
}
|
|
13
20
|
/** Extended PSBT with address resolution (no coin parameter needed) */
|
|
14
21
|
export interface IPsbtWithAddress extends IPsbt {
|
|
@@ -334,7 +334,15 @@ export class BitGoPsbt {
|
|
|
334
334
|
*/
|
|
335
335
|
generate_musig2_nonces(xpriv: WasmBIP32, session_id_bytes?: Uint8Array | null): void;
|
|
336
336
|
get_global_xpubs(): any;
|
|
337
|
+
/**
|
|
338
|
+
* Get a KV value from a specific PSBT input. Returns `undefined` if not present.
|
|
339
|
+
*/
|
|
340
|
+
get_input_kv(index: number, key: any): Uint8Array | undefined;
|
|
337
341
|
get_inputs(): any;
|
|
342
|
+
/**
|
|
343
|
+
* Get a KV value from the PSBT global map. Returns `undefined` if not present.
|
|
344
|
+
*/
|
|
345
|
+
get_kv(key: any): Uint8Array | undefined;
|
|
338
346
|
/**
|
|
339
347
|
* Get the network type for transaction extraction
|
|
340
348
|
*
|
|
@@ -342,6 +350,10 @@ export class BitGoPsbt {
|
|
|
342
350
|
* wrapper class should be used in TypeScript.
|
|
343
351
|
*/
|
|
344
352
|
get_network_type(): string;
|
|
353
|
+
/**
|
|
354
|
+
* Get a KV value from a specific PSBT output. Returns `undefined` if not present.
|
|
355
|
+
*/
|
|
356
|
+
get_output_kv(index: number, key: any): Uint8Array | undefined;
|
|
345
357
|
get_outputs(): any;
|
|
346
358
|
get_outputs_with_address(): any;
|
|
347
359
|
input_count(): number;
|
|
@@ -384,6 +396,21 @@ export class BitGoPsbt {
|
|
|
384
396
|
* The serialized PSBT as a byte array
|
|
385
397
|
*/
|
|
386
398
|
serialize(): Uint8Array;
|
|
399
|
+
/**
|
|
400
|
+
* Set an arbitrary KV pair on a specific PSBT input.
|
|
401
|
+
*/
|
|
402
|
+
set_input_kv(index: number, key: any, value: Uint8Array): void;
|
|
403
|
+
/**
|
|
404
|
+
* Set an arbitrary KV pair on the PSBT global map.
|
|
405
|
+
* `key` must be `{ type: "unknown", keyType: number, data?: Uint8Array }` or
|
|
406
|
+
* `{ type: "proprietary", prefix: Uint8Array, subtype: number, key?: Uint8Array }` or
|
|
407
|
+
* `{ type: "bitgo", subtype: number, key?: Uint8Array }`.
|
|
408
|
+
*/
|
|
409
|
+
set_kv(key: any, value: Uint8Array): void;
|
|
410
|
+
/**
|
|
411
|
+
* Set an arbitrary KV pair on a specific PSBT output.
|
|
412
|
+
*/
|
|
413
|
+
set_output_kv(index: number, key: any, value: Uint8Array): void;
|
|
387
414
|
/**
|
|
388
415
|
* Sign all MuSig2 keypath inputs in a single pass with optimized sighash computation.
|
|
389
416
|
*
|
|
@@ -676,6 +703,11 @@ export class FixedScriptWalletNamespace {
|
|
|
676
703
|
* The OP_RETURN script as bytes
|
|
677
704
|
*/
|
|
678
705
|
static create_op_return_script(data?: Uint8Array | null): Uint8Array;
|
|
706
|
+
/**
|
|
707
|
+
* Returns an object mapping BitGo proprietary key subtype names to their `u8` values.
|
|
708
|
+
* Values are loaded directly from the Rust enum at build time — no duplication in TypeScript.
|
|
709
|
+
*/
|
|
710
|
+
static get_bitgo_key_subtypes(): any;
|
|
679
711
|
static output_script(keys: WasmRootWalletKeys, chain: number, index: number, network: any): Uint8Array;
|
|
680
712
|
static output_script_with_network_str(keys: WasmRootWalletKeys, chain: number, index: number, network: string): Uint8Array;
|
|
681
713
|
/**
|
|
@@ -1234,6 +1266,19 @@ export class WasmTransaction {
|
|
|
1234
1266
|
version(): number;
|
|
1235
1267
|
}
|
|
1236
1268
|
|
|
1269
|
+
/**
|
|
1270
|
+
* Top-level package info namespace
|
|
1271
|
+
*/
|
|
1272
|
+
export class WasmUtxoNamespace {
|
|
1273
|
+
private constructor();
|
|
1274
|
+
free(): void;
|
|
1275
|
+
[Symbol.dispose](): void;
|
|
1276
|
+
/**
|
|
1277
|
+
* Returns the wasm-utxo build version as `{ version: string, gitHash: string }`.
|
|
1278
|
+
*/
|
|
1279
|
+
static get_wasm_utxo_version(): any;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1237
1282
|
/**
|
|
1238
1283
|
* A Zcash transaction with network-specific fields
|
|
1239
1284
|
*
|
|
@@ -1356,7 +1401,10 @@ export class WrapPsbt {
|
|
|
1356
1401
|
extract_transaction(): WasmTransaction;
|
|
1357
1402
|
finalize_mut(): void;
|
|
1358
1403
|
get_global_xpubs(): any;
|
|
1404
|
+
get_input_kv(index: number, key: any): Uint8Array | undefined;
|
|
1359
1405
|
get_inputs(): any;
|
|
1406
|
+
get_kv(key: any): Uint8Array | undefined;
|
|
1407
|
+
get_output_kv(index: number, key: any): Uint8Array | undefined;
|
|
1360
1408
|
get_outputs(): any;
|
|
1361
1409
|
get_outputs_with_address(coin: string): any;
|
|
1362
1410
|
get_partial_signatures(input_index: number): any;
|
|
@@ -1382,6 +1430,9 @@ export class WrapPsbt {
|
|
|
1382
1430
|
remove_input(index: number): void;
|
|
1383
1431
|
remove_output(index: number): void;
|
|
1384
1432
|
serialize(): Uint8Array;
|
|
1433
|
+
set_input_kv(index: number, key: any, value: Uint8Array): void;
|
|
1434
|
+
set_kv(key: any, value: Uint8Array): void;
|
|
1435
|
+
set_output_kv(index: number, key: any, value: Uint8Array): void;
|
|
1385
1436
|
/**
|
|
1386
1437
|
* Sign all inputs with a WasmBIP32 key
|
|
1387
1438
|
*
|