Skip to content

Commit

Permalink
Merge pull request #1750 from Web3Auth/feat/whitelabel-via-dashboard
Browse files Browse the repository at this point in the history
Fetch and merge whitelabel configs from dashboard
  • Loading branch information
chaitanyapotti authored Mar 14, 2024
2 parents 1910621 + e7e72c1 commit 4268c65
Show file tree
Hide file tree
Showing 10 changed files with 260 additions and 497 deletions.
185 changes: 103 additions & 82 deletions demo/react-app-no-modal/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions demo/react-app-no-modal/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import RPC from "./web3RPC"; // for using web3.js
import { MetamaskAdapter } from "@web3auth/metamask-adapter";
import { CoinbaseAdapter } from "@web3auth/coinbase-adapter";
import { SolanaWalletAdapter } from "@web3auth/torus-solana-adapter";
import { WalletConnectV1Adapter } from "@web3auth/wallet-connect-v1-adapter";
//import RPC from "./ethersRPC"; // for using ethers.js
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";

const clientId = "BEglQSgt4cUWcj6SKRdu5QkOXTsePmMcusG5EAoyjyOYKlVRjIF1iCNnMOTfpzCiunHRrMui8TIwQPXdkQ8Yxuk"; // get from https://dashboard.web3auth.io
// const clientId = "BEglQSgt4cUWcj6SKRdu5QkOXTsePmMcusG5EAoyjyOYKlVRjIF1iCNnMOTfpzCiunHRrMui8TIwQPXdkQ8Yxuk"; // get from https://dashboard.web3auth.io
const clientId = "BHHfGJWVEjpOFCOBr4fyKcAcQe-XlO93fV-lrFEjAoJI_9lUHCHNMeOiTkKXxXNuXDpeto79pjeULqmwfMo_CQI";

function App() {
const [web3auth, setWeb3auth] = useState<Web3AuthNoModal | null>(null);
Expand All @@ -26,9 +26,16 @@ function App() {
const web3auth = new Web3AuthNoModal({
clientId,
chainConfig: {
displayName: "Ethereum Mainnet",
chainId: "0x1",
rpcTarget: `https://rpc.ankr.com/eth`,
blockExplorerUrl: "https://etherscan.io/",
ticker: "ETH",
tickerName: "Ethereum",
logo: "https://images.toruswallet.io/eth.svg",
chainNamespace: CHAIN_NAMESPACES.EIP155,
},
web3AuthNetwork: "cyan",
web3AuthNetwork: "sapphire_devnet",
});

setWeb3auth(web3auth);
Expand All @@ -42,8 +49,6 @@ function App() {
});
web3auth.configureAdapter(openloginAdapter);

const adapter = new WalletConnectV1Adapter();
web3auth.configureAdapter(adapter);

await web3auth.init();
if (web3auth.connectedAdapterName && web3auth.provider) {
Expand Down
Loading

0 comments on commit 4268c65

Please sign in to comment.