The complete API documentation for our /tokens endpoint can be found here.
This endpoint gives a comprehensive list of all tokens that the LI.FI services are aware.
It is possible to filter them by chain to get a more concise and targeted result.
constgetTokens=async () => {constoptionalFilter= ['ETH',137] // Both numeric and mnemonic can be used/// chainTypes can be of type SVM and EVM. By default, only EVM tokens will be returnedconstoptionalChainTypes="EVM"constresult=awaitaxios.get('https://li.quest/v1/tokens', {params: { chains:optionalFilter.join(','), chainTypes: optionalChainType }});returnresult.data;}
The response is an object with a tokens property. In turn this is an object with keys being ChainId and values being Token objects. The sample response for the sample request above is: