Skip to main content
This page is the type-and-prop reference for @velora-dex/widget. For task-oriented walkthroughs, see Configure, Wallet management, Monetize, and Events & callbacks.

Public exports

Everything below can be imported from @velora-dex/widget:
ApiConfig is not re-exported by name even though it’s the shape of the apiConfig prop. Infer it via WidgetProps["apiConfig"] if you need a named type.

<Widget /> props

WidgetConfig

Field-by-field documentation lives on Configure. Monetization fields are documented on Monetize. Wallet-related fields on Wallet management.

ApiConfig

Forwarded to the Velora SDK on every backend request (prices, swap construction, Delta order submission). Use when integrating against an authenticated tier or a partner-proxied endpoint.
This is client-side code. Don’t embed secrets you wouldn’t put in a public bundle.

EIP1193ProviderLax

Many wallets don’t satisfy viem’s strict EIP1193Provider signature, so the widget accepts a looser shape:
Used with widgetMode: "dapp". See Wallet management.

FormInputProps

Pre-populate the form on mount, useful for deep links and programmatic control.

selectedForm

"swap" | "limit" | "otc" | "twap" — defaults to "swap". Corresponds to tradeMode in events.

tokenFromAddress

Address — the source-token address to pre-select. Pair with srcChainId.

srcChainId

SupportedChainId — chain for the source token. Required when tokenFromAddress is provided.

tokenToAddress

Address — the destination-token address to pre-select. Pair with destChainId (or omit for same-chain).

destChainId

SupportedChainId — chain for the destination token. Only functional when selectedForm is "swap" (crosschain). For limit and OTC, it’s forced to match srcChainId.

sendAmount

string — initial amount to send, in token units (not wei). Must parse as a number.

receiveAmount

string — initial amount to receive, in token units. Mutually exclusive with sendAmount for the same trade-side.

side

"BUY" | "SELL" — only for selectedForm: "swap" or "twap". If omitted, defaults to "SELL" when sendAmount is set and "BUY" when receiveAmount is set. If both or neither amounts are present, the user’s UI selection wins.

orderDeadline

string — Unix timestamp (seconds), as a numeric string. Only functional when selectedForm is "limit" or "otc". For Delta Limit Orders, the minimum recommended expiry is now + 10 minutes. For OTC, "0" means no expiry. The widget doesn’t reject invalid values at prop time — they surface in the trade flow.
For native ETH, pass the special address "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE".

WidgetEventCallbacks

Each callback receives { event, state } where event is a discriminated union on event.name and state is a snapshot of the full widget state. Detailed sub-event names, params, and lifecycle ordering live on Events & callbacks.

defaults

Use to compose custom values that include or exclude defaults:
Last modified on June 14, 2026