Skip to content

Commit

Permalink
fix(linea): enable token detection for Linea mainnet and testnet
Browse files Browse the repository at this point in the history
Token detection was never enabled in the extension code although the APIs we rely on for token detection do support Linea mainnet and testnet.
  • Loading branch information
gauthierpetetin committed Sep 2, 2023
1 parent 3d2de02 commit 571f6f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions shared/modules/network.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export function isTokenDetectionEnabledForNetwork(chainId: string | undefined) {
case CHAIN_IDS.BSC:
case CHAIN_IDS.POLYGON:
case CHAIN_IDS.AVALANCHE:
case CHAIN_IDS.LINEA_GOERLI:
case CHAIN_IDS.LINEA_MAINNET:
case CHAIN_IDS.AURORA:
return true;
default:
Expand Down
8 changes: 7 additions & 1 deletion ui/selectors/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,10 @@ export const getTokenDetectionSupportNetworkByChainId = (state) => {
return POLYGON_DISPLAY_NAME;
case CHAIN_IDS.AVALANCHE:
return AVALANCHE_DISPLAY_NAME;
case CHAIN_IDS.LINEA_GOERLI:
return LINEA_GOERLI_DISPLAY_NAME;
case CHAIN_IDS.LINEA_MAINNET:
return LINEA_MAINNET_DISPLAY_NAME;
case CHAIN_IDS.AURORA:
return AURORA_DISPLAY_NAME;
default:
Expand All @@ -1414,7 +1418,7 @@ export const getTokenDetectionSupportNetworkByChainId = (state) => {
};
/**
* To check if the chainId supports token detection,
* currently it returns true for Ethereum Mainnet, Polygon, BSC, Avalanche and Aurora
* currently it returns true for Ethereum Mainnet, BSC, Polygon, Avalanche, Linea and Aurora
*
* @param {*} state
* @returns Boolean
Expand All @@ -1426,6 +1430,8 @@ export function getIsDynamicTokenListAvailable(state) {
CHAIN_IDS.BSC,
CHAIN_IDS.POLYGON,
CHAIN_IDS.AVALANCHE,
CHAIN_IDS.LINEA_GOERLI,
CHAIN_IDS.LINEA_MAINNET,
CHAIN_IDS.AURORA,
].includes(chainId);
}
Expand Down

0 comments on commit 571f6f9

Please sign in to comment.