Skip to main content
POST
cURL

Overview

The WaitIntentReceipt endpoint provides a streaming or long-polling mechanism to wait for an intent to complete. Unlike GetIntentReceipt, which requires manual polling, this endpoint holds the connection until the intent reaches a terminal state or times out.

Use Cases

  • Wait for transaction completion without polling
  • Implement real-time transaction monitoring
  • Reduce API calls by using long-polling
  • Get notified immediately when transaction completes
  • Simplify client-side code for waiting

Request Parameters

Required Fields

  • intentId (string): The unique identifier of the intent to monitor

Response

The response includes:
  • intentReceipt (IntentReceipt): Complete receipt with transaction details
  • done (boolean): Indicates if the intent has reached a terminal state
    • true: Intent is complete (SUCCEEDED or FAILED)
    • false: Intent is still processing (may require another call)

Behavior

This endpoint will:
  1. Check the current status of the intent
  2. If complete (SUCCEEDED or FAILED), return immediately with done: true
  3. If still processing, wait for state changes
  4. Return updates as they occur
  5. Timeout after a reasonable period if no completion

Example

Comparison: WaitIntentReceipt vs GetIntentReceipt

GetIntentReceipt (Manual Polling)

WaitIntentReceipt (Long Polling)

WaitIntentReceipt is more efficient as it reduces the number of API calls and provides near-instant updates.

With Progress Updates

Timeout Handling

Best Practices

Always implement timeout handling to prevent indefinite waiting in case of network issues or unexpected states.
For UI applications, combine this endpoint with progress callbacks to provide real-time feedback to users.

Next Steps

After receiving the completed receipt:
  1. Verify transaction hashes on block explorers
  2. Update UI to show completion status
  3. Trigger any post-transaction logic
  4. Store receipt for record-keeping

Body

application/json
intentId
string
required
lastReceiptStates
enum<string>[]

[]TransactionStatus

Represented as uint8 on the server side

Available options:
UNKNOWN,
ON_HOLD,
PENDING,
RELAYING,
SENT,
ERRORED,
MINING,
SUCCEEDED,
FAILED,
ABORTED,
REVERTED

Response

OK

intentReceipt
object
required
receiptStates
enum<string>[]
required

[]TransactionStatus

Represented as uint8 on the server side

Available options:
UNKNOWN,
ON_HOLD,
PENDING,
RELAYING,
SENT,
ERRORED,
MINING,
SUCCEEDED,
FAILED,
ABORTED,
REVERTED
done
boolean
required