Skip to content

Commit b69dbd9

Browse files
authored
Merge pull request #1112 from Web3Auth/v10-connect-blockchain
V10: Doc Improvements & Custom Chain Integration Updates
2 parents 742565e + cfec088 commit b69dbd9

File tree

200 files changed

+6401
-6460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+6401
-6460
lines changed

docs/connect-blockchain/connect-blockchain.mdx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,13 @@ transactions, smart contract wallets, different elliptic curve pairs and even RS
3939

4040
:::
4141

42-
## Private Key Providers (PnP & SFA)
42+
## For Web3Auth PnP Web SDK
4343

44-
The Private Key Providers work with the majority of Web3Auth products, including Plug and Play SDKs
45-
and Single Factor Auth Mobile SDKs. As the name suggests these providers are a wrapper around the
46-
user's private key, which is dynamically reconstructed with Shamir's Secret Sharing and is present
47-
in the user's frontend.
44+
The Web3Auth PnP Web SDK(`@web3auth/modal`) from v10 onwards does not need any additional setup on
45+
the code side for blockchain connections. All of it is handled on the Dashboard. We can use any
46+
chain from the extensive list of predefined chains and add more if we need.
4847

49-
Once the authentication happens, the returned result from the Web3Auth network is taken up by the
50-
provider to give a common interface to interact with the blockchain of your choice. Currently,
51-
Web3Auth supports the following private key providers for Web SDKs:
52-
53-
- [EIP1193 Private Key Provider](/sdk/web/react): For connecting to EVM based chains
54-
- [Solana Private Key Provider](/sdk/web/react): For connecting with Solana Blockchain
55-
- [XRPL Private Key Provider](/sdk/web/react): For connecting with XRPL Blockchain
56-
- [Common Private Key Provider](/sdk/web/react): For connecting with any blockchain.
48+
![Chains on Dashboard](https://i.ibb.co/4nCD2GTJ/chains.gif)
5749

5850
## MPC Core Kit Providers
5951

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: Add Custom Chains to the Dashboard
3+
sidebar_label: Add Custom Chains to the Dashboard
4+
image: "images/docs-meta-cards/documentation-card.png"
5+
description: "Add Custom Chains | Documentation - Web3Auth"
6+
---
7+
8+
Web3Auth PnP V10 onwards does not need any additional setup on the code side for blockchain
9+
connections. All of it is handled on our updated Dashboard. We can use any chain from the extensive
10+
list of predefined chains and add more if we need by toggling them on.
11+
12+
![Chains on Dashboard](https://i.ibb.co/4nCD2GTJ/chains.gif)
13+
14+
## Adding Custom Chains
15+
16+
To add a custom chain, we need to follow these steps:
17+
18+
1. Go to the [Dashboard](https://dashboard.web3auth.io).
19+
2. Click on the `Projects` section and select the project you want to add the custom chain to.
20+
3. Click on the `Chains & Networks` tab.
21+
4. Fill in the details of the chain you want to add.(Like LogoURL, Network Name etc.)
22+
5. Then press Save Network blue button at the bottom.
23+
24+
![Adding Custom Chain](/images/connect-blockchain/add-a-chain-dashboard-v2.png)
25+
26+
## Adding Chains on Code-side for PnP Web SDK
27+
28+
While chains can be configured through the dashboard, you can also override these settings in your
29+
code by specifying custom chains during SDK initialization.
30+
31+
### Example
32+
33+
```typescript title="App.tsx"
34+
import { Web3Auth, WEB3AUTH_NETWORK, CHAIN_NAMESPACES } from "@web3auth/modal";
35+
36+
// Define custom chain configurations
37+
const evmChainConfig = {
38+
chainNamespace: CHAIN_NAMESPACES.EIP155,
39+
chainId: "0xaa36a7", // Sepolia chainId in hex
40+
rpcTarget: "https://1rpc.io/sepolia",
41+
displayName: "Ethereum Sepolia Testnet",
42+
blockExplorerUrl: "https://sepolia.etherscan.io",
43+
ticker: "ETH",
44+
tickerName: "Ethereum",
45+
decimals: 18,
46+
logo: "https://cryptologos.cc/logos/ethereum-eth-logo.png",
47+
};
48+
49+
const arbitrumChainConfig = {
50+
chainNamespace: CHAIN_NAMESPACES.EIP155,
51+
chainId: "0x66eee", // Arbitrum Sepolia (421614 in hex)
52+
rpcTarget: "https://sepolia-rollup.arbitrum.io/rpc",
53+
displayName: "Arbitrum Sepolia Testnet",
54+
blockExplorerUrl: "https://sepolia.arbiscan.io/",
55+
ticker: "AETH",
56+
tickerName: "AETH",
57+
decimals: 18,
58+
logo: "https://arbitrum.foundation/images/logo.png",
59+
};
60+
61+
// Initialize Web3Auth with custom chains
62+
const web3auth = new Web3Auth({
63+
clientId: "YOUR_CLIENT_ID",
64+
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
65+
chains: [evmChainConfig, arbitrumChainConfig], // Pass array of custom chains
66+
defaultChainId: "0x66eee", // Set default chain by chainId
67+
});
68+
```
69+
70+
By using the `chains` parameter, you can specify multiple chain configurations for your application,
71+
only provided chains will be used. The `defaultChainId` parameter allows you to set which chain
72+
should be used by default.
73+
74+
This approach gives you flexibility to dynamically configure chains in your code while maintaining
75+
the ease of dashboard configuration for your project.

docs/connect-blockchain/evm/5ire/5ire.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ description: "Integrate Web3Auth with the 5ire Blockchain | Documentation - Web3
99

1010
import Tiles from "@theme/Tiles";
1111
import SEO from "@site/src/components/SEO";
12+
import ChainDetails5ire from "@site/src/common/docs/general-connect-blockchain/_5ire.mdx";
1213

1314
<SEO
1415
title="Integrate Web3Auth with the 5ire Blockchain"
@@ -26,6 +27,10 @@ make calls to the network.
2627
This documentation provides a straightforward guide for developers looking to implement blockchain
2728
connections quickly and effortlessly across various platforms.
2829

30+
## Chain Details for 5ire
31+
32+
<ChainDetails5ire />
33+
2934
export const fire = [
3035
{
3136
name: "",

docs/connect-blockchain/evm/5ire/unity.mdx

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import GetBalanceSnippet from "@site/src/common/docs/unity-connect-blockchain/_e
1414
import InitialisationSnippet from "@site/src/common/docs/unity-connect-blockchain/_evm-initialisation.mdx";
1515
import SignMessageSnippet from "@site/src/common/docs/unity-connect-blockchain/_evm-sign-message.mdx";
1616
import SendTransactionSnippet from "@site/src/common/docs/unity-connect-blockchain/_evm-send-transaction.mdx";
17+
import ChainDetails5ire from "@site/src/common/docs/general-connect-blockchain/_5ire.mdx";
1718
import Tabs from "@theme/Tabs";
1819
import TabItem from "@theme/TabItem";
1920
import SEO from "@site/src/components/SEO";
@@ -37,41 +38,7 @@ you started.
3738

3839
## Chain Details for 5ire
3940

40-
<Tabs
41-
defaultValue="mainnet"
42-
values={[
43-
{ label: "Mainnet", value: "mainnet", },
44-
{ label: "Testnet", value: "testnet", },
45-
]}
46-
>
47-
<TabItem
48-
value="mainnet"
49-
>
50-
51-
- Chain ID: 0x3E3
52-
- Public RPC URL: https://rpc.5ire.network (Avoid using public rpcTarget in production, use services
53-
like Infura)
54-
- Display Name: 5ireChain Mainnet
55-
- Block Explorer Link: https://5irescan.io
56-
- Ticker: 5ire
57-
- Ticker Name: 5ire
58-
59-
</TabItem>
60-
61-
<TabItem
62-
value="testnet"
63-
>
64-
65-
- Chain ID: 0x3E5
66-
- Public RPC URL: https://rpc.testnet.5ire.network (Avoid using public rpcTarget in production, use
67-
services like Infura)
68-
- Display Name: 5ireChain Testnet
69-
- Block Explorer Link: https://testnet.5irescan.io
70-
- Ticker: 5ire
71-
- Ticker Name: 5ire
72-
73-
</TabItem>
74-
</Tabs>
41+
<ChainDetails5ire />
7542

7643
## Initialize
7744

docs/connect-blockchain/evm/5ire/web.mdx

Lines changed: 7 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ import DeployContractSolidityDeploySnippet from "@site/src/common/docs/_smart-co
2020
import DeployContractSolidityReadSnippet from "@site/src/common/docs/_smart-contract-solidity-read.mdx";
2121
import DeployContractSolidityWriteSnippet from "@site/src/common/docs/_smart-contract-solidity-write.mdx";
2222
import FetchUserPrivateKeySnippet from "@site/src/common/docs/web-connect-blockchain/_evm-fetch-user-private-key.mdx";
23+
import GetWeb3AuthProvider from "@site/src/common/docs/_get-web3auth-provider.mdx";
2324
import InitializeWeb3Auth from "@site/src/common/docs/_initialize-web3auth-evm-pnp-sfa.mdx";
25+
import ChainDetails5ire from "@site/src/common/docs/general-connect-blockchain/_5ire.mdx";
2426
import TabItem from "@theme/TabItem";
2527
import Tabs from "@theme/Tabs";
2628
import SEO from "@site/src/components/SEO";
@@ -53,62 +55,14 @@ Using `eip155` as `chainNamespace` while initializing `web3auth` will provide an
5355
[`EIP1193`](https://eips.ethereum.org/EIPS/eip-1193) compatible provider as **`web3auth.provider`**
5456
after successful authentication.
5557

56-
### Getting the `chainConfig`
57-
58-
<Tabs
59-
defaultValue="mainnet"
60-
values={[
61-
{ label: "Mainnet", value: "mainnet", },
62-
{ label: "Testnet", value: "testnet", },
63-
]}
64-
>
65-
<TabItem
66-
value="mainnet"
67-
>
68-
69-
```typescript
70-
const chainConfig = {
71-
chainNamespace: CHAIN_NAMESPACES.EIP155,
72-
chainId: "0x3E3", // hex of 995, 5ireChain Mainnet
73-
rpcTarget: "https://rpc.5ire.network",
74-
// Avoid using public rpcTarget in production.
75-
// Use services like Infura
76-
displayName: "5ireChain Mainnet",
77-
blockExplorerUrl: "https://5irescan.io",
78-
ticker: "5ire",
79-
tickerName: "5ire",
80-
logo: "https://i.ibb.co/TYkdN1g/logo-5ire.png",
81-
};
82-
```
83-
84-
</TabItem>
85-
86-
<TabItem
87-
value="testnet"
88-
>
89-
90-
```typescript
91-
const chainConfig = {
92-
chainNamespace: CHAIN_NAMESPACES.EIP155,
93-
chainId: "0x3E5", // hex of 997, 5ireChain Testnet
94-
rpcTarget: "https://rpc.testnet.5ire.network",
95-
// Avoid using public rpcTarget in production.
96-
// Use services like Infura
97-
displayName: "5ireChain Testnet",
98-
blockExplorerUrl: "https://testnet.5irescan.io",
99-
ticker: "5ire",
100-
tickerName: "5ire",
101-
logo: "https://i.ibb.co/TYkdN1g/logo-5ire.png",
102-
};
103-
```
104-
105-
</TabItem>
106-
</Tabs>
107-
108-
### Initializing and Instantiating the Web3Auth SDK
58+
### Initializing and instantiating the Web3Auth SDK
10959

11060
<InitializeWeb3Auth />
11161

62+
## Getting the Web3Auth provider
63+
64+
<GetWeb3AuthProvider />
65+
11266
## Get User Info
11367

11468
<GetUserInfoSnippet />

docs/connect-blockchain/evm/aleph-zero/aleph-zero.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@ sidebar_label: Aleph Zero
44
hide_table_of_contents: true
55

66
image: "banners/aleph-zero.png"
7-
description: "Integrate Web3Auth with the Aleph zero Blockchain | Documentation - Web3Auth"
7+
description: "Integrate Web3Auth with the Aleph Zero Blockchain | Documentation - Web3Auth"
88
---
99

1010
import Tiles from "@theme/Tiles";
1111
import SEO from "@site/src/components/SEO";
12+
import ChainDetailsAlephZero from "@site/src/common/docs/general-connect-blockchain/_aleph-zero.mdx";
1213

1314
<SEO
14-
title="Integrate Web3Auth with the Aleph zero Blockchain"
15-
description="Integrate Web3Auth with the Aleph zero Blockchain | Documentation - Web3Auth"
15+
title="Integrate Web3Auth with the Aleph Zero Blockchain"
16+
description="Integrate Web3Auth with the Aleph Zero Blockchain | Documentation - Web3Auth"
1617
image="https://web3auth.io/docs/banners/aleph-zero.png"
1718
slug="/connect-blockchain/evm/aleph-zero"
1819
/>
1920

20-
Integrate Web3Auth seamlessly with EVM-based Aleph zero Blockchain. For Web SDKs, Web3Auth returns a
21-
provider that can be directly used to initialize the libraries like ethers.js, web3.js etc. and make
22-
blockchain calls, while for Mobile & Gaming SDKs, the private key is available in the user scope
23-
which can be used in a similar way to initialize the respective blockchain interaction libraries and
24-
make calls to the network.
21+
The Aleph Zero blockchain's integration with Web3Auth, helps you get started with the integration in
22+
a matter of minutes. The integration is available for the following platforms: Web, Android, iOS,
23+
Flutter, React Native, and Unity.
2524

26-
This documentation provides a straightforward guide for developers looking to implement blockchain
27-
connections quickly and effortlessly across various platforms.
25+
## Chain Details for Aleph Zero
2826

29-
export const Alephzero = [
27+
<ChainDetailsAlephZero />
28+
29+
export const AlephZero = [
3030
{
3131
name: "",
3232
description: "",
@@ -71,4 +71,4 @@ export const Alephzero = [
7171
},
7272
];
7373

74-
<Tiles tileGroups={Alephzero} />
74+
<Tiles tileGroups={AlephZero} />

docs/connect-blockchain/evm/aleph-zero/unity.mdx

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import GetBalanceSnippet from "@site/src/common/docs/unity-connect-blockchain/_e
1414
import InitialisationSnippet from "@site/src/common/docs/unity-connect-blockchain/_evm-initialisation.mdx";
1515
import SignMessageSnippet from "@site/src/common/docs/unity-connect-blockchain/_evm-sign-message.mdx";
1616
import SendTransactionSnippet from "@site/src/common/docs/unity-connect-blockchain/_evm-send-transaction.mdx";
17+
import ChainDetailsAlephZero from "@site/src/common/docs/general-connect-blockchain/_aleph-zero.mdx";
1718
import Tabs from "@theme/Tabs";
1819
import TabItem from "@theme/TabItem";
1920
import SEO from "@site/src/components/SEO";
@@ -37,41 +38,7 @@ examples to get you started.
3738

3839
## Chain Details for Aleph Zero
3940

40-
<Tabs
41-
defaultValue="mainnet"
42-
values={[
43-
{ label: "Mainnet", value: "mainnet", },
44-
{ label: "Testnet", value: "testnet", },
45-
]}
46-
>
47-
<TabItem
48-
value="mainnet"
49-
>
50-
51-
- Chain ID: 0xA1EF
52-
- Public RPC URL: https://rpc.alephzero.raas.gelato.cloud (Avoid using public rpcTarget in
53-
production, use services like Infura)
54-
- Display Name: Aleph Zero Mainnet
55-
- Block Explorer Link: https://evm-explorer.alephzero.org
56-
- Ticker: AZERO
57-
- Ticker Name: Aleph Zero
58-
59-
</TabItem>
60-
61-
<TabItem
62-
value="testnet"
63-
>
64-
65-
- Chain ID: 0x7F7
66-
- Public RPC URL: https://rpc.alephzero-testnet.gelato.digital (Avoid using public rpcTarget in
67-
production, use services like Infura)
68-
- Display Name: Aleph Zero Testnet
69-
- Block Explorer Link: https://evm-explorer-testnet.alephzero.org
70-
- Ticker: tAZERO
71-
- Ticker Name: Aleph Zero
72-
73-
</TabItem>
74-
</Tabs>
41+
<ChainDetailsAlephZero />
7542

7643
## Initialize
7744

0 commit comments

Comments
 (0)