diff --git a/.changeset/moody-planes-flash.md b/.changeset/moody-planes-flash.md new file mode 100644 index 0000000000..7e109ae45e --- /dev/null +++ b/.changeset/moody-planes-flash.md @@ -0,0 +1,7 @@ +--- +'@moralisweb3/common-evm-utils': patch +'@moralisweb3/evm-api': patch +'moralis': patch +--- + +Add support for Linea mainnet chain diff --git a/packages/common/evmUtils/src/data/chaindata.ts b/packages/common/evmUtils/src/data/chaindata.ts index a77e4450eb..143bd2914a 100644 --- a/packages/common/evmUtils/src/data/chaindata.ts +++ b/packages/common/evmUtils/src/data/chaindata.ts @@ -664,6 +664,58 @@ export const chainList: EvmChainListDataEntry[] = [ }, ], }, + { + name: 'Linea', + title: 'Linea Mainnet', + chain: 'ETH', + rpc: [ + 'https://rpc.linea.build', + 'wss://rpc.linea.build', + 'https://linea-mainnet.infura.io/v3/${INFURA_API_KEY}', + 'wss://linea-mainnet.infura.io/ws/v3/${INFURA_API_KEY}', + ], + faucets: [], + nativeCurrency: { + name: 'Linea Ether', + symbol: 'ETH', + decimals: 18, + }, + infoURL: 'https://linea.build', + shortName: 'linea', + chainId: 59144, + networkId: 59144, + icon: 'linea', + parent: { + type: 'L2', + chain: 'eip155-1', + bridges: [ + { + url: 'https://bridge.linea.build', + }, + ], + }, + explorers: [ + { + name: 'Etherscan', + url: 'https://lineascan.build', + standard: 'EIP3091', + icon: 'linea', + }, + { + name: 'Blockscout', + url: 'https://explorer.linea.build', + standard: 'EIP3091', + icon: 'linea', + }, + { + name: 'L2scan', + url: 'https://linea.l2scan.co', + standard: 'EIP3091', + icon: 'linea', + }, + ], + status: 'active', + }, { name: 'Mumbai', title: 'Polygon Testnet Mumbai', diff --git a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts index c41e3f4ed4..97b433e8d4 100644 --- a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts +++ b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts @@ -123,6 +123,7 @@ describe('EvmChain', () => { expect(EvmChain.BASE_TESTNET.apiHex).toBe('0x14a33'); expect(EvmChain.HOLESKY.apiHex).toBe('0x4268'); expect(EvmChain.POLYGON_AMOY.apiHex).toBe('0x13882'); + expect(EvmChain.LINEA.apiHex).toBe('0xe708'); }); describe('metadata', () => { diff --git a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts index 8a046edb95..6e10b52767 100644 --- a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts +++ b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts @@ -253,6 +253,15 @@ export class EvmChain implements EvmChainable { return EvmChain.create(80002); } + /** + * Returns LINEA chain + * + * @example EvmChain.LINEA + */ + public static get LINEA() { + return EvmChain.create(59144); + } + /** * Create a new instance of EvmChain from any valid address input. * @@ -334,6 +343,7 @@ export class EvmChain implements EvmChainable { EvmChain.BASE_SEPOLIA, EvmChain.HOLESKY, EvmChain.POLYGON_AMOY, + EvmChain.LINEA, ]; } @@ -445,7 +455,8 @@ export class EvmChain implements EvmChainable { | '0x2105' | '0x14a33' | '0x4268' - | '0x13882'; + | '0x13882' + | '0xe708'; } /**