How to list supported chains & tokens
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.
const getConfig = async () => {
const result = await axios.get(
'https://swap.prod.swing.xyz/v0/transfer/config'.
);
return {
chains: result.data.chains,
tokens: result.data.tokens
bridges: result.data.bridges
};
};
The result contains a list of chains that look like the following:
{
"name": "Ethereum",
"slug": "ethereum",
"chainId": 1,
"protocolType": "evm",
"isSingleChainSupported": false,
"nativeCurrency": "ETH",
"logo: https://raw.githubusercontent.com/sushiswap/list/master/logos/token-logos/token/eth.jpg",
"blockExploreUrls": [
"https://etherscan.io/"
],
"rpcUrls": [
"https://eth-mainnet.alchemyapi.io/v2/hrkUnlgn_VD_KbxEjpo7D2mVwTfAVUJW"
],
"tokens": [],
"allowSwapFromChains": [
"fantom",
"bsc",
"polygon",
"avalanche",
"arbitrum",
"optimism"
],
"allowSwapToChains": [
"fantom",
"bsc",
"polygon",
"avalanche",
"arbitrum",
"optimism"
]
}
The result contains a list of tokens that look like the following:
{
"symbol": "USDC",
"name": "USD Coin",
"logoURI": "https://raw.githubusercontent.com/sushiswap/list/master/logos/token-logos/token/usdc.jpg"
}
Next, let's learn how to get historical data for a wallet address. Navigate to the next section 👈