@metamask-previews/network-enablement-controller 4.0.0-preview-821afcb8 → 4.0.0-preview-0c691324

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 +7 -0
  2. package/dist/NetworkEnablementController.cjs +240 -61
  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 +240 -61
  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 +3 -1
  13. package/dist/index.d.cts.map +1 -1
  14. package/dist/index.d.mts +3 -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 +176 -0
  19. package/dist/services/Slip44Service.cjs.map +1 -0
  20. package/dist/services/Slip44Service.d.cts +74 -0
  21. package/dist/services/Slip44Service.d.cts.map +1 -0
  22. package/dist/services/Slip44Service.d.mts +74 -0
  23. package/dist/services/Slip44Service.d.mts.map +1 -0
  24. package/dist/services/Slip44Service.mjs +169 -0
  25. package/dist/services/Slip44Service.mjs.map +1 -0
  26. package/dist/services/index.cjs +9 -0
  27. package/dist/services/index.cjs.map +1 -0
  28. package/dist/services/index.d.cts +6 -0
  29. package/dist/services/index.d.cts.map +1 -0
  30. package/dist/services/index.d.mts +6 -0
  31. package/dist/services/index.d.mts.map +1 -0
  32. package/dist/services/index.mjs +6 -0
  33. package/dist/services/index.mjs.map +1 -0
  34. package/package.json +2 -1
