Skip to main content

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.

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:
  1. Quote-first flow — use useQuote with actions when you want to build your own UI and preview a quote before sending it.
  2. Send-transaction flow — use useTrailsSendTransaction with actions when you want to trigger the Trails Widget.
Token amounts passed to 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:
  1. The user signs once on the origin chain. Their funds are bridged and/or swapped to an intent wallet on the destination chain.
  2. Trails then runs the destination calls from that intent wallet.
Composable Actions are a typed builder for those destination calls. Each builder returns a plain action descriptor, an array of them is what you hand to useQuote or useTrailsSendTransaction.

Available action builders

Import the builders you need directly from 0xtrails:
import { swap, lend, deposit, assertCondition, custom } from '0xtrails'
BuilderWhat 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)
See Building Actions for the full API of each builder.

Demo

Try composable actions in the SDK sandbox.

Where to go next

  • Quickstart — a multi-step example combining deposit, swap, assertCondition, and lend in a single intent.
  • Building Actions — the full builder API, one section per builder.
  • Dynamic Valuesdynamic() and self() 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.