Skip to main content

Overview

Composable API provides deployed or published data Mosaic uses under the hood. The API is intented for developers to have a faster access to all the assets, layers and their properties, eliminating the need of searching for them manually.

Retrieve the list of supported tokens#

HTTP request#

Try this in your browser

The following request retrieves all the supported tokens, as well as the supported chains for each of them

Request

GET
https://sdk-api.composable.finance/v1/tokens/supported

Response

PropertyDescription
crossChainIdunique identifier for each token across the supported chains
chainIdchain unique identifier
addresstoken's address (lowercase)
decimalstoken's decimals
symboldisplay name
application/json
[  {    "crossChainId": "usdc",    "chainId": 1,    "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",    "decimals": 6,    "symbol": "USDC"  },  {    "crossChainId": "usdc",    "chainId": 137,    "address": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",    "decimals": 6,    "symbol": "USDC"  },...]

Usage#

import axios from "axios";import { Token } from "@composable-finance/v1-sdk-typescript";
async function getSupportedTokens() {  const response = await axios.get("https://sdk-api.composable.finance/v1/tokens/supported");  const result = response.data as {    crossChainId: string;    chainId: number;    address: string;    decimals: number;    symbol: string;  }[];
  return result.map(    (t) => new Token(t.chainId, t.address, t.decimals, t.symbol, t.symbol)  );}