executeGaslessBatch action takes a quote from getQuote, delegates the user’s EOA to a batch executor using EIP-7702, batches the quote’s transaction steps atomically, and submits via Relay’s execute API with the sponsor covering gas costs. This means the user pays no gas fees.
An API key is required for gasless batch execution. Configure it via
createClient({ apiKey: "..." }).Parameters
Example
Example with Subsidized Fees
Handling onProgress updates
TheonProgress callback fires at each stage of the gasless batch execution. The status field indicates which stage is currently active:
- signing_authorization: The user is being prompted to sign the EIP-7702 authorization to delegate their EOA to the batch executor. This step is skipped if the EOA is already delegated.
- signing_batch: The user is being prompted to sign the EIP-712 typed data for the batched calls.
- submitting: The signed batch is being submitted to the Relay API.
- polling: The request has been submitted and is being polled for completion.
- success: The batch execution completed successfully. The
detailsfield contains the full status response. - failure: The batch execution failed or was refunded. The
detailsfield contains the full status response.