@metamask-previews/network-enablement-controller 4.0.0-preview-3e207569 → 4.0.0-preview-47cfb4e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/NetworkEnablementController.cjs +182 -58
  3. package/dist/NetworkEnablementController.cjs.map +1 -1
  4. package/dist/NetworkEnablementController.d.cts +52 -2
  5. package/dist/NetworkEnablementController.d.cts.map +1 -1
  6. package/dist/NetworkEnablementController.d.mts +52 -2
  7. package/dist/NetworkEnablementController.d.mts.map +1 -1
  8. package/dist/NetworkEnablementController.mjs +182 -58
  9. package/dist/NetworkEnablementController.mjs.map +1 -1
  10. package/dist/index.cjs +5 -1
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +2 -1
  13. package/dist/index.d.cts.map +1 -1
  14. package/dist/index.d.mts +2 -1
  15. package/dist/index.d.mts.map +1 -1
  16. package/dist/index.mjs +1 -0
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/services/Slip44Service.cjs +171 -0
  19. package/dist/services/Slip44Service.cjs.map +1 -0
  20. package/dist/services/Slip44Service.d.cts +75 -0
  21. package/dist/services/Slip44Service.d.cts.map +1 -0
  22. package/dist/services/Slip44Service.d.mts +75 -0
  23. package/dist/services/Slip44Service.d.mts.map +1 -0
  24. package/dist/services/Slip44Service.mjs +164 -0
  25. package/dist/services/Slip44Service.mjs.map +1 -0
  26. package/dist/services/index.cjs +11 -0
  27. package/dist/services/index.cjs.map +1 -0
  28. package/dist/services/index.d.cts +5 -0
  29. package/dist/services/index.d.cts.map +1 -0
  30. package/dist/services/index.d.mts +5 -0
  31. package/dist/services/index.d.mts.map +1 -0
  32. package/dist/services/index.mjs +8 -0
  33. package/dist/services/index.mjs.map +1 -0
  34. package/package.json +2 -1
