TheDocumentation Index
Fetch the complete documentation index at: https://docs.trustware.io/llms.txt
Use this file to discover all available pages before exploring further.
routes field in TrustwareConfigOptions defines the destination for every transaction the widget processes. At a minimum you must tell the SDK which chain and token to route to. Everything else (source token preference, slippage, amount constraints) is optional and can be configured incrementally.
Required fields
The destination chain ID as a string. For example,
"8453" targets Base
mainnet. This must be a chain the Trustware backend supports.The destination token address on the target chain. Pass the ERC-20 contract
address. For example,
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" is the
conventional address used for the native gas token on EVM chains.Optional fields
A preferred source token. When set, the widget pre-selects this token on the
source side. The user can still change it.
Override the source wallet address used when building routes. Useful when you
want to pre-specify the sending address independently of the connected wallet.
Override the destination wallet address. You can also set this at runtime
using
Trustware.setDestinationAddress(address) without rebuilding the
provider.Slippage tolerance as a percentage. Defaults to
1 (1%). Increase this for
volatile pairs or routes with low liquidity.routes.options
The nestedoptions object controls route refresh behavior and amount constraints.
How often (in milliseconds) the widget automatically re-fetches a fresh route
preview while the user is on the amount entry screen. If omitted, routes are
not automatically refreshed.
Locks the widget’s amount input to a specific USD amount. When set, the user
cannot change the amount; the widget behaves as a fixed-price checkout.
The minimum USD amount the user is allowed to enter. Amounts below this
threshold are rejected by the widget before a route is requested.
The maximum USD amount the user is allowed to enter. Amounts above this
threshold are rejected by the widget before a route is requested.
Setting the destination address at runtime
If you only know the destination address after the provider has mounted (for example, after a user logs in), useTrustware.setDestinationAddress instead of rebuilding the config:
Trustware.setDestinationAddress overwrites routes.toAddress for the
current session. You do not need to unmount and remount the provider.