@@ -0,0 +1,169 @@
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. `getSlip44ByChainId` - Primary method using chainid.network data (recommended)
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 a given EVM chain ID.
32
+ *
33
+ * This method first checks chainid.network data (which maps chainId directly
34
+ * to slip44), then falls back to symbol lookup if not found.
35
+ *
36
+ * @param chainId - The EVM chain ID (e.g., 1 for Ethereum, 56 for BNB Chain)
37
+ * @param symbol - Optional symbol for fallback lookup (e.g., 'ETH', 'BNB')
38
+ * @returns The SLIP-44 coin type number, or undefined if not found
39
+ * @example
40
+ * ```typescript
41
+ * const ethCoinType = await Slip44Service.getSlip44ByChainId(1);
42
+ * // Returns 60
43
+ *
44
+ * const bnbCoinType = await Slip44Service.getSlip44ByChainId(56);
45
+ * // Returns 714
46
+ * ```
47
+ */
48
+ static async getSlip44ByChainId(chainId, symbol) {
49
+ // Ensure chain data is loaded
50
+ await __classPrivateFieldGet(this, _a, "m", _Slip44Service_fetchChainData).call(this);
51
+ // Check chainId cache first
52
+ const cached = __classPrivateFieldGet(this, _a, "f", _Slip44Service_chainIdCache)?.get(chainId);
53
+ if (cached !== undefined) {
54
+ return cached;
55
+ }
56
+ // Fall back to symbol lookup if provided
57
+ if (symbol) {
58
+ return this.getSlip44BySymbol(symbol);
59
+ }
60
+ return undefined;
61
+ }
62
+ /**
63
+ * Gets the SLIP-44 coin type identifier for a given network symbol.
64
+ *
65
+ * Note: Symbol lookup may return incorrect results for duplicate symbols
66
+ * (e.g., CPC is both CPChain and Capricoin). For EVM networks, prefer
67
+ * using getSlip44ByChainId instead.
68
+ *
69
+ * @param symbol - The network symbol (e.g., 'ETH', 'BTC', 'SOL')
70
+ * @returns The SLIP-44 coin type number, or undefined if not found
71
+ * @example
72
+ * ```typescript
73
+ * const ethCoinType = Slip44Service.getSlip44BySymbol('ETH');
74
+ * // Returns 60
75
+ *
76
+ * const btcCoinType = Slip44Service.getSlip44BySymbol('BTC');
77
+ * // Returns 0
78
+ * ```
79
+ */
80
+ static getSlip44BySymbol(symbol) {
81
+ // Check cache first
82
+ if (__classPrivateFieldGet(this, _a, "f", _Slip44Service_symbolCache).has(symbol)) {
83
+ return __classPrivateFieldGet(this, _a, "f", _Slip44Service_symbolCache).get(symbol);
84
+ }
85
+ const slip44Data = slip44;
86
+ const upperSymbol = symbol.toUpperCase();
87
+ // Iterate through all entries to find matching symbol
88
+ // Note: Object.keys returns numeric keys in ascending order,
89
+ // so for duplicate symbols we get the lowest coin type first
90
+ // (which is the convention for resolving duplicates)
91
+ for (const key of Object.keys(slip44Data)) {
92
+ const entry = slip44Data[key];
93
+ if (entry.symbol.toUpperCase() === upperSymbol) {
94
+ const coinType = parseInt(key, 10);
95
+ __classPrivateFieldGet(this, _a, "f", _Slip44Service_symbolCache).set(symbol, coinType);
96
+ return coinType;
97
+ }
98
+ }
99
+ // Cache the miss as well to avoid repeated lookups
100
+ __classPrivateFieldGet(this, _a, "f", _Slip44Service_symbolCache).set(symbol, undefined);
101
+ return undefined;
102
+ }
103
+ /**
104
+ * Gets the SLIP-44 entry for a given coin type index.
105
+ *
106
+ * @param index - The SLIP-44 coin type index (e.g., 60 for ETH, 0 for BTC)
107
+ * @returns The SLIP-44 entry with metadata, or undefined if not found
108
+ */
109
+ static getSlip44Entry(index) {
110
+ const slip44Data = slip44;
111
+ return slip44Data[index.toString()];
112
+ }
113
+ /**
114
+ * Clears all internal caches.
115
+ * Useful for testing or if the underlying data might change.
116
+ */
117
+ static clearCache() {
118
+ __classPrivateFieldGet(this, _a, "f", _Slip44Service_symbolCache).clear();
119
+ __classPrivateFieldSet(this, _a, null, "f", _Slip44Service_chainIdCache);
120
+ __classPrivateFieldSet(this, _a, null, "f", _Slip44Service_fetchPromise);
121
+ }
122
+ }
123
+ _a = Slip44Service, _Slip44Service_fetchChainData = async function _Slip44Service_fetchChainData() {
124
+ if (__classPrivateFieldGet(this, _a, "f", _Slip44Service_chainIdCache) !== null) {
125
+ return;
126
+ }
127
+ // Avoid duplicate fetches
128
+ if (__classPrivateFieldGet(this, _a, "f", _Slip44Service_fetchPromise)) {
129
+ await __classPrivateFieldGet(this, _a, "f", _Slip44Service_fetchPromise);
130
+ return;
131
+ }
132
+ __classPrivateFieldSet(this, _a, (async () => {
133
+ try {
134
+ const chains = await fetchWithErrorHandling({
135
+ url: CHAINID_NETWORK_URL,
136
+ timeout: 10000,
137
+ });
138
+ if (chains && Array.isArray(chains)) {
139
+ __classPrivateFieldSet(this, _a, new Map(chains
140
+ .filter((chain) => chain.slip44 !== undefined)
141
+ .map((chain) => [chain.chainId, chain.slip44])), "f", _Slip44Service_chainIdCache);
142
+ }
143
+ else {
144
+ // Invalid response, initialize empty cache
145
+ __classPrivateFieldSet(this, _a, new Map(), "f", _Slip44Service_chainIdCache);
146
+ }
147
+ }
148
+ catch {
149
+ // Network failed, initialize empty cache so we fall back to symbol lookup
150
+ __classPrivateFieldSet(this, _a, new Map(), "f", _Slip44Service_chainIdCache);
151
+ }
152
+ })(), "f", _Slip44Service_fetchPromise);
153
+ await __classPrivateFieldGet(this, _a, "f", _Slip44Service_fetchPromise);
154
+ __classPrivateFieldSet(this, _a, null, "f", _Slip44Service_fetchPromise);
155
+ };
156
+ /**
157
+ * Cache for chainId to slip44 lookups from chainid.network.
158
+ */
159
+ _Slip44Service_chainIdCache = { value: null };
160
+ /**
161
+ * Whether a fetch is currently in progress.
162
+ */
163
+ _Slip44Service_fetchPromise = { value: null };
164
+ /**
165
+ * Cache for symbol to slip44 index lookups.
166
+ * This avoids iterating through all entries on repeated lookups.
167
+ */
168
+ _Slip44Service_symbolCache = { value: new Map() };
169
+ //# 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;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAC7B,OAAe,EACf,MAAe;QAEf,8BAA8B;QAC9B,MAAM,uBAAA,IAAI,yCAAgB,MAApB,IAAI,CAAkB,CAAC;QAE7B,4BAA4B;QAC5B,MAAM,MAAM,GAAG,uBAAA,IAAI,u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AG,EAAE,mCAAA,CAAC;QACjC,CAAC;IACH,CAAC,CAAC,EAAE,mCAAA,CAAC;IAEL,MAAM,uBAAA,IAAI,uCAAc,CAAC;IACzB,uBAAA,IAAI,MAAiB,IAAI,mCAAA,CAAC;AAC5B,CAAC;AA5DD;;GAEG;AACI,uCAA4C,IAAI,EAAnC,CAAoC;AAExD;;GAEG;AACI,uCAAsC,IAAI,EAA7B,CAA8B;AAElD;;;GAGG;AACa,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. `getSlip44ByChainId` - Primary method using chainid.network data (recommended)\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 getSlip44ByChainId.\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 a given EVM chain ID.\n *\n * This method first checks chainid.network data (which maps chainId directly\n * to slip44), then falls back to symbol lookup if not found.\n *\n * @param chainId - The EVM chain ID (e.g., 1 for Ethereum, 56 for BNB Chain)\n * @param symbol - Optional symbol for fallback lookup (e.g., 'ETH', 'BNB')\n * @returns The SLIP-44 coin type number, or undefined if not found\n * @example\n * ```typescript\n * const ethCoinType = await Slip44Service.getSlip44ByChainId(1);\n * // Returns 60\n *\n * const bnbCoinType = await Slip44Service.getSlip44ByChainId(56);\n * // Returns 714\n * ```\n */\n static async getSlip44ByChainId(\n chainId: number,\n symbol?: string,\n ): Promise<number | undefined> {\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 // Fall back to symbol lookup if provided\n if (symbol) {\n return this.getSlip44BySymbol(symbol);\n }\n\n return undefined;\n }\n\n /**\n * Gets the SLIP-44 coin type identifier for a given network symbol.\n *\n * Note: Symbol lookup may return incorrect results for duplicate symbols\n * (e.g., CPC is both CPChain and Capricoin). For EVM networks, prefer\n * using getSlip44ByChainId instead.\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 * Gets the SLIP-44 entry for a given coin type index.\n *\n * @param index - The SLIP-44 coin type index (e.g., 60 for ETH, 0 for BTC)\n * @returns The SLIP-44 entry with metadata, or undefined if not found\n */\n static getSlip44Entry(index: number): Slip44Entry | undefined {\n const slip44Data = slip44 as Slip44Data;\n return slip44Data[index.toString()];\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,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSlip44ByChainId = exports.getSlip44BySymbol = 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
+ exports.getSlip44BySymbol = Slip44Service_1.Slip44Service.getSlip44BySymbol.bind(Slip44Service_1.Slip44Service);
8
+ exports.getSlip44ByChainId = Slip44Service_1.Slip44Service.getSlip44ByChainId.bind(Slip44Service_1.Slip44Service);
9
+ //# 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;AAGtB,mEAAmE;AACtD,QAAA,iBAAiB,GAC5B,6BAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,6BAAa,CAAC,CAAC;AACzC,QAAA,kBAAkB,GAC7B,6BAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,6BAAa,CAAC,CAAC","sourcesContent":["import { Slip44Service } from './Slip44Service';\n\nexport { Slip44Service };\nexport type { Slip44Entry } from './Slip44Service';\n\n// Re-export static methods as standalone functions for convenience\nexport const getSlip44BySymbol =\n Slip44Service.getSlip44BySymbol.bind(Slip44Service);\nexport const getSlip44ByChainId =\n Slip44Service.getSlip44ByChainId.bind(Slip44Service);\n"]}
@@ -0,0 +1,6 @@
1
+ import { Slip44Service } from "./Slip44Service.cjs";
2
+ export { Slip44Service };
3
+ export type { Slip44Entry } from "./Slip44Service.cjs";
4
+ export declare const getSlip44BySymbol: typeof Slip44Service.getSlip44BySymbol;
5
+ export declare const getSlip44ByChainId: typeof Slip44Service.getSlip44ByChainId;
6
+ //# 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;AACzB,YAAY,EAAE,WAAW,EAAE,4BAAwB;AAGnD,eAAO,MAAM,iBAAiB,wCACuB,CAAC;AACtD,eAAO,MAAM,kBAAkB,yCACuB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Slip44Service } from "./Slip44Service.mjs";
2
+ export { Slip44Service };
3
+ export type { Slip44Entry } from "./Slip44Service.mjs";
4
+ export declare const getSlip44BySymbol: typeof Slip44Service.getSlip44BySymbol;
5
+ export declare const getSlip44ByChainId: typeof Slip44Service.getSlip44ByChainId;
6
+ //# 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;AACzB,YAAY,EAAE,WAAW,EAAE,4BAAwB;AAGnD,eAAO,MAAM,iBAAiB,wCACuB,CAAC;AACtD,eAAO,MAAM,kBAAkB,yCACuB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Slip44Service } from "./Slip44Service.mjs";
2
+ export { Slip44Service };
3
+ // Re-export static methods as standalone functions for convenience
4
+ export const getSlip44BySymbol = Slip44Service.getSlip44BySymbol.bind(Slip44Service);
5
+ export const getSlip44ByChainId = Slip44Service.getSlip44ByChainId.bind(Slip44Service);
6
+ //# 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;AAGzB,mEAAmE;AACnE,MAAM,CAAC,MAAM,iBAAiB,GAC5B,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,kBAAkB,GAC7B,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { Slip44Service } from './Slip44Service';\n\nexport { Slip44Service };\nexport type { Slip44Entry } from './Slip44Service';\n\n// Re-export static methods as standalone functions for convenience\nexport const getSlip44BySymbol =\n Slip44Service.getSlip44BySymbol.bind(Slip44Service);\nexport const getSlip44ByChainId =\n Slip44Service.getSlip44ByChainId.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-821afcb8",
3
+ "version": "4.0.0-preview-0c691324",
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"