Skip to content

Commit d562262

Browse files
authored
Merge branch 'master' into sfa-web-improvements
2 parents d9cbf31 + a7a2d4e commit d562262

File tree

249 files changed

+3181
-2353
lines changed

Some content is hidden

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

249 files changed

+3181
-2353
lines changed

docs/auth-provider-setup/aggregate-verifier.mdx

+3-11
Original file line numberDiff line numberDiff line change
@@ -166,21 +166,13 @@ You can aggregate two or more verifiers.
166166
import { Web3AuthNoModal } from "@web3auth/no-modal";
167167
import { AuthAdapter } from "@web3auth/auth-adapter";
168168
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";
169-
import { CHAIN_NAMESPACES } from "@web3auth/base";
169+
import { getEvmChainConfig } from "@web3auth/base";
170170

171171
const clientId =
172172
"BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ"; // get it from https://dashboard.web3auth.io by creating a Plug n Play project.
173173

174-
const chainConfig = {
175-
chainNamespace: CHAIN_NAMESPACES.EIP155,
176-
chainId: "0x1",
177-
rpcTarget: "https://rpc.ankr.com/eth",
178-
displayName: "Ethereum Mainnet",
179-
blockExplorerUrl: "https://etherscan.io",
180-
ticker: "ETH",
181-
tickerName: "Ethereum",
182-
logo: "https://images.toruswallet.io/ethereum.svg",
183-
};
174+
// Get custom chain configs for your chain from https://web3auth.io/docs/connect-blockchain
175+
const chainConfig = getEvmChainConfig(0x1, clientId)!;
184176

185177
const privateKeyProvider = new EthereumPrivateKeyProvider({ config: { chainConfig } });
186178

docs/auth-provider-setup/social-providers/telegram.mdx

+9-11
Original file line numberDiff line numberDiff line change
@@ -143,24 +143,22 @@ If you don't have a JWKS endpoint already, you can create one by following these
143143

