Failed to create a wallet when using sepolia

Hey guys when i try to generate a wallet i’m facing this issue:

[Log] Error creating wallet
{ “code”: 4901, “message”: “Invalid network, net_version is: 11155111”, “stack”: “JsonRpcError@\nEthereumProviderError@\ngetEthProviderError@\n@” }

and this is my config

const privateKeyProvider = new EthereumPrivateKeyProvider({
      config: {
        chainConfig: {
          chainNamespace: CHAIN_NAMESPACES.EIP155,
          chainId: '11155111',
          rpcTarget: 'https://sepolia.infura.io/v3/9b1b4e645a9541faa755cfc71d96cad8',
          displayName: 'Ethereum',
          ticker: 'ETH',
          tickerName: 'Ethereum',
          decimals: 18,
        },
      },
    });

    const web3auth = new Web3Auth({
      clientId: WEB3_CLIENT_ID,
      web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_DEVNET,
      privateKeyProvider,
    });

    await web3auth.init();

i want to know what setup is expected for WEB3AUTH_NETWORK.SAPPHIRE_DEVNET cuz i think there is some missmatch between SAPPHIRE_DEVNET and sepolia

Hi Andon,

Thank you for reaching out with your issue. It looks like you’re correctly setting up your configuration for the Sepolia testnet, but you might be right about a potential mismatch between SAPPHIRE_DEVNET and Sepolia.

Please ensure the WEB3AUTH_NETWORK and chainConfig chain ID are aligned. The SAPPHIRE_DEVNET is tuned for Torus’s Sapphire instance, which may not be the same as Sepolia.

  1. Initialization Code Snippet Overview:

    • You’re using Single Factor Auth Web SDK.
    • Current chainConfig for Sepolia looks correct: chainId: '11155111'.
    • WEB3AUTH_NETWORK.SAPPHIRE_DEVNET might be misaligned with Sepolia.
  2. Configuration Check:

    • The WEB3AUTH_NETWORK should potentially be set to MAINNET or another supported test network depending on your setup.

To assist further, please try adjusting the WEB3AUTH_NETWORK setting. Instead of SAPPHIRE_DEVNET, try using MAINNET or the specific network that you intend to use and fits with Sepolia.

const web3auth = new Web3Auth({
  clientId: WEB3_CLIENT_ID,
  web3AuthNetwork: WEB3AUTH_NETWORK.MAINNET, // Change to MAINNET or appropriate network
  privateKeyProvider,
});

Alternatively, you may want to verify the compatibility of SAPPHIRE_DEVNET with Sepolia, as typically SAPPHIRE_DEVNET might be designed for a different chain setup.

This response was generated by the Web3Auth Bot. A team member from Web3Auth will review your issue and provide further insights shortly.

Hey @andon please change the chain id to 0xaa36a7. You need to pass the hex value.