Request Tokens
Path parameters
chainIdintegerRequiredExample:
Example: 42161
42161
protocolIdstringRequiredExample:
Example: uniswap-v3
uniswap-v3
logicIdstringRequiredExample:
Example: swap-token
swap-token
Responses
200
OK
application/json
get
GET /v1/protocols/{chainId}/{protocolId}/{logicId}/tokens HTTP/1.1
Host: api.protocolink.com
Accept: */*
200
OK
{
"tokens": [
{
"chainId": 42161,
"address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"decimals": 6,
"symbol": "USDC",
"name": "USDCoin"
}
]
}
Provides a list of tokens supported by a Logic, depending on the chain and protocol. See Networks & Protocols.
const client = axios.create({ baseURL: 'https://api.protocolink.com' });
const getTokens = async (chainId, protocol, logicId) => {
const result = await client.get(`/v1/protocols/${chainId}/${protocol}/${logicId}/tokens`);
return result.data;
}
const chainId = 1;
const protocol = "uniswap-v3";
const logicId = "swap-token";
const tokens = await getTokens(chainId, protocol, logicId);
The result contains a list of chains that looks the following:
{
"tokens":[
{
"chainId":1,
"address":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"decimals":6,
"symbol":"USDC",
"name":"USD Coin"
},
... // other tokens will be present in the list
]
}
Presented according to different protocols or the token has been paired:
:{
"tokens":[
[
{
"chainId":1,
"address":"0x0000000000000000000000000000000000000000",
"decimals":18,
"symbol":"ETH",
"name":"Ethereum"
},
{
"chainId":1,
"address":"0x4d5F47FA6A74757f35C14fD3a6Ef8E3C9BC514E8",
"decimals":18,
"symbol":"aEthWETH",
"name":"Aave Ethereum WETH"
}
],
... // other token pair will be present in the list
]
}j
Last updated