@@ -0,0 +1,164 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7
+ if (kind === "m") throw new TypeError("Private method is not writable");
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
+ };
12
+ var _a, _Slip44Service_chainIdCache, _Slip44Service_fetchPromise, _Slip44Service_symbolCache, _Slip44Service_fetchChainData;
13
+ import { fetchWithErrorHandling } from "@metamask/controller-utils";
14
+ // @ts-expect-error: No type definitions for '@metamask/slip44'
15
+ import slip44 from "@metamask/slip44" with { type: "json" };
16
+ const CHAINID_NETWORK_URL = 'https://chainid.network/chains.json';
17
+ /**
18
+ * Service for looking up SLIP-44 coin type identifiers.
19
+ *
20
+ * SLIP-44 defines registered coin types used in BIP-44 derivation paths.
21
+ *
22
+ * This service provides two lookup methods:
23
+ * 1. `getEvmSlip44` - For EVM networks, uses chainid.network data (recommended for eip155)
24
+ * 2. `getSlip44BySymbol` - Fallback method using @metamask/slip44 package
25
+ *
26
+ * @see https://github.com/satoshilabs/slips/blob/master/slip-0044.md
27
+ * @see https://chainid.network/chains.json
28
+ */
29
+ export class Slip44Service {
30
+ /**
31
+ * Gets the SLIP-44 coin type identifier for an EVM network by chain ID.
32
+ *
33
+ * **IMPORTANT: This method is for EVM networks only (eip155 namespace).**
34
+ * For non-EVM networks (Bitcoin, Solana, Tron, etc.), use `getSlip44BySymbol`.
35
+ *
36
+ * This method checks chainid.network data (which maps chainId directly
37
+ * to slip44). If not found, defaults to 60 (Ethereum).
38
+ *
39
+ * @param chainId - The EVM chain ID as a number (e.g., 1 for Ethereum, 56 for BNB Chain)
40
+ * @returns The SLIP-44 coin type number (defaults to 60 if not found)
41
+ * @example
42
+ * ```typescript
43
+ * // For EVM networks only
44
+ * const ethCoinType = await Slip44Service.getEvmSlip44(1);
45
+ * // Returns 60
46
+ *
47
+ * const bnbCoinType = await Slip44Service.getEvmSlip44(56);
48
+ * // Returns 714
49
+ *
50
+ * const unknownEvmChain = await Slip44Service.getEvmSlip44(99999);
51
+ * // Returns 60 (default for EVM)
52
+ * ```
53
+ */
54
+ static async getEvmSlip44(chainId) {
55
+ // Ensure chain data is loaded
56
+ await __classPrivateFieldGet(this, _a, "m", _Slip44Service_fetchChainData).call(this);
57
+ // Check chainId cache first
58
+ const cached = __classPrivateFieldGet(this, _a, "f", _Slip44Service_chainIdCache)?.get(chainId);
59
+ if (cached !== undefined) {
60
+ return cached;
61
+ }
62
+ // Default to 60 (Ethereum) for EVM networks without specific mapping
63
+ return 60;
64
+ }
65
+ /**
66
+ * Gets the SLIP-44 coin type identifier for a non-EVM network by symbol.
67
+ *
68
+ * **IMPORTANT: This method is for non-EVM networks only (Bitcoin, Solana, Tron, etc.).**
69
+ * For EVM networks (eip155 namespace), use `getEvmSlip44` instead.
70
+ *
71
+ * Note: Symbol lookup may return incorrect results for duplicate symbols
72
+ * (e.g., CPC is both CPChain and Capricoin).
73
+ *
74
+ * @param symbol - The network symbol (e.g., 'ETH', 'BTC', 'SOL')
75
+ * @returns The SLIP-44 coin type number, or undefined if not found
76
+ * @example
77
+ * ```typescript
78
+ * const ethCoinType = Slip44Service.getSlip44BySymbol('ETH');
79
+ * // Returns 60
80
+ *
81
+ * const btcCoinType = Slip44Service.getSlip44BySymbol('BTC');
82
+ * // Returns 0
83
+ * ```
84
+ */
85
+ static getSlip44BySymbol(symbol) {
86
+ // Check cache first
87
+ if (__classPrivateFieldGet(this, _a, "f", _Slip44Service_symbolCache).has(symbol)) {
88
+ return __classPrivateFieldGet(this, _a, "f", _Slip44Service_symbolCache).get(symbol);
89
+ }
90
+ const slip44Data = slip44;
91
+ const upperSymbol = symbol.toUpperCase();
92
+ // Iterate through all entries to find matching symbol
93
+ // Note: Object.keys returns numeric keys in ascending order,
94
+ // so for duplicate symbols we get the lowest coin type first
95
+ // (which is the convention for resolving duplicates)
96
+ for (const key of Object.keys(slip44Data)) {
97
+ const entry = slip44Data[key];
98
+ if (entry.symbol.toUpperCase() === upperSymbol) {
99
+ const coinType = parseInt(key, 10);
100
+ __classPrivateFieldGet(this, _a, "f", _Slip44Service_symbolCache).set(symbol, coinType);
101
+ return coinType;
102
+ }
103
+ }
104
+ // Cache the miss as well to avoid repeated lookups
105
+ __classPrivateFieldGet(this, _a, "f", _Slip44Service_symbolCache).set(symbol, undefined);
106
+ return undefined;
107
+ }
108
+ /**
109
+ * Clears all internal caches.
110
+ * Useful for testing or if the underlying data might change.
111
+ */
112
+ static clearCache() {
113
+ __classPrivateFieldGet(this, _a, "f", _Slip44Service_symbolCache).clear();
114
+ __classPrivateFieldSet(this, _a, null, "f", _Slip44Service_chainIdCache);
115
+ __classPrivateFieldSet(this, _a, null, "f", _Slip44Service_fetchPromise);
116
+ }
117
+ }
118
+ _a = Slip44Service, _Slip44Service_fetchChainData = async function _Slip44Service_fetchChainData() {
119
+ if (__classPrivateFieldGet(this, _a, "f", _Slip44Service_chainIdCache) !== null) {
120
+ return;
121
+ }
122
+ // Avoid duplicate fetches
123
+ if (__classPrivateFieldGet(this, _a, "f", _Slip44Service_fetchPromise)) {
124
+ await __classPrivateFieldGet(this, _a, "f", _Slip44Service_fetchPromise);
125
+ return;
126
+ }
127
+ __classPrivateFieldSet(this, _a, (async () => {
128
+ try {
129
+ const chains = await fetchWithErrorHandling({
130
+ url: CHAINID_NETWORK_URL,
131
+ timeout: 10000,
132
+ });
133
+ if (chains && Array.isArray(chains)) {
134
+ __classPrivateFieldSet(this, _a, new Map(chains
135
+ .filter((chain) => chain.slip44 !== undefined)
136
+ .map((chain) => [chain.chainId, chain.slip44])), "f", _Slip44Service_chainIdCache);
137
+ }
138
+ else {
139
+ // Invalid response, initialize empty cache
140
+ __classPrivateFieldSet(this, _a, new Map(), "f", _Slip44Service_chainIdCache);
141
+ }
142
+ }
143
+ catch {
144
+ // Network failed, initialize empty cache so we fall back to symbol lookup
145
+ __classPrivateFieldSet(this, _a, new Map(), "f", _Slip44Service_chainIdCache);
146
+ }
147
+ })(), "f", _Slip44Service_fetchPromise);
148
+ await __classPrivateFieldGet(this, _a, "f", _Slip44Service_fetchPromise);
149
+ __classPrivateFieldSet(this, _a, null, "f", _Slip44Service_fetchPromise);
150
+ };
151
+ /**
152
+ * Cache for chainId to slip44 lookups from chainid.network.
153
+ */
154
+ _Slip44Service_chainIdCache = { value: null };
155
+ /**
156
+ * Whether a fetch is currently in progress.
157
+ */
158
+ _Slip44Service_fetchPromise = { value: null };
159
+ /**
160
+ * Cache for symbol to slip44 index lookups.
161
+ * This avoids iterating through all entries on repeated lookups.
162
+ */
163
+ _Slip44Service_symbolCache = { value: new Map() };
164
+ //# sourceMappingURL=Slip44Service.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Slip44Service.mjs","sourceRoot":"","sources":["../../src/services/Slip44Service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,sBAAsB,EAAE,mCAAmC;AACpE,+DAA+D;AAC/D,OAAO,MAAM,+CAAyB;AAEtC,MAAM,mBAAmB,GAAG,qCAAqC,CAAC;AAoClE;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,aAAa;IA+DxB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAe;QACvC,8BAA8B;QAC9B,MAAM,uBAAA,IAAI,yCAAgB,MAApB,IAAI,CAAkB,CAAC;QAE7B,4BAA4B;QAC5B,MAAM,MAAM,GAAG,uBAAA,IAAI,uCAAc,EAAE,GAAG,CAAC,O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a,sCAAgD,IAAI,GAAG,EAAE,EAA7C,CAA8C","sourcesContent":["import { fetchWithErrorHandling } from '@metamask/controller-utils';\n// @ts-expect-error: No type definitions for '@metamask/slip44'\nimport slip44 from '@metamask/slip44';\n\nconst CHAINID_NETWORK_URL = 'https://chainid.network/chains.json';\n\n/**\n * Represents a single SLIP-44 entry with its metadata.\n */\nexport type Slip44Entry = {\n index: string;\n symbol: string;\n name: string;\n};\n\n/**\n * Chain data from chainid.network\n */\ntype ChainIdNetworkEntry = {\n chainId: number;\n slip44?: number;\n nativeCurrency?: {\n symbol: string;\n };\n};\n\n/**\n * Internal type for SLIP-44 data from the @metamask/slip44 package.\n * Includes the hex field which we don't expose externally.\n */\ntype Slip44DataEntry = Slip44Entry & {\n // eslint-disable-next-line id-denylist\n hex: `0x${string}`;\n};\n\n/**\n * The SLIP-44 mapping type from the @metamask/slip44 package.\n */\ntype Slip44Data = Record<string, Slip44DataEntry>;\n\n/**\n * Service for looking up SLIP-44 coin type identifiers.\n *\n * SLIP-44 defines registered coin types used in BIP-44 derivation paths.\n *\n * This service provides two lookup methods:\n * 1. `getEvmSlip44` - For EVM networks, uses chainid.network data (recommended for eip155)\n * 2. `getSlip44BySymbol` - Fallback method using @metamask/slip44 package\n *\n * @see https://github.com/satoshilabs/slips/blob/master/slip-0044.md\n * @see https://chainid.network/chains.json\n */\nexport class Slip44Service {\n /**\n * Cache for chainId to slip44 lookups from chainid.network.\n */\n static #chainIdCache: Map<number, number> | null = null;\n\n /**\n * Whether a fetch is currently in progress.\n */\n static #fetchPromise: Promise<void> | null = null;\n\n /**\n * Cache for symbol to slip44 index lookups.\n * This avoids iterating through all entries on repeated lookups.\n */\n static readonly #symbolCache: Map<string, number | undefined> = new Map();\n\n /**\n * Fetches and caches chain data from chainid.network.\n * This is called automatically by getEvmSlip44.\n */\n static async #fetchChainData(): Promise<void> {\n if (this.#chainIdCache !== null) {\n return;\n }\n\n // Avoid duplicate fetches\n if (this.#fetchPromise) {\n await this.#fetchPromise;\n return;\n }\n\n this.#fetchPromise = (async (): Promise<void> => {\n try {\n const chains: ChainIdNetworkEntry[] | undefined =\n await fetchWithErrorHandling({\n url: CHAINID_NETWORK_URL,\n timeout: 10000,\n });\n\n if (chains && Array.isArray(chains)) {\n this.#chainIdCache = new Map(\n chains\n .filter(\n (chain): chain is ChainIdNetworkEntry & { slip44: number } =>\n chain.slip44 !== undefined,\n )\n .map((chain) => [chain.chainId, chain.slip44]),\n );\n } else {\n // Invalid response, initialize empty cache\n this.#chainIdCache = new Map();\n }\n } catch {\n // Network failed, initialize empty cache so we fall back to symbol lookup\n this.#chainIdCache = new Map();\n }\n })();\n\n await this.#fetchPromise;\n this.#fetchPromise = null;\n }\n\n /**\n * Gets the SLIP-44 coin type identifier for an EVM network by chain ID.\n *\n * **IMPORTANT: This method is for EVM networks only (eip155 namespace).**\n * For non-EVM networks (Bitcoin, Solana, Tron, etc.), use `getSlip44BySymbol`.\n *\n * This method checks chainid.network data (which maps chainId directly\n * to slip44). If not found, defaults to 60 (Ethereum).\n *\n * @param chainId - The EVM chain ID as a number (e.g., 1 for Ethereum, 56 for BNB Chain)\n * @returns The SLIP-44 coin type number (defaults to 60 if not found)\n * @example\n * ```typescript\n * // For EVM networks only\n * const ethCoinType = await Slip44Service.getEvmSlip44(1);\n * // Returns 60\n *\n * const bnbCoinType = await Slip44Service.getEvmSlip44(56);\n * // Returns 714\n *\n * const unknownEvmChain = await Slip44Service.getEvmSlip44(99999);\n * // Returns 60 (default for EVM)\n * ```\n */\n static async getEvmSlip44(chainId: number): Promise<number> {\n // Ensure chain data is loaded\n await this.#fetchChainData();\n\n // Check chainId cache first\n const cached = this.#chainIdCache?.get(chainId);\n if (cached !== undefined) {\n return cached;\n }\n\n // Default to 60 (Ethereum) for EVM networks without specific mapping\n return 60;\n }\n\n /**\n * Gets the SLIP-44 coin type identifier for a non-EVM network by symbol.\n *\n * **IMPORTANT: This method is for non-EVM networks only (Bitcoin, Solana, Tron, etc.).**\n * For EVM networks (eip155 namespace), use `getEvmSlip44` instead.\n *\n * Note: Symbol lookup may return incorrect results for duplicate symbols\n * (e.g., CPC is both CPChain and Capricoin).\n *\n * @param symbol - The network symbol (e.g., 'ETH', 'BTC', 'SOL')\n * @returns The SLIP-44 coin type number, or undefined if not found\n * @example\n * ```typescript\n * const ethCoinType = Slip44Service.getSlip44BySymbol('ETH');\n * // Returns 60\n *\n * const btcCoinType = Slip44Service.getSlip44BySymbol('BTC');\n * // Returns 0\n * ```\n */\n static getSlip44BySymbol(symbol: string): number | undefined {\n // Check cache first\n if (this.#symbolCache.has(symbol)) {\n return this.#symbolCache.get(symbol);\n }\n\n const slip44Data = slip44 as Slip44Data;\n const upperSymbol = symbol.toUpperCase();\n\n // Iterate through all entries to find matching symbol\n // Note: Object.keys returns numeric keys in ascending order,\n // so for duplicate symbols we get the lowest coin type first\n // (which is the convention for resolving duplicates)\n for (const key of Object.keys(slip44Data)) {\n const entry = slip44Data[key];\n if (entry.symbol.toUpperCase() === upperSymbol) {\n const coinType = parseInt(key, 10);\n this.#symbolCache.set(symbol, coinType);\n return coinType;\n }\n }\n\n // Cache the miss as well to avoid repeated lookups\n this.#symbolCache.set(symbol, undefined);\n return undefined;\n }\n\n /**\n * Clears all internal caches.\n * Useful for testing or if the underlying data might change.\n */\n static clearCache(): void {\n this.#symbolCache.clear();\n this.#chainIdCache = null;\n this.#fetchPromise = null;\n }\n}\n"]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSlip44BySymbol = exports.getEvmSlip44 = exports.Slip44Service = void 0;
4
+ const Slip44Service_1 = require("./Slip44Service.cjs");
5
+ Object.defineProperty(exports, "Slip44Service", { enumerable: true, get: function () { return Slip44Service_1.Slip44Service; } });
6
+ // Re-export static methods as standalone functions for convenience
7
+ // getEvmSlip44: For EVM networks (eip155) - uses chainId lookup, defaults to 60
8
+ exports.getEvmSlip44 = Slip44Service_1.Slip44Service.getEvmSlip44.bind(Slip44Service_1.Slip44Service);
9
+ // getSlip44BySymbol: For non-EVM networks (Bitcoin, Solana, Tron) - uses symbol lookup
10
+ exports.getSlip44BySymbol = Slip44Service_1.Slip44Service.getSlip44BySymbol.bind(Slip44Service_1.Slip44Service);
11
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;AAAA,uDAAgD;AAEvC,8FAFA,6BAAa,OAEA;AAEtB,mEAAmE;AACnE,gFAAgF;AACnE,QAAA,YAAY,GAAG,6BAAa,CAAC,YAAY,CAAC,IAAI,CAAC,6BAAa,CAAC,CAAC;AAC3E,uFAAuF;AAC1E,QAAA,iBAAiB,GAC5B,6BAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,6BAAa,CAAC,CAAC","sourcesContent":["import { Slip44Service } from './Slip44Service';\n\nexport { Slip44Service };\n\n// Re-export static methods as standalone functions for convenience\n// getEvmSlip44: For EVM networks (eip155) - uses chainId lookup, defaults to 60\nexport const getEvmSlip44 = Slip44Service.getEvmSlip44.bind(Slip44Service);\n// getSlip44BySymbol: For non-EVM networks (Bitcoin, Solana, Tron) - uses symbol lookup\nexport const getSlip44BySymbol =\n Slip44Service.getSlip44BySymbol.bind(Slip44Service);\n"]}
@@ -0,0 +1,5 @@
1
+ import { Slip44Service } from "./Slip44Service.cjs";
2
+ export { Slip44Service };
3
+ export declare const getEvmSlip44: typeof Slip44Service.getEvmSlip44;
4
+ export declare const getSlip44BySymbol: typeof Slip44Service.getSlip44BySymbol;
5
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAEhD,OAAO,EAAE,aAAa,EAAE,CAAC;AAIzB,eAAO,MAAM,YAAY,mCAAiD,CAAC;AAE3E,eAAO,MAAM,iBAAiB,wCACuB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Slip44Service } from "./Slip44Service.mjs";
2
+ export { Slip44Service };
3
+ export declare const getEvmSlip44: typeof Slip44Service.getEvmSlip44;
4
+ export declare const getSlip44BySymbol: typeof Slip44Service.getSlip44BySymbol;
5
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAEhD,OAAO,EAAE,aAAa,EAAE,CAAC;AAIzB,eAAO,MAAM,YAAY,mCAAiD,CAAC;AAE3E,eAAO,MAAM,iBAAiB,wCACuB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Slip44Service } from "./Slip44Service.mjs";
2
+ export { Slip44Service };
3
+ // Re-export static methods as standalone functions for convenience
4
+ // getEvmSlip44: For EVM networks (eip155) - uses chainId lookup, defaults to 60
5
+ export const getEvmSlip44 = Slip44Service.getEvmSlip44.bind(Slip44Service);
6
+ // getSlip44BySymbol: For non-EVM networks (Bitcoin, Solana, Tron) - uses symbol lookup
7
+ export const getSlip44BySymbol = Slip44Service.getSlip44BySymbol.bind(Slip44Service);
8
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAEhD,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,mEAAmE;AACnE,gFAAgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAC3E,uFAAuF;AACvF,MAAM,CAAC,MAAM,iBAAiB,GAC5B,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { Slip44Service } from './Slip44Service';\n\nexport { Slip44Service };\n\n// Re-export static methods as standalone functions for convenience\n// getEvmSlip44: For EVM networks (eip155) - uses chainId lookup, defaults to 60\nexport const getEvmSlip44 = Slip44Service.getEvmSlip44.bind(Slip44Service);\n// getSlip44BySymbol: For non-EVM networks (Bitcoin, Solana, Tron) - uses symbol lookup\nexport const getSlip44BySymbol =\n Slip44Service.getSlip44BySymbol.bind(Slip44Service);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/network-enablement-controller",
3
- "version": "4.0.0-preview-3e207569",
3
+ "version": "4.0.0-preview-47cfb4e",
4
4
  "description": "Provides an interface to the currently enabled network using a MetaMask-compatible provider object",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -54,6 +54,7 @@
54
54
  "@metamask/messenger": "^0.3.0",
55
55
  "@metamask/multichain-network-controller": "^3.0.1",
56
56
  "@metamask/network-controller": "^28.0.0",
57
+ "@metamask/slip44": "^4.3.0",
57
58
  "@metamask/transaction-controller": "^62.9.1",
58
59
  "@metamask/utils": "^11.9.0",
59
60
  "reselect": "^5.1.1"