TradeWidget can manage wallets internally or reuse wallet state from the host application. The built-in wallet flow is enough for standalone embeds. Host wallet management is useful when your app already has wallet connection UI, account state, and providers.
Current widget execution supports two wallet namespaces:
EVMfor Ethereum-compatible chainsSVMfor Solana-compatible chains
originis the sell-side wallet and signs the transactiondestinationis the optional receiver-side wallet on the buy side
Packages
Wallet integration is split into two layers.| Package | Use for | Exports |
|---|---|---|
@deloraprotocol/widget | Built-in wallet management and low-level manual adapters | TradeWidget, TradeWidgetWalletProvider, useTradeWidgetWalletManagement |
@deloraprotocol/widget-wallet-management | Ready-made adapters for common host wallet stacks | Wagmi adapter, Solana Wallet Adapter adapter, composite adapter, auto-detect provider |
@deloraprotocol/widget-wallet-management/auto import both adapters, so use them only when both optional peer stacks are available in your app.
Built-in wallet management
If you renderTradeWidget by itself, the widget shows its own wallet connection UI and owns the wallet state.
- MetaMask
- Rabby Wallet
- Wallet Connect
- Backpack
- Phantom
- Solflare
- Trust Wallet
- OKX Wallet
- Coinbase Wallet
- Magic Eden
- EVM wallets use injected providers or WalletConnect
- Solana wallets use injected providers or Wallet Standard providers
- wallet selection is persisted in browser
localStorage - the connect modal requires the user to accept Terms and Privacy Policy before connection
config.termsUrl or config.privacyPolicyUrl is omitted, the modal falls back to same-origin /documentation/termsofuse and /documentation/privacypolicy links. Third-party embeds should pass explicit URLs.
Set config.walletConnectProjectId to override the WalletConnect Cloud project id used by the built-in EVM QR flow.
Auto wallet management
DeloraAutoWalletManagementProvider is the auto-detected integration layer for apps that already use Wagmi and/or Solana Wallet Adapter. It detects those React contexts above the widget and wires them into TradeWidget.
Use this when:
- your EVM wallet UI is built on Wagmi, RainbowKit, Reown, Dynamic, or a similar Wagmi-based stack
- your Solana wallet UI is built on Solana Wallet Adapter
- you want the widget connect button to open the host app’s wallet modal
- you want the widget to fall back to built-in wallets for namespaces the host does not manage
WagmiProvider and, for Solana, below ConnectionProvider and WalletProvider from Solana Wallet Adapter.
The example uses RainbowKit and Solana Wallet Adapter UI only as host wallet modals. Replace those callbacks with your own Wagmi-based or Solana wallet UI if your app uses a different provider.
EVM wallet connection
For EVM, the optional package reads wallet state from Wagmi throughuseWagmiManagedWallet.
useWagmiManagedWallet returns a TradeWidgetManagedWallet object with:
- connected Wagmi address and connector name
- EIP-1193 provider access through
getEvmProvider - connect, disconnect, and error handlers
- optional wallet rows derived from Wagmi connectors
wallet_switchEthereumChain and falls back to wallet_addEthereumChain when the chain is missing from the wallet.
If your host wallet UI restricts supported chains, keep that host configuration aligned with the chains you allow in the widget.
SVM wallet connection
For Solana, the optional package reads wallet state from Solana Wallet Adapter throughuseSolanaWalletAdapterManagedWallet.
useSolanaWalletAdapterManagedWallet returns a TradeWidgetManagedWallet object with:
- connected public key
- wallet name and icon when available
- connect, disconnect, and error handlers
- a Solana provider wrapper that exposes
signTransaction - optional wallet rows derived from Solana Wallet Adapter wallets
signTransaction, execution cannot continue.
Connect button modes
The optional adapters support two host-wallet UX modes.Host modal
PasswalletOptions: [] and openConnectModal.
Widget picker
OmitwalletOptions to let the adapter expose wallet rows to the Delora connect modal.
connectWalletOption.
For Wagmi, unknown or service connectors are hidden by default. Use:
walletOptionIdsfor an explicit allowlistincludeUnknownWalletOptions: trueto expose custom connectors
includeUndetectedWallets: true when you want installable Solana wallet rows.
Partial wallet management
Partial wallet management lets the host manage one namespace while the widget keeps built-in management for the other namespace. Examples:- host manages EVM through Wagmi, Delora manages Solana internally
- host manages Solana through Solana Wallet Adapter, Delora manages EVM internally
- host manages both namespaces through a composite wallet adapter
DeloraAutoWalletManagementProvider enables partial wallet management by default.
usePartialWalletManagement={false} when the host wants full wallet ownership and does not want Delora to fall back to its built-in wallet flow for unmanaged namespaces.
Force internal wallet management
UseforceInternalWalletManagement on the auto provider to ignore detected host wallet contexts and use only Delora’s built-in wallet flow.
TradeWidgetWalletProvider API, the equivalent is to not render the provider around TradeWidget.
Manual core provider
TradeWidgetWalletProvider is the low-level API from @deloraprotocol/widget. Use it when you have custom wallet state that is not represented by Wagmi or Solana Wallet Adapter.
TradeWidgetWalletProvider is a React context provider. It does not connect to wallets by itself and it does not replace an EVM or Solana provider.
Its job is to expose two optional wallet adapters to TradeWidget:
originfor the sell-side walletdestinationfor the receiver-side wallet
TradeWidget mounts, it reads that context and passes origin and destination into its wallet hooks. If one side is present, that side switches into externally managed mode. If one side is missing, the widget falls back to its built-in wallet flow for that side.
This is presence-based, not connection-based.
If you pass an origin or destination object at all, that side is considered externally managed even when namespace and address are currently null.
If you want the widget to keep its built-in wallet flow for a side, omit that side from the provider value entirely.
What the widget reads from your wallet adapter
For each externally managed side, the widget reads values such as:namespaceaddressstatuswalletNameconnectedWalletIdconnectedWalletVisualIdconnectedWalletIconUrlerrorMessage
originfor the sell-side walletdestinationfor the receiver-side wallet
Managed wallet shape
At minimum, a managed wallet exposes:namespaceaddress
connectWalletOptionconnectPreferredconnect
statusmanagedNamespaceswalletsByNamespacewalletNameconnectedWalletId,connectedWalletVisualId,connectedWalletIconUrlwalletOptionsevmProviderorgetEvmProviderevmBrowserProviderorgetEvmBrowserProvidersolanaProviderorgetSolanaProviderwalletStandardSolanaAccountorgetConnectedWalletStandardSolanaAccountdisconnecterrorMessage,clearError, andpeekLastConnectionError
connectWalletOption(walletId, namespace)connectPreferred(namespace)connect(params)
Composite wallets
UseuseCompositeManagedWallet when EVM and Solana are managed by separate hooks but should be passed to the widget as one wallet object.
managedNamespacesfor the namespaces it controlswalletsByNamespaceso the widget can route EVM and Solana operations to the correct adapter- merged wallet rows for the connect modal
Receiver and destination behavior
The widget has a separate receiver flow on the buy side. At runtime, users can:- receive to the origin wallet when the buy-side namespace matches
- connect a separate destination wallet
- paste a receiver address directly in the UI
- built-in wallet management
- auto wallet management through
@deloraprotocol/widget-wallet-management - manual
originanddestinationadapters throughTradeWidgetWalletProvider
Provider access and execution
Wallet management only provides connection state and provider access. Transaction orchestration stays insideTradeWidget.
The widget still handles:
- metadata and quote loading
- balance checks
- allowance checks
- approve vs swap state transitions
- transaction submission callbacks
- confirmation callbacks
- bridge and swap tracking
getEvmProvider()evmProvider
- read the active account with
eth_accounts - switch to the selected sell chain with
wallet_switchEthereumChain - add missing chains with
wallet_addEthereumChain - submit transactions with
eth_sendTransaction - try EIP-5792 batching for approve plus swap when the wallet supports it
ethers BrowserProvider, it wraps the raw EIP-1193 provider internally. evmBrowserProvider and getEvmBrowserProvider() are optional helpers, not a replacement for the raw provider in the current execution path.
For externally managed Solana wallets, provide:
getSolanaProvider()orsolanaProvider
walletStandardSolanaAccountgetConnectedWalletStandardSolanaAccount()
- Wallet Standard
signAndSendTransactionwhen available - otherwise the connected wallet’s
signTransaction
walletOptions, the widget calls the host’s connect function directly. When walletOptions are present, the widget can show its own wallet chooser and call the host’s connectWalletOption logic. Each option’s availableNamespaces should reflect the ecosystems that wallet can actually connect to.
Mental model
The shortest way to choose an integration is:- use plain
TradeWidgetfor standalone embeds - use
DeloraAutoWalletManagementProviderwhen your app already has Wagmi and/or Solana Wallet Adapter contexts - use
TradeWidgetWalletProviderwhen you need a custom low-level adapter

