Skip to main content

Monitoring

After executing a plan, you need to know when it confirms. Legend offers two approaches: polling activities and long-polling events.

Polling activities

The simplest approach. After executing a plan, poll the activities endpoint until you see your transaction:
This works, but makes many requests. For production use, prefer long-polling.

Long-polling events

The events endpoint with poll=true holds the connection open until something happens — no wasted requests:

Continuous monitoring loop

For a service that needs to react to all account changes:

Which approach to use