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

usePrepareTransactionRequest fails eth_maxPriorityFeePerGas rpc call on MetaMask injected connector #3865

Closed
1 task done
holic opened this issue Apr 27, 2024 · 4 comments · Fixed by #3869
Closed
1 task done

Comments

@holic
Copy link
Sponsor Contributor

holic commented Apr 27, 2024

Describe the bug

I am using usePrepareTransactionRequest, which internally calls eth_maxPriorityFeePerGas using the connector client, which fails on injected MetaMask connector:

image
{
    "code": -32601,
    "message": "The method \"eth_maxPriorityFeePerGas\" does not exist / is not available.",
    "data": {
        "origin": "http://localhost:5173",
        "cause": null
    }
}

Link to Minimal Reproducible Example

No response

Steps To Reproduce

No response

Wagmi Version

2.6.0

Viem Version

2.9.20

TypeScript Version

5.4.2

Check existing issues

Anything else?

No response

@holic
Copy link
Sponsor Contributor Author

holic commented Apr 28, 2024

I worked around this for now with:

const fees = useEstimateFeesPerGas({ chainId });
const prepared = usePrepareTransactionRequest({
  chainId,
  to,
  value,
  maxPriorityFeePerGas: fees.data?.maxPriorityFeePerGas,
});

@tmm
Copy link
Member

tmm commented Apr 28, 2024

@tmm tmm closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2024
@jxom
Copy link
Member

jxom commented Apr 28, 2024

I think we can resolve this by not using the connector client for usePrepareTransactionRequest. It's not needed.

jxom added a commit that referenced this issue Apr 28, 2024
jxom added a commit that referenced this issue Apr 30, 2024
jxom added a commit that referenced this issue Apr 30, 2024
Copy link
Contributor

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.

@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants