@metamask-previews/controller-utils 12.3.0-preview-b13d916 → 12.3.0-preview-4f4c98e

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 (83) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{abi.d.mts → abi.d.ts} +3 -3
  3. package/dist/abi.d.ts.map +1 -0
  4. package/dist/{abi.mjs → abi.js} +3 -3
  5. package/dist/{abi.mjs.map → abi.js.map} +1 -1
  6. package/dist/{constants.d.cts → constants.d.ts} +3 -3
  7. package/dist/constants.d.ts.map +1 -0
  8. package/dist/{constants.mjs → constants.js} +2 -2
  9. package/dist/constants.js.map +1 -0
  10. package/dist/{create-service-policy.d.mts → create-service-policy.d.ts} +3 -3
  11. package/dist/create-service-policy.d.ts.map +1 -0
  12. package/dist/{create-service-policy.mjs → create-service-policy.js} +3 -3
  13. package/dist/create-service-policy.js.map +1 -0
  14. package/dist/{index.d.cts → index.d.ts} +9 -9
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/{index.mjs → index.js} +7 -7
  17. package/dist/index.js.map +1 -0
  18. package/dist/logger.d.ts +4 -0
  19. package/dist/logger.d.ts.map +1 -0
  20. package/dist/logger.js +4 -0
  21. package/dist/logger.js.map +1 -0
  22. package/dist/{siwe.d.mts → siwe.d.ts} +2 -2
  23. package/dist/siwe.d.ts.map +1 -0
  24. package/dist/{siwe.mjs → siwe.js} +4 -4
  25. package/dist/siwe.js.map +1 -0
  26. package/dist/{types.d.mts → types.d.ts} +98 -98
  27. package/dist/types.d.ts.map +1 -0
  28. package/dist/{types.mjs → types.js} +1 -1
  29. package/dist/types.js.map +1 -0
  30. package/dist/{util.d.cts → util.d.ts} +6 -6
  31. package/dist/util.d.ts.map +1 -0
  32. package/dist/{util.mjs → util.js} +8 -18
  33. package/dist/util.js.map +1 -0
  34. package/package.json +14 -18
  35. package/dist/abi.cjs +0 -58
  36. package/dist/abi.cjs.map +0 -1
  37. package/dist/abi.d.cts +0 -16
  38. package/dist/abi.d.cts.map +0 -1
  39. package/dist/abi.d.mts.map +0 -1
  40. package/dist/constants.cjs +0 -308
  41. package/dist/constants.cjs.map +0 -1
  42. package/dist/constants.d.cts.map +0 -1
  43. package/dist/constants.d.mts +0 -283
  44. package/dist/constants.d.mts.map +0 -1
  45. package/dist/constants.mjs.map +0 -1
  46. package/dist/create-service-policy.cjs +0 -250
  47. package/dist/create-service-policy.cjs.map +0 -1
  48. package/dist/create-service-policy.d.cts +0 -249
  49. package/dist/create-service-policy.d.cts.map +0 -1
  50. package/dist/create-service-policy.d.mts.map +0 -1
  51. package/dist/create-service-policy.mjs.map +0 -1
  52. package/dist/index.cjs +0 -102
  53. package/dist/index.cjs.map +0 -1
  54. package/dist/index.d.cts.map +0 -1
  55. package/dist/index.d.mts +0 -9
  56. package/dist/index.d.mts.map +0 -1
  57. package/dist/index.mjs.map +0 -1
  58. package/dist/logger.cjs +0 -7
  59. package/dist/logger.cjs.map +0 -1
  60. package/dist/logger.d.cts +0 -5
  61. package/dist/logger.d.cts.map +0 -1
  62. package/dist/logger.d.mts +0 -5
  63. package/dist/logger.d.mts.map +0 -1
  64. package/dist/logger.mjs +0 -4
  65. package/dist/logger.mjs.map +0 -1
  66. package/dist/siwe.cjs +0 -131
  67. package/dist/siwe.cjs.map +0 -1
  68. package/dist/siwe.d.cts +0 -69
  69. package/dist/siwe.d.cts.map +0 -1
  70. package/dist/siwe.d.mts.map +0 -1
  71. package/dist/siwe.mjs.map +0 -1
  72. package/dist/types.cjs +0 -232
  73. package/dist/types.cjs.map +0 -1
  74. package/dist/types.d.cts +0 -267
  75. package/dist/types.d.cts.map +0 -1
  76. package/dist/types.d.mts.map +0 -1
  77. package/dist/types.mjs.map +0 -1
  78. package/dist/util.cjs +0 -569
  79. package/dist/util.cjs.map +0 -1
  80. package/dist/util.d.cts.map +0 -1
  81. package/dist/util.d.mts +0 -261
  82. package/dist/util.d.mts.map +0 -1
  83. package/dist/util.mjs.map +0 -1
