@metamask-previews/assets-controllers 109.4.1-preview-7ed2770ae → 109.4.1-preview-9feca08d3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -25,6 +25,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
25
25
  - Remove optional `accountAssetInfo` from selector `Asset` items.
26
26
  - `MultichainAssetsController:accountAssetListUpdated` no longer includes a `refreshed` asset list for already-tracked snap adds;
27
27
 
28
+ ### Fixed
29
+
30
+ - Fix incorrect Linea chain ID (`0xe728` → `0xe708`) in `SUPPORTED_NETWORKS_ACCOUNTS_API_V4`, which caused the legacy `AssetsController` (used in production when the Unified Assets Controller feature flag is off) to fall back to RPC instead of the Accounts API V4 ([#9519](https://github.com/MetaMask/core/pull/9519))
31
+
28
32
  ## [109.4.1]
29
33
 
30
34
  ### Changed
@@ -13,7 +13,7 @@ exports.SUPPORTED_NETWORKS_ACCOUNTS_API_V4 = [
13
13
  '0x1', // 1
14
14
  '0x89', // 137
15
15
  '0x38', // 56
16
- '0xe728', // 59144
16
+ '0xe708', // 59144
17
17
  '0x2105', // 8453
18
18
  '0xa', // 10
19
19
  '0xa4b1', // 42161
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,iEAA4E;AAG5E,IAAY,MAIX;AAJD,WAAY,MAAM;IAChB,2BAAiB,CAAA;IACjB,uBAAa,CAAA;IACb,+BAAqB,CAAA;AACvB,CAAC,EAJW,MAAM,sBAAN,MAAM,QAIjB;AAED,wEAAwE;AAC3D,QAAA,kCAAkC,GAAG;IAChD,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,OAAO;IACjB,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE,QAAQ;IACl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C,MAAM,CAAC;YACP,oDAAoD;YACpD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,+BAA+B;IAC/B,IACE,iDAA8B,CAAC,QAAQ,CACrC,OAA0D,CAC3D,EACD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AA9BD,4DA8BC","sourcesContent":["import { CHAIN_IDS_WITH_NO_NATIVE_TOKEN } from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\n\nexport enum Source {\n Custom = 'custom',\n Dapp = 'dapp',\n Detected = 'detected',\n}\n\n// TODO: delete this once we have the v4 endpoint for supported networks\nexport const SUPPORTED_NETWORKS_ACCOUNTS_API_V4 = [\n '0x1', // 1\n '0x89', // 137\n '0x38', // 56\n '0xe728', // 59144\n '0x2105', // 8453\n '0xa', // 10\n '0xa4b1', // 42161\n '0x82750', // 534352\n '0x531', // 1329\n '0x8f', // 143\n '0x3e7', // 999 HyperEVM\n '0x13b2', // 5042 Arc\n];\n\n/** Lowercase ERC-20 address for MetaMask USD (mUSD), same contract on listed chains. */\nexport const MUSD_ERC20_ADDRESS_LOWER =\n '0xaca92e438df0b2401ff60da7e4337b687a2435da';\n\n/**\n * EVM chains where mUSD is always merged into the token-detection candidate list.\n * Metadata matches `GET /v3/assets` on `tokens.api.cx.metamask.io` (assetIds CAIP-19).\n */\nexport const MUSD_TOKEN_DETECTION_CHAIN_IDS = [\n '0x1', // Ethereum mainnet (eip155:1)\n '0xe708', // Linea (eip155:59144)\n '0x8f', // Monad mainnet (eip155:143)\n] as const satisfies readonly Hex[];\n\n/** Raw `aggregators` keys from the Tokens API (same shape as token list cache). */\nexport type MusdTokenDetectionMetadata = {\n name: string;\n symbol: string;\n decimals: number;\n aggregators: string[];\n};\n\nexport const MUSD_TOKEN_METADATA_BY_CHAIN: Record<\n (typeof MUSD_TOKEN_DETECTION_CHAIN_IDS)[number],\n MusdTokenDetectionMetadata\n> = {\n '0x1': {\n name: 'MetaMask USD',\n symbol: 'MUSD',\n decimals: 6,\n aggregators: ['metamask', 'liFi', 'socket', 'rubic', 'rango'],\n },\n '0xe708': {\n name: 'MetaMask USD',\n symbol: 'MUSD',\n decimals: 6,\n aggregators: ['metamask', 'liFi', 'socket', 'rubic', 'squid', 'rango'],\n },\n '0x8f': {\n name: 'MetaMask USD',\n symbol: 'mUSD',\n decimals: 6,\n aggregators: ['dynamic'],\n },\n};\n\n/**\n * Determines if native token fetching should be included for the given chain.\n * Returns false for chains that return arbitrary large numbers (e.g., Tempo networks).\n *\n * @param chainId - Chain ID in hex format (e.g., \"0xa5bf\") or CAIP-2 format (e.g., \"eip155:42431\").\n * @returns True if native token should be included, false if it should be skipped.\n */\nexport function shouldIncludeNativeToken(chainId: string): boolean {\n // Convert hex format to CAIP-2 for comparison\n if (chainId.startsWith('0x')) {\n try {\n const decimal = parseInt(chainId, 16);\n const caipChainId = `eip155:${decimal}`;\n if (\n CHAIN_IDS_WITH_NO_NATIVE_TOKEN.includes(\n caipChainId as (typeof CHAIN_IDS_WITH_NO_NATIVE_TOKEN)[number],\n )\n ) {\n return false;\n }\n } catch {\n // If conversion fails, assume it should be included\n return true;\n }\n return true;\n }\n\n // Check CAIP-2 format directly\n if (\n CHAIN_IDS_WITH_NO_NATIVE_TOKEN.includes(\n chainId as (typeof CHAIN_IDS_WITH_NO_NATIVE_TOKEN)[number],\n )\n ) {\n return false;\n }\n\n return true;\n}\n"]}
1
+ {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,iEAA4E;AAG5E,IAAY,MAIX;AAJD,WAAY,MAAM;IAChB,2BAAiB,CAAA;IACjB,uBAAa,CAAA;IACb,+BAAqB,CAAA;AACvB,CAAC,EAJW,MAAM,sBAAN,MAAM,QAIjB;AAED,wEAAwE;AAC3D,QAAA,kCAAkC,GAAG;IAChD,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,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U,OAAO,EAAE,CAAC;YACxC,IACE,iDAA8B,CAAC,QAAQ,CACrC,WAA8D,CAC/D,EACD,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,oDAAoD;YACpD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,+BAA+B;IAC/B,IACE,iDAA8B,CAAC,QAAQ,CACrC,OAA0D,CAC3D,EACD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AA9BD,4DA8BC","sourcesContent":["import { CHAIN_IDS_WITH_NO_NATIVE_TOKEN } from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\n\nexport enum Source {\n Custom = 'custom',\n Dapp = 'dapp',\n Detected = 'detected',\n}\n\n// TODO: delete this once we have the v4 endpoint for supported networks\nexport const SUPPORTED_NETWORKS_ACCOUNTS_API_V4 = [\n '0x1', // 1\n '0x89', // 137\n '0x38', // 56\n '0xe708', // 59144\n '0x2105', // 8453\n '0xa', // 10\n '0xa4b1', // 42161\n '0x82750', // 534352\n '0x531', // 1329\n '0x8f', // 143\n '0x3e7', // 999 HyperEVM\n '0x13b2', // 5042 Arc\n];\n\n/** Lowercase ERC-20 address for MetaMask USD (mUSD), same contract on listed chains. */\nexport const MUSD_ERC20_ADDRESS_LOWER =\n '0xaca92e438df0b2401ff60da7e4337b687a2435da';\n\n/**\n * EVM chains where mUSD is always merged into the token-detection candidate list.\n * Metadata matches `GET /v3/assets` on `tokens.api.cx.metamask.io` (assetIds CAIP-19).\n */\nexport const MUSD_TOKEN_DETECTION_CHAIN_IDS = [\n '0x1', // Ethereum mainnet (eip155:1)\n '0xe708', // Linea (eip155:59144)\n '0x8f', // Monad mainnet (eip155:143)\n] as const satisfies readonly Hex[];\n\n/** Raw `aggregators` keys from the Tokens API (same shape as token list cache). */\nexport type MusdTokenDetectionMetadata = {\n name: string;\n symbol: string;\n decimals: number;\n aggregators: string[];\n};\n\nexport const MUSD_TOKEN_METADATA_BY_CHAIN: Record<\n (typeof MUSD_TOKEN_DETECTION_CHAIN_IDS)[number],\n MusdTokenDetectionMetadata\n> = {\n '0x1': {\n name: 'MetaMask USD',\n symbol: 'MUSD',\n decimals: 6,\n aggregators: ['metamask', 'liFi', 'socket', 'rubic', 'rango'],\n },\n '0xe708': {\n name: 'MetaMask USD',\n symbol: 'MUSD',\n decimals: 6,\n aggregators: ['metamask', 'liFi', 'socket', 'rubic', 'squid', 'rango'],\n },\n '0x8f': {\n name: 'MetaMask USD',\n symbol: 'mUSD',\n decimals: 6,\n aggregators: ['dynamic'],\n },\n};\n\n/**\n * Determines if native token fetching should be included for the given chain.\n * Returns false for chains that return arbitrary large numbers (e.g., Tempo networks).\n *\n * @param chainId - Chain ID in hex format (e.g., \"0xa5bf\") or CAIP-2 format (e.g., \"eip155:42431\").\n * @returns True if native token should be included, false if it should be skipped.\n */\nexport function shouldIncludeNativeToken(chainId: string): boolean {\n // Convert hex format to CAIP-2 for comparison\n if (chainId.startsWith('0x')) {\n try {\n const decimal = parseInt(chainId, 16);\n const caipChainId = `eip155:${decimal}`;\n if (\n CHAIN_IDS_WITH_NO_NATIVE_TOKEN.includes(\n caipChainId as (typeof CHAIN_IDS_WITH_NO_NATIVE_TOKEN)[number],\n )\n ) {\n return false;\n }\n } catch {\n // If conversion fails, assume it should be included\n return true;\n }\n return true;\n }\n\n // Check CAIP-2 format directly\n if (\n CHAIN_IDS_WITH_NO_NATIVE_TOKEN.includes(\n chainId as (typeof CHAIN_IDS_WITH_NO_NATIVE_TOKEN)[number],\n )\n ) {\n return false;\n }\n\n return true;\n}\n"]}
@@ -10,7 +10,7 @@ export const SUPPORTED_NETWORKS_ACCOUNTS_API_V4 = [
10
10
  '0x1', // 1
11
11
  '0x89', // 137
12
12
  '0x38', // 56
13
- '0xe728', // 59144
13
+ '0xe708', // 59144
14
14
  '0x2105', // 8453
15
15
  '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Q,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;KACvE;IACD,MAAM,EAAE;QACN,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,CAAC;QACX,WAAW,EAAE,CAAC,SAAS,CAAC;KACzB;CACF,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe;IACtD,8CAA8C;IAC9C,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACtC,MAAM,WAAW,GAAG,UAAU,OAAO,EAAE,CAAC;YACxC,IACE,8BAA8B,CAAC,QAAQ,CACrC,WAA8D,CAC/D,EACD,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,oDAAoD;YACpD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,+BAA+B;IAC/B,IACE,8BAA8B,CAAC,QAAQ,CACrC,OAA0D,CAC3D,EACD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { CHAIN_IDS_WITH_NO_NATIVE_TOKEN } from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\n\nexport enum Source {\n Custom = 'custom',\n Dapp = 'dapp',\n Detected = 'detected',\n}\n\n// TODO: delete this once we have the v4 endpoint for supported networks\nexport const SUPPORTED_NETWORKS_ACCOUNTS_API_V4 = [\n '0x1', // 1\n '0x89', // 137\n '0x38', // 56\n '0xe728', // 59144\n '0x2105', // 8453\n '0xa', // 10\n '0xa4b1', // 42161\n '0x82750', // 534352\n '0x531', // 1329\n '0x8f', // 143\n '0x3e7', // 999 HyperEVM\n '0x13b2', // 5042 Arc\n];\n\n/** Lowercase ERC-20 address for MetaMask USD (mUSD), same contract on listed chains. */\nexport const MUSD_ERC20_ADDRESS_LOWER =\n '0xaca92e438df0b2401ff60da7e4337b687a2435da';\n\n/**\n * EVM chains where mUSD is always merged into the token-detection candidate list.\n * Metadata matches `GET /v3/assets` on `tokens.api.cx.metamask.io` (assetIds CAIP-19).\n */\nexport const MUSD_TOKEN_DETECTION_CHAIN_IDS = [\n '0x1', // Ethereum mainnet (eip155:1)\n '0xe708', // Linea (eip155:59144)\n '0x8f', // Monad mainnet (eip155:143)\n] as const satisfies readonly Hex[];\n\n/** Raw `aggregators` keys from the Tokens API (same shape as token list cache). */\nexport type MusdTokenDetectionMetadata = {\n name: string;\n symbol: string;\n decimals: number;\n aggregators: string[];\n};\n\nexport const MUSD_TOKEN_METADATA_BY_CHAIN: Record<\n (typeof MUSD_TOKEN_DETECTION_CHAIN_IDS)[number],\n MusdTokenDetectionMetadata\n> = {\n '0x1': {\n name: 'MetaMask USD',\n symbol: 'MUSD',\n decimals: 6,\n aggregators: ['metamask', 'liFi', 'socket', 'rubic', 'rango'],\n },\n '0xe708': {\n name: 'MetaMask USD',\n symbol: 'MUSD',\n decimals: 6,\n aggregators: ['metamask', 'liFi', 'socket', 'rubic', 'squid', 'rango'],\n },\n '0x8f': {\n name: 'MetaMask USD',\n symbol: 'mUSD',\n decimals: 6,\n aggregators: ['dynamic'],\n },\n};\n\n/**\n * Determines if native token fetching should be included for the given chain.\n * Returns false for chains that return arbitrary large numbers (e.g., Tempo networks).\n *\n * @param chainId - Chain ID in hex format (e.g., \"0xa5bf\") or CAIP-2 format (e.g., \"eip155:42431\").\n * @returns True if native token should be included, false if it should be skipped.\n */\nexport function shouldIncludeNativeToken(chainId: string): boolean {\n // Convert hex format to CAIP-2 for comparison\n if (chainId.startsWith('0x')) {\n try {\n const decimal = parseInt(chainId, 16);\n const caipChainId = `eip155:${decimal}`;\n if (\n CHAIN_IDS_WITH_NO_NATIVE_TOKEN.includes(\n caipChainId as (typeof CHAIN_IDS_WITH_NO_NATIVE_TOKEN)[number],\n )\n ) {\n return false;\n }\n } catch {\n // If conversion fails, assume it should be included\n return true;\n }\n return true;\n }\n\n // Check CAIP-2 format directly\n if (\n CHAIN_IDS_WITH_NO_NATIVE_TOKEN.includes(\n chainId as (typeof CHAIN_IDS_WITH_NO_NATIVE_TOKEN)[number],\n )\n ) {\n return false;\n }\n\n return true;\n}\n"]}
1
+ {"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,mCAAmC;AAG5E,MAAM,CAAN,IAAY,MAIX;AAJD,WAAY,MAAM;IAChB,2BAAiB,CAAA;IACjB,uBAAa,CAAA;IACb,+BAAqB,CAAA;AACvB,CAAC,EAJW,MAAM,KAAN,MAAM,QAIjB;AAED,wEAAwE;AACxE,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,OAAO;IACjB,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,eAAe;IACxB,QAAQ,EAAE,WAAW;CACtB,CAAC;AAEF,wFAAwF;AACxF,MAAM,CAAC,MAAM,wBAAwB,GACnC,4CAA4C,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,KAAK,EAAE,8BAA8B;IACrC,QAAQ,EAAE,uBAAuB;IACjC,MAAM,EAAE,6BAA6B;CACJ,CAAC;AAUpC,MAAM,CAAC,MAAM,4BAA4B,GAGrC;IACF,KAAK,EAAE;QACL,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,CAAC;QACX,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC;KAC9D;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,CAAC;QACX,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;KACvE;IACD,MAAM,EAAE;QACN,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,CAAC;QACX,WAAW,EAAE,CAAC,SAAS,CAAC;KACzB;CACF,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe;IACtD,8CAA8C;IAC9C,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACtC,MAAM,WAAW,GAAG,UAAU,OAAO,EAAE,CAAC;YACxC,IACE,8BAA8B,CAAC,QAAQ,CACrC,WAA8D,CAC/D,EACD,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,oDAAoD;YACpD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,+BAA+B;IAC/B,IACE,8BAA8B,CAAC,QAAQ,CACrC,OAA0D,CAC3D,EACD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { CHAIN_IDS_WITH_NO_NATIVE_TOKEN } from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\n\nexport enum Source {\n Custom = 'custom',\n Dapp = 'dapp',\n Detected = 'detected',\n}\n\n// TODO: delete this once we have the v4 endpoint for supported networks\nexport const SUPPORTED_NETWORKS_ACCOUNTS_API_V4 = [\n '0x1', // 1\n '0x89', // 137\n '0x38', // 56\n '0xe708', // 59144\n '0x2105', // 8453\n '0xa', // 10\n '0xa4b1', // 42161\n '0x82750', // 534352\n '0x531', // 1329\n '0x8f', // 143\n '0x3e7', // 999 HyperEVM\n '0x13b2', // 5042 Arc\n];\n\n/** Lowercase ERC-20 address for MetaMask USD (mUSD), same contract on listed chains. */\nexport const MUSD_ERC20_ADDRESS_LOWER =\n '0xaca92e438df0b2401ff60da7e4337b687a2435da';\n\n/**\n * EVM chains where mUSD is always merged into the token-detection candidate list.\n * Metadata matches `GET /v3/assets` on `tokens.api.cx.metamask.io` (assetIds CAIP-19).\n */\nexport const MUSD_TOKEN_DETECTION_CHAIN_IDS = [\n '0x1', // Ethereum mainnet (eip155:1)\n '0xe708', // Linea (eip155:59144)\n '0x8f', // Monad mainnet (eip155:143)\n] as const satisfies readonly Hex[];\n\n/** Raw `aggregators` keys from the Tokens API (same shape as token list cache). */\nexport type MusdTokenDetectionMetadata = {\n name: string;\n symbol: string;\n decimals: number;\n aggregators: string[];\n};\n\nexport const MUSD_TOKEN_METADATA_BY_CHAIN: Record<\n (typeof MUSD_TOKEN_DETECTION_CHAIN_IDS)[number],\n MusdTokenDetectionMetadata\n> = {\n '0x1': {\n name: 'MetaMask USD',\n symbol: 'MUSD',\n decimals: 6,\n aggregators: ['metamask', 'liFi', 'socket', 'rubic', 'rango'],\n },\n '0xe708': {\n name: 'MetaMask USD',\n symbol: 'MUSD',\n decimals: 6,\n aggregators: ['metamask', 'liFi', 'socket', 'rubic', 'squid', 'rango'],\n },\n '0x8f': {\n name: 'MetaMask USD',\n symbol: 'mUSD',\n decimals: 6,\n aggregators: ['dynamic'],\n },\n};\n\n/**\n * Determines if native token fetching should be included for the given chain.\n * Returns false for chains that return arbitrary large numbers (e.g., Tempo networks).\n *\n * @param chainId - Chain ID in hex format (e.g., \"0xa5bf\") or CAIP-2 format (e.g., \"eip155:42431\").\n * @returns True if native token should be included, false if it should be skipped.\n */\nexport function shouldIncludeNativeToken(chainId: string): boolean {\n // Convert hex format to CAIP-2 for comparison\n if (chainId.startsWith('0x')) {\n try {\n const decimal = parseInt(chainId, 16);\n const caipChainId = `eip155:${decimal}`;\n if (\n CHAIN_IDS_WITH_NO_NATIVE_TOKEN.includes(\n caipChainId as (typeof CHAIN_IDS_WITH_NO_NATIVE_TOKEN)[number],\n )\n ) {\n return false;\n }\n } catch {\n // If conversion fails, assume it should be included\n return true;\n }\n return true;\n }\n\n // Check CAIP-2 format directly\n if (\n CHAIN_IDS_WITH_NO_NATIVE_TOKEN.includes(\n chainId as (typeof CHAIN_IDS_WITH_NO_NATIVE_TOKEN)[number],\n )\n ) {\n return false;\n }\n\n return true;\n}\n"]}
@@ -116,7 +116,7 @@ type SupportedCurrency = (typeof SUPPORTED_CURRENCIES_FALLBACK)[number] | Upperc
116
116
  *
117
117
  * @see Used by {@link CodefiTokenPricesServiceV2} to validate that a given chain ID is supported by V2 of the Codefi Price API.
118
118
  */
119
- export declare const SUPPORTED_CHAIN_IDS: ("0x1" | "0x89" | "0x38" | "0x2105" | "0xa" | "0xa4b1" | "0x82750" | "0x531" | "0x8f" | "0x3e7" | "0x13b2" | "0xe708" | "0x2a" | "0x44d" | "0x64" | "0xa86a" | "0xfa" | "0x504" | "0x505" | "0x63564c40" | "0x19" | "0x7a" | "0x120" | "0x4e454152" | "0x80" | "0x440" | "0x1e" | "0xa516" | "0xa4ec" | "0x141" | "0x6a" | "0x1388" | "0x39" | "0x52" | "0x15b38" | "0xa729" | "0x1b58" | "0x13e31" | "0x144" | "0xfc" | "0x28c58" | "0xc4" | "0xed88" | "0x2eb" | "0x6f0" | "0xa867" | "0x2611" | "0x15f900" | "0x74c" | "0xa3c3" | "0xab5" | "0x138de" | "0x8173" | "0xb67d2" | "0xe8" | "0x18232" | "0x32" | "0x10e6" | "0x10b3e" | "0xdef1" | "0x3dc" | "0xa5bf" | "0x1079" | "0x1237" | "0x58" | "0x92" | "0x150" | "0x169" | "0x9dd" | "0x2710" | "0x11d9b" | "0x17dcd" | "0x518af" | "0xf043a")[];
119
+ export declare const SUPPORTED_CHAIN_IDS: ("0x1" | "0x89" | "0x38" | "0xe708" | "0x2105" | "0xa" | "0xa4b1" | "0x82750" | "0x531" | "0x8f" | "0x3e7" | "0x13b2" | "0x2a" | "0x44d" | "0x64" | "0xa86a" | "0xfa" | "0x504" | "0x505" | "0x63564c40" | "0x19" | "0x7a" | "0x120" | "0x4e454152" | "0x80" | "0x440" | "0x1e" | "0xa516" | "0xa4ec" | "0x141" | "0x6a" | "0x1388" | "0x39" | "0x52" | "0x15b38" | "0xa729" | "0x1b58" | "0x13e31" | "0x144" | "0xfc" | "0x28c58" | "0xc4" | "0xed88" | "0x2eb" | "0x6f0" | "0xa867" | "0x2611" | "0x15f900" | "0x74c" | "0xa3c3" | "0xab5" | "0x138de" | "0x8173" | "0xb67d2" | "0xe8" | "0x18232" | "0x32" | "0x10e6" | "0x10b3e" | "0xdef1" | "0x3dc" | "0xa5bf" | "0x1079" | "0x1237" | "0x58" | "0x92" | "0x150" | "0x169" | "0x9dd" | "0x2710" | "0x11d9b" | "0x17dcd" | "0x518af" | "0xf043a")[];
120
120
  /**
121
121
  * A chain ID that can be supplied in the URL for the `/spot-prices` endpoint,
122
122
  * but in hexadecimal form (for consistency with how we represent chain IDs in
@@ -116,7 +116,7 @@ type SupportedCurrency = (typeof SUPPORTED_CURRENCIES_FALLBACK)[number] | Upperc
116
116
  *
117
117
  * @see Used by {@link CodefiTokenPricesServiceV2} to validate that a given chain ID is supported by V2 of the Codefi Price API.
118
118
  */
119
- export declare const SUPPORTED_CHAIN_IDS: ("0x1" | "0x89" | "0x38" | "0x2105" | "0xa" | "0xa4b1" | "0x82750" | "0x531" | "0x8f" | "0x3e7" | "0x13b2" | "0xe708" | "0x2a" | "0x44d" | "0x64" | "0xa86a" | "0xfa" | "0x504" | "0x505" | "0x63564c40" | "0x19" | "0x7a" | "0x120" | "0x4e454152" | "0x80" | "0x440" | "0x1e" | "0xa516" | "0xa4ec" | "0x141" | "0x6a" | "0x1388" | "0x39" | "0x52" | "0x15b38" | "0xa729" | "0x1b58" | "0x13e31" | "0x144" | "0xfc" | "0x28c58" | "0xc4" | "0xed88" | "0x2eb" | "0x6f0" | "0xa867" | "0x2611" | "0x15f900" | "0x74c" | "0xa3c3" | "0xab5" | "0x138de" | "0x8173" | "0xb67d2" | "0xe8" | "0x18232" | "0x32" | "0x10e6" | "0x10b3e" | "0xdef1" | "0x3dc" | "0xa5bf" | "0x1079" | "0x1237" | "0x58" | "0x92" | "0x150" | "0x169" | "0x9dd" | "0x2710" | "0x11d9b" | "0x17dcd" | "0x518af" | "0xf043a")[];
119
+ export declare const SUPPORTED_CHAIN_IDS: ("0x1" | "0x89" | "0x38" | "0xe708" | "0x2105" | "0xa" | "0xa4b1" | "0x82750" | "0x531" | "0x8f" | "0x3e7" | "0x13b2" | "0x2a" | "0x44d" | "0x64" | "0xa86a" | "0xfa" | "0x504" | "0x505" | "0x63564c40" | "0x19" | "0x7a" | "0x120" | "0x4e454152" | "0x80" | "0x440" | "0x1e" | "0xa516" | "0xa4ec" | "0x141" | "0x6a" | "0x1388" | "0x39" | "0x52" | "0x15b38" | "0xa729" | "0x1b58" | "0x13e31" | "0x144" | "0xfc" | "0x28c58" | "0xc4" | "0xed88" | "0x2eb" | "0x6f0" | "0xa867" | "0x2611" | "0x15f900" | "0x74c" | "0xa3c3" | "0xab5" | "0x138de" | "0x8173" | "0xb67d2" | "0xe8" | "0x18232" | "0x32" | "0x10e6" | "0x10b3e" | "0xdef1" | "0x3dc" | "0xa5bf" | "0x1079" | "0x1237" | "0x58" | "0x92" | "0x150" | "0x169" | "0x9dd" | "0x2710" | "0x11d9b" | "0x17dcd" | "0x518af" | "0xf043a")[];
120
120
  /**
121
121
  * A chain ID that can be supplied in the URL for the `/spot-prices` endpoint,
122
122
  * but in hexadecimal form (for consistency with how we represent chain IDs in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/assets-controllers",
3
- "version": "109.4.1-preview-7ed2770ae",
3
+ "version": "109.4.1-preview-9feca08d3",
4
4
  "description": "Controllers which manage interactions involving ERC-20, ERC-721, and ERC-1155 tokens (including NFTs)",
5
5
  "keywords": [
6
6
  "Ethereum",