From a9a024009d0e8d0a2f75db596236b13ea1ba0cf3 Mon Sep 17 00:00:00 2001 From: shrinathprabhu Date: Wed, 27 Mar 2024 13:23:42 +0530 Subject: [PATCH 1/2] Add linea to chainlist --- src/constants/chainList.ts | 27 +++++++++++++++++++++++++++ src/services/send.service.ts | 2 +- src/use/switchChain.ts | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/constants/chainList.ts b/src/constants/chainList.ts index 6ac4db46..6fe3750e 100644 --- a/src/constants/chainList.ts +++ b/src/constants/chainList.ts @@ -6,6 +6,7 @@ const chains = { blockchain: "eth", currency: "ETH", explorer: "https://etherscan.io", + icon_url: "https://icons.llamao.fi/icons/chains/rsz_ethereum.jpg", }, 137: { name: "Polygon", @@ -14,6 +15,7 @@ const chains = { blockchain: "polygon", currency: "MATIC", explorer: "https://polygonscan.com", + icon_url: "https://icons.llamao.fi/icons/chains/rsz_polygon.jpg", }, 80001: { name: "Polygon Mumbai", @@ -22,6 +24,7 @@ const chains = { blockchain: "polygon_mumbai", currency: "MATIC", explorer: "https://mumbai.polygonscan.com", + icon_url: "https://icons.llamao.fi/icons/chains/rsz_polygon.jpg", }, 42161: { name: "Arbitrum One", @@ -30,6 +33,7 @@ const chains = { rpc_url: "https://rpc.ankr.com/arbitrum", currency: "ETH", explorer: "https://arbiscan.io", + icon_url: "https://icons.llamao.fi/icons/chains/rsz_arbitrum.jpg", }, 56: { name: "BNB Smart Chain", @@ -38,6 +42,7 @@ const chains = { rpc_url: "https://rpc.ankr.com/bsc", currency: "BNB", explorer: "https://bscscan.com", + icon_url: "https://icons.llamao.fi/icons/chains/rsz_binance.jpg", }, 97: { name: "BNB Smart Chain Testnet", @@ -46,6 +51,7 @@ const chains = { rpc_url: "https://rpc.ankr.com/bsc_testnet_chapel", currency: "BNB", explorer: "https://testnet.bscscan.com", + icon_url: "https://icons.llamao.fi/icons/chains/rsz_binance.jpg", }, 204: { name: "opBNB Mainnet", @@ -54,6 +60,25 @@ const chains = { rpc_url: "https://1rpc.io/opbnb", currency: "BNB", explorer: "https://opbnbscan.com/", + icon_url: "https://icons.llamao.fi/icons/chains/rsz_binance.jpg", + }, + 59144: { + name: "Linea", + chain_id: 59144, + rpc_url: "https://1rpc.io/linea", + blockchain: "linea", + currency: "ETH", + explorer: "https://lineascan.build", + icon_url: "https://icons.llamao.fi/icons/chains/rsz_linea.jpg", + }, + 59140: { + name: "Linea Goerli", + chain_id: 59140, + rpc_url: "https://rpc.goerli.linea.build", + blockchain: "linea_testnet", + currency: "ETH", + explorer: "https://goerli.lineascan.build", + icon_url: "https://icons.llamao.fi/icons/chains/rsz_linea.jpg", }, }; @@ -74,6 +99,7 @@ export enum ChainNames { "bsc" = "BNB Smart Chain", "bsc_testnet_chapel" = "BNB Smart Chain Testnet", "opbnb" = "opBNB Mainnet", + "linea" = "Linea", } export enum ChainIds { @@ -84,6 +110,7 @@ export enum ChainIds { "bsc" = 56, "bsc_testnet_chapel" = 97, "opbnb" = 204, + "linea" = 59144, } export const SupportedChainIdsForAccounts = { diff --git a/src/services/send.service.ts b/src/services/send.service.ts index af9a4966..61ac507a 100644 --- a/src/services/send.service.ts +++ b/src/services/send.service.ts @@ -69,7 +69,7 @@ async function nativeTokenTransfer( value: decimalAmount.mul(Decimal.pow(10, 18)).ceil().toHexadecimal(), }; if (feeData) { - rawTx.gasLimit = 21000n; + // rawTx.gasLimit = 21000n; rawTx.maxFeePerGas = feeData.maxFeePerGas; rawTx.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; } diff --git a/src/use/switchChain.ts b/src/use/switchChain.ts index 2e1f2a66..7bd7538b 100644 --- a/src/use/switchChain.ts +++ b/src/use/switchChain.ts @@ -26,6 +26,7 @@ export async function switchChain(chainId) { }, rpcUrls: [chainDetails.rpc_url], blockExplorerUrls: [chainDetails.explorer], + iconUrls: [chainDetails.icon_url], }, ], }); From 1796d0cd7c89137dccd5d95eb4bcc5c100f8b3d1 Mon Sep 17 00:00:00 2001 From: shrinathprabhu Date: Wed, 27 Mar 2024 13:25:13 +0530 Subject: [PATCH 2/2] Add chain id and chain name for linea testnet --- src/constants/chainList.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/constants/chainList.ts b/src/constants/chainList.ts index 6fe3750e..7338f351 100644 --- a/src/constants/chainList.ts +++ b/src/constants/chainList.ts @@ -100,6 +100,7 @@ export enum ChainNames { "bsc_testnet_chapel" = "BNB Smart Chain Testnet", "opbnb" = "opBNB Mainnet", "linea" = "Linea", + "linea_testnet" = "Linea Goerli", } export enum ChainIds { @@ -111,6 +112,7 @@ export enum ChainIds { "bsc_testnet_chapel" = 97, "opbnb" = 204, "linea" = 59144, + "linea_testnet" = 59140, } export const SupportedChainIdsForAccounts = {