Overview
The Nexus SDK emits detailed step-by-step events during operations, allowing you to:- Show real-time progress to users
- Display current step and remaining steps
- Link to blockchain explorers for transparency
- Handle errors gracefully with context
- Build custom progress visualizations
Event System
All main operations emit two key events:STEPS_LIST
Emitted once at the start with all expected steps
STEP_COMPLETE
Emitted each time a step completes
Basic Progress Tracker
React Progress Component
A complete React example with visual progress:Bridge Step Types
Understand the steps emitted during bridge operations:| Step Type | Description | Data Available |
|---|---|---|
INTENT_ACCEPTED | Intent created and accepted | intentID |
INTENT_HASH_SIGNED | User signed the intent hash | - |
INTENT_SUBMITTED | Intent submitted to network | explorerURL, txHash |
INTENT_FULFILLED | Intent fulfilled by solver | - |
ALLOWANCE_USER_APPROVAL | Waiting for allowance approval | chainID, chainName |
ALLOWANCE_APPROVAL_MINED | Allowance transaction mined | chainID, explorerURL |
ALLOWANCE_ALL_DONE | All allowances approved | - |
INTENT_DEPOSIT | Deposit on source chain | chainID, amount, explorerURL |
INTENT_DEPOSITS_CONFIRMED | All deposits confirmed | - |
INTENT_COLLECTION | Collecting from source | chainID |
INTENT_COLLECTION_COMPLETE | All funds collected | - |
APPROVAL | Token approval for execution | explorerURL |
TRANSACTION_SENT | Execute transaction sent | txHash, explorerURL |
TRANSACTION_CONFIRMED | Execute transaction confirmed | explorerURL |
Swap Step Types
Steps emitted during swap operations:| Step Type | Description |
|---|---|
SWAP_START | Swap operation started |
DETERMINING_SWAP | Calculating optimal swap route |
CREATE_PERMIT_EOA_TO_EPHEMERAL | Creating permit for ephemeral wallet |
CREATE_PERMIT_FOR_SOURCE_SWAP | Creating permit for source swap |
SOURCE_SWAP_BATCH_TX | Executing source chain swaps |
SOURCE_SWAP_HASH | Source swap transaction hash |
BRIDGE_DEPOSIT | Bridge deposit for cross-chain swap |
RFF_ID | Request for funds ID |
DESTINATION_SWAP_BATCH_TX | Executing destination swaps |
DESTINATION_SWAP_HASH | Destination swap transaction hash |
SWAP_COMPLETE | Swap completed successfully |
SWAP_SKIPPED | Swap skipped (balance sufficient) |
Advanced: Multi-Operation Tracker
Track multiple operations simultaneously:Vue.js Example
For Vue developers:Best Practices
Always initialize with STEPS_LIST
Always initialize with STEPS_LIST
The
STEPS_LIST event tells you all expected steps upfront. Use it to initialize your UI and show users what to expect.Use typeID for tracking
Use typeID for tracking
Each step has a unique
typeID. Use it (not the type name) to track completion, as some steps may repeat.Display explorer links
Display explorer links
When
step.data.explorerURL is available, show it to users for transparency and debugging.Handle errors gracefully
Handle errors gracefully
If an operation fails, display the last completed step and error context to help users understand what happened.
Show time estimates
Show time estimates
Track
startTime and show elapsed time. Most operations complete in 30-120 seconds.Next Steps
Basic Bridge
Learn bridge operations with events
Swap Examples
Implement swap progress tracking
Error Handling
Handle errors in progress UIs
Events Reference
Complete events API documentation