144144
```tsx
145145
import { Web3AuthNoModal } from "@web3auth/no-modal";
146-
import { WALLET_ADAPTERS, CHAIN_NAMESPACES, UX_MODE, WEB3AUTH_NETWORK } from "@web3auth/base";
146+
import {
147+
WALLET_ADAPTERS,
148+
CHAIN_NAMESPACES,
149+
UX_MODE,
150+
WEB3AUTH_NETWORK,
151+
getEvmChainConfig,
152+
} from "@web3auth/base";
147153
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";
148154
import { AuthAdapter } from "@web3auth/auth-adapter";
149155

150156
const clientId =
151157
"BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ";
152158
// get it from https://dashboard.web3auth.io by creating a project.
153159

154-
const chainConfig = {
155-
chainNamespace: CHAIN_NAMESPACES.EIP155,
156-
chainId: "0x1",
157-
rpcTarget: "https://rpc.ankr.com/eth",
158-
displayName: "Ethereum Mainnet",
159-
blockExplorerUrl: "https://etherscan.io",
160-
ticker: "ETH",
161-
tickerName: "Ethereum",
162-
logo: "https://images.toruswallet.io/ethereum.svg",
163-
};
160+
// Get custom chain configs for your chain from https://web3auth.io/docs/connect-blockchain
161+
const chainConfig = getEvmChainConfig(0x1, clientId)!;
164162

165163
const privateKeyProvider = new EthereumPrivateKeyProvider({
166164
config: { chainConfig },
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
title: Built-in Chain Configs
3+
sidebar_label: Built-in Chain Configs
4+
5+
description: "Built-in Chain Configurations Provided by Web3Auth"
6+
image: "images/docs-meta-cards/documentation-card.png"
7+
---
8+
9+
Web3Auth provides **Built-in Chain Configurations** for certain popular blockchain networks. This
10+
simplifies the setup by abstracting away manual configuration steps. This convenience
11+
complements—but does not replace—the existing approach of manually specifying the entire chain
12+
configuration when needed.
13+
14+
For supported EVM-based chains, Web3Auth uses a **premium Infura service**, currently bundled
15+
conveniently with your Web3Auth setup.
16+
17+
## Type Declarations
18+
19+
Here's how these helper functions are declared:
20+
21+
```typescript
22+
import { ChainNamespaceType, CustomChainConfig } from "./IChainInterface";
23+
24+
export declare const getEvmChainConfig: (
25+
chainId: number,
26+
web3AuthClientId?: string,
27+
) => CustomChainConfig | null;
28+
export declare const getSolanaChainConfig: (chainId: number) => CustomChainConfig | null;
29+
export declare const getXrplChainConfig: (chainId: number) => CustomChainConfig | null;
30+
export declare const getChainConfig: (
31+
chainNamespace: ChainNamespaceType,
32+
chainId?: number | string,
33+
web3AuthClientId?: string,
34+
) => CustomChainConfig | null;
35+
```
36+
37+
## Usage
38+
39+
Web3Auth provides dedicated helper functions to fetch these built-in chain configurations:
40+
41+
### EVM Chains
42+
43+
```typescript
44+
import { getEvmChainConfig } from "@web3auth/base";
45+
46+
const clientId = "YOUR_WEB3AUTH_CLIENT_ID"; // get it from https://dashboard.web3auth.io
47+
48+
const chainConfig = getEvmChainConfig(0x1, clientId)!;
49+
```
50+
51+
:::info
52+
53+
Though the `web3AuthClientId` parameter appears optional, it is mandatory to access Web3Auth's
54+
bundled premium Infura RPC APIs. It's marked optional for backward compatibility and isn't required
55+
for non-EVM chains.
56+
57+
:::
58+
59+
### Solana Chains
60+
61+
```typescript
62+
import { getSolanaChainConfig } from "@web3auth/base";
63+
64+
const chainConfig = getSolanaChainConfig(0x1)!;
65+
```
66+
67+
### XRPL Chains
68+
69+
```typescript
70+
import { getXrplChainConfig } from "@web3auth/base";
71+
72+
const chainConfig = getXrplChainConfig(0x2)!;
73+
```
74+
75+
## Supported Chains and Chain IDs
76+
77+
### EVM Chains
78+
79+
| Chain Name | Decimal ID | Hexadecimal ID |
80+
| --------------------------- | ---------- | -------------- |
81+
| Ethereum Mainnet | 1 | `0x1` |
82+
| Optimism | 10 | `0xa` |
83+
| Base | 8453 | `0x2105` |
84+
| Arbitrum One | 42161 | `0xa4b1` |
85+
| Linea | 59144 | `0xe708` |
86+
| Sepolia Testnet | 11155111 | `0xaa36a7` |
87+
| Polygon Mainnet | 137 | `0x89` |
88+
| Polygon Amoy Testnet | 80002 | `0x13882` |
89+
| Binance Smart Chain Mainnet | 56 | `0x38` |
90+
| Binance Smart Chain Testnet | 97 | `0x61` |
91+
| Cronos Mainnet | 25 | `0x19` |
92+
| Cronos Testnet | 338 | `0x152` |
93+
| Klaytn Mainnet | 8217 | `0x2019` |
94+
| Soneium Minato Testnet | 1946 | `0x79a` |
95+
| Soneium Mainnet | 1868 | `0x74c` |
96+
97+
:::tip
98+
99+
If you're working with an EVM chain that's not listed here, you must provide the complete chain
100+
configuration yourself. Please refer to the
101+
[EVM Chain Configuration](/connect-blockchain/evm/evm.mdx) guide for detailed instructions.
102+
103+
:::
104+
105+
### Solana Chains
106+
107+
| Chain Name | Decimal IDs | Hexadecimal IDs |
108+
| -------------- | ----------- | --------------- |
109+
| Solana Mainnet | 1, 101 | `0x1`, `0x65` |
110+
| Solana Testnet | 2, 102 | `0x2`, `0x66` |
111+
| Solana Devnet | 3, 103 | `0x3`, `0x67` |
112+
113+
### XRPL Chains
114+
115+
| Chain Name | Decimal ID | Hexadecimal ID |
116+
| ------------ | ---------- | -------------- |
117+
| XRPL Mainnet | 1 | `0x1` |
118+
| XRPL Testnet | 2 | `0x2` |
119+
| XRPL Devnet | 3 | `0x3` |

docs/connect-blockchain/connect-blockchain.mdx

+3-34
Original file line numberDiff line numberDiff line change
@@ -93,32 +93,6 @@ gateway to the Ethereum network, allowing developers to build and scale decentra
9393
without having to run their own infrastructure. Most of the Web3Auth backend infrastructure runs on
9494
Infura APIs.
9595

96-
#### Quicknode
97-
98-
[Quicknode](https://www.quicknode.com/) is a managed blockchain node service that provides
99-
high-performance access to 15+ blockchains, including Ethereum, Gnosis (xDAI), Polygon, Binance
100-
101-
Smart Chain, Avalanche, Fantom, Solana, Optimism, Arbitrum (+Nova), Algorand, Harmony, Celo, Neon,
102-
Terra and Bitcoin networks. They're the biggest node providers for the Solana Ecosystem, and our
103-
major partners for Solana infrastructure.
104-
105-
#### Alchemy
106-
107-
As a developer platform, [Alchemy](https://www.alchemy.com/) provides a suite of developer toolings
108-
and abstractions including JSON RPC APIs across all major chains, an ethers.js SDK, and a library of
109-
[enhanced APIs](https://docs.alchemy.com/reference/enhanced-apis-overview) like their NFT APIs.
110-
111-
#### Ankr
112-
113-
[Ankr](https://www.ankr.com/) is a decentralized cloud computing platform that provides a full suite
114-
of infrastructure services for blockchain developers. Most of the examples in our documentation use
115-
Ankr's Public JSON RPC APIs, to help you kickstart.
116-
117-
#### dRPC
118-
119-
[dRPC](https://drpc.org) is a new type of RPC services, that combined 30+ RPC provider across the
120-
globe in one computation pool, to provide best possible reliability and latency.
121-
12296
## Faucets for Different Blockchains
12397

12498
Faucets are services that provide users with a small amount of cryptocurrency for free. These are
@@ -127,12 +101,10 @@ popular faucet services for different test blockchains:
127101

128102
- Amoy Polygon faucet
129103
- https://faucet.polygon.technology/
130-
- https://www.alchemy.com/faucets/polygon-amoy
131-
- https://faucet.quicknode.com/polygon/amoy
132104
- Avalanche
133105
- https://faucet.avax.network/
134106
- Base Sepolia Faucet
135-
- https://www.alchemy.com/faucets/base-sepolia
107+
- https://docs.base.org/chain/network-faucets
136108
- Binance Smart Chain Faucet
137109
- https://www.bnbchain.org/en/testnet-faucet
138110
- Cosmos
@@ -143,13 +115,10 @@ popular faucet services for different test blockchains:
143115
- https://faucet.polkadot.io/
144116
- Sepolia Ethereum Faucet
145117
- https://www.infura.io/faucet/sepolia
146-
- https://www.alchemy.com/faucets/ethereum-sepolia
147118
- (Sepolia PoW Faucet)[https://sepolia-faucet.pk910.de/]
148-
- https://faucet.quicknode.com/ethereum/sepolia
149-
- https://faucets.chain.link/
150119
- Solana
151120
- https://faucet.solana.com/
152121
- Gnosis
153-
- https://drpc.org/faucet/gnosis
122+
- https://faucet.gnosischain.com/
154123
- Lisk
155-
- https://drpc.org/faucet/lisk
124+
- https://docs.lisk.com/lisk-tools/faucets/

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ with smart contracts. We have highlighted a few examples to get you started quic
5050

5151
- Chain ID: 0x3E3
5252
- Public RPC URL: https://rpc.5ire.network (Avoid using public rpcTarget in production, use services
53-
like Infura, Quicknode etc)
53+
like Infura)
5454
- Display Name: 5ireChain Mainnet
5555
- Block Explorer Link: https://5irescan.io
5656
- Ticker: 5ire
@@ -64,7 +64,7 @@ with smart contracts. We have highlighted a few examples to get you started quic
6464

6565
- Chain ID: 0x3E5
6666
- Public RPC URL: https://rpc.testnet.5ire.network (Avoid using public rpcTarget in production, use
67-
services like Infura, Quicknode etc)
67+
services like Infura)
6868
- Display Name: 5ireChain Testnet
6969
- Block Explorer Link: https://testnet.5irescan.io
7070
- Ticker: 5ire

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const chainConfig = {
6464
chainId: "0x3E3", // hex of 995, 5ireChain Mainnet
6565
rpcTarget: "https://rpc.5ire.network",
6666
// Avoid using public rpcTarget in production.
67-
// Use services like Infura, Quicknode etc
67+
// Use services like Infura
6868
displayName: "5ireChain Mainnet",
6969
blockExplorer: "https://5irescan.io",
7070
ticker: "5ire",
@@ -84,7 +84,7 @@ const chainConfig = {
8484
chainId: "0x3E5", // hex of 997, 5ireChain Testnet
8585
rpcTarget: "https://rpc.testnet.5ire.network",
8686
// Avoid using public rpcTarget in production.
87-
// Use services like Infura, Quicknode etc
87+
// Use services like Infura
8888
displayName: "5ireChain Testnet",
8989
blockExplorer: "https://testnet.5irescan.io",
9090
ticker: "5ire",

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ you started.
5050

5151
- Chain ID: 0x3E3
5252
- Public RPC URL: https://rpc.5ire.network (Avoid using public rpcTarget in production, use services
53-
like Infura, Quicknode etc)
53+
like Infura)
5454
- Display Name: 5ireChain Mainnet
5555
- Block Explorer Link: https://5irescan.io
5656
- Ticker: 5ire
@@ -64,7 +64,7 @@ you started.
6464

6565
- Chain ID: 0x3E5
6666
- Public RPC URL: https://rpc.testnet.5ire.network (Avoid using public rpcTarget in production, use
67-
services like Infura, Quicknode etc)
67+
services like Infura)
6868
- Display Name: 5ireChain Testnet
6969
- Block Explorer Link: https://testnet.5irescan.io
7070
- Ticker: 5ire

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const chainConfig = {
7272
chainId: "0x3E3", // hex of 995, 5ireChain Mainnet
7373
rpcTarget: "https://rpc.5ire.network",
7474
// Avoid using public rpcTarget in production.
75-
// Use services like Infura, Quicknode etc
75+
// Use services like Infura
7676
displayName: "5ireChain Mainnet",
7777
blockExplorerUrl: "https://5irescan.io",
7878
ticker: "5ire",
@@ -93,7 +93,7 @@ const chainConfig = {
9393
chainId: "0x3E5", // hex of 997, 5ireChain Testnet
9494
rpcTarget: "https://rpc.testnet.5ire.network",
9595
// Avoid using public rpcTarget in production.
96-
// Use services like Infura, Quicknode etc
96+
// Use services like Infura
9797
displayName: "5ireChain Testnet",
9898
blockExplorerUrl: "https://testnet.5irescan.io",
9999
ticker: "5ire",

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ that.
5252

5353
- Chain ID: 0xA1EF
5454
- Public RPC URL: https://rpc.alephzero.raas.gelato.cloud (Avoid using public rpcTarget in
55-
production, use services like Infura, Quicknode etc)
55+
production, use services like Infura)
5656
- Display Name: Aleph Zero Mainnet
5757
- Block Explorer Link: https://evm-explorer.alephzero.org
5858
- Ticker: AZERO
@@ -66,7 +66,7 @@ that.
6666

6767
- Chain ID: 0x7F7
6868
- Public RPC URL: https://rpc.alephzero-testnet.gelato.digital (Avoid using public rpcTarget in
69-
production, use services like Infura, Quicknode etc)
69+
production, use services like Infura)
7070
- Display Name: Aleph Zero Testnet
7171
- Block Explorer Link: https://evm-explorer-testnet.alephzero.org/
7272
- Ticker: AZERO

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const chainConfig = {
6464
chainId: "0xA1EF", // hex of 41455, Aleph Zero Mainnet
6565
rpcTarget: "https://rpc.alephzero.raas.gelato.cloud",
6666
// Avoid using public rpcTarget in production.
67-
// Use services like Infura, Quicknode etc
67+
// Use services like Infura
6868
displayName: "Aleph Zero Mainnet",
6969
blockExplorer: "https://evm-explorer.alephzero.org",
7070
ticker: "AZERO",
@@ -84,7 +84,7 @@ const chainConfig = {
8484
chainId: "0x7F7", // hex of 2039, Aleph Zero Testnet
8585
rpcTarget: "https://rpc.alephzero-testnet.gelato.digital",
8686
// Avoid using public rpcTarget in production.
87-
// Use services like Infura, Quicknode etc
87+
// Use services like Infura
8888
displayName: "Aleph Zero Testnet",
8989
blockExplorer: "https://evm-explorer-testnet.alephzero.org",
9090
ticker: "tAZERO",

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ examples to get you started.
5050

5151
- Chain ID: 0xA1EF
5252
- Public RPC URL: https://rpc.alephzero.raas.gelato.cloud (Avoid using public rpcTarget in
53-
production, use services like Infura, Quicknode etc)
53+
production, use services like Infura)
5454
- Display Name: Aleph Zero Mainnet
5555
- Block Explorer Link: https://evm-explorer.alephzero.org
5656
- Ticker: AZERO
@@ -64,7 +64,7 @@ examples to get you started.
6464

6565
- Chain ID: 0x7F7
6666
- Public RPC URL: https://rpc.alephzero-testnet.gelato.digital (Avoid using public rpcTarget in
67-
production, use services like Infura, Quicknode etc)
67+
production, use services like Infura)
6868
- Display Name: Aleph Zero Testnet
6969
- Block Explorer Link: https://evm-explorer-testnet.alephzero.org
7070
- Ticker: tAZERO

docs/connect-blockchain/evm/ancient8/ios.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ quickly on that.
5252

5353
- Chain ID: 0x34BC6B8
5454
- Public RPC URL: https://rpc.ancient8.gg (Avoid using public rpcTarget in production, use services
55-
like Infura, Quicknode etc)
55+
like Infura)
5656
- Display Name: Ancient8 Mainnet
5757
- Block Explorer Link: https://scan.ancient8.gg
5858
- Ticker: ETH
@@ -66,7 +66,7 @@ quickly on that.
6666

6767
- Chain ID: 0x1AD4150
6868
- Public RPC URL: https://rpcv2-testnet.ancient8.gg (Avoid using public rpcTarget in production, use
69-
services like Infura, Quicknode etc)
69+
services like Infura)
7070
- Display Name: Ancient8 Testnet V2
7171
- Block Explorer Link: https://scanv2-testnet.ancient8.gg
7272
- Ticker: ETH

0 commit comments

Comments
 (0)