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.
Fund with Trails
Traditional funding flows require users to find an external bridge, swap to the required deposit token, pay multiple gas fees across networks, and navigate complex UIs. Trails handles all of that in a single transaction. Users can deposit from any token they hold on any supported chain — or use a fiat onramp, exchange transfer, or QR code — all in one embedded experience.Use cases
Funding flows are exact-input by default. The user selects how much to send; the destination receives the resulting amount after routing.- Transfer funds into a perpetual exchange
- Bootstrap liquidity in a lending protocol vault
- Onboard users to a new chain
- Top up a prediction market or gaming app account
- Deposit into staking contracts
Examples
Deposit USDC to Polygon
Depositing into a lending protocol
For protocols like Aave that are natively supported, use thelend composable action. This handles approval, the supply call, and dynamic amount resolution without encoding any calldata by hand:
useEarnMarkets to discover available market IDs. See Markets and Providers.
Depositing into a vault
For ERC-4626 and vault-style protocols (Morpho, Yearn, SummerFi), use thedeposit composable action:
Depositing into a custom contract
For protocols not covered by composable actions, useTRAILS_ROUTER_PLACEHOLDER_AMOUNT in to.calldata:
Trustless deposit address via API (quote → commit → execute)
Create a deposit address flow server-side using the Trails API directly:Quotes expire after 10 minutes.
Next steps
- Composable actions — programmatic DeFi deposits using
lend,deposit, andswap - Fund mode configuration — complete configuration options
- SDK configuration — widget setup and event handling
- Theming — customize appearance
- Hooks reference — programmatic control