From 9e7b92dc55565fe046213f6961359555a21291a0 Mon Sep 17 00:00:00 2001 From: Kayode Odole <31928403+Kayconfig@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:55:13 +0100 Subject: [PATCH 1/4] chore: add linea-sepolia to evmChain --- .../evmUtils/src/dataTypes/EvmChain/EvmChain.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts index ca95f56ff3..b1722fa698 100644 --- a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts +++ b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts @@ -286,6 +286,14 @@ export class EvmChain implements EvmChainable { public static get MOONBASE() { return EvmChain.create(1287); } + /** + * Returns LINEA SEPOLIA chain + * + * @example EvmChain.LINEA_SEPOLIA + */ + public static get LINEA_SEPOLIA() { + return EvmChain.create(59141); + } /** * Create a new instance of EvmChain from any valid address input. @@ -372,6 +380,7 @@ export class EvmChain implements EvmChainable { EvmChain.MOONBEAM, EvmChain.MOONRIVER, EvmChain.MOONBASE, + EvmChain.LINEA_SEPOLIA, ]; } @@ -487,7 +496,8 @@ export class EvmChain implements EvmChainable { | '0xe708' | '0x504' | '0x505' - | '0x507'; + | '0x507' + | '0xe705'; } /** From 9790264e62caf2314c6d87249f186ea42f1bb656 Mon Sep 17 00:00:00 2001 From: Kayode Odole <31928403+Kayconfig@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:55:34 +0100 Subject: [PATCH 2/4] chore: write test to validate linea-sepolia --- packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts index 3996d1cfe3..b35e9d0ac4 100644 --- a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts +++ b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts @@ -127,6 +127,7 @@ describe('EvmChain', () => { expect(EvmChain.MOONBEAM.apiHex).toBe('0x504'); expect(EvmChain.MOONRIVER.apiHex).toBe('0x505'); expect(EvmChain.MOONBASE.apiHex).toBe('0x507'); + expect(EvmChain.LINEA_SEPOLIA.apiHex).toBe('0xe705'); }); describe('metadata', () => { From 0a9ba248f6f255158024b0237d88562d357b0efd Mon Sep 17 00:00:00 2001 From: Kayode Odole <31928403+Kayconfig@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:56:11 +0100 Subject: [PATCH 3/4] chore: build common-evmUtils --- .../common/evmUtils/src/data/chaindata.ts | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/packages/common/evmUtils/src/data/chaindata.ts b/packages/common/evmUtils/src/data/chaindata.ts index 181aa2ca1e..6cec07e719 100644 --- a/packages/common/evmUtils/src/data/chaindata.ts +++ b/packages/common/evmUtils/src/data/chaindata.ts @@ -750,6 +750,53 @@ export const chainList: EvmChainListDataEntry[] = [ }, ], }, + { + name: 'Linea Sepolia', + title: 'Linea Sepolia Testnet', + chain: 'ETH', + rpc: [ + 'https://rpc.sepolia.linea.build', + 'wss://rpc.sepolia.linea.build', + 'https://linea-sepolia.infura.io/v3/${INFURA_API_KEY}', + 'wss://linea-sepolia.infura.io/ws/v3/${INFURA_API_KEY}', + ], + faucets: [], + nativeCurrency: { + name: 'Linea Ether', + symbol: 'ETH', + decimals: 18, + }, + infoURL: 'https://linea.build', + shortName: 'linea-sepolia', + chainId: 59141, + networkId: 59141, + slip44: 1, + icon: 'linea', + parent: { + type: 'L2', + chain: 'eip155-5', + bridges: [ + { + url: 'https://bridge.linea.build/', + }, + ], + }, + explorers: [ + { + name: 'Etherscan', + url: 'https://sepolia.lineascan.build', + standard: 'EIP3091', + icon: 'linea', + }, + { + name: 'Blockscout', + url: 'https://explorer.sepolia.linea.build', + standard: 'EIP3091', + icon: 'linea', + }, + ], + status: 'active', + }, { name: 'Linea', title: 'Linea Mainnet', From e3eaa7e10476dc725fe676801e6464310c413940 Mon Sep 17 00:00:00 2001 From: Kayode Odole <31928403+Kayconfig@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:09:51 +0100 Subject: [PATCH 4/4] chore: bump patch version --- .changeset/beige-plants-retire.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/beige-plants-retire.md diff --git a/.changeset/beige-plants-retire.md b/.changeset/beige-plants-retire.md new file mode 100644 index 0000000000..6a9882b706 --- /dev/null +++ b/.changeset/beige-plants-retire.md @@ -0,0 +1,7 @@ +--- +'@moralisweb3/common-evm-utils': patch +'@moralisweb3/evm-api': patch +'moralis': patch +--- + +Add support for linea-sepolia