Skip to content

Insufficient funds for gas * price + value"}, method="sendTransaction", transaction=undefined, code=INSUFFICIENT_FUNDSย #653

@phil3k3

Description

@phil3k3

โœ… Prerequisites

  • Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • Are you running the latest SDK version?
  • Are you reporting to the correct repository (magic-sdk)?

๐Ÿ› Description

I am receiving INSUFFICIENT_FUNDS when trying to use the signer of Magic's RPC provider.

Magic RPC Error: [-32603] Error forwarded from node: insufficient funds for gas * price + value"}, method="sendTransaction", transaction=undefined, code=INSUFFICIENT_FUNDS

๐Ÿงฉ Steps to Reproduce

  1. Create sample project as described in https://magic.link/docs/dedicated/login-methods/email/integration/web
  2. Generate a Web3Provider using ethers v5
    const owner = new ethers.providers.Web3Provider(magic.rpcProvider as any);
  3. Use the signer of this provider to retrieve the balance of an ERC 20 token
const contract = new ethers.Contract(tokenAddress, erc20Abi, owner.getSigner());
const balance = await contract.balanceOf(receiver);

๐Ÿค” Expected behavior

Getting the balance of this usually gas-less transaction.

๐Ÿ˜ฎ Actual behavior

"Magic RPC Error: [-32603] Error forwarded from node: insufficient funds for gas * price + value"}, method="sendTransaction", transaction=undefined, code=INSUFFICIENT_FUNDS

๐Ÿ’ป Code Sample

[If possible, please provide a code repository, gist, code snippet or sample files to reproduce the issue.]

๐ŸŒŽ Environment

Software Version(s)
magic-sdk 21.0.0
Browser Chrome
yarn 1.22.19
Operating System MacOS 13.4.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions