Trails is an intent-based orchestration layer that executes cross-chain transactions automatically. Developers specify what they want delivered; Trails handles routing, bridging, swapping, and gas, regardless of what chain or token the user starts from.Documentation Index
Fetch the complete documentation index at: https://docs.polygon.technology/llms.txt
Use this file to discover all available pages before exploring further.
How it works
Trails is built on an intent address primitive: a unique contract address computed from the full transaction parameters. When a user deposits tokens into their intent address, Trails automatically executes every step needed to deliver the result: swaps, bridges, relaying, with no further input from the user.- Intent definition: specify the origin token, destination token, amount, and target chain
- Intent address generation: Trails computes a unique address encoding all transaction parameters
- User deposits: the user transfers tokens to their intent address in a single confirmation
- Origin execution: a relayer executes the encoded origin transaction (swaps, bridges as needed)
- Destination settlement: bridged funds arrive and the final transaction executes on the destination chain
- Receipt: Trails confirms settlement; funds reach the recipient
Widget & SDK
The Trails Widget is a drop-in React UI. Use the mode-specific components when you know the job you want the user to complete, or use the Headless SDK when you want full control over the UI.| Path | Package | Best for |
|---|---|---|
| Mode widgets | 0xtrails/widget | Typed drop-in flows: Pay, Fund, Swap, Earn, Withdraw |
| Generic widget | 0xtrails/widget | Existing TrailsWidget integrations with mode="pay" | "fund" | "swap" | "earn" | "withdraw" |
| Headless SDK | 0xtrails | Custom UI with quote previews and programmatic execution |
"25" for 25 USDC.
Pay
Accept any token from any chain and receive a specific token on a specific chain. Users pay from their full cross-chain balance.Fund
Deposit funds into any wallet or chain from any starting token. Fund mode includes built-in funding paths from a connected wallet, crypto transfer, exchange, or fiat onramp.Swap
Exchange any token for any other token across chains. Use theSwap widget for a drop-in UI:
useQuote when you want to render the quote and button yourself:
Direct API
The Direct API lets you build the full intent lifecycle in server-side code, with no frontend required.Install
Initialize
X-Access-Key header. Base URL: https://trails-api.sequence.app/rpc/Trails/.
Step 1: Get a quote
Step 2: Commit the quote
Step 3: Execute
Transfer method: send tokens to the intent deposit address, then confirm:Step 4: Monitor until complete
getIntentReceipt for non-blocking status checks. Terminal states: SUCCEEDED, FAILED.
Supported chains and tokens
Trails supports all EVM-compatible chains. To query available tokens and supported networks:Get started
Trails quickstart
Integrate the Widget, Headless SDK, or Direct API in minutes.
API reference
Full endpoint reference, request/response schemas, and error codes.