Widget Events
The event envelope
interface SwapperWidgetEvent {
type: "SWAPPER_EVENT"; // discriminator — filter on this
version: "1.0"; // protocol version
name: WidgetEventName; // e.g. "transaction_success"
timestamp: string; // ISO 8601
payload: WidgetEventPayload; // event-specific data
}Field
Description
Three ways to listen
onEvent (recommended)
on() / off()
Raw window.addEventListener
Event types
Name
Value
Meaning
transaction_success
Field
Type
Description
resize
close_request
Extensibility
Events vs. webhooks
Last updated