Skip to content

Commit

Permalink
Feat: Linea sepolia (#1202)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayconfig committed Apr 30, 2024
1 parent 85a3e6e commit ea0b14b
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/beige-plants-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@moralisweb3/common-evm-utils': patch
'@moralisweb3/evm-api': patch
'moralis': patch
---

Add support for linea-sepolia
47 changes: 47 additions & 0 deletions packages/common/evmUtils/src/data/chaindata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
12 changes: 11 additions & 1 deletion packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -372,6 +380,7 @@ export class EvmChain implements EvmChainable {
EvmChain.MOONBEAM,
EvmChain.MOONRIVER,
EvmChain.MOONBASE,
EvmChain.LINEA_SEPOLIA,
];
}

Expand Down Expand Up @@ -487,7 +496,8 @@ export class EvmChain implements EvmChainable {
| '0xe708'
| '0x504'
| '0x505'
| '0x507';
| '0x507'
| '0xe705';
}

/**
Expand Down

1 comment on commit ea0b14b

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test coverage

Title Lines Statements Branches Functions
api-utils Coverage: 20%
20.6% (61/296) 20.48% (17/83) 19.04% (12/63)
auth Coverage: 89%
92.45% (98/106) 83.33% (20/24) 86.66% (26/30)
evm-api Coverage: 83%
84.9% (90/106) 66.66% (6/9) 77.77% (56/72)
common-aptos-utils Coverage: 4%
4.56% (151/3306) 4.49% (25/556) 5.53% (45/813)
common-evm-utils Coverage: 59%
59.63% (1900/3186) 20% (172/860) 40.39% (454/1124)
sol-api Coverage: 97%
97.56% (40/41) 66.66% (6/9) 93.75% (15/16)
common-sol-utils Coverage: 64%
65.42% (229/350) 41.86% (18/43) 50.89% (57/112)
common-streams-utils Coverage: 90%
90.73% (1204/1327) 73.63% (363/493) 82.07% (444/541)
streams Coverage: 91%
90.54% (603/666) 72.34% (68/94) 90.97% (131/144)

Please sign in to comment.