Documentation Index
Fetch the complete documentation index at: https://docs.trustware.io/llms.txt
Use this file to discover all available pages before exploring further.
TrustwareConfigOptions is the single object you pass to TrustwareProvider. Every aspect of the SDK (which chain and token to route to, how the widget looks, how retries are handled, and which wallet connectors are available) is controlled through this shape.
Two fields are required: apiKey and a routes object containing at minimum toChain and toToken. Everything else is optional and falls back to a sensible default.
Complete config shape
Required fields
Your Trustware API key. Used for all requests the SDK makes to the Trustware
backend. Store this in an environment variable and avoid committing it to
source control.
The destination chain ID as a string (for example,
"8453" for Base). See
the route configuration page for the full list of
supported values.The destination token address. Use the standard ERC-20 contract address for
the token on the destination chain. See route configuration
for details.
Config groups
Each top-level key beyondapiKey and routes is documented on its own page.
| Key | Description |
|---|---|
routes | Controls the destination chain, token, slippage, route type, and amount constraints. See route configuration. |
theme | Overrides widget colors and border radius. See appearance customization. |
messages | Overrides the widget title and description copy. See appearance customization. |
walletConnect | Configures or disables the WalletConnect connector. See WalletConnect configuration. |
retry | Controls automatic retry behavior on rate-limited requests. See retry configuration. |
features | Controls optional SDK behaviours: tokensPagination, balanceStreaming, and shouldAllowGA4. See the types reference. |
autoDetectProvider | For headless usage; when true, the core API auto-picks up window.ethereum when called directly. Defaults to false. See note below. |
autoDetectProvider vs autoDetect: two related but distinct controls.autoDetectis a prop on<TrustwareProvider>that triggers wallet detection on mount. Defaults totrue. SetautoDetect={false}when passing your ownwallet(see host wallet) to avoid duplicate discovery.autoDetectProvideris a field insideTrustwareConfigOptionsfor headless usage. Whentrue, the core API auto-picks upwindow.ethereumwhen called directly. Defaults tofalse.
Lifecycle callbacks
Called whenever a
TrustwareError is thrown during a route or transaction
operation. Use this to surface errors to your own UI or logging pipeline.Called after a transaction is successfully submitted and confirmed. Receives
the completed
Transaction object.Called for widget lifecycle events such as step transitions. Use this for
analytics or custom instrumentation.
