cURL
Intents
ExecuteIntent
POST
cURL
Overview
TheExecuteIntent endpoint initiates the execution of a committed intent. This endpoint triggers the actual cross-chain transaction flow, including deposits, swaps, bridges, and destination calls.
Use Cases
- Execute a committed cross-chain transaction
- Initiate gasless transactions with deposit signatures
- Trigger intent execution after deposit confirmation
- Start the cross-chain bridging process
Request Parameters
Required Fields
- intentId (string): The unique identifier returned from
CommitIntent
Optional Fields
- depositTransactionHash (string): Hash of the deposit transaction if already executed
- depositSignature (DepositSignature): Signature for gasless execution
- intentSignature (string): EIP-712 signature of the intent
- permitSignature (string): ERC-2612 permit signature (if applicable)
- permitDeadline (number): Permit expiration timestamp
- permitAmount (number): Amount authorized by permit
- selectedGasFeeOption (FeeOption): Selected gas fee payment option
- userNonce (number): User’s nonce for replay protection
- deadline (number): Signature expiration timestamp
Response
The response includes:- intentId (string): The intent identifier
- intentStatus (IntentStatus): Current status of the intent
QUOTED: Initial quote generatedCOMMITTED: Intent committed and readyEXECUTING: Currently executingFAILED: Execution failedSUCCEEDED: Successfully completed
Execution Options
Mode 1: With Deposit Transaction Hash
First, deposit tokens to the intent address, then call ExecuteIntent with the transaction hash:Mode 2: With Deposit Signature (Gasless)
Trails also supports paying end to end in non-native gas tokens that are permit compatible:For complete details on preparing the deposit signature with permit and intent signatures, see the Alternative Fee Token Flow in the Getting Started guide.
Transaction Flow
Once executed, the intent goes through several stages:- Deposit: Tokens are deposited to the origin intent address
- Relaying: Transaction is relayed to destination chain (if cross-chain)
- Execution: Destination calls are executed if calldata is passed
- Completion: Final status is recorded
Example: Full Flow
Timing Requirements
Error Handling
Next Steps
After executing an intent:- Use
GetIntentReceiptto poll for transaction status - Use
WaitIntentReceiptfor streaming updates - Check transaction hashes on block explorers
- Verify final balances on destination chain