Skip to content

MetaMask - RPC Error: Unsupported non-optional capabilities: paymasterService #7155

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

Closed
miguelmota opened this issue May 24, 2025 · 3 comments
Assignees

Comments

@miguelmota
Copy link

According to the thirdweb docs I should be able to use paymaster with MetaMask. From docs:

Using EIP-7702 with External Wallets (EIP-5792)
Don’t want to embed an in-app wallet? No problem. EIP-5792 lets you tap into the same 7702 capabilities from any external wallet—like Metamask and Coinbase Wallet —via the sendCalls RPC method.

Sponsoring Gas & Batching Transactions

The useSendCalls React hook (or the plain sendCalls function in vanilla TypeScript) lets you bundle multiple calls into one and attach a paymaster so your dApp covers the gas:

import { useSendCalls } from "thirdweb/react";

const { mutate: sendCalls, data: bundleId } = useSendCalls();
await sendCalls({
client,
 calls: [sendTx1, sendTx2],
 capabilities: {
   paymasterService: {
     url: `https://${CHAIN.id}.bundler.thirdweb.com/${client.clientId}`,
   },
 },
});

This enabled single signature, gas-free, batched execution on exernal wallets like Metamask!


I tried the code in a sample react app (gist) and on Sepolia, using MetaMask Version 12.17.3 and get the error:

inpage.js:1 MetaMask - RPC Error: Unsupported non-optional capabilities: paymasterService {code: 5700, message: 'Unsupported non-optional capabilities: paymasterService', stack: '{\n  "code": 5700,\n  "message": "Unsupported non-op…fbeogaeaoehlefnkodbefgpgknn/common-2.js:1:1391130'}

Any ideas on why paymaster doesn't work with MetaMask?

Copy link

linear bot commented May 24, 2025

@joaquim-verges joaquim-verges self-assigned this May 27, 2025
@joaquim-verges
Copy link
Member

joaquim-verges commented May 27, 2025

@miguelmota for EIP5792, you should always check the exposed capabilities of the wallet you're interacting with.

you can call useCapabilities() in react or getCapabilities() in TS with a given wallet, like shown here: https://playground.thirdweb.com/connect/account-abstraction/5792

for metamask, you'll see that they don't support the paymaster capability, only 'atomic' which is multi tx batching

@miguelmota
Copy link
Author

@joaquim-verges Thanks for the clarification, I was confused by the wording in the docs since it implied MetaMask supported paymaster capability.

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

2 participants