Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Error if using web3Auth without wagmi #1

Open
manish-raana opened this issue Aug 8, 2024 · 0 comments
Open

Getting Error if using web3Auth without wagmi #1

manish-raana opened this issue Aug 8, 2024 · 0 comments

Comments

@manish-raana
Copy link

Hi Team,

I am using the web3Auth for the EOA wallet for social login,
I tried this repo it is working fine with wagmi connector with web3auth.

But I wanted to use it without wagmi so I tried the below code, but it is throwing some error.

const smartAccountSigner = await providerToSmartAccountSigner(web3auth?.provider! as any);
const smartAccount = await signerToSimpleSmartAccount(publicClient!, {
  signer: smartAccountSigner,
  entryPoint: ENTRYPOINT_ADDRESS_V06,
});
const smartAccountClient = createSmartAccountClient({
  account: smartAccount,
  entryPoint: ENTRYPOINT_ADDRESS_V06,
  chain: sepolia,
  bundlerTransport: http(pimlicoRpcUrl, {
    timeout: 30_000,
}),
middleware: {
    sponsorUserOperation: pimlicoPaymaster.sponsorUserOperation,
    gasPrice: async () => (await bundlerClient.getUserOperationGasPrice()).fast,
  },
});
const sendTxn = async () => { 
    try {
      if (!smartAccountClient?.account) { 
        uiConsole("smartAccountClient not initialized yet");
        return;
      }
      const txHash = await smartAccountClient?.sendTransaction({
        // @ts-ignore
        account: smartAccountClient.account!,
        to: "0x644a1c3bf84c6a994Dd548BC5e7A765Ac33e57Fc",
        data: "0x",
        value: parseEther("0.1"),
      });
      
      console.log('txHash: ', txHash);
    } catch (error) {
      console.error(error);
    }
  }

Screenshot 2024-08-08 at 6 54 45 PM

Is there a workaround to resolve this and use without a wagmi provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant