🇺🇲
Protocolink
  • 🔮Overview
  • 🌟Why Protocolink?
  • 💡Use Cases
    • Flash Loans
    • Permit2 Amplifier
    • Zap-in & Zap-out
    • Position Management
    • Multi-Action Bundling
  • 📋Networks & Protocols
  • 🛡️Security & Audits
  • 💎Fees
  • ❓FAQ
  • Protocolink API
    • 🔮Overview
      • Swap & Supply (Example)
    • 📗Swagger
      • Request Protocols
      • Request Tokens
      • Request Quote
      • Estimate Logics Result
      • Request Transaction Data
  • Protocolink SDK
    • 🔮Overview
    • 1️⃣Install SDK
    • 2️⃣Build Logics
    • 3️⃣Estimate Router Data
    • 4️⃣Send Router Transaction
    • ⚒️API SDK Interfaces
      • Global Types
      • FlashLoan Logic
      • Aave V2
      • Aave V3
      • Balancer V2
      • Compound V3
      • Iolend
      • Magicsea
      • Morphoblue
      • OpenOcean V2
      • ParaSwap V5
      • Permit2
      • Spark
      • Stargate
      • Stargate V2
      • SyncSwap
      • Uniswap V3
      • Utility
      • Wagmi
      • ZeroEx V4
    • ⚒️Common SDK Interfaces
      • Constants
      • Network
      • Token
      • Web3Toolkit
      • Utility Functions
  • Lending SDK
    • 🔮Overview
    • ✳️SDK
      • Open By Collateral
      • Open By Debt
      • Close
      • Leverage By Collateral
      • Leverage By Debt
      • Deleverage
      • Collateral swap
      • Debt swap
      • Zap supply
      • Zap withdraw
      • Zap repay
      • Zap borrow
  • Smart Contract
    • 🔮Overview
      • Router
      • Agent
      • Callback
      • Fees
      • Utility
      • Data Type
      • ERC721/ERC1155 Support
    • 📑Deployment Addresses
    • 🧑‍💻Security Review Details
  • COMPOUND KIT
    • 🔮Overview
    • ✳️SDK
      • Leverage
      • Deleverage
      • Collateral Swap
      • Zap Supply
      • Zap Withdraw
      • Zap Repay
      • Zap Borrow
    • 📗API
  • Video Tutorials
    • 1. Introducing Protocolink
    • 2. Lending SDK
    • 3. Protocolink Q&A
  • Social medias
    • Twitter
  • Support
Powered by GitBook
On this page
  1. Protocolink API
  2. Swagger

Request Tokens

PreviousRequest ProtocolsNextRequest Quote

Last updated 1 year ago

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
📗

List available tokens for protocol logic

get
Path parameters
chainIdintegerRequired

Example: 42161

Example: 42161
protocolIdstringRequired

Example: uniswap-v3

Example: uniswap-v3
logicIdstringRequired

Example: swap-token

Example: 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"
    }
  ]
}