How to request available chains, tokens and token pairs
The full API reference for our /config endpoint can be found in the API reference section.
We are continuously expanding our ecosystem by incorporating new blockchain networks and tokens to allow for a greater number of cross-chain token transfers and swaps.
To get a list of all chains and all tokens that are currently supported, the /config endpoint can be queried.
If you have a project-specific configuration applied through the Swing Platform, make sure to send you projectId with the request to get all supported chains and tokens for your project.
The result contains a list of chains that look like the following:
The result contains a list of tokens that look like the following:
This step is only important if you have project-specific rules applied through the Swing Platform. This would ensure your users can get routes and start transfers only for allowed token pairs based on your project’s configurations.
Set up your project in Swing Platform to configure your integration and access transaction data.
Given a projectId, directionPriority, chain and token you can get all available token pairs for this token..
This is useful for the user experience, and making sure that only allowed route options are presented to the user. For example: your configuration only allows users to swap ETH on Etherium to MATIC on Polygon and the other way arround. Given ETH on Etherium is selected as a sending token, what tokens can we recieve? If you query /config/token_pairs endpoint with parameter directionPriority: from, you will get MATIC on Polygon as the only possible pair.
To get a list of available token pairs for a specific sending token - query /config/tokenpairs endpoint with parameter _directionPriority: from.
To get a list of available token pairs for a specific receiving token - query /config/tokenpairs endpoint with parameter _directionPriority: to
The full API reference for our /config/token_pairs endpoint can be found in the API reference section.