Sponsorship configurations
By default your project sponsors everything. There is no setup step, and the gas cost is billed back to you on a monthly cycle through OMS, converted to a USD value at the time of each transaction. You can instead sponsor a subset of transactions per user. A rule might cover a user’s first three transactions, for example, and leave the rest to the user. When a transaction is not sponsored, the user pays its fee. They do not need the network’s native token to do so: preparation returns the tokens accepted for that fee, and the user can pay in a stablecoin instead. Sponsorship is configured on your OMS project. Your application code does not select it per transaction.Handle both outcomes
Every transaction follows the same lifecycle:- Prepare the transaction.
- Read whether the prepared transaction is sponsored, along with any fee options it returned.
- Execute. A sponsored transaction needs no fee selection. An unsponsored transaction needs one fee option.
firstAvailable selector that handles both outcomes.
Transactions that are always sponsored
Three cases are sponsored regardless of your project’s rules:- Testnets. Transaction fees are sponsored on testnets.
- Smart sessions. Smart session transactions must be sponsored. OMS rejects preparation when the transaction is not sponsored, so a remote backend never selects or submits a fee option. See Smart Sessions.
- Server Wallet transfers. A Server Wallet transfer requires a sponsored quote, and preparation fails without one. See Server Wallets.