Skip to main content
POST
cURL

Overview

The ExecuteIntent 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 generated
    • COMMITTED: Intent committed and ready
    • EXECUTING: Currently executing
    • FAILED: Execution failed
    • SUCCEEDED: 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:
  1. Deposit: Tokens are deposited to the origin intent address
  2. Relaying: Transaction is relayed to destination chain (if cross-chain)
  3. Execution: Destination calls are executed if calldata is passed
  4. Completion: Final status is recorded

Example: Full Flow

Timing Requirements

You must call ExecuteIntent within 10 minutes of committing the intent. If this window expires, the committed intent becomes invalid and you’ll need to request a new quote and commit again.

Error Handling

If execution fails, the intent status will be set to FAILED. Check the statusReason field in the receipt for details.

Next Steps

After executing an intent:
  1. Use GetIntentReceipt to poll for transaction status
  2. Use WaitIntentReceipt for streaming updates
  3. Check transaction hashes on block explorers
  4. Verify final balances on destination chain

Body

application/json
intentId
string
required
depositTransactionHash
string
depositSignature
object

Response

OK

intentId
string
required
intentStatus
enum<string>
required

Represented as uint8 on the server side

Available options:
QUOTED,
COMMITTED,
EXECUTING,
FAILED,
SUCCEEDED,
ABORTED,
REFUNDED,
INVALID