Skip to main content

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.

When you want users to choose their own deposit amount but need to enforce a floor or ceiling — to meet minimum transaction thresholds, cap exposure, or comply with business rules — you can set minAmountOut and maxAmountOut in your route options. The widget constrains its slider and input field to the range you configure.

The minAmountOut and maxAmountOut options

Both options live inside routes.options in your TrustwareConfigOptions. You can set either one independently or both together.
import { type TrustwareConfigOptions } from "@trustware/sdk";

const guardedConfig = {
  ...trustwareConfig,
  routes: {
    ...trustwareConfig.routes,
    options: {
      minAmountOut: "10",
      maxAmountOut: "250",
      routeRefreshMs: 10000,
    },
  },
} satisfies TrustwareConfigOptions;
Pass this config to TrustwareProvider:
<TrustwareProvider config={guardedConfig}>
  <TrustwareWidget />
</TrustwareProvider>

Value format

Both options accept a string or a number representing a USD amount:
minAmountOut: "10"    // string — minimum of $10 USD
maxAmountOut: "250"   // string — maximum of $250 USD
Values are interpreted as USD amounts. Do not include a currency symbol or unit suffix.

routeRefreshMs in this context

The example above also sets routeRefreshMs: 10000. This controls how often the widget re-fetches route previews, in milliseconds. When users are actively adjusting an amount within a constrained range, a shorter refresh interval keeps quotes current. The default is 15000 ms (15 seconds).
minAmountOut and maxAmountOut constrain the widget UI. They do not replace server-side validation. Your backend should independently enforce any deposit limits that are critical to your business logic.
If you want to lock users to a single amount rather than a range, use fixedFromAmount instead. See the fixed amount guide for details.