Prerequisites
Setup Smart Account Client
Gas Sponsorship Configuration
Gas sponsorship is typically configured during client setup. Here’s how each provider enables it:- Alchemy
- ZeroDev
- Gelato
- Pimlico
- Biconomy
- Safe
- Thirdweb
- Rhinestone
Gas sponsorship is enabled via the
policyId parameter from your Alchemy dashboard.Copy
Ask AI
import { createModularAccountV2Client } from "@account-kit/smart-contracts";
import { alchemy, sepolia } from "@account-kit/infra";
import { WalletClientSigner } from "@aa-sdk/core";
const client = await createModularAccountV2Client({
transport: alchemy({ apiKey: ALCHEMY_API_KEY }),
chain: sepolia,
signer,
policyId: GAS_POLICY_ID,
});
const userOpHash = await client.sendUserOperation({
uo: {
target: "0x...",
data: "0x",
value: 0n,
},
});
const hash = await client.waitForUserOperationTransaction(userOpHash);
Create a gas policy in the Alchemy Dashboard under Account Kit → Gas Manager.
ZeroDev automatically sponsors gas when using their paymaster RPC.
Copy
Ask AI
import { createKernelAccountClient, createZeroDevPaymasterClient } from "@zerodev/sdk";
import { http } from "viem";
const paymasterClient = createZeroDevPaymasterClient({
chain: CHAIN,
transport: http(PAYMASTER_RPC),
});
const kernelClient = createKernelAccountClient({
account: kernelAccount,
chain: CHAIN,
bundlerTransport: http(BUNDLER_RPC),
paymaster: {
getPaymasterData: (userOperation) =>
paymasterClient.sponsorUserOperation({ userOperation }),
},
});
const hash = await kernelClient.sendTransaction({
calls: [{ to: "0x...", data: "0x", value: 0n }],
});
Configure sponsorship policies in the ZeroDev Dashboard.
Gelato sponsors gas via their API key configuration.
Copy
Ask AI
import { createGelatoSmartWalletClient, accounts } from "@gelatonetwork/smartwallet";
const kernelAccount = await accounts.kernel({
owner: viemAccount,
client: publicClient,
index: BigInt(0),
eip7702: false,
});
const walletClient = createWalletClient({
account: kernelAccount,
chain: CHAIN,
transport: http(),
});
const smartWalletClient = await createGelatoSmartWalletClient(walletClient, {
apiKey: GELATO_API_KEY,
});
const hash = await smartWalletClient.sendTransaction({
to: "0x...",
value: 0n,
data: "0x",
});
Get your API key from the Gelato Dashboard.
Pimlico provides sponsorship via their verifying paymaster.
Copy
Ask AI
import { createSmartAccountClient } from "permissionless";
import { createPimlicoClient } from "permissionless/clients/pimlico";
import { http } from "viem";
const pimlicoClient = createPimlicoClient({
transport: http(PIMLICO_URL),
entryPoint: { address: entryPoint07Address, version: "0.7" },
});
const smartAccountClient = createSmartAccountClient({
account: simpleSmartAccount,
chain: CHAIN,
bundlerTransport: http(PIMLICO_URL),
paymaster: pimlicoClient,
userOperation: {
estimateFeesPerGas: async () =>
(await pimlicoClient.getUserOperationGasPrice()).fast,
},
});
const userOpHash = await smartAccountClient.sendUserOperation({
calls: [{ to: "0x...", data: "0x", value: 0n }],
});
Configure sponsorship in the Pimlico Dashboard.
Biconomy uses the
SPONSORED mode with their paymaster URL.Copy
Ask AI
import { createSmartAccountClient } from "@biconomy/account";
const smartAccountClient = await createSmartAccountClient({
signer: walletClient,
chainId: CHAIN.id,
bundlerUrl: BUNDLER_URL,
paymasterUrl: PAYMASTER_URL,
});
const userOpResponse = await smartAccountClient.sendTransaction(
{
to: "0x...",
data: "0x",
value: "0",
},
{
paymasterServiceData: {
mode: "SPONSORED",
},
}
);
const receipt = await userOpResponse.wait();
Set up your paymaster in the Biconomy Dashboard.
Safe accounts use Pimlico as the paymaster provider.
Copy
Ask AI
import { createSmartAccountClient } from "permissionless";
import { toSafeSmartAccount } from "permissionless/accounts";
import { createPimlicoClient } from "permissionless/clients/pimlico";
const pimlicoClient = createPimlicoClient({
transport: http(PIMLICO_URL),
entryPoint: { address: entryPoint07Address, version: "0.7" },
});
const smartAccountClient = createSmartAccountClient({
account: safeAccount,
chain: CHAIN,
bundlerTransport: http(PIMLICO_URL),
paymaster: pimlicoClient,
userOperation: {
estimateFeesPerGas: async () =>
(await pimlicoClient.getUserOperationGasPrice()).fast,
},
});
const userOpHash = await smartAccountClient.sendUserOperation({
calls: [{ to: "0x...", data: "0x", value: 0n }],
});
Thirdweb enables sponsorship via the
sponsorGas flag.Copy
Ask AI
import { smartWallet } from "thirdweb/wallets";
import { sendTransaction } from "thirdweb";
const smartWalletConfig = smartWallet({
chain: CHAIN,
sponsorGas: true,
factoryAddress: DEFAULT_ACCOUNT_FACTORY_V0_7,
});
const smartAccount = await smartWalletConfig.connect({
client: thirdwebClient,
personalAccount,
});
const result = await sendTransaction({
transaction: {
chain: CHAIN,
client: thirdwebClient,
to: "0x...",
value: 0n,
data: "0x",
},
account: smartAccount,
});
Sponsorship is managed through your Thirdweb Dashboard.
Rhinestone provides built-in sponsorship via the
sponsored flag.Copy
Ask AI
import { RhinestoneSDK } from "@rhinestone/sdk";
import type { Account } from "viem";
const rhinestone = new RhinestoneSDK({
apiKey: RHINESTONE_API_KEY,
});
const rhinestoneAccount = await rhinestone.createAccount({
owners: {
type: "ecdsa",
accounts: [viemAccount as Account],
},
});
// Transactions are sponsored when sponsored: true
const transaction = await rhinestoneAccount.sendTransaction({
sourceChains: [],
targetChain: { chainId: 8453 },
calls: [{ to: "0x...", data: "0x", value: 0n }],
tokenRequests: [],
sponsored: true,
});
const result = await rhinestoneAccount.waitForExecution(transaction);
Rhinestone sponsorship is enabled per-transaction with the
sponsored: true flag. Contact Rhinestone for sponsorship limits and policies.Key Points
- Configuration at setup - Gas sponsorship is configured when creating the client
- Automatic sponsorship - Once configured, transactions are automatically sponsored
- No ETH required - Users don’t need ETH for gas fees
- Provider limits - Check your provider dashboard for sponsorship limits and policies
- Smart wallet deployment - First transaction may deploy the smart wallet (also sponsored)