Have you specified the web3AuthNetwork parameter during the Web3Auth No-Modal initialization ? I’ll paste a snippet here for your reference on where should it go. Please mention the network you are on Testnet, Mainnet, etc whichever you have setup up on the dashboard should match with the network in your code too.
const web3auth = new Web3AuthNoModal({
clientId: "", // Get your Client ID from Web3Auth Dashboard
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x1",
displayName: "Ethereum Mainnet",
blockExplorer: "https://etherscan.io",
ticker: "ETH",
tickerName: "Ethereum",
rpcTarget: "https://rpc.ankr.com/eth", // This is the mainnet RPC we have added, please pass on your own endpoint while creating an app
},
web3AuthNetwork: "mainnet", // mainnet, aqua, cyan or testnet
});
If you are using chainNamespace: "other" while initializing or Web3AuthNoModal with the OpenloginAdapter, you need to add the privateKeyProvider to the OpenLogin instance and your rpcTarget in chainconfig
const chainConfig = {
chainId: "0x1",
chainNamespace: CHAIN_NAMESPACES.OTHER,
rpcTarget: "https://any-rpc-endpoint.com",
};
const web3auth = new Web3AuthNoModal({
clientId,
chainConfig,
web3AuthNetwork: "cyan",
});
const privateKeyProvider = new CommonPrivateKeyProvider(config: chainConfig);
const openloginAdapter = new OpenloginAdapter({
privateKeyProvider,
adapterSettings: {...},
mfaSettings: {...},
loginSettings: {...},
});
web3auth.configureAdapter(openloginAdapter);
provider = await web3auth.connectTo(
WALLET_ADAPTERS.OPENLOGIN,
{
loginProvider: "google",
}
);
// use this provider to export the private key of the userr