- Instant — the user transfers tokens to the companion account, and the app executes the intent immediately
- Delayed / Automated — the user pre-approves tokens, and the app pulls and executes later (triggered by an event or schedule)
Companion Account
Each user gets a companion smart account owned solely by their EOA. The account has smart sessions enabled so your app can operate it via a session key.Session Key Setup
Define multi-chain sessions scoped to the vault contracts your app supports. The session key is controlled by your app’s service.Sessions can be further scoped to specific contract functions (e.g.,
deposit and withdraw) and guarded with policies like spending limits or timeframes. See the Smart Sessions docs.Instant Execution
In the instant flow, the user makes a single token transfer and your app handles the rest.Funding the Account
Prompt the user to transfer tokens to the companion account:For native token deposits (e.g., ETH), transfer the native token directly to the companion account. The intent system handles wrapping to WETH internally.
Executing the Intent
Once funded, the companion account executes the crosschain intent using the session key:After submitting the intent, poll the intent status until it reaches a terminal state (
COMPLETED, FILLED, FAILED, or EXPIRED). This typically takes a few seconds for cross-chain settlements.Delayed / Automated Execution
In the delayed flow, the user pre-approves tokens and your app triggers execution later — for example, on a schedule, when a vault matures, or in response to an onchain event.Step 1: User Approves Tokens
The user approves the companion account to spend their tokens:Step 2: Pull Funds and Execute
When your app is ready to execute, it pulls the funds from the user and executes the intent in two steps. Pull approved tokens into the companion account (same-chain):This two-step flow can potentially be simplified to a single step using source chain executions.
Gas Sponsorship
You can sponsor the gas and bridging costs for the intent execution by passingsponsored: true:
The user still needs gas for the initial token transfer (instant flow) or approval transaction (delayed flow).
Event Listening Service
For the delayed execution flow, your app implements a service that listens for onchain or offchain events to trigger executions. The service has access to the session key and stored credentials.The specific events to listen for (e.g., ERC-20 Transfer events, vault maturity events, or offchain triggers) and the service architecture are implementation-specific.