createPaymasterClient will check whether a paymaster sponsors a transaction and send the signed transaction to it. Until it ships, you can make the same two calls with viem.
Planned function
createPaymasterClient
The name comes from the SDK plan. Parameters and return types aren’t final. One rule is set:string
required
The paymaster endpoint. No endpoint is confirmed for BOT Chain, so there’s no default. If you leave it out, the client is planned to throw
MissingConfigError.- A sponsor check. It sends
pm_isSponsorablewith the transaction’sto,from,value,dataandgas, every value hex-encoded. BOT Chain’s docs say the reply hasSponsorable, a boolean, andSponsorPolicy, the name of the policy that matched. - A send. It takes a transaction you’ve signed and posts it to the paymaster’s
eth_sendRawTransaction.
The signing flow
Signing stays with your wallet. The SDK won’t hold keys.1
Build the transaction
Encode the call and estimate gas against a normal RPC.
2
Check sponsorship
Ask the paymaster. If it says no, send a normal paid transaction instead.
3
Sign with a gas price of 0
Sign a legacy transaction with
gasPrice: 0n. The paymaster design sets the gas price directly, so don’t use an EIP-1559 transaction.4
Send to the paymaster
Send the signed bytes to the paymaster URL. The public RPC rejects them with
gasPrice too low.Do it today
EOA paymaster has a viem script that does all four steps against aPAYMASTER_URL you provide. It’s typechecked but untested, because there’s no endpoint to run it against.
For gasless transactions that work on BOT Chain now, use meta-transactions with a relayer.
Related
Paymaster module
Why the URL is required.
Errors
The errors this client will throw.