package/dist/abi.d.cts DELETED
@@ -1,16 +0,0 @@
1
- import { Interface } from "@ethersproject/abi";
2
- import type { Hex } from "@metamask/utils";
3
- /**
4
- * Encode the data required for a function call.
5
- *
6
- * Note: This uses `@ethersproject/abi` under the hood, but for improved
7
- * performance, does not verify checksums of addresses. Make sure addresses
8
- * passed to this function are valid and checksummed if necessary.
9
- *
10
- * @param abi - The ABI instance.
11
- * @param functionName - The function name.
12
- * @param values - The parameters to encode.
13
- * @returns The encoded data for the function call in hexadecimal.
14
- */
15
- export declare function encodeFunctionData(abi: Interface, functionName: string, values: unknown[]): Hex;
16
- //# sourceMappingURL=abi.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"abi.d.cts","sourceRoot":"","sources":["../src/abi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,SAAS,EAAa,2BAA2B;AAQpE,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAoD3C;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,SAAS,EACd,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,OAAO,EAAE,GAChB,GAAG,CAKL"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"abi.d.mts","sourceRoot":"","sources":["../src/abi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,SAAS,EAAa,2BAA2B;AAQpE,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAoD3C;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,SAAS,EACd,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,OAAO,EAAE,GAChB,GAAG,CAKL"}
@@ -1,308 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CHAIN_IDS_WITH_NO_NATIVE_TOKEN = exports.DAYS = exports.DAY = exports.HOURS = exports.HOUR = exports.MINUTES = exports.MINUTE = exports.SECONDS = exports.SECOND = exports.CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP = exports.ApprovalType = exports.ORIGIN_METAMASK = exports.NFT_API_TIMEOUT = exports.NFT_API_VERSION = exports.NFT_API_BASE_URL = exports.OPENSEA_PROXY_URL = exports.NETWORKS_BYPASSING_VALIDATION = exports.BUILT_IN_NETWORKS = exports.BUILT_IN_CUSTOM_NETWORKS_RPC = exports.TESTNET_TICKER_SYMBOLS = exports.ASSET_TYPES = exports.GWEI = exports.ERC1155_TOKEN_RECEIVER_INTERFACE_ID = exports.ERC1155_METADATA_URI_INTERFACE_ID = exports.ERC1155_INTERFACE_ID = exports.ERC721_ENUMERABLE_INTERFACE_ID = exports.ERC721_METADATA_INTERFACE_ID = exports.ERC721_INTERFACE_ID = exports.ERC20 = exports.ERC1155 = exports.ERC721 = exports.MAX_SAFE_CHAIN_ID = exports.GANACHE_CHAIN_ID = exports.IPFS_DEFAULT_GATEWAY_URL = exports.FALL_BACK_VS_CURRENCY = exports.RPC = void 0;
4
- const types_js_1 = require("./types.cjs");
5
- exports.RPC = 'rpc';
6
- exports.FALL_BACK_VS_CURRENCY = 'ETH';
7
- exports.IPFS_DEFAULT_GATEWAY_URL = 'https://cloudflare-ipfs.com/ipfs/';
8
- // NETWORKS ID
9
- // `toHex` not invoked to avoid cyclic dependency
10
- exports.GANACHE_CHAIN_ID = '0x539'; // toHex(1337)
11
- /**
12
- * The largest possible chain ID we can handle.
13
- * Explanation: https://gist.github.com/rekmarks/a47bd5f2525936c4b8eee31a16345553
14
- */
15
- exports.MAX_SAFE_CHAIN_ID = 4503599627370476;
16
- // TOKEN STANDARDS
17
- exports.ERC721 = 'ERC721';
18
- exports.ERC1155 = 'ERC1155';
19
- exports.ERC20 = 'ERC20';
20
- // TOKEN INTERFACE IDS
21
- exports.ERC721_INTERFACE_ID = '0x80ac58cd';
22
- exports.ERC721_METADATA_INTERFACE_ID = '0x5b5e139f';
23
- exports.ERC721_ENUMERABLE_INTERFACE_ID = '0x780e9d63';
24
- exports.ERC1155_INTERFACE_ID = '0xd9b67a26';
25
- exports.ERC1155_METADATA_URI_INTERFACE_ID = '0x0e89341c';
26
- exports.ERC1155_TOKEN_RECEIVER_INTERFACE_ID = '0x4e2312e0';
27
- // UNITS
28
- exports.GWEI = 'gwei';
29
- // ASSET TYPES
30
- exports.ASSET_TYPES = {
31
- NATIVE: 'NATIVE',
32
- TOKEN: 'TOKEN',
33
- NFT: 'NFT',
34
- UNKNOWN: 'UNKNOWN',
35
- };
36
- // TICKER SYMBOLS
37
- exports.TESTNET_TICKER_SYMBOLS = {
38
- GOERLI: 'GoerliETH',
39
- SEPOLIA: 'SepoliaETH',
40
- LINEA_GOERLI: 'LineaETH',
41
- LINEA_SEPOLIA: 'LineaETH',
42
- MEGAETH_TESTNET: 'MegaETH',
43
- MEGAETH_TESTNET_V2: 'MegaETH',
44
- };
45
- /**
46
- * Map of all built-in custom networks to their RPC endpoints.
47
- */
48
- exports.BUILT_IN_CUSTOM_NETWORKS_RPC = {
49
- /**
50
- * @deprecated Please use `megaeth-testnet` instead.
51
- */
52
- MEGAETH_TESTNET: 'https://carrot.megaeth.com/rpc',
53
- /**
54
- * @deprecated Please use `megaeth-testnet-v2` instead.
55
- */
56
- 'megaeth-testnet': 'https://carrot.megaeth.com/rpc',
57
- 'megaeth-testnet-v2': 'https://carrot.megaeth.com/rpc',
58
- 'monad-testnet': 'https://testnet-rpc.monad.xyz',
59
- };
60
- /**
61
- * Map of all build-in Infura networks to their network, ticker and chain IDs.
62
- */
63
- exports.BUILT_IN_NETWORKS = {
64
- [types_js_1.NetworkType.goerli]: {
65
- chainId: types_js_1.ChainId.goerli,
66
- ticker: types_js_1.NetworksTicker.goerli,
67
- rpcPrefs: {
68
- blockExplorerUrl: types_js_1.BlockExplorerUrl.goerli,
69
- },
70
- },
71
- [types_js_1.NetworkType.sepolia]: {
72
- chainId: types_js_1.ChainId.sepolia,
73
- ticker: types_js_1.NetworksTicker.sepolia,
74
- rpcPrefs: {
75
- blockExplorerUrl: types_js_1.BlockExplorerUrl.sepolia,
76
- },
77
- },
78
- [types_js_1.NetworkType.mainnet]: {
79
- chainId: types_js_1.ChainId.mainnet,
80
- ticker: types_js_1.NetworksTicker.mainnet,
81
- rpcPrefs: {
82
- blockExplorerUrl: types_js_1.BlockExplorerUrl.mainnet,
83
- },
84
- },
85
- [types_js_1.NetworkType['linea-goerli']]: {
86
- chainId: types_js_1.ChainId['linea-goerli'],
87
- ticker: types_js_1.NetworksTicker['linea-goerli'],
88
- rpcPrefs: {
89
- blockExplorerUrl: types_js_1.BlockExplorerUrl['linea-goerli'],
90
- },
91
- },
92
- [types_js_1.NetworkType['linea-sepolia']]: {
93
- chainId: types_js_1.ChainId['linea-sepolia'],
94
- ticker: types_js_1.NetworksTicker['linea-sepolia'],
95
- rpcPrefs: {
96
- blockExplorerUrl: types_js_1.BlockExplorerUrl['linea-sepolia'],
97
- },
98
- },
99
- [types_js_1.NetworkType['linea-mainnet']]: {
100
- chainId: types_js_1.ChainId['linea-mainnet'],
101
- ticker: types_js_1.NetworksTicker['linea-mainnet'],
102
- rpcPrefs: {
103
- blockExplorerUrl: types_js_1.BlockExplorerUrl['linea-mainnet'],
104
- },
105
- },
106
- [types_js_1.NetworkType['megaeth-testnet']]: {
107
- chainId: types_js_1.ChainId['megaeth-testnet'],
108
- ticker: types_js_1.NetworksTicker['megaeth-testnet'],
109
- rpcPrefs: {
110
- blockExplorerUrl: types_js_1.BlockExplorerUrl['megaeth-testnet'],
111
- },
112
- },
113
- [types_js_1.NetworkType['megaeth-testnet-v2']]: {
114
- chainId: types_js_1.ChainId['megaeth-testnet-v2'],
115
- ticker: types_js_1.NetworksTicker['megaeth-testnet-v2'],
116
- rpcPrefs: {
117
- blockExplorerUrl: types_js_1.BlockExplorerUrl['megaeth-testnet-v2'],
118
- },
119
- },
120
- [types_js_1.NetworkType['monad-testnet']]: {
121
- chainId: types_js_1.ChainId['monad-testnet'],
122
- ticker: types_js_1.NetworksTicker['monad-testnet'],
123
- rpcPrefs: {
124
- blockExplorerUrl: types_js_1.BlockExplorerUrl['monad-testnet'],
125
- },
126
- },
127
- [types_js_1.NetworkType['base-mainnet']]: {
128
- chainId: types_js_1.ChainId['base-mainnet'],
129
- ticker: types_js_1.NetworksTicker['base-mainnet'],
130
- rpcPrefs: {
131
- blockExplorerUrl: types_js_1.BlockExplorerUrl['base-mainnet'],
132
- },
133
- },
134
- [types_js_1.NetworkType['arbitrum-mainnet']]: {
135
- chainId: types_js_1.ChainId['arbitrum-mainnet'],
136
- ticker: types_js_1.NetworksTicker['arbitrum-mainnet'],
137
- rpcPrefs: {
138
- blockExplorerUrl: types_js_1.BlockExplorerUrl['arbitrum-mainnet'],
139
- },
140
- },
141
- [types_js_1.NetworkType['bsc-mainnet']]: {
142
- chainId: types_js_1.ChainId['bsc-mainnet'],
143
- ticker: types_js_1.NetworksTicker['bsc-mainnet'],
144
- rpcPrefs: {
145
- blockExplorerUrl: types_js_1.BlockExplorerUrl['bsc-mainnet'],
146
- },
147
- },
148
- [types_js_1.NetworkType['optimism-mainnet']]: {
149
- chainId: types_js_1.ChainId['optimism-mainnet'],
150
- ticker: types_js_1.NetworksTicker['optimism-mainnet'],
151
- rpcPrefs: {
152
- blockExplorerUrl: types_js_1.BlockExplorerUrl['optimism-mainnet'],
153
- },
154
- },
155
- [types_js_1.NetworkType['polygon-mainnet']]: {
156
- chainId: types_js_1.ChainId['polygon-mainnet'],
157
- ticker: types_js_1.NetworksTicker['polygon-mainnet'],
158
- rpcPrefs: {
159
- blockExplorerUrl: types_js_1.BlockExplorerUrl['polygon-mainnet'],
160
- },
161
- },
162
- [types_js_1.NetworkType['sei-mainnet']]: {
163
- chainId: types_js_1.ChainId['sei-mainnet'],
164
- ticker: types_js_1.NetworksTicker['sei-mainnet'],
165
- rpcPrefs: {
166
- blockExplorerUrl: types_js_1.BlockExplorerUrl['sei-mainnet'],
167
- },
168
- },
169
- [types_js_1.NetworkType['monad-mainnet']]: {
170
- chainId: types_js_1.ChainId['monad-mainnet'],
171
- ticker: types_js_1.NetworksTicker['monad-mainnet'],
172
- rpcPrefs: {
173
- blockExplorerUrl: types_js_1.BlockExplorerUrl['monad-mainnet'],
174
- },
175
- },
176
- [types_js_1.NetworkType['zksync-mainnet']]: {
177
- chainId: types_js_1.ChainId['zksync-mainnet'],
178
- ticker: types_js_1.NetworksTicker['zksync-mainnet'],
179
- rpcPrefs: {
180
- blockExplorerUrl: types_js_1.BlockExplorerUrl['zksync-mainnet'],
181
- },
182
- },
183
- [types_js_1.NetworkType['megaeth-mainnet']]: {
184
- chainId: types_js_1.ChainId['megaeth-mainnet'],
185
- ticker: types_js_1.NetworksTicker['megaeth-mainnet'],
186
- rpcPrefs: {
187
- blockExplorerUrl: types_js_1.BlockExplorerUrl['megaeth-mainnet'],
188
- },
189
- },
190
- [types_js_1.NetworkType['avalanche-mainnet']]: {
191
- chainId: types_js_1.ChainId['avalanche-mainnet'],
192
- ticker: types_js_1.NetworksTicker['avalanche-mainnet'],
193
- rpcPrefs: {
194
- blockExplorerUrl: types_js_1.BlockExplorerUrl['avalanche-mainnet'],
195
- },
196
- },
197
- [types_js_1.NetworkType.rpc]: {
198
- chainId: undefined,
199
- blockExplorerUrl: undefined,
200
- ticker: undefined,
201
- rpcPrefs: undefined,
202
- },
203
- };
204
- /**
205
- * When a user adds a custom network to MetaMask, we perform some basic
206
- * validations on the network. For instance, usually a network cannot share the
207
- * same chain as another. In some cases, however, we want to allow networks that
208
- * would normally be invalid. This mapping contains networks that should bypass
209
- * validation.
210
- */
211
- exports.NETWORKS_BYPASSING_VALIDATION = {
212
- // HyperEVM uses the same chain ID as Wanchain
213
- '0x3e7': {
214
- name: 'HyperEVM',
215
- symbol: 'HYPE',
216
- rpcUrl: 'https://rpc.hyperliquid.xyz',
217
- },
218
- };
219
- // APIs
220
- exports.OPENSEA_PROXY_URL = 'https://proxy.api.cx.metamask.io/opensea/v1/api/v2';
221
- exports.NFT_API_BASE_URL = 'https://nft.api.cx.metamask.io';
222
- exports.NFT_API_VERSION = '1';
223
- exports.NFT_API_TIMEOUT = 15000;
224
- // Default origin for controllers
225
- exports.ORIGIN_METAMASK = 'metamask';
226
- /**
227
- * Approval request types for various operations.
228
- * These types are used by different controllers to create and manage
229
- * approval requests consistently.
230
- */
231
- var ApprovalType;
232
- (function (ApprovalType) {
233
- ApprovalType["AddEthereumChain"] = "wallet_addEthereumChain";
234
- ApprovalType["ConnectAccounts"] = "connect_accounts";
235
- ApprovalType["EthDecrypt"] = "eth_decrypt";
236
- ApprovalType["EthGetEncryptionPublicKey"] = "eth_getEncryptionPublicKey";
237
- ApprovalType["EthSignTypedData"] = "eth_signTypedData";
238
- ApprovalType["PersonalSign"] = "personal_sign";
239
- ApprovalType["ResultError"] = "result_error";
240
- ApprovalType["ResultSuccess"] = "result_success";
241
- ApprovalType["SnapDialogAlert"] = "snap_dialog:alert";
242
- ApprovalType["SnapDialogConfirmation"] = "snap_dialog:confirmation";
243
- ApprovalType["SnapDialogPrompt"] = "snap_dialog:prompt";
244
- ApprovalType["SnapDialogDefault"] = "snap_dialog";
245
- ApprovalType["SwitchEthereumChain"] = "wallet_switchEthereumChain";
246
- ApprovalType["Transaction"] = "transaction";
247
- ApprovalType["TransactionBatch"] = "transaction_batch";
248
- ApprovalType["Unlock"] = "unlock";
249
- ApprovalType["WalletConnect"] = "wallet_connect";
250
- ApprovalType["WalletRequestPermissions"] = "wallet_requestPermissions";
251
- ApprovalType["WatchAsset"] = "wallet_watchAsset";
252
- })(ApprovalType || (exports.ApprovalType = ApprovalType = {}));
253
- /**
254
- * Mapping of chain IDs to their network names for ENS functionality.
255
- * Note: MegaETH-testnet is intentionally excluded from this mapping as it doesn't support ENS.
256
- */
257
- exports.CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP = {
258
- [types_js_1.ChainId.goerli]: types_js_1.BuiltInNetworkName.Goerli,
259
- [types_js_1.ChainId.sepolia]: types_js_1.BuiltInNetworkName.Sepolia,
260
- [types_js_1.ChainId.mainnet]: types_js_1.BuiltInNetworkName.Mainnet,
261
- [types_js_1.ChainId['linea-goerli']]: types_js_1.BuiltInNetworkName.LineaGoerli,
262
- [types_js_1.ChainId['linea-sepolia']]: types_js_1.BuiltInNetworkName.LineaSepolia,
263
- [types_js_1.ChainId['linea-mainnet']]: types_js_1.BuiltInNetworkName.LineaMainnet,
264
- [types_js_1.ChainId.aurora]: types_js_1.BuiltInNetworkName.Aurora,
265
- };
266
- /**
267
- * The number of milliseconds in a second.
268
- */
269
- exports.SECOND = 1000;
270
- /**
271
- * The number of milliseconds in a second.
272
- */
273
- exports.SECONDS = exports.SECOND;
274
- /**
275
- * The number of milliseconds in a minute.
276
- */
277
- exports.MINUTE = exports.SECONDS * 60;
278
- /**
279
- * The number of milliseconds in a minute.
280
- */
281
- exports.MINUTES = exports.MINUTE;
282
- /**
283
- * The number of milliseconds in a hour.
284
- */
285
- exports.HOUR = exports.MINUTES * 60;
286
- /**
287
- * The number of milliseconds in a hour.
288
- */
289
- exports.HOURS = exports.HOUR;
290
- /**
291
- * The number of milliseconds in a day.
292
- */
293
- exports.DAY = exports.HOURS * 24;
294
- /**
295
- * The number of milliseconds in a day.
296
- */
297
- exports.DAYS = exports.DAY;
298
- /**
299
- * Special "EVM-ish" chains with no native tokens.
300
- * Created for Tempo, but can be extended to others.
301
- * - For hidding the native token from the token list and Send list.
302
- * - For excluding the native token from the total wallet value calculation.
303
- */
304
- exports.CHAIN_IDS_WITH_NO_NATIVE_TOKEN = [
305
- 'eip155:42431', // Tempo Testnet
306
- 'eip155:4217', // Tempo Mainnet
307
- ];
308
- //# sourceMappingURL=constants.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,0CAMoB;AAEP,QAAA,GAAG,GAAG,KAAK,CAAC;AACZ,QAAA,qBAAqB,GAAG,KAAK,CAAC;AAC9B,QAAA,wBAAwB,GAAG,mCAAmC,CAAC;AAE5E,cAAc;AACd,iDAAiD;AAC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AoBvB;AAED;;;GAGG;AACU,QAAA,mCAAmC,GAG5C;IACF,CAAC,kBAAO,CAAC,MAAM,CAAC,EAAE,6BAAkB,CAAC,MAAM;IAC3C,CAAC,kBAAO,CAAC,OAAO,CAAC,EAAE,6BAAkB,CAAC,OAAO;IAC7C,CAAC,kBAAO,CAAC,OAAO,CAAC,EAAE,6BAAkB,CAAC,OAAO;IAC7C,CAAC,kBAAO,CAAC,cAAc,CAAC,CAAC,EAAE,6BAAkB,CAAC,WAAW;IACzD,CAAC,kBAAO,CAAC,eAAe,CAAC,CAAC,EAAE,6BAAkB,CAAC,YAAY;IAC3D,CAAC,kBAAO,CAAC,eAAe,CAAC,CAAC,EAAE,6BAAkB,CAAC,YAAY;IAC3D,CAAC,kBAAO,CAAC,MAAM,CAAC,EAAE,6BAAkB,CAAC,MAAM;CAC5C,CAAC;AAEF;;GAEG;AACU,QAAA,MAAM,GAAG,IAAI,CAAC;AAE3B;;GAEG;AACU,QAAA,OAAO,GAAG,cAAM,CAAC;AAE9B;;GAEG;AACU,QAAA,MAAM,GAAG,eAAO,GAAG,EAAE,CAAC;AAEnC;;GAEG;AACU,QAAA,OAAO,GAAG,cAAM,CAAC;AAE9B;;GAEG;AACU,QAAA,IAAI,GAAG,eAAO,GAAG,EAAE,CAAC;AAEjC;;GAEG;AACU,QAAA,KAAK,GAAG,YAAI,CAAC;AAE1B;;GAEG;AACU,QAAA,GAAG,GAAG,aAAK,GAAG,EAAE,CAAC;AAE9B;;GAEG;AACU,QAAA,IAAI,GAAG,WAAG,CAAC;AAExB;;;;;GAKG;AACU,QAAA,8BAA8B,GAAG;IAC5C,cAAc,EAAE,gBAAgB;IAChC,aAAa,EAAE,gBAAgB;CACvB,CAAC","sourcesContent":["import {\n NetworkType,\n NetworksTicker,\n ChainId,\n BuiltInNetworkName,\n BlockExplorerUrl,\n} from './types.js';\n\nexport const RPC = 'rpc';\nexport const FALL_BACK_VS_CURRENCY = 'ETH';\nexport const IPFS_DEFAULT_GATEWAY_URL = 'https://cloudflare-ipfs.com/ipfs/';\n\n// NETWORKS ID\n// `toHex` not invoked to avoid cyclic dependency\nexport const GANACHE_CHAIN_ID = '0x539'; // toHex(1337)\n/**\n * The largest possible chain ID we can handle.\n * Explanation: https://gist.github.com/rekmarks/a47bd5f2525936c4b8eee31a16345553\n */\nexport const MAX_SAFE_CHAIN_ID = 4503599627370476;\n\n// TOKEN STANDARDS\nexport const ERC721 = 'ERC721';\nexport const ERC1155 = 'ERC1155';\nexport const ERC20 = 'ERC20';\n\n// TOKEN INTERFACE IDS\nexport const ERC721_INTERFACE_ID = '0x80ac58cd';\nexport const ERC721_METADATA_INTERFACE_ID = '0x5b5e139f';\nexport const ERC721_ENUMERABLE_INTERFACE_ID = '0x780e9d63';\nexport const ERC1155_INTERFACE_ID = '0xd9b67a26';\nexport const ERC1155_METADATA_URI_INTERFACE_ID = '0x0e89341c';\nexport const ERC1155_TOKEN_RECEIVER_INTERFACE_ID = '0x4e2312e0';\n\n// UNITS\nexport const GWEI = 'gwei';\n\n// ASSET TYPES\nexport const ASSET_TYPES = {\n NATIVE: 'NATIVE',\n TOKEN: 'TOKEN',\n NFT: 'NFT',\n UNKNOWN: 'UNKNOWN',\n};\n\n// TICKER SYMBOLS\nexport const TESTNET_TICKER_SYMBOLS = {\n GOERLI: 'GoerliETH',\n SEPOLIA: 'SepoliaETH',\n LINEA_GOERLI: 'LineaETH',\n LINEA_SEPOLIA: 'LineaETH',\n MEGAETH_TESTNET: 'MegaETH',\n MEGAETH_TESTNET_V2: 'MegaETH',\n};\n\n/**\n * Map of all built-in custom networks to their RPC endpoints.\n */\nexport const BUILT_IN_CUSTOM_NETWORKS_RPC = {\n /**\n * @deprecated Please use `megaeth-testnet` instead.\n */\n MEGAETH_TESTNET: 'https://carrot.megaeth.com/rpc',\n /**\n * @deprecated Please use `megaeth-testnet-v2` instead.\n */\n 'megaeth-testnet': 'https://carrot.megaeth.com/rpc',\n 'megaeth-testnet-v2': 'https://carrot.megaeth.com/rpc',\n 'monad-testnet': 'https://testnet-rpc.monad.xyz',\n};\n\n/**\n * Map of all build-in Infura networks to their network, ticker and chain IDs.\n */\nexport const BUILT_IN_NETWORKS = {\n [NetworkType.goerli]: {\n chainId: ChainId.goerli,\n ticker: NetworksTicker.goerli,\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl.goerli,\n },\n },\n [NetworkType.sepolia]: {\n chainId: ChainId.sepolia,\n ticker: NetworksTicker.sepolia,\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl.sepolia,\n },\n },\n [NetworkType.mainnet]: {\n chainId: ChainId.mainnet,\n ticker: NetworksTicker.mainnet,\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl.mainnet,\n },\n },\n [NetworkType['linea-goerli']]: {\n chainId: ChainId['linea-goerli'],\n ticker: NetworksTicker['linea-goerli'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['linea-goerli'],\n },\n },\n [NetworkType['linea-sepolia']]: {\n chainId: ChainId['linea-sepolia'],\n ticker: NetworksTicker['linea-sepolia'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['linea-sepolia'],\n },\n },\n [NetworkType['linea-mainnet']]: {\n chainId: ChainId['linea-mainnet'],\n ticker: NetworksTicker['linea-mainnet'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['linea-mainnet'],\n },\n },\n [NetworkType['megaeth-testnet']]: {\n chainId: ChainId['megaeth-testnet'],\n ticker: NetworksTicker['megaeth-testnet'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['megaeth-testnet'],\n },\n },\n [NetworkType['megaeth-testnet-v2']]: {\n chainId: ChainId['megaeth-testnet-v2'],\n ticker: NetworksTicker['megaeth-testnet-v2'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['megaeth-testnet-v2'],\n },\n },\n [NetworkType['monad-testnet']]: {\n chainId: ChainId['monad-testnet'],\n ticker: NetworksTicker['monad-testnet'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['monad-testnet'],\n },\n },\n [NetworkType['base-mainnet']]: {\n chainId: ChainId['base-mainnet'],\n ticker: NetworksTicker['base-mainnet'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['base-mainnet'],\n },\n },\n [NetworkType['arbitrum-mainnet']]: {\n chainId: ChainId['arbitrum-mainnet'],\n ticker: NetworksTicker['arbitrum-mainnet'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['arbitrum-mainnet'],\n },\n },\n [NetworkType['bsc-mainnet']]: {\n chainId: ChainId['bsc-mainnet'],\n ticker: NetworksTicker['bsc-mainnet'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['bsc-mainnet'],\n },\n },\n [NetworkType['optimism-mainnet']]: {\n chainId: ChainId['optimism-mainnet'],\n ticker: NetworksTicker['optimism-mainnet'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['optimism-mainnet'],\n },\n },\n [NetworkType['polygon-mainnet']]: {\n chainId: ChainId['polygon-mainnet'],\n ticker: NetworksTicker['polygon-mainnet'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['polygon-mainnet'],\n },\n },\n [NetworkType['sei-mainnet']]: {\n chainId: ChainId['sei-mainnet'],\n ticker: NetworksTicker['sei-mainnet'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['sei-mainnet'],\n },\n },\n [NetworkType['monad-mainnet']]: {\n chainId: ChainId['monad-mainnet'],\n ticker: NetworksTicker['monad-mainnet'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['monad-mainnet'],\n },\n },\n [NetworkType['zksync-mainnet']]: {\n chainId: ChainId['zksync-mainnet'],\n ticker: NetworksTicker['zksync-mainnet'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['zksync-mainnet'],\n },\n },\n [NetworkType['megaeth-mainnet']]: {\n chainId: ChainId['megaeth-mainnet'],\n ticker: NetworksTicker['megaeth-mainnet'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['megaeth-mainnet'],\n },\n },\n [NetworkType['avalanche-mainnet']]: {\n chainId: ChainId['avalanche-mainnet'],\n ticker: NetworksTicker['avalanche-mainnet'],\n rpcPrefs: {\n blockExplorerUrl: BlockExplorerUrl['avalanche-mainnet'],\n },\n },\n [NetworkType.rpc]: {\n chainId: undefined,\n blockExplorerUrl: undefined,\n ticker: undefined,\n rpcPrefs: undefined,\n },\n} as const;\n\n/**\n * When a user adds a custom network to MetaMask, we perform some basic\n * validations on the network. For instance, usually a network cannot share the\n * same chain as another. In some cases, however, we want to allow networks that\n * would normally be invalid. This mapping contains networks that should bypass\n * validation.\n */\nexport const NETWORKS_BYPASSING_VALIDATION = {\n // HyperEVM uses the same chain ID as Wanchain\n '0x3e7': {\n name: 'HyperEVM',\n symbol: 'HYPE',\n rpcUrl: 'https://rpc.hyperliquid.xyz',\n },\n};\n\n// APIs\nexport const OPENSEA_PROXY_URL =\n 'https://proxy.api.cx.metamask.io/opensea/v1/api/v2';\n\nexport const NFT_API_BASE_URL = 'https://nft.api.cx.metamask.io';\n\nexport const NFT_API_VERSION = '1';\n\nexport const NFT_API_TIMEOUT = 15000;\n\n// Default origin for controllers\nexport const ORIGIN_METAMASK = 'metamask';\n\n/**\n * Approval request types for various operations.\n * These types are used by different controllers to create and manage\n * approval requests consistently.\n */\nexport enum ApprovalType {\n AddEthereumChain = 'wallet_addEthereumChain',\n ConnectAccounts = 'connect_accounts',\n EthDecrypt = 'eth_decrypt',\n EthGetEncryptionPublicKey = 'eth_getEncryptionPublicKey',\n EthSignTypedData = 'eth_signTypedData',\n PersonalSign = 'personal_sign',\n ResultError = 'result_error',\n ResultSuccess = 'result_success',\n SnapDialogAlert = 'snap_dialog:alert',\n SnapDialogConfirmation = 'snap_dialog:confirmation',\n SnapDialogPrompt = 'snap_dialog:prompt',\n SnapDialogDefault = 'snap_dialog',\n SwitchEthereumChain = 'wallet_switchEthereumChain',\n Transaction = 'transaction',\n TransactionBatch = 'transaction_batch',\n Unlock = 'unlock',\n WalletConnect = 'wallet_connect',\n WalletRequestPermissions = 'wallet_requestPermissions',\n WatchAsset = 'wallet_watchAsset',\n}\n\n/**\n * Mapping of chain IDs to their network names for ENS functionality.\n * Note: MegaETH-testnet is intentionally excluded from this mapping as it doesn't support ENS.\n */\nexport const CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP: Record<\n string,\n BuiltInNetworkName\n> = {\n [ChainId.goerli]: BuiltInNetworkName.Goerli,\n [ChainId.sepolia]: BuiltInNetworkName.Sepolia,\n [ChainId.mainnet]: BuiltInNetworkName.Mainnet,\n [ChainId['linea-goerli']]: BuiltInNetworkName.LineaGoerli,\n [ChainId['linea-sepolia']]: BuiltInNetworkName.LineaSepolia,\n [ChainId['linea-mainnet']]: BuiltInNetworkName.LineaMainnet,\n [ChainId.aurora]: BuiltInNetworkName.Aurora,\n};\n\n/**\n * The number of milliseconds in a second.\n */\nexport const SECOND = 1000;\n\n/**\n * The number of milliseconds in a second.\n */\nexport const SECONDS = SECOND;\n\n/**\n * The number of milliseconds in a minute.\n */\nexport const MINUTE = SECONDS * 60;\n\n/**\n * The number of milliseconds in a minute.\n */\nexport const MINUTES = MINUTE;\n\n/**\n * The number of milliseconds in a hour.\n */\nexport const HOUR = MINUTES * 60;\n\n/**\n * The number of milliseconds in a hour.\n */\nexport const HOURS = HOUR;\n\n/**\n * The number of milliseconds in a day.\n */\nexport const DAY = HOURS * 24;\n\n/**\n * The number of milliseconds in a day.\n */\nexport const DAYS = DAY;\n\n/**\n * Special \"EVM-ish\" chains with no native tokens.\n * Created for Tempo, but can be extended to others.\n * - For hidding the native token from the token list and Send list.\n * - For excluding the native token from the total wallet value calculation.\n */\nexport const CHAIN_IDS_WITH_NO_NATIVE_TOKEN = [\n 'eip155:42431', // Tempo Testnet\n 'eip155:4217', // Tempo Mainnet\n] as const;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.cts","sour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E,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,eAAO,MAAM,eAAe,QAAQ,CAAC;AAGrC,eAAO,MAAM,eAAe,aAAa,CAAC;AAE1C;;;;GAIG;AACH,oBAAY,YAAY;IACtB,gBAAgB,4BAA4B;IAC5C,eAAe,qBAAqB;IACpC,UAAU,gBAAgB;IAC1B,yBAAyB,+BAA+B;IACxD,gBAAgB,sBAAsB;IACtC,YAAY,kBAAkB;IAC9B,WAAW,iBAAiB;IAC5B,aAAa,mBAAmB;IAChC,eAAe,sBAAsB;IACrC,sBAAsB,6BAA6B;IACnD,gBAAgB,uBAAuB;IACvC,iBAAiB,gBAAgB;IACjC,mBAAmB,+BAA+B;IAClD,WAAW,gBAAgB;IAC3B,gBAAgB,sBAAsB;IACtC,MAAM,WAAW;IACjB,aAAa,mBAAmB;IAChC,wBAAwB,8BAA8B;IACtD,UAAU,sBAAsB;CACjC;AAED;;;GAGG;AACH,eAAO,MAAM,mCAAmC,EAAE,MAAM,CACtD,MAAM,EACN,kBAAkB,CASnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,OAAO,CAAC;AAE3B;;GAEG;AACH,eAAO,MAAM,OAAO,OAAS,CAAC;AAE9B;;GAEG;AACH,eAAO,MAAM,MAAM,QAAe,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,OAAO,QAAS,CAAC;AAE9B;;GAEG;AACH,eAAO,MAAM,IAAI,QAAe,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,KAAK,QAAO,CAAC;AAE1B;;GAEG;AACH,eAAO,MAAM,GAAG,QAAa,CAAC;AAE9B;;GAEG;AACH,eAAO,MAAM,IAAI,QAAM,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,0CAGjC,CAAC"}
@@ -1,283 +0,0 @@
1
- import { NetworksTicker, BuiltInNetworkName } from "./types.mjs";
2
- export declare const RPC = "rpc";
3
- export declare const FALL_BACK_VS_CURRENCY = "ETH";
4
- export declare const IPFS_DEFAULT_GATEWAY_URL = "https://cloudflare-ipfs.com/ipfs/";
5
- export declare const GANACHE_CHAIN_ID = "0x539";
6
- /**
7
- * The largest possible chain ID we can handle.
8
- * Explanation: https://gist.github.com/rekmarks/a47bd5f2525936c4b8eee31a16345553
9
- */
10
- export declare const MAX_SAFE_CHAIN_ID = 4503599627370476;
11
- export declare const ERC721 = "ERC721";
12
- export declare const ERC1155 = "ERC1155";
13
- export declare const ERC20 = "ERC20";
14
- export declare const ERC721_INTERFACE_ID = "0x80ac58cd";
15
- export declare const ERC721_METADATA_INTERFACE_ID = "0x5b5e139f";
16
- export declare const ERC721_ENUMERABLE_INTERFACE_ID = "0x780e9d63";
17
- export declare const ERC1155_INTERFACE_ID = "0xd9b67a26";
18
- export declare const ERC1155_METADATA_URI_INTERFACE_ID = "0x0e89341c";
19
- export declare const ERC1155_TOKEN_RECEIVER_INTERFACE_ID = "0x4e2312e0";
20
- export declare const GWEI = "gwei";
21
- export declare const ASSET_TYPES: {
22
- NATIVE: string;
23
- TOKEN: string;
24
- NFT: string;
25
- UNKNOWN: string;
26
- };
27
- export declare const TESTNET_TICKER_SYMBOLS: {
28
- GOERLI: string;
29
- SEPOLIA: string;
30
- LINEA_GOERLI: string;
31
- LINEA_SEPOLIA: string;
32
- MEGAETH_TESTNET: string;
33
- MEGAETH_TESTNET_V2: string;
34
- };
35
- /**
36
- * Map of all built-in custom networks to their RPC endpoints.
37
- */
38
- export declare const BUILT_IN_CUSTOM_NETWORKS_RPC: {
39
- /**
40
- * @deprecated Please use `megaeth-testnet` instead.
41
- */
42
- MEGAETH_TESTNET: string;
43
- /**
44
- * @deprecated Please use `megaeth-testnet-v2` instead.
45
- */
46
- 'megaeth-testnet': string;
47
- 'megaeth-testnet-v2': string;
48
- 'monad-testnet': string;
49
- };
50
- /**
51
- * Map of all build-in Infura networks to their network, ticker and chain IDs.
52
- */
53
- export declare const BUILT_IN_NETWORKS: {
54
- readonly goerli: {
55
- readonly chainId: "0x5";
56
- readonly ticker: NetworksTicker.goerli;
57
- readonly rpcPrefs: {
58
- readonly blockExplorerUrl: "https://goerli.etherscan.io";
59
- };
60
- };
61
- readonly sepolia: {
62
- readonly chainId: "0xaa36a7";
63
- readonly ticker: NetworksTicker.sepolia;
64
- readonly rpcPrefs: {
65
- readonly blockExplorerUrl: "https://sepolia.etherscan.io";
66
- };
67
- };
68
- readonly mainnet: {
69
- readonly chainId: "0x1";
70
- readonly ticker: NetworksTicker.mainnet;
71
- readonly rpcPrefs: {
72
- readonly blockExplorerUrl: "https://etherscan.io";
73
- };
74
- };
75
- readonly "linea-goerli": {
76
- readonly chainId: "0xe704";
77
- readonly ticker: (typeof NetworksTicker)["linea-goerli"];
78
- readonly rpcPrefs: {
79
- readonly blockExplorerUrl: "https://goerli.lineascan.build";
80
- };
81
- };
82
- readonly "linea-sepolia": {
83
- readonly chainId: "0xe705";
84
- readonly ticker: (typeof NetworksTicker)["linea-goerli"];
85
- readonly rpcPrefs: {
86
- readonly blockExplorerUrl: "https://sepolia.lineascan.build";
87
- };
88
- };
89
- readonly "linea-mainnet": {
90
- readonly chainId: "0xe708";
91
- readonly ticker: NetworksTicker.mainnet;
92
- readonly rpcPrefs: {
93
- readonly blockExplorerUrl: "https://lineascan.build";
94
- };
95
- };
96
- readonly "megaeth-testnet": {
97
- readonly chainId: "0x18c6";
98
- readonly ticker: (typeof NetworksTicker)["megaeth-testnet"];
99
- readonly rpcPrefs: {
100
- readonly blockExplorerUrl: "https://megaexplorer.xyz";
101
- };
102
- };
103
- readonly "megaeth-testnet-v2": {
104
- readonly chainId: "0x18c7";
105
- readonly ticker: (typeof NetworksTicker)["megaeth-testnet"];
106
- readonly rpcPrefs: {
107
- readonly blockExplorerUrl: "https://megaeth-testnet-v2.blockscout.com";
108
- };
109
- };
110
- readonly "monad-testnet": {
111
- readonly chainId: "0x279f";
112
- readonly ticker: (typeof NetworksTicker)["monad-testnet"];
113
- readonly rpcPrefs: {
114
- readonly blockExplorerUrl: "https://testnet.monadexplorer.com";
115
- };
116
- };
117
- readonly "base-mainnet": {
118
- readonly chainId: "0x2105";
119
- readonly ticker: NetworksTicker.mainnet;
120
- readonly rpcPrefs: {
121
- readonly blockExplorerUrl: "https://basescan.org";
122
- };
123
- };
124
- readonly "arbitrum-mainnet": {
125
- readonly chainId: "0xa4b1";
126
- readonly ticker: NetworksTicker.mainnet;
127
- readonly rpcPrefs: {
128
- readonly blockExplorerUrl: "https://arbiscan.io";
129
- };
130
- };
131
- readonly "bsc-mainnet": {
132
- readonly chainId: "0x38";
133
- readonly ticker: (typeof NetworksTicker)["bsc-mainnet"];
134
- readonly rpcPrefs: {
135
- readonly blockExplorerUrl: "https://bscscan.com";
136
- };
137
- };
138
- readonly "optimism-mainnet": {
139
- readonly chainId: "0xa";
140
- readonly ticker: NetworksTicker.mainnet;
141
- readonly rpcPrefs: {
142
- readonly blockExplorerUrl: "https://optimistic.etherscan.io";
143
- };
144
- };
145
- readonly "polygon-mainnet": {
146
- readonly chainId: "0x89";
147
- readonly ticker: (typeof NetworksTicker)["polygon-mainnet"];
148
- readonly rpcPrefs: {
149
- readonly blockExplorerUrl: "https://polygonscan.com";
150
- };
151
- };
152
- readonly "sei-mainnet": {
153
- readonly chainId: "0x531";
154
- readonly ticker: (typeof NetworksTicker)["sei-mainnet"];
155
- readonly rpcPrefs: {
156
- readonly blockExplorerUrl: "https://seiscan.io";
157
- };
158
- };
159
- readonly "monad-mainnet": {
160
- readonly chainId: "0x8f";
161
- readonly ticker: (typeof NetworksTicker)["monad-testnet"];
162
- readonly rpcPrefs: {
163
- readonly blockExplorerUrl: "https://monadscan.com";
164
- };
165
- };
166
- readonly "zksync-mainnet": {
167
- readonly chainId: "0x144";
168
- readonly ticker: NetworksTicker.mainnet;
169
- readonly rpcPrefs: {
170
- readonly blockExplorerUrl: "https://explorer.zksync.io";
171
- };
172
- };
173
- readonly "megaeth-mainnet": {
174
- readonly chainId: "0x10e6";
175
- readonly ticker: NetworksTicker.mainnet;
176
- readonly rpcPrefs: {
177
- readonly blockExplorerUrl: "https://megaeth.blockscout.com";
178
- };
179
- };
180
- readonly "avalanche-mainnet": {
181
- readonly chainId: "0xa86a";
182
- readonly ticker: (typeof NetworksTicker)["avalanche-mainnet"];
183
- readonly rpcPrefs: {
184
- readonly blockExplorerUrl: "https://snowtrace.io";
185
- };
186
- };
187
- readonly rpc: {
188
- readonly chainId: undefined;
189
- readonly blockExplorerUrl: undefined;
190
- readonly ticker: undefined;
191
- readonly rpcPrefs: undefined;
192
- };
193
- };
194
- /**
195
- * When a user adds a custom network to MetaMask, we perform some basic
196
- * validations on the network. For instance, usually a network cannot share the
197
- * same chain as another. In some cases, however, we want to allow networks that
198
- * would normally be invalid. This mapping contains networks that should bypass
199
- * validation.
200
- */
201
- export declare const NETWORKS_BYPASSING_VALIDATION: {
202
- '0x3e7': {
203
- name: string;
204
- symbol: string;
205
- rpcUrl: string;
206
- };
207
- };
208
- export declare const OPENSEA_PROXY_URL = "https://proxy.api.cx.metamask.io/opensea/v1/api/v2";
209
- export declare const NFT_API_BASE_URL = "https://nft.api.cx.metamask.io";
210
- export declare const NFT_API_VERSION = "1";
211
- export declare const NFT_API_TIMEOUT = 15000;
212
- export declare const ORIGIN_METAMASK = "metamask";
213
- /**
214
- * Approval request types for various operations.
215
- * These types are used by different controllers to create and manage
216
- * approval requests consistently.
217
- */
218
- export declare enum ApprovalType {
219
- AddEthereumChain = "wallet_addEthereumChain",
220
- ConnectAccounts = "connect_accounts",
221
- EthDecrypt = "eth_decrypt",
222
- EthGetEncryptionPublicKey = "eth_getEncryptionPublicKey",
223
- EthSignTypedData = "eth_signTypedData",
224
- PersonalSign = "personal_sign",
225
- ResultError = "result_error",
226
- ResultSuccess = "result_success",
227
- SnapDialogAlert = "snap_dialog:alert",
228
- SnapDialogConfirmation = "snap_dialog:confirmation",
229
- SnapDialogPrompt = "snap_dialog:prompt",
230
- SnapDialogDefault = "snap_dialog",
231
- SwitchEthereumChain = "wallet_switchEthereumChain",
232
- Transaction = "transaction",
233
- TransactionBatch = "transaction_batch",
234
- Unlock = "unlock",
235
- WalletConnect = "wallet_connect",
236
- WalletRequestPermissions = "wallet_requestPermissions",
237
- WatchAsset = "wallet_watchAsset"
238
- }
239
- /**
240
- * Mapping of chain IDs to their network names for ENS functionality.
241
- * Note: MegaETH-testnet is intentionally excluded from this mapping as it doesn't support ENS.
242
- */
243
- export declare const CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP: Record<string, BuiltInNetworkName>;
244
- /**
245
- * The number of milliseconds in a second.
246
- */
247
- export declare const SECOND = 1000;
248
- /**
249
- * The number of milliseconds in a second.
250
- */
251
- export declare const SECONDS = 1000;
252
- /**
253
- * The number of milliseconds in a minute.
254
- */
255
- export declare const MINUTE: number;
256
- /**
257
- * The number of milliseconds in a minute.
258
- */
259
- export declare const MINUTES: number;
260
- /**
261
- * The number of milliseconds in a hour.
262
- */
263
- export declare const HOUR: number;
264
- /**
265
- * The number of milliseconds in a hour.
266
- */
267
- export declare const HOURS: number;
268
- /**
269
- * The number of milliseconds in a day.
270
- */
271
- export declare const DAY: number;
272
- /**
273
- * The number of milliseconds in a day.
274
- */
275
- export declare const DAYS: number;
276
- /**
277
- * Special "EVM-ish" chains with no native tokens.
278
- * Created for Tempo, but can be extended to others.
279
- * - For hidding the native token from the token list and Send list.
280
- * - For excluding the native token from the total wallet value calculation.
281
- */
282
- export declare const CHAIN_IDS_WITH_NO_NATIVE_TOKEN: readonly ["eip155:42431", "eip155:4217"];
283
- //# sourceMappingURL=constants.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EAEd,kBAAkB,EAEnB,oBAAmB;AAEpB,eAAO,MAAM,GAAG,QAAQ,CAAC;AACzB,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAC3C,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAI5E,eAAO,MAAM,gB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