@deloraprotocol/widget and the optional @deloraprotocol/widget-wallet-management adapter package.
Most integrations center on the trading widget surface:
TradeWidgetTradeWidgetWalletProvideruseTradeWidgetWalletManagement
MyWidget demo component and shared theming props.
@deloraprotocol/widget exports
Components and hooks:
MyWidgetTradeWidgetTradeWidgetWalletProvideruseTradeWidgetWalletManagement
MyWidgetPropsMyWidgetThemeMyWidgetVars
TradeWidgetPropsTradeWidgetConfigTradeWidgetRpcUrlsByChainIdTradeWidgetWalletConfigTradeWidgetWalletIdTradeWidgetPoweredByPositionWalletNamespaceTradeWidgetStatusTradeWidgetFiltersTradeWidgetSideFiltersTradeWidgetTokenSelectionTradeWidgetQuotePayloadTradeWidgetActionPayloadTradeWidgetConnectPayloadTradeWidgetTransactionPayloadTradeWidgetErrorPayloadTokenNetwork
TradeWidgetManagedWalletTradeWidgetManagedWalletConnectParamsTradeWidgetWalletManagementTradeWidgetWalletProviderPropsEip1193ProviderKnownWalletOptionIdSolanaInjectedProviderSolanaProviderWalletConnectionStatusWalletOptionDescriptorWalletOptionIdWalletOptionTypeWalletVisualIdWalletStandardSolanaAccountWalletStandardSolanaProvider
MyWidget and MyWidgetProps
MyWidget is a minimal example export that shares the same root theming surface as TradeWidget.
If you are embedding the production trade experience, use TradeWidget. If you need the lightweight demo component that ships with the package, use MyWidget.
MyWidgetProps extends normal root div props.
Common
MyWidgetVars fields include:
radiusfor shared surface radiusactionButtonRadiusfor the main CTA radiusfontFamily,fontSize,lineHeight, andletterSpacingfor typography- color and surface tokens such as
bg,fg,border,surface, andsurfaceAlt
TradeWidgetProps
TradeWidgetProps extends normal root div props, except the DOM onError prop is replaced by the widget error callback.
TradeWidgetConfig
For browser-rendered widgets, prefer not to pass
apiKey directly from the client. Keep it on your backend and proxy /v1/chains, /v1/tokens, /v1/tools, and /v1/quotes through config.apiUrl.
If your proxy does not serve Delora-relative image assets, set assetBaseUrl explicitly or proxy those asset paths as well.
If termsUrl or privacyPolicyUrl is omitted, the connect modal falls back to:
${window.location.origin}/documentation/termsofuse${window.location.origin}/documentation/privacypolicy
requireWalletConsent is false, the consent checkbox and both legal
links are hidden, and wallet rows can be selected immediately.
Wallet and branding configuration types
include, exclude, and order are independent. include is an allowlist,
exclude is a denylist with precedence over include, and order only moves
enabled wallets to the front without hiding unlisted wallets. These controls
apply to widget-managed wallets, not host-provided walletOptions.
Filters
TradeWidgetStatus
Event payloads
Wallet management types
origin or destination object into TradeWidgetWalletProvider, that side is treated as externally managed. To keep the built-in wallet flow for a side, omit that side from the provider value entirely.
useTradeWidgetWalletManagement is a thin helper hook for reading the same wallet-management context that powers TradeWidgetWalletProvider.
@deloraprotocol/widget-wallet-management exports
This package is optional. Install it when you want Delora to reuse wallet state from common host wallet libraries instead of writing a TradeWidgetManagedWallet object by hand.
Subpath exports:
The root package also re-exports every adapter and shared type. Prefer subpath imports when your app only installs one optional peer wallet stack.
Shared types exported from the root package:
DeloraOpenConnectModalDeloraOpenConnectModalParamsManagedWallet
DeloraWalletManagementProvider
DeloraWalletManagementProvider is a convenience wrapper around TradeWidgetWalletProvider.
origin or destination is omitted, that side receives wallet. Pass explicit origin and destination when sell-side and receiver-side wallet ownership should differ.
DeloraAutoWalletManagementProvider
DeloraAutoWalletManagementProvider detects host Wagmi and Solana Wallet Adapter contexts and wires them into the widget.
usePartialWalletManagement:trueforceInternalWalletManagement:false
evm={false} or solana={false} to opt out of one namespace. Set forceInternalWalletManagement to ignore all detected host contexts.
useWagmiManagedWallet
TradeWidgetManagedWallet for the EVM namespace. It reads account state from Wagmi, resolves an EIP-1193 provider from the active connector, and delegates connect and disconnect actions to Wagmi.
useSolanaWalletAdapterManagedWallet
TradeWidgetManagedWallet for the SVM namespace. It reads account state from Solana Wallet Adapter and exposes a Solana provider wrapper for transaction signing.
useCompositeManagedWallet
TradeWidgetManagedWallet. It sets managedNamespaces, fills walletsByNamespace, merges wallet options, and routes connect/provider calls to the namespace-specific adapter.
Shared connect modal types
openConnectModal when the Delora connect button should open a host wallet modal, such as RainbowKit or Solana Wallet Adapter UI.
