Skip to content

Commit

Permalink
Merge pull request #290 from massalabs/289-massa-web3-client-initiali…
Browse files Browse the repository at this point in the history
…zation

Change CHAIN_ID.MainNet on custom client tab
  • Loading branch information
Adrien LF authored Mar 6, 2024
2 parents 397ed85 + 6fb371e commit e5da6c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/build/massa-web3/massa-web3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ const testnetClient: Client = await ClientFactory.createDefaultClient(
const baseAccount: IAccount = await WalletClient.getAccountFromSecretKey(
privateKey
);
const chainId = CHAIN_ID.Sandbox;

// You must set the `chainId` to match the network your client intends to interact with.
const chainId = CHAIN_ID.MainNet;

const testnetClient: Client = await ClientFactory.createDefaultClient(
DefaultProviderUrls.LOCALNET,
Expand All @@ -192,7 +194,9 @@ You can also create a custom client connecting to a node whose ip and ports are
const baseAccount: IAccount = await WalletClient.getAccountFromSecretKey(
privateKey
);
const chainId = CHAIN_ID.Sandbox;

// You must set the `chainId` to match the network your client intends to interact with.
const chainId = CHAIN_ID.MainNet;

// initialize a custom client using an own provider
const providers: Array<IProvider> = [
Expand Down

0 comments on commit e5da6c2

Please sign in to comment.