Skip to content

Commit 9e5eb47

Browse files
feat: add Arbitrum Sepolia support (#139)
* feat: add Arbitrum Sepolia support and update SDK initialization for experimental networks * fix: rename variable for clarity in ChainSelector component * fix: query update on chain switch was showing previous chain data * refactor: consolidate network imports into wagmiNetworks module * fix: add TODO comments to remove allowExperimentalNetworks in next SDK update
1 parent af32350 commit 9e5eb47

File tree

5 files changed

+38
-13
lines changed

5 files changed

+38
-13
lines changed

src/components/navBar/ChainSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function ChainSelector({ className }: { className?: string }) {
1717
await switchChain(wagmiAdapter.wagmiConfig, { chainId });
1818
};
1919

20-
const filteredChains = getSupportedChains();
20+
const chains = getSupportedChains();
2121

2222
return (
2323
<Select
@@ -29,7 +29,7 @@ export function ChainSelector({ className }: { className?: string }) {
2929
<SelectValue placeholder="Select Chain" />
3030
</SelectTrigger>
3131
<SelectContent className="border-grey-600">
32-
{filteredChains.map((chain) => (
32+
{chains.map((chain) => (
3333
<SelectItem key={chain.id} value={chain.id.toString()}>
3434
<img src={chain.icon} className="size-4" alt="" /> {chain.name}
3535
</SelectItem>

src/config/config.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import arbitrumIcon from '@/assets/chain-icons/arbitrum.svg';
22
import iexecLogo from '@/assets/iexec-logo.svg';
3-
import { bellecour, arbitrum } from '../utils/wagmiNetworks';
3+
import wagmiNetworks from '@/utils/wagmiNetworks';
44

55
export const ITEMS_PER_PAGE = 6;
66

@@ -11,6 +11,7 @@ export const CONTACT_URL =
1111
// Chain ID constants
1212
export const BELLECOUR_CHAIN_ID = 134;
1313
export const ARBITRUM_CHAIN_ID = 42161;
14+
export const ARBITRUM_SEPOLIA_CHAIN_ID = 421614;
1415

1516
// Workerpool configuration
1617
export const WORKERPOOL_ADDRESS_OR_ENS = 'prod-v8-learn.main.pools.iexec.eth';
@@ -35,7 +36,7 @@ export const SUPPORTED_CHAINS = [
3536
bridge: 'https://bridge-bellecour.iex.ec/',
3637
bridgeInformation:
3738
'Move your xRLC in your wallet between bellecour and Ethereum Mainnet with our bridge.',
38-
wagmiNetwork: bellecour,
39+
wagmiNetwork: wagmiNetworks.bellecour,
3940
tokenSymbol: 'xRLC',
4041
whitelist: {
4142
web3mail: '0x781482c39cce25546583eac4957fb7bf04c277d2',
@@ -51,11 +52,26 @@ export const SUPPORTED_CHAINS = [
5152
blockExplorerUrl: 'https://arbiscan.io/',
5253
subgraphUrl:
5354
'https://thegraph.arbitrum.iex.ec/api/subgraphs/id/B1comLe9SANBLrjdnoNTJSubbeC7cY7EoNu6zD82HeKy',
54-
wagmiNetwork: arbitrum,
55+
wagmiNetwork: wagmiNetworks.arbitrum,
5556
tokenSymbol: 'RLC',
5657
whitelist: {
5758
web3mail: '0xD5054a18565c4a9E5c1aa3cEB53258bd59d4c78C',
5859
web3telegram: '0x53AFc09a647e7D5Fa9BDC784Eb3623385C45eF89',
5960
},
6061
},
62+
{
63+
id: ARBITRUM_SEPOLIA_CHAIN_ID,
64+
name: 'Arbitrum Sepolia',
65+
slug: 'arbitrum-sepolia-testnet',
66+
color: '#28A0F080',
67+
icon: arbitrumIcon,
68+
blockExplorerUrl: 'https://sepolia.arbiscan.io/',
69+
subgraphUrl: {
70+
poco: 'https://thegraph.arbitrum-sepolia-testnet.iex.ec/api/subgraphs/id/2GCj8gzLCihsiEDq8cYvC5nUgK6VfwZ6hm3Wj8A3kcxz',
71+
dataprotector:
72+
'https://thegraph.arbitrum-sepolia-testnet.iex.ec/api/subgraphs/id/5YjRPLtjS6GH6bB4yY55Qg4HzwtRGQ8TaHtGf9UBWWd',
73+
},
74+
wagmiNetwork: wagmiNetworks.arbitrumSepolia,
75+
tokenSymbol: 'RLC',
76+
},
6177
] as const;

src/externals/iexecSdkClient.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ export async function initIExecSDKs({ connector }: { connector?: Connector }) {
4646
return;
4747
}
4848

49-
const dataProtectorParent = new IExecDataProtector(provider);
49+
// TODO: remove allowExperimentalNetworks in next sdk update
50+
const dataProtectorParent = new IExecDataProtector(provider, {
51+
allowExperimentalNetworks: true,
52+
});
5053

5154
iExecDataProtectorCore = dataProtectorParent.core;
5255
iExecDataProtectorSharing = dataProtectorParent.sharing;
@@ -63,15 +66,18 @@ export async function initIExecSDKs({ connector }: { connector?: Connector }) {
6366
});
6467
DATA_PROTECTOR_SHARING_CLIENT_RESOLVES.length = 0;
6568

66-
iExecWeb3mail = new IExecWeb3mail(provider);
69+
// TODO: remove allowExperimentalNetworks in next sdk update
70+
iExecWeb3mail = new IExecWeb3mail(provider, {
71+
allowExperimentalNetworks: true,
72+
});
6773
WEB3MAIL_CLIENT_RESOLVES.forEach((resolve) => {
6874
return resolve(iExecWeb3mail);
6975
});
7076
WEB3MAIL_CLIENT_RESOLVES.length = 0;
7177

72-
//TODO: Remove hardcoded IPFS node when new IExecWeb3telegram version is released
78+
// TODO: remove allowExperimentalNetworks in next sdk update
7379
iExecWeb3telegram = new IExecWeb3telegram(provider, {
74-
ipfsNode: 'https://ipfs-upload.v8-bellecour.iex.ec',
80+
allowExperimentalNetworks: true,
7581
});
7682
WEB3TELEGRAM_CLIENT_RESOLVES.forEach((resolve) => {
7783
return resolve(iExecWeb3telegram);

src/hooks/useWatchAccount.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ export function useWatchAccount() {
2323
setChainId(accountChain.id);
2424
}
2525

26+
cleanIExecSDKs();
2627
// Update dataProtector client
2728
if (status === 'connected') {
2829
initIExecSDKs({ connector });
2930
return;
3031
}
31-
cleanIExecSDKs();
3232
}, [
3333
connector,
3434
status,

src/utils/wagmiNetworks.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { AppKitNetwork, arbitrum } from '@reown/appkit/networks';
2-
3-
export { arbitrum } from '@reown/appkit/networks';
1+
import {
2+
AppKitNetwork,
3+
arbitrum,
4+
arbitrumSepolia,
5+
} from '@reown/appkit/networks';
46

57
export const bellecour: AppKitNetwork = {
68
id: 0x86,
@@ -26,6 +28,7 @@ export const bellecour: AppKitNetwork = {
2628
const wagmiNetworks = {
2729
bellecour,
2830
arbitrum,
31+
arbitrumSepolia,
2932
};
3033

3134
export default wagmiNetworks;

0 commit comments

Comments
 (0)