Skip to content
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
4 changes: 2 additions & 2 deletions src/components/navBar/ChainSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function ChainSelector({ className }: { className?: string }) {
await switchChain(wagmiAdapter.wagmiConfig, { chainId });
};

const filteredChains = getSupportedChains();
const chains = getSupportedChains();

return (
<Select
Expand All @@ -29,7 +29,7 @@ export function ChainSelector({ className }: { className?: string }) {
<SelectValue placeholder="Select Chain" />
</SelectTrigger>
<SelectContent className="border-grey-600">
{filteredChains.map((chain) => (
{chains.map((chain) => (
<SelectItem key={chain.id} value={chain.id.toString()}>
<img src={chain.icon} className="size-4" alt="" /> {chain.name}
</SelectItem>
Expand Down
22 changes: 19 additions & 3 deletions src/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import arbitrumIcon from '@/assets/chain-icons/arbitrum.svg';
import iexecLogo from '@/assets/iexec-logo.svg';
import { bellecour, arbitrum } from '../utils/wagmiNetworks';
import wagmiNetworks from '@/utils/wagmiNetworks';

export const ITEMS_PER_PAGE = 6;

Expand All @@ -11,6 +11,7 @@ export const CONTACT_URL =
// Chain ID constants
export const BELLECOUR_CHAIN_ID = 134;
export const ARBITRUM_CHAIN_ID = 42161;
export const ARBITRUM_SEPOLIA_CHAIN_ID = 421614;

// Workerpool configuration
export const WORKERPOOL_ADDRESS_OR_ENS = 'prod-v8-learn.main.pools.iexec.eth';
Expand All @@ -35,7 +36,7 @@ export const SUPPORTED_CHAINS = [
bridge: 'https://bridge-bellecour.iex.ec/',
bridgeInformation:
'Move your xRLC in your wallet between bellecour and Ethereum Mainnet with our bridge.',
wagmiNetwork: bellecour,
wagmiNetwork: wagmiNetworks.bellecour,
tokenSymbol: 'xRLC',
whitelist: {
web3mail: '0x781482c39cce25546583eac4957fb7bf04c277d2',
Expand All @@ -51,11 +52,26 @@ export const SUPPORTED_CHAINS = [
blockExplorerUrl: 'https://arbiscan.io/',
subgraphUrl:
'https://thegraph.arbitrum.iex.ec/api/subgraphs/id/B1comLe9SANBLrjdnoNTJSubbeC7cY7EoNu6zD82HeKy',
wagmiNetwork: arbitrum,
wagmiNetwork: wagmiNetworks.arbitrum,
tokenSymbol: 'RLC',
whitelist: {
web3mail: '0xD5054a18565c4a9E5c1aa3cEB53258bd59d4c78C',
web3telegram: '0x53AFc09a647e7D5Fa9BDC784Eb3623385C45eF89',
},
},
{
id: ARBITRUM_SEPOLIA_CHAIN_ID,
name: 'Arbitrum Sepolia',
slug: 'arbitrum-sepolia-testnet',
color: '#28A0F080',
icon: arbitrumIcon,
blockExplorerUrl: 'https://sepolia.arbiscan.io/',
subgraphUrl: {
poco: 'https://thegraph.arbitrum-sepolia-testnet.iex.ec/api/subgraphs/id/2GCj8gzLCihsiEDq8cYvC5nUgK6VfwZ6hm3Wj8A3kcxz',
dataprotector:
'https://thegraph.arbitrum-sepolia-testnet.iex.ec/api/subgraphs/id/5YjRPLtjS6GH6bB4yY55Qg4HzwtRGQ8TaHtGf9UBWWd',
},
wagmiNetwork: wagmiNetworks.arbitrumSepolia,
tokenSymbol: 'RLC',
},
] as const;
14 changes: 10 additions & 4 deletions src/externals/iexecSdkClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ export async function initIExecSDKs({ connector }: { connector?: Connector }) {
return;
}

const dataProtectorParent = new IExecDataProtector(provider);
// TODO: remove allowExperimentalNetworks in next sdk update
const dataProtectorParent = new IExecDataProtector(provider, {
allowExperimentalNetworks: true,
});

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

iExecWeb3mail = new IExecWeb3mail(provider);
// TODO: remove allowExperimentalNetworks in next sdk update
iExecWeb3mail = new IExecWeb3mail(provider, {
allowExperimentalNetworks: true,
});
WEB3MAIL_CLIENT_RESOLVES.forEach((resolve) => {
return resolve(iExecWeb3mail);
});
WEB3MAIL_CLIENT_RESOLVES.length = 0;

//TODO: Remove hardcoded IPFS node when new IExecWeb3telegram version is released
// TODO: remove allowExperimentalNetworks in next sdk update
iExecWeb3telegram = new IExecWeb3telegram(provider, {
ipfsNode: 'https://ipfs-upload.v8-bellecour.iex.ec',
allowExperimentalNetworks: true,
});
WEB3TELEGRAM_CLIENT_RESOLVES.forEach((resolve) => {
return resolve(iExecWeb3telegram);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useWatchAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ export function useWatchAccount() {
setChainId(accountChain.id);
}

cleanIExecSDKs();
// Update dataProtector client
if (status === 'connected') {
initIExecSDKs({ connector });
return;
}
cleanIExecSDKs();
}, [
connector,
status,
Expand Down
9 changes: 6 additions & 3 deletions src/utils/wagmiNetworks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { AppKitNetwork, arbitrum } from '@reown/appkit/networks';

export { arbitrum } from '@reown/appkit/networks';
import {
AppKitNetwork,
arbitrum,
arbitrumSepolia,
} from '@reown/appkit/networks';

export const bellecour: AppKitNetwork = {
id: 0x86,
Expand All @@ -26,6 +28,7 @@ export const bellecour: AppKitNetwork = {
const wagmiNetworks = {
bellecour,
arbitrum,
arbitrumSepolia,
};

export default wagmiNetworks;