When to use this pattern
Choose this pattern when:- your app does not already have a connected wallet state
- you want the complete built-in UX: wallet selection, token picker, amount entry, and confirmation
- you want to reach production with the shortest integration path
The widget does not accept a
hooks field, so destination contract calls are
not available through it. To deposit into a contract on the destination chain,
use the headless core or the
REST API. See
vault destinations.Setup
1
Install the SDK
18.2+ or 19.2
Define your config
Create a
TrustwareConfigOptions object. At minimum you need apiKey and routes.toChain / routes.toToken.autoDetectProvider: true tells Trustware to manage wallet discovery on its own. Leave this enabled when using the drop-in pattern.3
Render the provider and widget
Wrap a component with
TrustwareProvider and place TrustwareWidget anywhere inside it.TrustwareProvider initializes the SDK, runs wallet detection, and makes configuration available to the widget. You do not need to pass anything else.Widget flow
Once rendered, the widget walks users through these steps in order:- Home: entry point; users choose to pay with crypto or fiat
- Select Token: all routable assets in the connected wallet are displayed for the transaction
- Confirm Deposit: amount entry with slider, token carousel, and fee summary
- Processing: transaction submitted; the widget waits for confirmation
- Success / Error: final result screen
