Please select an SDK-specific category from the dropdown when creating a topic here. Use this category for generic help-related topics. Also, removhttps://draft.sbsfantasy.com/
I have my domain whitelisted in the https://dashboard.web3auth.io but it still says the same error where it asks me to whitelist the domain. Here are my settings for the chainConfig:
const chainConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x1",
rpcTarget: "https://rpc.ankr.com/eth", // This is the public RPC we have added, please pass on your own endpoint while creating an app
displayName: "Ethereum Mainnet",
blockExplorer: "https://etherscan.io",
ticker: "ETH",
tickerName: "Ethereum",
}
Any advice? Please helpe these lines when asking for generic Help.
Have you specified the web3AuthNetwork parameter during the Web3Auth Modal initialization ?
I’ll paste a snippet here for your reference on where should it go.
I don’t believe it is working but perhaps it takes a few minutes? Here is the full code in case you want to see more of the setup:
const chainConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x1",
rpcTarget: "https://rpc.ankr.com/eth", // This is the public RPC we have added, please pass on your own endpoint while creating an app
displayName: "Ethereum Mainnet",
blockExplorer: "https://etherscan.io",
ticker: "ETH",
tickerName: "Ethereum",
}
const metamaskAdapter = new MetamaskAdapter({
clientId: process.env.NEXT_PUBLIC_WEB3AUTH_CLIENT_ID, // Get your Client ID from Web3Auth Dashboard
sessionTime: 3600, // 1 hour in seconds
web3AuthNetwork: "cyan",
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x1",
rpcTarget: "https://rpc.ankr.com/eth", // This is the public RPC we have added, please pass on your own endpoint while creating an app
},
})
const web3Auth = new Web3AuthNoModal({
clientId: process.env.NEXT_PUBLIC_WEB3AUTH_CLIENT_ID, // Get your Client ID from Web3Auth Dashboard
chainConfig,
})
const privateKeyProvider = new EthereumPrivateKeyProvider({ config: { chainConfig } })
const openloginProvider = new OpenloginAdapter({
privateKeyProvider,
adapterSettings: {
uxMode: "redirect",
},
web3AuthNetwork: "cyan",
})
web3Auth.configureAdapter(openloginProvider)
web3Auth.configureAdapter(metamaskAdapter)
metamaskAdapter.setAdapterSettings({
sessionTime: 86400, // 1 day in seconds
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x1",
rpcTarget: "https://rpc.ankr.com/eth", // This is the public RPC we have added, please pass on your own endpoint while creating an app
},
web3AuthNetwork: "cyan",
})
web3Auth.init()
I am using Web3Modal for my mobile app and NoModal for my web app.
My mobile app was pointed to testnet this entire time and it has worked fine. However, I just switched it to be network: OPENLOGIN_NETWORK.MAINNET and now it is not working. I believe my dashboard is only set up to be working on testnet.
However, I cannot find anywhere on the dashboard to point to Mainnet. Can you please explain how I can fix this?
I see what the problem is. I had to create a new project with the same name and point that to mainnet. There was no way to toggle from testnet to mainnet in my project, I didn’t realize I had to create a new one. It is working now. Thank you so much for pointing me in the right direction.