1inch_v6_0_classic_swap_liquidity_sources

The 1inch_v6_0_classic_swap_liquidity_sources method returns liquidity sources for classic swaps from 1inch API version 6.0.

Refer to the 1inch Classic Swap documentation for more information.

Arguments

StructureTypeDescription
chain_idnumericChain id

Response

StructureTypeDescription
dst_amountrational numberDestination token amount, in coins units.
protocolslistOptional. A list of standard 1inchProtocolImage objects.

📌 Examples

Command

POST 1inch_v6_0_classic_swap_liquidity_sources
{
  "mmrpc": "2.0",
  "userpass": "RPC_UserP@SSW0RD",
  "method": "1inch_v6_0_classic_swap_liquidity_sources",
  "params": {
    "chain_id": 1
  }
}
Show Response

Response

{
"mmrpc": "2.0",
"result": {
  "protocols": [
    {
      "id": "UNISWAP_V1",
      "title": "Uniswap V1",
      "img": "https://cdn.1inch.io/liquidity-sources-logo/uniswap.png",
      "img_color": "https://cdn.1inch.io/liquidity-sources-logo/uniswap_color.png"
    },
    {
      "id": "UNISWAP_V2",
      "title": "Uniswap V2",
      "img": "https://cdn.1inch.io/liquidity-sources-logo/uniswap.png",
      "img_color": "https://cdn.1inch.io/liquidity-sources-logo/uniswap_color.png"
    },
    {
      "id": "SUSHI",
      "title": "SushiSwap",
      "img": "https://cdn.1inch.io/liquidity-sources-logo/sushiswap.png",
      "img_color": "https://cdn.1inch.io/liquidity-sources-logo/sushiswap_color.png"
    }
  ]
}
}
Show Error Responses

Error: Configuration missing

The 1inch_api url not set in your MM2.json file.

{
    "mmrpc": "2.0",
    "error": "No API config param",
    "error_path": "rpcs.client",
    "error_trace": "rpcs:137] client:105]",
    "error_type": "InvalidParam",
    "error_data": "No API config param",
    "id": null
}

Error: Authentication failure

ONE_INCH_API_TEST_AUTH environment variable not set, or incorrect.

{
    "mmrpc": "2.0",
    "error": "1inch API error: General API error: Unauthorized description: ",
    "error_path": "rpcs.client",
    "error_trace": "rpcs:140] client:152]",
    "error_type": "OneInchError",
    "error_data": {
        "GeneralApiError": {
            "error_msg": "Unauthorized",
            "description": "",
            "status_code": 401
        }
    },
    "id": null
}