execute_onchain_intent
Simulates and executes a gasless, sponsored Web3 transaction on Base L2 (e.g. token swaps, transfers) against operator-allowlisted targets. Simulates before broadcasting: Tenderly when the operator has it enabled, otherwise an RPC gas estimate plus a USDC amount cap. Requires an API key. When the operator charges for execution, the first call returns the x402 USDC payment requirements; sign that EIP-3009 authorization locally (never send a private key) and call again with paymentSignature. Payment settles only after the target and simulation checks pass, and only for the exact price.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agentId | No | Agent identifier for session scoping. | |
| calldata | Yes | Hex-encoded transaction calldata. | |
| valueWei | No | Native token value in Wei (defaults to '0'). | |
| fromAddress | Yes | The Safe Smart Account address performing the action. | |
| sessionKeyId | No | Optional gateway-issued session key id to enforce spend/target caps. | |
| targetAddress | Yes | Target contract or token recipient address. | |
| paymentSignature | No | Base64 PAYMENT-SIGNATURE: { signature, payload: { from, to, value, validAfter, validBefore, nonce } } for the EIP-3009 USDC TransferWithAuthorization in the payment requirements. Single-use and exact-price; signed by your own wallet. | |
| maxAllowedDrainUSD | No | Maximum allowable wallet drain in USD. Checked against Tenderly balance changes; an RPC-only simulation reports none. |