Skip to content

Commit 33c1528

Browse files
Merge pull request #59 from Web3Auth/feat/next
Add nextjs example
2 parents f1b5aaa + 553fce5 commit 33c1528

File tree

38 files changed

+5812
-4210
lines changed

38 files changed

+5812
-4210
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { FunctionComponent } from "react";
2+
3+
const Loader: FunctionComponent = () => {
4+
return <h1>Loading....</h1>;
5+
};
6+
7+
export default Loader;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { CHAIN_NAMESPACES, CustomChainConfig } from "@web3auth/base";
2+
3+
export const CHAIN_CONFIG = {
4+
mainnet: {
5+
displayName: "Ethereum Mainnet",
6+
chainNamespace: CHAIN_NAMESPACES.EIP155,
7+
chainId: "0x1",
8+
rpcTarget: `https://mainnet.infura.io/v3/776218ac4734478c90191dde8cae483c`,
9+
blockExplorer: "https://etherscan.io/",
10+
ticker: "ETH",
11+
tickerName: "Ethereum",
12+
} as CustomChainConfig,
13+
solana: {
14+
chainNamespace: CHAIN_NAMESPACES.SOLANA,
15+
rpcTarget: "https://api.mainnet-beta.solana.com",
16+
blockExplorer: "https://explorer.solana.com/",
17+
chainId: "0x1",
18+
displayName: "Solana Mainnet",
19+
ticker: "SOL",
20+
tickerName: "Solana",
21+
} as CustomChainConfig,
22+
polygon: {
23+
chainNamespace: CHAIN_NAMESPACES.EIP155,
24+
rpcTarget: "https://polygon-rpc.com",
25+
blockExplorer: "https://polygonscan.com/",
26+
chainId: "0x89",
27+
displayName: "Polygon Mainnet",
28+
ticker: "matic",
29+
tickerName: "Matic",
30+
} as CustomChainConfig,
31+
} as const;
32+
33+
export type CHAIN_CONFIG_TYPE = keyof typeof CHAIN_CONFIG;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export const WEB3AUTH_NETWORK = {
2+
mainnet: {
3+
displayName: "Mainnet",
4+
},
5+
testnet: {
6+
displayName: "Testnet",
7+
},
8+
cyan: {
9+
displayName: "Cyan",
10+
},
11+
} as const;
12+
13+
export type WEB3AUTH_NETWORK_TYPE = keyof typeof WEB3AUTH_NETWORK;

examples/next-app/next.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
33
reactStrictMode: true,
4-
}
4+
experimental: {
5+
esmExternals: "loose",
6+
},
7+
};
58

6-
module.exports = nextConfig
9+
module.exports = nextConfig;

0 commit comments

Comments
 (0)