Transactions

Sponsor gas

Sponsor gas fees for transactions using EIP-7702 or ERC-4337. Thirdweb will handle the gas fees for you.


Sponsor gas fees using EIP-7702, enabling gasless transactions and improving user experience.

You can enable EIP-7702 execution for your server wallet and the transactions API. This is the default execution mode for server wallets.

POST /v1/contract/write
Content-Type: application/json
x-secret-key: <your-project-secret-key>
{
"executionOptions": {
"from": "0x...", // your server wallet **signer (EOA) address** address
"chainId": "1" // your chain id
},
"params": [{
"contractAddress": "0x...",
"method": "function transfer(address to, uint256 amount)",
"params": ["0x...", "1000000000000000000"],
}],
}

You can also explicitly set type: "EIP7702" in the executionOptions to enable EIP-7702 execution.

That's it! All transactions executed by the user will be sponsored via the thirdweb infrastructure.