Skip to content

Commit

Permalink
fix(contracts-sdk): correct rpc for browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Ansonhkg committed Jun 28, 2024
1 parent bfe0cac commit 83c7382
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions packages/contracts-sdk/src/lib/contracts-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ import { minStakingAbi } from '../abis/minAbi/minStakingAbi';
// const DEFAULT_RPC = 'https://lit-protocol.calderachain.xyz/replica-http';
// const DEFAULT_READ_RPC = 'https://lit-protocol.calderachain.xyz/replica-http';

const BLOCK_EXPLORER = 'https://chain.litprotocol.com/';

// This function asynchronously executes a provided callback function for each item in the given array.
// The callback function is awaited before continuing to the next iteration.
// The resulting array of callback return values is then returned.
Expand Down Expand Up @@ -280,15 +278,27 @@ export class LitContracts {
throw new Error(msg);
}

const chainInfo = {
const chronicleChainInfo = {
chainId: '0x2AC49',
chainName: 'Chronicle - Lit Protocol Testnet',
nativeCurrency: { name: 'LIT', symbol: 'LIT', decimals: 18 },
rpcUrls: this.rpcs,
blockExplorerUrls: [BLOCK_EXPLORER],
blockExplorerUrls: ['https://chain.litprotocol.com/'],
iconUrls: ['future'],
};

const vesuviusChainInfo = {
chainId: '0x907',
chainName: 'Vesuvius - Lit Protocol Devnet',
nativeCurrency: { name: 'testLit', symbol: 'testLit', decimals: 18 },
rpcUrls: this.rpcs,
blockExplorerUrls: ['https://vesuvius-explorer.litprotocol.com/'],
iconUrls: ['future'],
};

const chainInfo =
this.network === 'datil-dev' ? vesuviusChainInfo : chronicleChainInfo;

try {
await web3Provider.send('wallet_switchEthereumChain', [
{ chainId: chainInfo.chainId },
Expand Down

0 comments on commit 83c7382

Please sign in to comment.