# Check whether Olympex supports Polygon (chain ID 137).
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
METHOD=POST
ENDPOINT=/support-chain
QUERY=''
BODY='{"chainId":137}'
TS="${OLYMPEX_TIMESTAMP:-$(date +%s)}"
NONCE="${OLYMPEX_NONCE:-$(openssl rand -hex 12)}"
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 -binary | openssl base64 -A | tr '+/' '-_' | tr -d '=')"
VALUE_INFO="$(printf '%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")"
MESSAGE="$(printf 'OLPX-HMAC-SHA256-V2\n%s\n%s\n%s\n%s\n%s\n%s' "$TS" "$NONCE" "$METHOD" "/api/v1$ENDPOINT" "$QUERY" "$BODY_HASH")"
curl -sS -X "$METHOD" "https://api-rest.olympex.io/api/v1$ENDPOINT${QUERY:+?$QUERY}" \
-H "content-type: application/json" \
-H "x-api-key-id: $OLYMPEX_API_KEY_ID" \
-H "x-value-info: $(printf '%s' "$VALUE_INFO" | openssl base64 -A)" \
-H "x-passphrase: $OLYMPEX_PASSPHRASE" \
-H "x-signature: $(printf '%s' "$MESSAGE" | openssl dgst -sha256 -hmac "$OLYMPEX_SECRET_KEY" -binary | od -An -v -tx1 | tr -d ' \n')" \
--data-raw "$BODY"
import { olympexRequest } from "./sign-request.ts"; // /authentication/sign-requests
const supported = await olympexRequest<boolean>("POST", "/support-chain", { chainId: 137 });
console.log(supported ? "Polygon is supported" : "Polygon is not supported");
from sign_request import olympex_request # /authentication/sign-requests
supported = olympex_request("POST", "/support-chain", {"chainId": 137})
print("Polygon is supported" if supported else "Polygon is not supported")
{
"success": true,
"data": true,
"meta": {
"requestId": "ENUlxjCsIAMEMUA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": false,
"meta": {
"requestId": "ENUmEhC2oAMEMtQ=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"field": "chainId",
"message": "Invalid input: expected number, received string"
}
]
},
"meta": {
"requestId": "E7ee3hLMoAMEZxg=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
Check chain support
Check whether Olympex supports a chain, for example when you enable it in your product.
# Check whether Olympex supports Polygon (chain ID 137).
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
METHOD=POST
ENDPOINT=/support-chain
QUERY=''
BODY='{"chainId":137}'
TS="${OLYMPEX_TIMESTAMP:-$(date +%s)}"
NONCE="${OLYMPEX_NONCE:-$(openssl rand -hex 12)}"
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 -binary | openssl base64 -A | tr '+/' '-_' | tr -d '=')"
VALUE_INFO="$(printf '%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")"
MESSAGE="$(printf 'OLPX-HMAC-SHA256-V2\n%s\n%s\n%s\n%s\n%s\n%s' "$TS" "$NONCE" "$METHOD" "/api/v1$ENDPOINT" "$QUERY" "$BODY_HASH")"
curl -sS -X "$METHOD" "https://api-rest.olympex.io/api/v1$ENDPOINT${QUERY:+?$QUERY}" \
-H "content-type: application/json" \
-H "x-api-key-id: $OLYMPEX_API_KEY_ID" \
-H "x-value-info: $(printf '%s' "$VALUE_INFO" | openssl base64 -A)" \
-H "x-passphrase: $OLYMPEX_PASSPHRASE" \
-H "x-signature: $(printf '%s' "$MESSAGE" | openssl dgst -sha256 -hmac "$OLYMPEX_SECRET_KEY" -binary | od -An -v -tx1 | tr -d ' \n')" \
--data-raw "$BODY"
import { olympexRequest } from "./sign-request.ts"; // /authentication/sign-requests
const supported = await olympexRequest<boolean>("POST", "/support-chain", { chainId: 137 });
console.log(supported ? "Polygon is supported" : "Polygon is not supported");
from sign_request import olympex_request # /authentication/sign-requests
supported = olympex_request("POST", "/support-chain", {"chainId": 137})
print("Polygon is supported" if supported else "Polygon is not supported")
{
"success": true,
"data": true,
"meta": {
"requestId": "ENUlxjCsIAMEMUA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": false,
"meta": {
"requestId": "ENUmEhC2oAMEMtQ=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"field": "chainId",
"message": "Invalid input: expected number, received string"
}
]
},
"meta": {
"requestId": "E7ee3hLMoAMEZxg=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
POST /support-chain returns data: true when Olympex supports a chain and data: false when it doesn’t. Use it to check one chain ID at runtime, for example a chain ID from your own configuration. To get every enabled chain at once, call GET /chains: both endpoints read the same list. Cache the result instead of calling it before every quote.
Send the chain ID as an integer
chainId is a JSON integer (137), as on every endpoint. A string such as "137" fails validation with 400 VALIDATION_ERROR and the detail "Invalid input: expected number, received string". Pass the IDs from GET /chains unchanged: they’re integers too.
Conventions lists every chain ID field.
200 with data: false, not an error. Only an invalid body returns 400: invalid JSON, or a chainId that is missing or isn’t a positive integer. Other body fields are ignored.Supported chains
| Chain | Chain ID | Single-chain swaps | Cross-chain source | Limit orders and DCA |
|---|---|---|---|---|
1 | Yes | Yes | Yes | |
10 | Yes | Yes | Yes | |
56 | Yes | Yes | Yes | |
137 | Yes | Yes | Yes | |
146 | Yes | No | Yes | |
4663 | Yes | No | Yes | |
5042 | Yes | No | Yes | |
8453 | Yes | No | Yes | |
42161 | Yes | Yes | Yes | |
43114 | Yes | Yes | Yes | |
59144 | Yes | No | Yes |
GET /chains returns chain IDs only, without names, logos or capabilities. If your product needs them, keep this table’s names and columns in your code, and use GET /chains to decide which of these chains to offer: offer a chain only while its ID is in the response. POST /support-chain checks one chain ID against the same list.
GET /tokens lists the tokens on each chain. Supported chains covers token addresses, amounts and decimals.
# Check whether Olympex supports Polygon (chain ID 137).
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
METHOD=POST
ENDPOINT=/support-chain
QUERY=''
BODY='{"chainId":137}'
TS="${OLYMPEX_TIMESTAMP:-$(date +%s)}"
NONCE="${OLYMPEX_NONCE:-$(openssl rand -hex 12)}"
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 -binary | openssl base64 -A | tr '+/' '-_' | tr -d '=')"
VALUE_INFO="$(printf '%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")"
MESSAGE="$(printf 'OLPX-HMAC-SHA256-V2\n%s\n%s\n%s\n%s\n%s\n%s' "$TS" "$NONCE" "$METHOD" "/api/v1$ENDPOINT" "$QUERY" "$BODY_HASH")"
curl -sS -X "$METHOD" "https://api-rest.olympex.io/api/v1$ENDPOINT${QUERY:+?$QUERY}" \
-H "content-type: application/json" \
-H "x-api-key-id: $OLYMPEX_API_KEY_ID" \
-H "x-value-info: $(printf '%s' "$VALUE_INFO" | openssl base64 -A)" \
-H "x-passphrase: $OLYMPEX_PASSPHRASE" \
-H "x-signature: $(printf '%s' "$MESSAGE" | openssl dgst -sha256 -hmac "$OLYMPEX_SECRET_KEY" -binary | od -An -v -tx1 | tr -d ' \n')" \
--data-raw "$BODY"
import { olympexRequest } from "./sign-request.ts"; // /authentication/sign-requests
const supported = await olympexRequest<boolean>("POST", "/support-chain", { chainId: 137 });
console.log(supported ? "Polygon is supported" : "Polygon is not supported");
from sign_request import olympex_request # /authentication/sign-requests
supported = olympex_request("POST", "/support-chain", {"chainId": 137})
print("Polygon is supported" if supported else "Polygon is not supported")
{
"success": true,
"data": true,
"meta": {
"requestId": "ENUlxjCsIAMEMUA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": false,
"meta": {
"requestId": "ENUmEhC2oAMEMtQ=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"field": "chainId",
"message": "Invalid input: expected number, received string"
}
]
},
"meta": {
"requestId": "E7ee3hLMoAMEZxg=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
Authorizations
Your API key ID (UUID). See Sign requests.
Lowercase hex HMAC-SHA256 (signature v2), keyed with your secret key string (UTF-8, not decoded), of seven lines joined with \n, with no trailing newline: OLPX-HMAC-SHA256-V2, timestamp, nonce, the uppercase method, path, canonicalQuery and bodyHash. path is the request path including /api/v1, without the query string, for example /api/v1/limit-order/<id>. canonicalQuery is the query parameters decoded (+ is a space), sorted by key and then by value, re-encoded per RFC 3986 and joined with &, or the empty string when there is no query. Headers signed for one request are rejected on any other. See Sign requests.
Body
Was this page helpful?



