Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Linea sepolia #1202

Merged
merged 4 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading