Widget Events
The<argyros-swap> element dispatches custom events at key points in the swap lifecycle. All events have bubbles: true and composed: true, so they cross the shadow DOM boundary.
Event Reference
| Event | Fired when | detail type |
|---|---|---|
quote-update | A new quote is fetched | QuoteResponse |
swap-initiated | User clicks “Swap” and the request starts | { inputMint: string, outputMint: string, amount: string } |
swap-complete | Swap transaction is built successfully | SwapResponse |
swap-error | Swap request fails | { error: string } |
connect-wallet | User clicks the button without a wallet connected | {} |
quote-update
Fired every time a new quote loads (after the 400ms debounce).
swap-initiated
Fired when the user clicks “Swap” and the SDK request begins. Use this for analytics or loading states.
swap-complete
Fired when the swap transaction is built successfully. The detail contains the full SwapResponse including the base64 transaction.