Skip to content

Commit

Permalink
Merge pull request #59 from Web3Auth/feat/next
Browse files Browse the repository at this point in the history
Add nextjs example
  • Loading branch information
himanshuchawla009 authored Feb 16, 2022
2 parents f1b5aaa + 553fce5 commit 33c1528
Show file tree
Hide file tree
Showing 38 changed files with 5,812 additions and 4,210 deletions.
7 changes: 7 additions & 0 deletions examples/next-app/components/Loader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { FunctionComponent } from "react";

const Loader: FunctionComponent = () => {
return <h1>Loading....</h1>;
};

export default Loader;
33 changes: 33 additions & 0 deletions examples/next-app/config/chainConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { CHAIN_NAMESPACES, CustomChainConfig } from "@web3auth/base";

export const CHAIN_CONFIG = {
mainnet: {
displayName: "Ethereum Mainnet",
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x1",
rpcTarget: `https://mainnet.infura.io/v3/776218ac4734478c90191dde8cae483c`,
blockExplorer: "https://etherscan.io/",
ticker: "ETH",
tickerName: "Ethereum",
} as CustomChainConfig,
solana: {
chainNamespace: CHAIN_NAMESPACES.SOLANA,
rpcTarget: "https://api.mainnet-beta.solana.com",
blockExplorer: "https://explorer.solana.com/",
chainId: "0x1",
displayName: "Solana Mainnet",
ticker: "SOL",
tickerName: "Solana",
} as CustomChainConfig,
polygon: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
rpcTarget: "https://polygon-rpc.com",
blockExplorer: "https://polygonscan.com/",
chainId: "0x89",
displayName: "Polygon Mainnet",
ticker: "matic",
tickerName: "Matic",
} as CustomChainConfig,
} as const;

export type CHAIN_CONFIG_TYPE = keyof typeof CHAIN_CONFIG;
13 changes: 13 additions & 0 deletions examples/next-app/config/web3AuthNetwork.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const WEB3AUTH_NETWORK = {
mainnet: {
displayName: "Mainnet",
},
testnet: {
displayName: "Testnet",
},
cyan: {
displayName: "Cyan",
},
} as const;

export type WEB3AUTH_NETWORK_TYPE = keyof typeof WEB3AUTH_NETWORK;
7 changes: 5 additions & 2 deletions examples/next-app/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}
experimental: {
esmExternals: "loose",
},
};

module.exports = nextConfig
module.exports = nextConfig;
Loading

0 comments on commit 33c1528

Please sign in to comment.