Prerequisites
You need a Para-enabled smart account client configured with your AA provider. Gas sponsorship is typically configured during the initial client setup.Setup Smart Account Libraries
Sponsor Transactions
- Alchemy
- Biconomy
- Gelato
- Pimlico
- Safe
- Thirdweb
- ZeroDev
Copy
Ask AI
import { createModularAccountAlchemyClient } from "@account-kit/smart-contracts";
import { WalletClientSigner } from "@aa-sdk/core";
import { alchemy } from "@account-kit/infra";
// Gas sponsorship is enabled via the policyId parameter
const client = await createModularAccountAlchemyClient({
transport: alchemy({ rpcUrl: ALCHEMY_RPC_URL }),
chain: CHAIN,
signer: walletClientSigner, // Para-enabled WalletClientSigner
policyId: GAS_POLICY_ID, // ← Enables gas sponsorship
salt,
});
// The gas is automatically sponsored based on your policy
const userOpHash = await client.sendUserOperation({
uo: {
target: "0x...", // Recipient address
data: "0x", // Transaction data
value: 0n // ETH value to send
}
});
// Wait for the transaction to be mined
const receipt = await client.waitForUserOperationReceipt({ hash: userOpHash });
Copy
Ask AI
import { createSmartAccountClient } from '@biconomy/account';
// Gas sponsorship is enabled via the paymasterUrl parameter
const smartAccountClient = await createSmartAccountClient({
signer: walletClient, // Para-enabled WalletClient
chainId: chain.id,
bundlerUrl,
paymasterUrl, // ← Enables gas sponsorship
});
// Specify SPONSORED mode in paymasterServiceData
const transaction = {
to: "0x...", // Recipient address
data: "0x", // Transaction data
value: "0" // ETH value as string
};
const userOpResponse = await smartAccountClient.sendTransaction(
transaction,
{
paymasterServiceData: {
mode: "SPONSORED" // ← Request gas sponsorship
}
}
);
const receipt = await userOpResponse.wait();
Copy
Ask AI
import { createGelatoSmartWalletClient } from "@gelatonetwork/smartwallet";
// Gas sponsorship is enabled via the Gelato API key
const smartWalletClient = await createGelatoSmartWalletClient(
walletClient, // Para-enabled WalletClient with kernel account
{
apiKey: GELATO_API_KEY, // ← Enables gas sponsorship
}
);
// Gas is automatically sponsored when using the smart wallet client
const txHash = await smartWalletClient.sendTransaction({
to: "0x...", // Recipient address
value: 0n, // ETH value to send
data: "0x" // Transaction data
});
// Wait for the transaction to be mined
const receipt = await smartWalletClient.waitForTransactionReceipt({
hash: txHash
});
Copy
Ask AI
import { createSmartAccountClient } from "permissionless";
import { createPimlicoClient } from "permissionless/clients/pimlico";
// Create Pimlico client for paymaster operations
const pimlicoClient = createPimlicoClient({
transport: http(PIMLICO_URL),
entryPoint: {
address: entryPoint07Address,
version: "0.7"
}
});
// Include paymaster in smart account client
const smartAccountClient = createSmartAccountClient({
account: simpleSmartAccount, // Para-enabled smart account
chain: CHAIN,
bundlerTransport: http(PIMLICO_URL),
paymaster: pimlicoClient, // ← Enables gas sponsorship
userOperation: {
estimateFeesPerGas: async () => {
return (await pimlicoClient.getUserOperationGasPrice()).fast
}
}
});
// Gas is automatically sponsored via the paymaster
const userOpHash = await smartAccountClient.sendUserOperation({
calls: [{
to: "0x...", // Recipient address
value: 0n, // ETH value to send
data: "0x" // Transaction data
}]
});
// Wait for the transaction to be mined
const receipt = await smartAccountClient.waitForUserOperationReceipt({
hash: userOpHash
});
Copy
Ask AI
import { createSmartAccountClient } from "permissionless";
import { toSafeSmartAccount } from "permissionless/accounts";
import { createPimlicoClient } from "permissionless/clients/pimlico";
// Safe uses Pimlico as the paymaster provider
const pimlicoClient = createPimlicoClient({
transport: http(PIMLICO_URL),
entryPoint: {
address: entryPoint07Address,
version: "0.7"
}
});
const smartAccountClient = createSmartAccountClient({
account: safeAccount, // Para-enabled Safe account
chain: CHAIN,
bundlerTransport: http(PIMLICO_URL),
paymaster: pimlicoClient, // ← Enables gas sponsorship
userOperation: {
estimateFeesPerGas: async () => {
return (await pimlicoClient.getUserOperationGasPrice()).fast
}
}
});
// Gas is automatically sponsored via the paymaster
const userOpHash = await smartAccountClient.sendUserOperation({
calls: [{
to: "0x...", // Recipient address
value: 0n, // ETH value to send
data: "0x" // Transaction data
}]
});
// Wait for the transaction to be mined
const receipt = await smartAccountClient.waitForUserOperationReceipt({
hash: userOpHash
});
Copy
Ask AI
import { smartWallet } from "thirdweb/wallets";
import { sendTransaction } from "thirdweb";
// Gas sponsorship is enabled via the sponsorGas flag
const smartWalletConfig = smartWallet({
chain: CHAIN,
sponsorGas: true, // ← Enables gas sponsorship
factoryAddress: DEFAULT_ACCOUNT_FACTORY_V0_7,
overrides: {
accountSalt: salt,
},
});
// Connect the smart wallet with Para as the signer
const smartAccount = await smartWalletConfig.connect({
client: thirdwebClient,
personalAccount, // Para-enabled personal account
});
// Gas is automatically sponsored when sponsorGas is enabled
const transaction = {
chain: CHAIN,
client: thirdwebClient,
to: "0x...", // Recipient address
value: 0n, // ETH value to send
data: "0x" // Transaction data
};
const result = await sendTransaction({
transaction,
account: smartAccount // Uses the sponsored smart wallet
});
console.log("Sponsored transaction mined:", result.transactionHash);
Copy
Ask AI
import { createKernelAccountClient, createZeroDevPaymasterClient } from "@zerodevapp/sdk";
import { http } from "viem";
// ZeroDev automatically sponsors gas when using their bundler URL
const kernelClient = createKernelAccountClient({
account: kernelAccount, // Para-enabled kernel account
chain: CHAIN,
transport: http(
`https://rpc.zerodev.app/api/v2/bundler/${ZERODEV_PROJECT_ID}`
), // ← Bundler URL includes sponsorship
});
// Optional: For explicit paymaster configuration
const paymasterClient = createZeroDevPaymasterClient({
chain: CHAIN,
transport: http(
`https://rpc.zerodev.app/api/v2/paymaster/${ZERODEV_PROJECT_ID}`
)
});
// Gas is automatically sponsored via the ZeroDev infrastructure
const userOpHash = await kernelClient.sendUserOperation({
callData: await kernelAccount.encodeCalls([{
to: "0x...", // Recipient address
value: 0n, // ETH value to send
data: "0x" // Transaction data
}])
});
// Wait for the transaction to be mined
const receipt = await kernelClient.waitForUserOperationReceipt({
hash: userOpHash
});
Key Points
- Gas sponsorship is configured during client setup - Each provider has a specific parameter or configuration that enables sponsorship (policyId, paymasterUrl, apiKey, etc.)
- Transactions are automatically sponsored - Once configured, transactions sent through the smart account client will have their gas fees covered
- No ETH required in user wallets - Users can interact with your dApp without holding ETH for gas fees
- Provider-specific limits may apply - Check your provider’s dashboard for sponsorship limits and policies
- Smart Wallet Deployment - Providers automatically handle smart wallet deployment if the account does not exist on first transaction