Skip to main content

Activities & Events

After executing a plan, you’ll want to track its progress. Legend provides two complementary mechanisms.

Activities

Activities represent completed or in-progress on-chain operations. Each activity has:
  • activity_type — What happened (e.g., "quark_operation_executed")
  • activity_status — Current state: "pending", "confirmed", or "failed"
  • activity_metadata — Details about the operations (amounts, assets, chains)
Use List Activities to see all activities, or Get Activity for a specific one.

Activity lifecycle

pending → confirmed    (transaction confirmed on-chain)
pending → failed       (transaction reverted)

Events

Events provide a real-time stream of changes to a sub-account. Use them for:
  • Webhooks-style monitoring — Long-poll for updates instead of repeatedly fetching activities
  • Cursor-based pagination — Track where you left off with the cursor value

Long-polling

Pass poll=true to the Events endpoint and the request will hang until new events arrive (up to ~30 seconds). This is more efficient than polling activities on a timer.
GET /accounts/acc_xxx/events?since=0&poll=true
→ hangs until an event occurs
→ returns events + new cursor

When to use which

Use caseRecommended
Show transaction historyActivities
Wait for a specific transaction to confirmEvents (long-poll)
Build a real-time dashboardEvents (long-poll loop)
Debug a failed transactionActivity (by ID)