Endpoint
| Field | Value |
|---|---|
| Method | GET |
| Path | /api/v1/pair-config |
| Base URL | https://swap.xoxno.com |
| Auth | None |
| Availability | Public |
| Rate limit | 100 requests per second per IP |
Required Params
| Param | Type | Description |
|---|---|---|
from | string | Input token identifier, for example WEGLD-bd4d79. |
to | string | Output token identifier, for example USDC-c76f1f. |
Request
- cURL
- TypeScript
- Python
- Rust
curl "https://swap.xoxno.com/api/v1/pair-config?\
from=WEGLD-bd4d79&\
to=USDC-c76f1f"
const params = new URLSearchParams({
from: "WEGLD-bd4d79",
to: "USDC-c76f1f",
});
const res = await fetch(`https://swap.xoxno.com/api/v1/pair-config?${params}`);
if (!res.ok) throw new Error(`pair-config failed: ${res.status}`);
const config = await res.json();
if (!config.supported) throw new Error(config.error);
console.log(config.decimalsIn, config.decimalsOut, config.minAmountIn);
import httpx
res = httpx.get(
"https://swap.xoxno.com/api/v1/pair-config",
params={"from": "WEGLD-bd4d79", "to": "USDC-c76f1f"},
timeout=10,
)
res.raise_for_status()
config = res.json()
if not config["supported"]:
raise ValueError(config["error"])
print(config["decimalsIn"], config["decimalsOut"], config["minAmountIn"])
use reqwest::Client;
use serde::Deserialize;
#[derive(Deserialize)]
struct PairConfig {
supported: bool,
error: Option<String>,
#[serde(rename = "decimalsIn")]
decimals_in: Option<u8>,
#[serde(rename = "decimalsOut")]
decimals_out: Option<u8>,
#[serde(rename = "minAmountIn")]
min_amount_in: Option<String>,
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config: PairConfig = Client::new()
.get("https://swap.xoxno.com/api/v1/pair-config")
.query(&[("from", "WEGLD-bd4d79"), ("to", "USDC-c76f1f")])
.send()
.await?
.error_for_status()?
.json()
.await?;
if !config.supported {
return Err(config.error.unwrap_or_else(|| "unsupported pair".into()).into());
}
println!(
"{} {} {}",
config.decimals_in.unwrap(),
config.decimals_out.unwrap(),
config.min_amount_in.unwrap()
);
Ok(())
}
Success Response
{
"from": "WEGLD-bd4d79",
"to": "USDC-c76f1f",
"supported": true,
"decimalsIn": 18,
"decimalsOut": 6,
"minAmountIn": "1000000000",
"minAmountInShort": 0.000000001
}
Unsupported Response
{
"from": "WEGLD-bd4d79",
"to": "UNKNOWN-123456",
"supported": false,
"error": "unknown tokenOut"
}
Fields
| Field | Type | Description |
|---|---|---|
from | string | Input token identifier. |
to | string | Output token identifier. |
supported | boolean | Whether the service can quote the pair. |
decimalsIn | number | Input token decimals. Present when supported=true. |
decimalsOut | number | Output token decimals. Present when supported=true. |
minAmountIn | string | Minimum input amount in smallest units. Present when supported=true. |
minAmountInShort | number | Human-readable minimum input. Present when supported=true. |
error | string | Unsupported reason. Present when supported=false. |
Errors
| Status | Cause | Fix |
|---|---|---|
400 | Missing or invalid token parameter. | Send both from and to. |
429 | Per-IP rate limit exceeded. | Back off and queue requests client-side. |
503 | Service is warming up or pool snapshot is unavailable. | Retry with backoff. |
Verify
Before calling/api/v1/quote:
supportedistrue.- User input is greater than or equal to
minAmountIn. - Amount conversion used
decimalsIn. - Display conversion for the expected output uses
decimalsOut.

