CommonProvider is not giving Wallets Options in modal

When asking for help in this category, please make sure to provide the following details:

  • SDK Version(package.json):
    "@toruslabs/eccrypto": "^5.0.4",
    "@web3auth/auth-adapter": "^9.4.0",
    "@web3auth/base": "^9.4.0",
    "@web3auth/base-provider": "^9.4.0",
    "@web3auth/default-evm-adapter": "^9.4.2",
    "@web3auth/modal": "^9.4.2",
import { web3AuthChainConfig, web3AuthCliedId } from "@root/constants";
import { WALLET_ADAPTERS, WEB3AUTH_NETWORK } from "@web3auth/base";
import { CommonPrivateKeyProvider } from "@web3auth/base-provider";
import { Web3Auth } from "@web3auth/modal";
import { useEffect, useState } from "react";

const privateKeyProvider = new CommonPrivateKeyProvider({
  config: { chainConfig: web3AuthChainConfig },
});

const web3AuthOptions = {
  clientId: web3AuthCliedId,
  privateKeyProvider,
  web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
};
const web3auth = new Web3Auth(web3AuthOptions);


const useWeb3AuthModal = () => {

  const [, setLoggedIn] = useState(false);
  const [, setProvider] = useState(null);
    
  useEffect(() => {
    const init = async () => {
      try {
        await web3auth.initModal({
          modalConfig: {
            [WALLET_ADAPTERS.AUTH]: {
              label: "openlogin",
              loginMethods: {
                apple: {
                  name: "apple",
                  showOnModal: false,
                },
                discord: {
                  name: "discord",
                  showOnModal: false,
                },
                facebook: {
                  name: "facebook",
                  showOnModal: false,
                },
                farcaster: {
                  name: "farcaster",
                  showOnModal: false,
                },
                github: {
                  name: "github",
                  showOnModal: false,
                },
                google: {
                  name: "google",
                  showOnModal: true,
                },
                kakao: {
                  name: "kakao",
                  showOnModal: false,
                },
                line: {
                  name: "line",
                  showOnModal: false,
                },
                linkedin: {
                  name: "linkedin",
                  showOnModal: false,
                },
                reddit: {
                  name: "reddit",
                  showOnModal: false,
                },
                sms_passwordless: {
                  name: "sms_passwordless",
                  showOnModal: false,
                },
                twitch: {
                  name: "twitch",
                  showOnModal: false,
                },
                twitter: {
                  name: "twitter",
                  showOnModal: false,
                },
                wechat: {
                  name: "wechat",
                  showOnModal: false,
                },
                weibo: {
                  name: "weibo",
                  showOnModal: false,
                },
              },
            }, 
          },
        });
        setProvider(web3auth.provider);

        if (web3auth.connected) {
          setLoggedIn(true);
        }
      } catch (error) {
        console.error(error);
      }
    };

    init();
  }, []);
  const login = async () => {
    const web3authProvider = await web3auth.connect();
    setProvider(web3authProvider);
    if (web3auth.connected) {
      setLoggedIn(true);
    }
  };
    
  return { login };
};


export default useWeb3AuthModal;

In the Modal I am unable to see the Wallets like Keplr.
I want to Add it under the Google Button. Like the below
Screenshot 2024-11-22 at 13.30.12

Or It is nit even showing the Continue With Wallet Button.

Can we show Continue with Wallet with only Keplr Wallet?

Hi Srinath! Thanks for sharing all the details with me. I can see you’re facing an issue with the wallet options in the modal of your PnP Web SDK integration.

Here’s a summary of your reported issue for the support team:

  • SDK Details: PnP Web SDK
  • SDK Version:
    • @toruslabs/eccrypto: ^5.0.4
    • @web3auth/auth-adapter: ^9.4.0
    • @web3auth/base: ^9.4.0
    • @web3auth/base-provider: ^9.4.0
    • @web3auth/default-evm-adapter: ^9.4.2
    • @web3auth/modal: ^9.4.2
  • Platform: React Js with Vite
  • Issue: The modal is not displaying wallet options such as Keplr or the “Continue with Wallet” button.

Screenshots:

  1. Continue with Wallet Missing

Code Snippet:

You have provided a code snippet to help troubleshoot the issue which is useful.

Proposed Solution

To ensure that the Keplr wallet is displayed, you’ll want to make sure that the appropriate wallet adapter for Keplr is included in your configuration, and that it’s marked with showOnModal: true. This would look something like this:

keplr: {
  name: "Keplr",
  showOnModal: true,
}

Please check if you’ve included the Keplr wallet in your loginMethods section. If not, adding that might resolve the issue.

If the problem persists, I recommend sharing the complete flow of how the modal is being invoked and configured for better support.

Let the support team know about this situation, and I’m sure they’ll provide assistance soon! If you have any more questions or need further help, feel free to ask. :blush:

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

This isn’t the Solution that is working.

I think this is a problem with CommonPrivateKeyProvider.

When I use Etherium Provider Its showing Continue With a Wallet But when I use Common Provider its not showing that button.

I want just the Keplr Connectivity, Nothing more as I have already added Google and email logins

Hello,

Is there any way to Add Just Keplr to the Web3Auth/no-modal?
I have a Connect to Keplr Button currently using window.keplr.
I want web3auth to handle it. Is there any way to do so?

Hey @bsrinath4839,

Could you let me know which chain you’re trying to connect to?

WalletConnect V2 is supported only for Ethereum and, more recently, Solana. For these, you should configure either EthereumPrivateKeyProvider or SolanaPrivateKeyProvider, depending on the chain.

Since you’re using CommonPrivateKeyProvider in your configuration, it won’t be supported for connection via WalletConnect V2 if you’re targeting a chain other than Ethereum or Solana chains. Let me know if this helps or if you need further clarification!

Can We expect the support in Future?

Hey @bsrinath4839
Can you please let me know which chain are you trying to connect to?