Skip to content

Commit 9ff1bde

Browse files
authored
feat(wallet): add Ethereum Sepolia Testnet configuration (#2784)
1 parent 24ed1cd commit 9ff1bde

File tree

5 files changed

+47
-9
lines changed

5 files changed

+47
-9
lines changed

packages/wallet/src/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ export const ARBITRUM_ONE_CHAIN_ID = 42161;
1818
/** Arbitrum Sepolia Testnet chain ID */
1919
export const ARBITRUM_SEPOLIA_CHAIN_ID = 421614;
2020

21+
/** Ethereum Sepolia Testnet chain ID */
22+
export const ETHEREUM_SEPOLIA_CHAIN_ID = 11155111;
23+
2124
/**
2225
* Magic configuration for Immutable networks
2326
* @internal

packages/wallet/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export {
77
IMMUTABLE_ZKEVM_TESTNET_CHAIN_ID,
88
ARBITRUM_ONE_CHAIN_ID,
99
ARBITRUM_SEPOLIA_CHAIN_ID,
10+
ETHEREUM_SEPOLIA_CHAIN_ID,
1011
} from './constants';
1112

1213
// Export presets (public API)
@@ -23,6 +24,9 @@ export {
2324
ARBITRUM_SEPOLIA,
2425
ARBITRUM_ONE_CHAIN,
2526
ARBITRUM_SEPOLIA_CHAIN,
27+
// Ethereum chains
28+
ETHEREUM_SEPOLIA,
29+
ETHEREUM_SEPOLIA_CHAIN,
2630
} from './network/presets';
2731

2832
// Export chain registry for looking up chain configs

packages/wallet/src/network/chainRegistry.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Environment } from '@imtbl/config';
22
import { getChainConfig, getEvmChainFromChainId } from './chainRegistry';
33
import { EvmChain } from '../types';
4-
import { ARBITRUM_ONE_CHAIN, ARBITRUM_SEPOLIA_CHAIN } from './presets';
4+
import { ARBITRUM_ONE_CHAIN, ETHEREUM_SEPOLIA_CHAIN } from './presets';
55

66
describe('chainRegistry', () => {
77
describe('getChainConfig', () => {
@@ -13,12 +13,12 @@ describe('chainRegistry', () => {
1313
expect(config.name).toBe('Arbitrum One');
1414
});
1515

16-
it('returns Arbitrum Sepolia config for SANDBOX', () => {
16+
it('returns Ethereum Sepolia config for SANDBOX', () => {
1717
const config = getChainConfig(EvmChain.ARBITRUM_ONE, Environment.SANDBOX);
1818

19-
expect(config).toEqual(ARBITRUM_SEPOLIA_CHAIN);
20-
expect(config.chainId).toBe(421614);
21-
expect(config.name).toBe('Arbitrum Sepolia');
19+
expect(config).toEqual(ETHEREUM_SEPOLIA_CHAIN);
20+
expect(config.chainId).toBe(11155111);
21+
expect(config.name).toBe('Ethereum Sepolia');
2222
});
2323

2424
it('throws error for unsupported chain', () => {
@@ -45,8 +45,8 @@ describe('chainRegistry', () => {
4545
expect(getEvmChainFromChainId(42161)).toBe(EvmChain.ARBITRUM_ONE);
4646
});
4747

48-
it('returns ARBITRUM_ONE for Arbitrum Sepolia chainId', () => {
49-
expect(getEvmChainFromChainId(421614)).toBe(EvmChain.ARBITRUM_ONE);
48+
it('returns ARBITRUM_ONE for Ethereum Sepolia chainId', () => {
49+
expect(getEvmChainFromChainId(11155111)).toBe(EvmChain.ARBITRUM_ONE);
5050
});
5151

5252
it('handles string chainId', () => {

packages/wallet/src/network/chainRegistry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
IMMUTABLE_ZKEVM_MAINNET_CHAIN,
55
IMMUTABLE_ZKEVM_TESTNET_CHAIN,
66
ARBITRUM_ONE_CHAIN,
7-
ARBITRUM_SEPOLIA_CHAIN,
7+
ETHEREUM_SEPOLIA_CHAIN,
88
} from './presets';
99
import { ChainId } from './chains';
1010

@@ -18,7 +18,7 @@ const CHAIN_REGISTRY: Record<EvmChain, Record<Environment, ChainConfig>> = {
1818
},
1919
[EvmChain.ARBITRUM_ONE]: {
2020
[Environment.PRODUCTION]: ARBITRUM_ONE_CHAIN,
21-
[Environment.SANDBOX]: ARBITRUM_SEPOLIA_CHAIN,
21+
[Environment.SANDBOX]: ETHEREUM_SEPOLIA_CHAIN,
2222
},
2323
};
2424

packages/wallet/src/network/presets.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
IMMUTABLE_ZKEVM_TESTNET_CHAIN_ID,
55
ARBITRUM_ONE_CHAIN_ID,
66
ARBITRUM_SEPOLIA_CHAIN_ID,
7+
ETHEREUM_SEPOLIA_CHAIN_ID,
78
MAGIC_CONFIG,
89
} from '../constants';
910

@@ -67,6 +68,21 @@ export const ARBITRUM_SEPOLIA_CHAIN: ChainConfig = {
6768
sequenceIdentityInstrumentEndpoint: 'https://next-identity.sequence-dev.app',
6869
};
6970

71+
/**
72+
* Ethereum Sepolia Testnet chain configuration
73+
*/
74+
export const ETHEREUM_SEPOLIA_CHAIN: ChainConfig = {
75+
chainId: ETHEREUM_SEPOLIA_CHAIN_ID,
76+
name: 'Ethereum Sepolia',
77+
rpcUrl: 'https://rpc.sepolia.org',
78+
relayerUrl: 'https://next-sepolia-relayer.sequence.app',
79+
nodeUrl: 'https://next-nodes.sequence.app/sepolia',
80+
apiUrl: 'https://api.sandbox.immutable.com',
81+
passportDomain: 'https://passport.sandbox.immutable.com',
82+
feeTokenSymbol: 'ETH',
83+
sequenceIdentityInstrumentEndpoint: 'https://next-identity.sequence-dev.app',
84+
};
85+
7086
/**
7187
* Default chains (testnet + mainnet)
7288
* Testnet is first (default initial chain)
@@ -152,3 +168,18 @@ export const ARBITRUM_ONE = {
152168
export const ARBITRUM_SEPOLIA = {
153169
chains: [ARBITRUM_SEPOLIA_CHAIN],
154170
};
171+
172+
/**
173+
* Ethereum Sepolia testnet only preset
174+
*
175+
* @example
176+
* ```typescript
177+
* const provider = await connectWallet({
178+
* ...ETHEREUM_SEPOLIA,
179+
* auth,
180+
* });
181+
* ```
182+
*/
183+
export const ETHEREUM_SEPOLIA = {
184+
chains: [ETHEREUM_SEPOLIA_CHAIN],
185+
};

0 commit comments

Comments
 (0)