Txn on Hardhat and other networks fails because of codefi.network gas fee estimation

I’m using the @web3auth/modal sdk to add login to my web app. I develop locally using a Hardhat network. I create Web3 using these params:

  const web3auth = new Web3Auth({
    clientId: process.env.NEXT_PUBLIC_WEB3AUTH_CLIENT_ID || "",
    web3AuthNetwork: "testnet",
    chainConfig: {
      chainNamespace: "eip155",
      chainId: "0x7A69", // 31337
      rpcTarget: "http://127.0.0.1:8545",
    },
  });
  await web3auth.initModal();

When authenticating with a social account (Google) and using the resulting provider/signer to send a txn, I get the following 500 error from within the web3auth sdk in the console:

httpHelpers.esm.js:61     GET https://gas-api.metaswap.codefi.network/networks/31337/suggestedGasFees 500

Makes sense that it can’t get a 3rd party gas estimate for a local Hardhat node, but it’s unfortunate this might block anyone from using Hardhat.

I checked some other networks I need to use by plugging their chain ids into that URL, and many of them aren’t supported either, for example both of the Arbitrum testnets:

https://gas-api.metaswap.codefi.network/networks/421611/suggestedGasFees
https://gas-api.metaswap.codefi.network/networks/421613/suggestedGasFees

Does this mean I can’t use web3auth on those chains as well?

Thanks.

1 Like

@ops Welcome Aboard!

Your request has been forwarded to our team and we will get back with further updates once more information becomes available.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.