@bitgo/wasm-utxo 1.20.0 → 1.21.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.
@@ -5,12 +5,13 @@ import { type BIP32Arg } from "../bip32.js";
5
5
  import { type ECPairArg } from "../ecpair.js";
6
6
  import type { UtxolibName } from "../utxolibCompat.js";
7
7
  import type { CoinName } from "../coinName.js";
8
+ import type { InputScriptType } from "./scriptType.js";
9
+ export type { InputScriptType };
8
10
  export type NetworkName = UtxolibName | CoinName;
9
11
  export type ScriptId = {
10
12
  chain: number;
11
13
  index: number;
12
14
  };
13
- export type InputScriptType = "p2shP2pk" | "p2sh" | "p2shP2wsh" | "p2wsh" | "p2trLegacy" | "p2trMusig2ScriptPath" | "p2trMusig2KeyPath";
14
15
  export type OutPoint = {
15
16
  txid: string;
16
17
  vout: number;
@@ -1,6 +1,35 @@
1
+ import type { CoinName } from "../coinName.js";
1
2
  export { RootWalletKeys, type WalletKeysArg, type IWalletKeys } from "./RootWalletKeys.js";
2
3
  export { ReplayProtection, type ReplayProtectionArg } from "./ReplayProtection.js";
3
4
  export { outputScript, address } from "./address.js";
4
5
  export { Dimensions } from "./Dimensions.js";
5
- 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";
6
+ export { type OutputScriptType, type InputScriptType, type ScriptType } from "./scriptType.js";
7
+ export { BitGoPsbt, type NetworkName, type ScriptId, type ParsedInput, type ParsedOutput, type ParsedTransaction, type SignPath, type CreateEmptyOptions, type AddInputOptions, type AddOutputOptions, type AddWalletInputOptions, type AddWalletOutputOptions, } from "./BitGoPsbt.js";
6
8
  export { ZcashBitGoPsbt, type ZcashNetworkName, type CreateEmptyZcashOptions, } from "./ZcashBitGoPsbt.js";
9
+ import type { ScriptType } from "./scriptType.js";
10
+ /**
11
+ * Check if a network supports a given fixed-script wallet script type
12
+ *
13
+ * @param coin - Coin name (e.g., "btc", "ltc", "doge")
14
+ * @param scriptType - Output script type or input script type to check
15
+ * @returns `true` if the network supports the script type, `false` otherwise
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * // Bitcoin supports all script types
20
+ * supportsScriptType("btc", "p2tr"); // true
21
+ *
22
+ * // Litecoin supports segwit but not taproot
23
+ * supportsScriptType("ltc", "p2wsh"); // true
24
+ * supportsScriptType("ltc", "p2tr"); // false
25
+ *
26
+ * // Dogecoin only supports legacy scripts
27
+ * supportsScriptType("doge", "p2sh"); // true
28
+ * supportsScriptType("doge", "p2wsh"); // false
29
+ *
30
+ * // Also works with input script types
31
+ * supportsScriptType("btc", "p2trMusig2KeyPath"); // true
32
+ * supportsScriptType("doge", "p2trLegacy"); // false
33
+ * ```
34
+ */
35
+ export declare function supportsScriptType(coin: CoinName, scriptType: ScriptType): boolean;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ZcashBitGoPsbt = exports.BitGoPsbt = exports.Dimensions = exports.address = exports.outputScript = exports.ReplayProtection = exports.RootWalletKeys = void 0;
4
+ exports.supportsScriptType = supportsScriptType;
5
+ const wasm_utxo_js_1 = require("../wasm/wasm_utxo.js");
4
6
  var RootWalletKeys_js_1 = require("./RootWalletKeys.js");
5
7
  Object.defineProperty(exports, "RootWalletKeys", { enumerable: true, get: function () { return RootWalletKeys_js_1.RootWalletKeys; } });
6
8
  var ReplayProtection_js_1 = require("./ReplayProtection.js");
@@ -16,3 +18,31 @@ Object.defineProperty(exports, "BitGoPsbt", { enumerable: true, get: function ()
16
18
  // Zcash-specific PSBT subclass
17
19
  var ZcashBitGoPsbt_js_1 = require("./ZcashBitGoPsbt.js");
18
20
  Object.defineProperty(exports, "ZcashBitGoPsbt", { enumerable: true, get: function () { return ZcashBitGoPsbt_js_1.ZcashBitGoPsbt; } });
21
+ /**
22
+ * Check if a network supports a given fixed-script wallet script type
23
+ *
24
+ * @param coin - Coin name (e.g., "btc", "ltc", "doge")
25
+ * @param scriptType - Output script type or input script type to check
26
+ * @returns `true` if the network supports the script type, `false` otherwise
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * // Bitcoin supports all script types
31
+ * supportsScriptType("btc", "p2tr"); // true
32
+ *
33
+ * // Litecoin supports segwit but not taproot
34
+ * supportsScriptType("ltc", "p2wsh"); // true
35
+ * supportsScriptType("ltc", "p2tr"); // false
36
+ *
37
+ * // Dogecoin only supports legacy scripts
38
+ * supportsScriptType("doge", "p2sh"); // true
39
+ * supportsScriptType("doge", "p2wsh"); // false
40
+ *
41
+ * // Also works with input script types
42
+ * supportsScriptType("btc", "p2trMusig2KeyPath"); // true
43
+ * supportsScriptType("doge", "p2trLegacy"); // false
44
+ * ```
45
+ */
46
+ function supportsScriptType(coin, scriptType) {
47
+ return wasm_utxo_js_1.FixedScriptWalletNamespace.supports_script_type(coin, scriptType);
48
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Fixed-script wallet output script types (2-of-3 multisig)
3
+ *
4
+ * This type represents the abstract script type, independent of chain (external/internal).
5
+ * Use this for checking network support or when you need the script type without derivation info.
6
+ */
7
+ export type OutputScriptType = "p2sh" | "p2shP2wsh" | "p2wsh" | "p2tr" | "p2trLegacy" | "p2trMusig2";
8
+ /**
9
+ * Input script types for fixed-script wallets
10
+ *
11
+ * These are more specific than output types and include single-sig and taproot variants.
12
+ */
13
+ export type InputScriptType = "p2shP2pk" | "p2sh" | "p2shP2wsh" | "p2wsh" | "p2trLegacy" | "p2trMusig2ScriptPath" | "p2trMusig2KeyPath";
14
+ /**
15
+ * Union of all script types that can be checked for network support
16
+ */
17
+ export type ScriptType = OutputScriptType | InputScriptType;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -379,6 +379,22 @@ export class FixedScriptWalletNamespace {
379
379
  free(): void;
380
380
  [Symbol.dispose](): void;
381
381
  static output_script(keys: WasmRootWalletKeys, chain: number, index: number, network: any): Uint8Array;
382
+ /**
383
+ * Check if a network supports a given fixed-script wallet script type
384
+ *
385
+ * # Arguments
386
+ * * `coin` - Coin name (e.g., "btc", "ltc", "doge")
387
+ * * `script_type` - Script type name: "p2sh", "p2shP2wsh", "p2wsh", "p2tr", "p2trMusig2"
388
+ *
389
+ * # Returns
390
+ * `true` if the network supports the script type, `false` otherwise
391
+ *
392
+ * # Examples
393
+ * - Bitcoin supports all script types (p2sh, p2shP2wsh, p2wsh, p2tr, p2trMusig2)
394
+ * - Litecoin supports segwit but not taproot (p2sh, p2shP2wsh, p2wsh)
395
+ * - Dogecoin only supports legacy scripts (p2sh)
396
+ */
397
+ static supports_script_type(coin: string, script_type: string): boolean;
382
398
  static address(keys: WasmRootWalletKeys, chain: number, index: number, network: any, address_format?: string | null): string;
383
399
  }
384
400
 
@@ -1220,6 +1220,43 @@ class FixedScriptWalletNamespace {
1220
1220
  wasm.__wbindgen_add_to_stack_pointer(16);
1221
1221
  }
1222
1222
  }
1223
+ /**
1224
+ * Check if a network supports a given fixed-script wallet script type
1225
+ *
1226
+ * # Arguments
1227
+ * * `coin` - Coin name (e.g., "btc", "ltc", "doge")
1228
+ * * `script_type` - Script type name: "p2sh", "p2shP2wsh", "p2wsh", "p2tr", "p2trMusig2"
1229
+ *
1230
+ * # Returns
1231
+ * `true` if the network supports the script type, `false` otherwise
1232
+ *
1233
+ * # Examples
1234
+ * - Bitcoin supports all script types (p2sh, p2shP2wsh, p2wsh, p2tr, p2trMusig2)
1235
+ * - Litecoin supports segwit but not taproot (p2sh, p2shP2wsh, p2wsh)
1236
+ * - Dogecoin only supports legacy scripts (p2sh)
1237
+ * @param {string} coin
1238
+ * @param {string} script_type
1239
+ * @returns {boolean}
1240
+ */
1241
+ static supports_script_type(coin, script_type) {
1242
+ try {
1243
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1244
+ const ptr0 = passStringToWasm0(coin, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1245
+ const len0 = WASM_VECTOR_LEN;
1246
+ const ptr1 = passStringToWasm0(script_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1247
+ const len1 = WASM_VECTOR_LEN;
1248
+ wasm.fixedscriptwalletnamespace_supports_script_type(retptr, ptr0, len0, ptr1, len1);
1249
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1250
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1251
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1252
+ if (r2) {
1253
+ throw takeObject(r1);
1254
+ }
1255
+ return r0 !== 0;
1256
+ } finally {
1257
+ wasm.__wbindgen_add_to_stack_pointer(16);
1258
+ }
1259
+ }
1223
1260
  /**
1224
1261
  * @param {WasmRootWalletKeys} keys
1225
1262
  * @param {number} chain
Binary file
@@ -1,60 +1,9 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
5
- export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
6
- export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
7
- export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
8
- export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
9
- export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
10
- export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
11
- export const __wbg_wrappsbt_free: (a: number, b: number) => void;
12
- export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
13
- export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
14
- export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
15
- export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
16
- export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
17
- export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
18
- export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
19
- export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
20
- export const wasmtransaction_get_vsize: (a: number) => number;
21
- export const wasmtransaction_to_bytes: (a: number, b: number) => void;
22
- export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
23
- export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
24
- export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
25
- export const wrapdescriptor_descType: (a: number, b: number) => void;
26
- export const wrapdescriptor_encode: (a: number, b: number) => void;
27
- export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
28
- export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
29
- export const wrapdescriptor_hasWildcard: (a: number) => number;
30
- export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
31
- export const wrapdescriptor_node: (a: number, b: number) => void;
32
- export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
33
- export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
34
- export const wrapdescriptor_toString: (a: number, b: number) => void;
35
- export const wrapminiscript_encode: (a: number, b: number) => void;
36
- export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
37
- export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
38
- export const wrapminiscript_node: (a: number, b: number) => void;
39
- export const wrapminiscript_toAsmString: (a: number, b: number) => void;
40
- export const wrapminiscript_toString: (a: number, b: number) => void;
41
- export const wrappsbt_clone: (a: number) => number;
42
- export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
43
- export const wrappsbt_finalize: (a: number, b: number) => void;
44
- export const wrappsbt_serialize: (a: number, b: number) => void;
45
- export const wrappsbt_signWithPrv: (a: number, b: number, c: number, d: number) => void;
46
- export const wrappsbt_signWithXprv: (a: number, b: number, c: number, d: number) => void;
47
- export const wrappsbt_updateInputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
48
- export const wrappsbt_updateOutputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
49
- export const __wbg_addressnamespace_free: (a: number, b: number) => void;
50
4
  export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
51
5
  export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
52
6
  export const __wbg_wasmbip32_free: (a: number, b: number) => void;
53
- export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
54
- export const __wbg_wasmecpair_free: (a: number, b: number) => void;
55
- export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
56
- export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
57
- export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
58
7
  export const bitgopsbt_add_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number, k: number) => void;
59
8
  export const bitgopsbt_add_output: (a: number, b: number, c: number, d: number, e: bigint) => void;
60
9
  export const bitgopsbt_add_output_with_address: (a: number, b: number, c: number, d: number, e: bigint) => void;
@@ -86,6 +35,7 @@ export const bitgopsbt_version: (a: number) => number;
86
35
  export const bitgopsbt_version_group_id: (a: number) => number;
87
36
  export const fixedscriptwalletnamespace_address: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
88
37
  export const fixedscriptwalletnamespace_output_script: (a: number, b: number, c: number, d: number, e: number) => void;
38
+ export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: number, c: number, d: number, e: number) => void;
89
39
  export const wasmbip32_chain_code: (a: number) => number;
90
40
  export const wasmbip32_depth: (a: number) => number;
91
41
  export const wasmbip32_derive: (a: number, b: number, c: number) => void;
@@ -106,15 +56,9 @@ export const wasmbip32_private_key: (a: number) => number;
106
56
  export const wasmbip32_public_key: (a: number) => number;
107
57
  export const wasmbip32_to_base58: (a: number, b: number) => void;
108
58
  export const wasmbip32_to_wif: (a: number, b: number) => void;
109
- export const wasmdimensions_empty: () => number;
110
- export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
111
- export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number) => void;
112
- export const wasmdimensions_from_output_script: (a: number, b: number) => number;
113
- export const wasmdimensions_from_psbt: (a: number, b: number) => void;
114
- export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
115
- export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
116
- export const wasmdimensions_has_segwit: (a: number) => number;
117
- export const wasmdimensions_plus: (a: number, b: number) => number;
59
+ export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
60
+ export const __wbg_wasmecpair_free: (a: number, b: number) => void;
61
+ export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
118
62
  export const wasmecpair_from_private_key: (a: number, b: number, c: number) => void;
119
63
  export const wasmecpair_from_public_key: (a: number, b: number, c: number) => void;
120
64
  export const wasmecpair_from_wif: (a: number, b: number, c: number) => void;
@@ -125,12 +69,69 @@ export const wasmecpair_public_key: (a: number) => number;
125
69
  export const wasmecpair_to_wif: (a: number, b: number) => void;
126
70
  export const wasmecpair_to_wif_mainnet: (a: number, b: number) => void;
127
71
  export const wasmecpair_to_wif_testnet: (a: number, b: number) => void;
72
+ export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
73
+ export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
74
+ export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
75
+ export const __wbg_addressnamespace_free: (a: number, b: number) => void;
76
+ export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
77
+ export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
78
+ export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
79
+ export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
80
+ export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
81
+ export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
82
+ export const __wbg_wrappsbt_free: (a: number, b: number) => void;
83
+ export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
84
+ export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
85
+ export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
86
+ export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
87
+ export const wasmdimensions_empty: () => number;
88
+ export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
89
+ export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number) => void;
90
+ export const wasmdimensions_from_output_script: (a: number, b: number) => number;
91
+ export const wasmdimensions_from_psbt: (a: number, b: number) => void;
92
+ export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
93
+ export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
94
+ export const wasmdimensions_has_segwit: (a: number) => number;
95
+ export const wasmdimensions_plus: (a: number, b: number) => number;
96
+ export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
97
+ export const wasmtransaction_get_vsize: (a: number) => number;
98
+ export const wasmtransaction_to_bytes: (a: number, b: number) => void;
99
+ export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
100
+ export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
101
+ export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
102
+ export const wrapdescriptor_descType: (a: number, b: number) => void;
103
+ export const wrapdescriptor_encode: (a: number, b: number) => void;
104
+ export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
105
+ export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
106
+ export const wrapdescriptor_hasWildcard: (a: number) => number;
107
+ export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
108
+ export const wrapdescriptor_node: (a: number, b: number) => void;
109
+ export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
110
+ export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
111
+ export const wrapdescriptor_toString: (a: number, b: number) => void;
112
+ export const wrapminiscript_encode: (a: number, b: number) => void;
113
+ export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
114
+ export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
115
+ export const wrapminiscript_node: (a: number, b: number) => void;
116
+ export const wrapminiscript_toAsmString: (a: number, b: number) => void;
117
+ export const wrapminiscript_toString: (a: number, b: number) => void;
118
+ export const wrappsbt_clone: (a: number) => number;
119
+ export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
120
+ export const wrappsbt_finalize: (a: number, b: number) => void;
121
+ export const wrappsbt_serialize: (a: number, b: number) => void;
122
+ export const wrappsbt_signWithPrv: (a: number, b: number, c: number, d: number) => void;
123
+ export const wrappsbt_signWithXprv: (a: number, b: number, c: number, d: number) => void;
124
+ export const wrappsbt_updateInputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
125
+ export const wrappsbt_updateOutputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
126
+ export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
128
127
  export const wasmrootwalletkeys_backup_key: (a: number) => number;
129
128
  export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
130
129
  export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
131
130
  export const wasmrootwalletkeys_user_key: (a: number) => number;
132
131
  export const wasmrootwalletkeys_with_derivation_prefixes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
133
- export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
132
+ export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
133
+ export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
134
+ export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
134
135
  export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
135
136
  export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
136
137
  export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
@@ -5,12 +5,13 @@ import { type BIP32Arg } from "../bip32.js";
5
5
  import { type ECPairArg } from "../ecpair.js";
6
6
  import type { UtxolibName } from "../utxolibCompat.js";
7
7
  import type { CoinName } from "../coinName.js";
8
+ import type { InputScriptType } from "./scriptType.js";
9
+ export type { InputScriptType };
8
10
  export type NetworkName = UtxolibName | CoinName;
9
11
  export type ScriptId = {
10
12
  chain: number;
11
13
  index: number;
12
14
  };
13
- export type InputScriptType = "p2shP2pk" | "p2sh" | "p2shP2wsh" | "p2wsh" | "p2trLegacy" | "p2trMusig2ScriptPath" | "p2trMusig2KeyPath";
14
15
  export type OutPoint = {
15
16
  txid: string;
16
17
  vout: number;
@@ -1,6 +1,35 @@
1
+ import type { CoinName } from "../coinName.js";
1
2
  export { RootWalletKeys, type WalletKeysArg, type IWalletKeys } from "./RootWalletKeys.js";
2
3
  export { ReplayProtection, type ReplayProtectionArg } from "./ReplayProtection.js";
3
4
  export { outputScript, address } from "./address.js";
4
5
  export { Dimensions } from "./Dimensions.js";
5
- 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";
6
+ export { type OutputScriptType, type InputScriptType, type ScriptType } from "./scriptType.js";
7
+ export { BitGoPsbt, type NetworkName, type ScriptId, type ParsedInput, type ParsedOutput, type ParsedTransaction, type SignPath, type CreateEmptyOptions, type AddInputOptions, type AddOutputOptions, type AddWalletInputOptions, type AddWalletOutputOptions, } from "./BitGoPsbt.js";
6
8
  export { ZcashBitGoPsbt, type ZcashNetworkName, type CreateEmptyZcashOptions, } from "./ZcashBitGoPsbt.js";
9
+ import type { ScriptType } from "./scriptType.js";
10
+ /**
11
+ * Check if a network supports a given fixed-script wallet script type
12
+ *
13
+ * @param coin - Coin name (e.g., "btc", "ltc", "doge")
14
+ * @param scriptType - Output script type or input script type to check
15
+ * @returns `true` if the network supports the script type, `false` otherwise
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * // Bitcoin supports all script types
20
+ * supportsScriptType("btc", "p2tr"); // true
21
+ *
22
+ * // Litecoin supports segwit but not taproot
23
+ * supportsScriptType("ltc", "p2wsh"); // true
24
+ * supportsScriptType("ltc", "p2tr"); // false
25
+ *
26
+ * // Dogecoin only supports legacy scripts
27
+ * supportsScriptType("doge", "p2sh"); // true
28
+ * supportsScriptType("doge", "p2wsh"); // false
29
+ *
30
+ * // Also works with input script types
31
+ * supportsScriptType("btc", "p2trMusig2KeyPath"); // true
32
+ * supportsScriptType("doge", "p2trLegacy"); // false
33
+ * ```
34
+ */
35
+ export declare function supportsScriptType(coin: CoinName, scriptType: ScriptType): boolean;
@@ -1,3 +1,4 @@
1
+ import { FixedScriptWalletNamespace } from "../wasm/wasm_utxo.js";
1
2
  export { RootWalletKeys } from "./RootWalletKeys.js";
2
3
  export { ReplayProtection } from "./ReplayProtection.js";
3
4
  export { outputScript, address } from "./address.js";
@@ -6,3 +7,31 @@ export { Dimensions } from "./Dimensions.js";
6
7
  export { BitGoPsbt, } from "./BitGoPsbt.js";
7
8
  // Zcash-specific PSBT subclass
8
9
  export { ZcashBitGoPsbt, } from "./ZcashBitGoPsbt.js";
10
+ /**
11
+ * Check if a network supports a given fixed-script wallet script type
12
+ *
13
+ * @param coin - Coin name (e.g., "btc", "ltc", "doge")
14
+ * @param scriptType - Output script type or input script type to check
15
+ * @returns `true` if the network supports the script type, `false` otherwise
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * // Bitcoin supports all script types
20
+ * supportsScriptType("btc", "p2tr"); // true
21
+ *
22
+ * // Litecoin supports segwit but not taproot
23
+ * supportsScriptType("ltc", "p2wsh"); // true
24
+ * supportsScriptType("ltc", "p2tr"); // false
25
+ *
26
+ * // Dogecoin only supports legacy scripts
27
+ * supportsScriptType("doge", "p2sh"); // true
28
+ * supportsScriptType("doge", "p2wsh"); // false
29
+ *
30
+ * // Also works with input script types
31
+ * supportsScriptType("btc", "p2trMusig2KeyPath"); // true
32
+ * supportsScriptType("doge", "p2trLegacy"); // false
33
+ * ```
34
+ */
35
+ export function supportsScriptType(coin, scriptType) {
36
+ return FixedScriptWalletNamespace.supports_script_type(coin, scriptType);
37
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Fixed-script wallet output script types (2-of-3 multisig)
3
+ *
4
+ * This type represents the abstract script type, independent of chain (external/internal).
5
+ * Use this for checking network support or when you need the script type without derivation info.
6
+ */
7
+ export type OutputScriptType = "p2sh" | "p2shP2wsh" | "p2wsh" | "p2tr" | "p2trLegacy" | "p2trMusig2";
8
+ /**
9
+ * Input script types for fixed-script wallets
10
+ *
11
+ * These are more specific than output types and include single-sig and taproot variants.
12
+ */
13
+ export type InputScriptType = "p2shP2pk" | "p2sh" | "p2shP2wsh" | "p2wsh" | "p2trLegacy" | "p2trMusig2ScriptPath" | "p2trMusig2KeyPath";
14
+ /**
15
+ * Union of all script types that can be checked for network support
16
+ */
17
+ export type ScriptType = OutputScriptType | InputScriptType;
@@ -0,0 +1 @@
1
+ export {};
@@ -379,6 +379,22 @@ export class FixedScriptWalletNamespace {
379
379
  free(): void;
380
380
  [Symbol.dispose](): void;
381
381
  static output_script(keys: WasmRootWalletKeys, chain: number, index: number, network: any): Uint8Array;
382
+ /**
383
+ * Check if a network supports a given fixed-script wallet script type
384
+ *
385
+ * # Arguments
386
+ * * `coin` - Coin name (e.g., "btc", "ltc", "doge")
387
+ * * `script_type` - Script type name: "p2sh", "p2shP2wsh", "p2wsh", "p2tr", "p2trMusig2"
388
+ *
389
+ * # Returns
390
+ * `true` if the network supports the script type, `false` otherwise
391
+ *
392
+ * # Examples
393
+ * - Bitcoin supports all script types (p2sh, p2shP2wsh, p2wsh, p2tr, p2trMusig2)
394
+ * - Litecoin supports segwit but not taproot (p2sh, p2shP2wsh, p2wsh)
395
+ * - Dogecoin only supports legacy scripts (p2sh)
396
+ */
397
+ static supports_script_type(coin: string, script_type: string): boolean;
382
398
  static address(keys: WasmRootWalletKeys, chain: number, index: number, network: any, address_format?: string | null): string;
383
399
  }
384
400
 
@@ -1227,6 +1227,43 @@ export class FixedScriptWalletNamespace {
1227
1227
  wasm.__wbindgen_add_to_stack_pointer(16);
1228
1228
  }
1229
1229
  }
1230
+ /**
1231
+ * Check if a network supports a given fixed-script wallet script type
1232
+ *
1233
+ * # Arguments
1234
+ * * `coin` - Coin name (e.g., "btc", "ltc", "doge")
1235
+ * * `script_type` - Script type name: "p2sh", "p2shP2wsh", "p2wsh", "p2tr", "p2trMusig2"
1236
+ *
1237
+ * # Returns
1238
+ * `true` if the network supports the script type, `false` otherwise
1239
+ *
1240
+ * # Examples
1241
+ * - Bitcoin supports all script types (p2sh, p2shP2wsh, p2wsh, p2tr, p2trMusig2)
1242
+ * - Litecoin supports segwit but not taproot (p2sh, p2shP2wsh, p2wsh)
1243
+ * - Dogecoin only supports legacy scripts (p2sh)
1244
+ * @param {string} coin
1245
+ * @param {string} script_type
1246
+ * @returns {boolean}
1247
+ */
1248
+ static supports_script_type(coin, script_type) {
1249
+ try {
1250
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1251
+ const ptr0 = passStringToWasm0(coin, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1252
+ const len0 = WASM_VECTOR_LEN;
1253
+ const ptr1 = passStringToWasm0(script_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1254
+ const len1 = WASM_VECTOR_LEN;
1255
+ wasm.fixedscriptwalletnamespace_supports_script_type(retptr, ptr0, len0, ptr1, len1);
1256
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1257
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1258
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1259
+ if (r2) {
1260
+ throw takeObject(r1);
1261
+ }
1262
+ return r0 !== 0;
1263
+ } finally {
1264
+ wasm.__wbindgen_add_to_stack_pointer(16);
1265
+ }
1266
+ }
1230
1267
  /**
1231
1268
  * @param {WasmRootWalletKeys} keys
1232
1269
  * @param {number} chain
Binary file
@@ -1,60 +1,9 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
5
- export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
6
- export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
7
- export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
8
- export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
9
- export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
10
- export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
11
- export const __wbg_wrappsbt_free: (a: number, b: number) => void;
12
- export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
13
- export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
14
- export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
15
- export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
16
- export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
17
- export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
18
- export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
19
- export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
20
- export const wasmtransaction_get_vsize: (a: number) => number;
21
- export const wasmtransaction_to_bytes: (a: number, b: number) => void;
22
- export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
23
- export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
24
- export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
25
- export const wrapdescriptor_descType: (a: number, b: number) => void;
26
- export const wrapdescriptor_encode: (a: number, b: number) => void;
27
- export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
28
- export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
29
- export const wrapdescriptor_hasWildcard: (a: number) => number;
30
- export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
31
- export const wrapdescriptor_node: (a: number, b: number) => void;
32
- export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
33
- export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
34
- export const wrapdescriptor_toString: (a: number, b: number) => void;
35
- export const wrapminiscript_encode: (a: number, b: number) => void;
36
- export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
37
- export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
38
- export const wrapminiscript_node: (a: number, b: number) => void;
39
- export const wrapminiscript_toAsmString: (a: number, b: number) => void;
40
- export const wrapminiscript_toString: (a: number, b: number) => void;
41
- export const wrappsbt_clone: (a: number) => number;
42
- export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
43
- export const wrappsbt_finalize: (a: number, b: number) => void;
44
- export const wrappsbt_serialize: (a: number, b: number) => void;
45
- export const wrappsbt_signWithPrv: (a: number, b: number, c: number, d: number) => void;
46
- export const wrappsbt_signWithXprv: (a: number, b: number, c: number, d: number) => void;
47
- export const wrappsbt_updateInputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
48
- export const wrappsbt_updateOutputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
49
- export const __wbg_addressnamespace_free: (a: number, b: number) => void;
50
4
  export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
51
5
  export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
52
6
  export const __wbg_wasmbip32_free: (a: number, b: number) => void;
53
- export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
54
- export const __wbg_wasmecpair_free: (a: number, b: number) => void;
55
- export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
56
- export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
57
- export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
58
7
  export const bitgopsbt_add_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number, k: number) => void;
59
8
  export const bitgopsbt_add_output: (a: number, b: number, c: number, d: number, e: bigint) => void;
60
9
  export const bitgopsbt_add_output_with_address: (a: number, b: number, c: number, d: number, e: bigint) => void;
@@ -86,6 +35,7 @@ export const bitgopsbt_version: (a: number) => number;
86
35
  export const bitgopsbt_version_group_id: (a: number) => number;
87
36
  export const fixedscriptwalletnamespace_address: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
88
37
  export const fixedscriptwalletnamespace_output_script: (a: number, b: number, c: number, d: number, e: number) => void;
38
+ export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: number, c: number, d: number, e: number) => void;
89
39
  export const wasmbip32_chain_code: (a: number) => number;
90
40
  export const wasmbip32_depth: (a: number) => number;
91
41
  export const wasmbip32_derive: (a: number, b: number, c: number) => void;
@@ -106,15 +56,9 @@ export const wasmbip32_private_key: (a: number) => number;
106
56
  export const wasmbip32_public_key: (a: number) => number;
107
57
  export const wasmbip32_to_base58: (a: number, b: number) => void;
108
58
  export const wasmbip32_to_wif: (a: number, b: number) => void;
109
- export const wasmdimensions_empty: () => number;
110
- export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
111
- export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number) => void;
112
- export const wasmdimensions_from_output_script: (a: number, b: number) => number;
113
- export const wasmdimensions_from_psbt: (a: number, b: number) => void;
114
- export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
115
- export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
116
- export const wasmdimensions_has_segwit: (a: number) => number;
117
- export const wasmdimensions_plus: (a: number, b: number) => number;
59
+ export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
60
+ export const __wbg_wasmecpair_free: (a: number, b: number) => void;
61
+ export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
118
62
  export const wasmecpair_from_private_key: (a: number, b: number, c: number) => void;
119
63
  export const wasmecpair_from_public_key: (a: number, b: number, c: number) => void;
120
64
  export const wasmecpair_from_wif: (a: number, b: number, c: number) => void;
@@ -125,12 +69,69 @@ export const wasmecpair_public_key: (a: number) => number;
125
69
  export const wasmecpair_to_wif: (a: number, b: number) => void;
126
70
  export const wasmecpair_to_wif_mainnet: (a: number, b: number) => void;
127
71
  export const wasmecpair_to_wif_testnet: (a: number, b: number) => void;
72
+ export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
73
+ export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
74
+ export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
75
+ export const __wbg_addressnamespace_free: (a: number, b: number) => void;
76
+ export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
77
+ export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
78
+ export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
79
+ export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
80
+ export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
81
+ export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
82
+ export const __wbg_wrappsbt_free: (a: number, b: number) => void;
83
+ export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
84
+ export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
85
+ export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
86
+ export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
87
+ export const wasmdimensions_empty: () => number;
88
+ export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
89
+ export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number) => void;
90
+ export const wasmdimensions_from_output_script: (a: number, b: number) => number;
91
+ export const wasmdimensions_from_psbt: (a: number, b: number) => void;
92
+ export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
93
+ export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
94
+ export const wasmdimensions_has_segwit: (a: number) => number;
95
+ export const wasmdimensions_plus: (a: number, b: number) => number;
96
+ export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
97
+ export const wasmtransaction_get_vsize: (a: number) => number;
98
+ export const wasmtransaction_to_bytes: (a: number, b: number) => void;
99
+ export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
100
+ export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
101
+ export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
102
+ export const wrapdescriptor_descType: (a: number, b: number) => void;
103
+ export const wrapdescriptor_encode: (a: number, b: number) => void;
104
+ export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
105
+ export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
106
+ export const wrapdescriptor_hasWildcard: (a: number) => number;
107
+ export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
108
+ export const wrapdescriptor_node: (a: number, b: number) => void;
109
+ export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
110
+ export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
111
+ export const wrapdescriptor_toString: (a: number, b: number) => void;
112
+ export const wrapminiscript_encode: (a: number, b: number) => void;
113
+ export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
114
+ export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
115
+ export const wrapminiscript_node: (a: number, b: number) => void;
116
+ export const wrapminiscript_toAsmString: (a: number, b: number) => void;
117
+ export const wrapminiscript_toString: (a: number, b: number) => void;
118
+ export const wrappsbt_clone: (a: number) => number;
119
+ export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
120
+ export const wrappsbt_finalize: (a: number, b: number) => void;
121
+ export const wrappsbt_serialize: (a: number, b: number) => void;
122
+ export const wrappsbt_signWithPrv: (a: number, b: number, c: number, d: number) => void;
123
+ export const wrappsbt_signWithXprv: (a: number, b: number, c: number, d: number) => void;
124
+ export const wrappsbt_updateInputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
125
+ export const wrappsbt_updateOutputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
126
+ export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
128
127
  export const wasmrootwalletkeys_backup_key: (a: number) => number;
129
128
  export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
130
129
  export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
131
130
  export const wasmrootwalletkeys_user_key: (a: number) => number;
132
131
  export const wasmrootwalletkeys_with_derivation_prefixes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
133
- export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
132
+ export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
133
+ export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
134
+ export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
134
135
  export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
135
136
  export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
136
137
  export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitgo/wasm-utxo",
3
3
  "description": "WebAssembly wrapper for rust-bitcoin (beta)",
4
- "version": "1.20.0",
4
+ "version": "1.21.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",