Composable Actions allow developers to easily specify multiple actions to take on a destination chain that can compose with multiple protocols. For example, staking in a liquid staking token and then depositing that token into a vault. This means a user can sign a single transaction and multiple onchain interactions can take place from virtually any chain as the starting point. Two browser integration styles are supported:Documentation Index
Fetch the complete documentation index at: https://anypay-docs-sdk-0-15-0-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- Quote-first flow — use
useQuotewithactionswhen you want to build your own UI and preview a quote before sending it. - Send-transaction flow — use
useTrailsSendTransactionwithactionswhen you want to trigger the Trails Widget.
useQuote and useTrailsSendTransaction are human-readable decimal strings, so "0.2" means 0.2 USDC / USDT / ETH depending on the selected token.
What Composable Actions are
A Trails intent is a two-phase transaction:- The user signs once on the origin chain. Their funds are bridged and/or swapped to an intent wallet on the destination chain.
- Trails then runs the destination calls from that intent wallet.
useQuote or useTrailsSendTransaction.
Available action builders
Import the builders you need directly from0xtrails:
| Builder | What it does |
|---|---|
swap({...}) | On-chain swap via Uniswap V3 or SushiSwap V3 |
lend({...}) | Supply into supported lending markets such as Aave |
deposit({...}) | Deposit into an ERC-4626 / vault-style market (Morpho, Yearn, SummerFi, Sky, …) |
assertCondition({...}) | On-chain guard (balance >= X, deadline > now, …) — whole batch reverts if false |
custom({...}) | Wrap an arbitrary contract call (escape hatch) |
Demo
Try composable actions in the SDK sandbox.Where to go next
- Quickstart — a multi-step example combining
deposit,swap,assertCondition, andlendin a single intent. - Building Actions — the full builder API, one section per builder.
- Dynamic Values —
dynamic()andself()for runtime amount / address resolution. - Markets & Providers — discover markets and providers.
- ERC-20 Helpers — token registry, calldata builders, slippage helper.
- Supported Chains — chain identifiers and swap provider coverage.