Skip to main content
GET
/
v1
/
connections
Get token pair connections
curl --request GET \
  --url https://api.hypermid.io/v1/connections \
  --header 'X-API-Key: <api-key>'
{
  "data": {
    "connections": [
      {
        "fromChainId": 1,
        "toChainId": 42161,
        "fromTokens": [
          {
            "address": "0x0000000000000000000000000000000000000000",
            "symbol": "ETH"
          },
          {
            "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "symbol": "USDC"
          }
        ],
        "toTokens": [
          {
            "address": "0x0000000000000000000000000000000000000000",
            "symbol": "ETH"
          },
          {
            "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            "symbol": "USDC"
          }
        ],
        "tools": ["stargate", "hop", "across"]
      }
    ]
  },
  "error": null,
  "meta": {
    "requestId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "timestamp": 1711234569,
    "rateLimit": {
      "limit": 2000,
      "remaining": 1997,
      "reset": 1711234627
    }
  }
}
Returns the available connections between chains, showing which chain pairs support direct swaps and which tools are available for each connection.
fromChain
number
Filter connections by source chain ID.
toChain
number
Filter connections by destination chain ID.
fromToken
string
Filter by source token address.
toToken
string
Filter by destination token address.
{
  "data": {
    "connections": [
      {
        "fromChainId": 1,
        "toChainId": 42161,
        "fromTokens": [
          {
            "address": "0x0000000000000000000000000000000000000000",
            "symbol": "ETH"
          },
          {
            "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "symbol": "USDC"
          }
        ],
        "toTokens": [
          {
            "address": "0x0000000000000000000000000000000000000000",
            "symbol": "ETH"
          },
          {
            "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            "symbol": "USDC"
          }
        ],
        "tools": ["stargate", "hop", "across"]
      }
    ]
  },
  "error": null,
  "meta": {
    "requestId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "timestamp": 1711234569,
    "rateLimit": {
      "limit": 2000,
      "remaining": 1997,
      "reset": 1711234627
    }
  }
}
const connections = await client.getConnections({
  fromChain: 1,
  toChain: 42161,
});

for (const conn of connections.data.connections) {
  console.log(`${conn.fromChainId} -> ${conn.toChainId}: ${conn.tools.join(", ")}`);
}

Authorizations

X-API-Key
string
header
required

Partner API key. Optional for public endpoints, required for /v1/partner/*.

Query Parameters

fromChain
integer

Source chain ID

fromToken
string

Source token address

toChain
integer

Destination chain ID

toToken
string

Destination token address

Response

Connection data

data
any
required

Response payload (null on error)

error
object
required
meta
object
required