Documentation Index
Fetch the complete documentation index at: https://mintlify.com/availproject/nexus-sdk/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Bridge operations emit step-by-step progress events through theonEvent callback. These events allow you to build real-time progress UIs, track transaction status, and provide users with detailed feedback during bridge, transfer, and execute operations.
Event Callback
Event Types
STEPS_LIST
Emitted once at the start of an operation with all expected steps.
Event name constant from
NEXUS_EVENTS.STEPS_LISTArray of all steps that will be executed during this operation
STEP_COMPLETE
Emitted each time a step completes successfully.
Event name constant from
NEXUS_EVENTS.STEP_COMPLETEThe step that just completed
Bridge Step Types
All bridge steps follow this structure:Step Reference
Intent Steps
Intent created and accepted by solver.When: After intent is validated and accepted by the Avail solver network.
User signed the intent hash.When: After user signs the intent message in their wallet.
Intent submitted to the network.Data:
explorerURL- Link to view intent on explorerintentID- Unique intent identifier
Intent fulfilled by solver.When: After solver fulfills the intent and funds arrive at destination.
Allowance Steps
Waiting for user to approve token allowance.Data:
chainID- Chain requiring approvalchainName- Chain name
typeID includes chain ID (e.g., AUA_1 for Ethereum).Allowance approval transaction mined.Data:
chainID- Chain where approval was minedchainName- Chain name
typeID includes chain ID (e.g., AAM_1 for Ethereum).All allowance approvals completed.When: After all required token approvals are confirmed.
Deposit Steps
Deposit initiated on source chain.Data:
amount- Deposit amount (human-readable)chainID- Source chain IDchainName- Source chain name
typeID includes deposit index (e.g., ID_0, ID_1 for multiple sources).All deposits confirmed.When: After all source chain deposits are confirmed.
Collection Steps
Collecting funds from source chain.Data:
confirmed- Number of collections confirmedtotal- Total collections expectedtxHash- Collection transaction hashexplorerUrl- Transaction explorer URL
typeID includes collection index.All funds collected from source chains.When: After solver has collected all deposits.
Execution Steps
Token approval for contract execution.When: During
execute() or bridgeAndExecute() when token approval is needed.Execute transaction sent to network.When: After execute transaction is broadcast to the network.
Execute transaction confirmed on-chain.When: After execute transaction is mined and confirmed.
Examples
Basic Progress Tracking
Progress Bar UI
React Progress Component
Detailed Step Information
Multi-Chain Source Tracking
Explorer Links
Time Tracking
Best Practices
-
Initialize UI early: Use
STEPS_LISTto set up your progress UI before any steps complete. -
Use typeID for tracking: The
typeIDis unique per step, ideal for keys and tracking completion. -
Show explorer links: Display
explorerURLwhen available so users can verify transactions. - Handle dynamic steps: Some operations may have different numbers of steps depending on source chains.
-
Provide context: Use
step.datato show relevant details (amounts, chains, etc.). -
Track progress percentage: Calculate
(completed / total) * 100for progress bars. - Highlight current step: Show which step is currently in progress, not just completed ones.
- Persist state: Consider persisting step state in case of page refresh during long operations.
Related Events
- Swap Steps - Track swap operation progress