GetExactInputRoutes will return a list of destination tokens, when given an origin chain and token,
Routes & Tokens
GetExactInputRoutes
POST
GetExactInputRoutes will return a list of destination tokens, when given an origin chain and token,
Documentation Index
Fetch the complete documentation index at: https://anypay-trails-api-docs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheGetExactInputRoutes endpoint retrieves available token routes for exact input swaps. Given a source token, it returns all destination tokens that can be received. This is essential for building UIs where users specify exactly how much they want to spend.
Use Cases
- Build “I want to spend exactly X tokens” interfaces
- Find which destination tokens are available from a source
- “Swap all” functionality where user empties a token balance
- Portfolio rebalancing flows
- Cross-chain token migration
Request Parameters
Required Fields
- originChainId (number): The chain ID of the source token
- originTokenAddress (string): The token address to swap from
Optional Fields
- destinationChainId (number): Filter routes to a specific destination chain
- destinationTokenAddress (string): Check if a specific route exists
Response
The response includes:- tokens (TokenInfo[]): Array of destination tokens that can be received
TokenInfo Object Structure
Each token object contains:- chainId (number): Chain where the token exists
- address (string): Token contract address
- name (string): Token name
- symbol (string): Token symbol
- decimals (number): Token decimals
- supportsBridging (boolean, optional): Whether the token supports cross-chain bridging
- logoUri (string, optional): URL to token logo
- featured (boolean): Whether this is a featured/popular token
- featureIndex (number): Sort order for featured tokens
Examples
Find Destination Tokens for ETH on Ethereum
Filter by Destination Chain
Build Destination Token Selector
Check Route Availability
Swap All Flow
When to Use Exact Input
UseGetExactInputRoutes when:
- User wants to spend a specific amount
- “Swap all” or “Max” button functionality
- User specifies the source amount
- Portfolio liquidation flows
GetExactOutputRoutes when:
- User needs to receive a specific amount
- Payment flows with fixed prices
- Invoice payments
Next Steps
GetExactOutputRoutes
Find routes based on output amount
QuoteIntent
Get a quote with EXACT_INPUT trade type