curl --request GET \
--url https://api.example.com/api/conversion/pairs{
"[TOKEN_SYMBOL]": [
{
"sourceId": "<string>",
"destId": "<string>",
"feePercent": "<string>",
"pair": {
"groupId": "<string>",
"baseId": "<string>",
"quoteId": "<string>"
},
"pairSide": "<string>"
}
]
}Retrieve all supported token conversion pairs and their configurations
curl --request GET \
--url https://api.example.com/api/conversion/pairs{
"[TOKEN_SYMBOL]": [
{
"sourceId": "<string>",
"destId": "<string>",
"feePercent": "<string>",
"pair": {
"groupId": "<string>",
"baseId": "<string>",
"quoteId": "<string>"
},
"pairSide": "<string>"
}
]
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Crocantefinancial/crocante-pitch-frontend/llms.txt
Use this file to discover all available pages before exploring further.
GET /api/conversion/pairs
0 to disable automatic refresh.interface ConversionPairsDataItem {
sourceId: string;
destId: string;
feePercent: string;
pair: {
groupId: string;
baseId: string;
quoteId: string;
};
pairSide: "SELL" | "BUY";
}
type SupportedToken =
| "AAVE" | "ADA" | "AVAX" | "BTC" | "ETH" | "SOL" | "XRP"
| "DOGE" | "DOT" | "LINK" | "LTC" | "MANA" | "MATIC" | "SUI"
| "USDC" | "USDT" | "XLM" | "ZIL" | "CHZ" | "DAI" | "UNI"
| "SAND" | "POL" | "S" | "TRX";
type ConversionPairsData = Record<SupportedToken, ConversionPairsDataItem[]>;
curl -X GET https://api.crocante.io/api/conversion/pairs \
-H "Authorization: Bearer YOUR_API_TOKEN"
{
"data": {
"BTC": [
{
"sourceId": "BTC",
"destId": "ETH",
"feePercent": "0.2",
"pair": {
"groupId": "main",
"baseId": "BTC",
"quoteId": "ETH"
},
"pairSide": "SELL"
},
{
"sourceId": "BTC",
"destId": "USDT",
"feePercent": "0.15",
"pair": {
"groupId": "main",
"baseId": "BTC",
"quoteId": "USDT"
},
"pairSide": "SELL"
},
{
"sourceId": "BTC",
"destId": "USDC",
"feePercent": "0.15",
"pair": {
"groupId": "main",
"baseId": "BTC",
"quoteId": "USDC"
},
"pairSide": "SELL"
}
],
"ETH": [
{
"sourceId": "ETH",
"destId": "BTC",
"feePercent": "0.2",
"pair": {
"groupId": "main",
"baseId": "BTC",
"quoteId": "ETH"
},
"pairSide": "BUY"
},
{
"sourceId": "ETH",
"destId": "USDT",
"feePercent": "0.15",
"pair": {
"groupId": "main",
"baseId": "ETH",
"quoteId": "USDT"
},
"pairSide": "SELL"
},
{
"sourceId": "ETH",
"destId": "USDC",
"feePercent": "0.15",
"pair": {
"groupId": "main",
"baseId": "ETH",
"quoteId": "USDC"
},
"pairSide": "SELL"
}
],
"USDT": [
{
"sourceId": "USDT",
"destId": "BTC",
"feePercent": "0.15",
"pair": {
"groupId": "main",
"baseId": "BTC",
"quoteId": "USDT"
},
"pairSide": "BUY"
},
{
"sourceId": "USDT",
"destId": "ETH",
"feePercent": "0.15",
"pair": {
"groupId": "main",
"baseId": "ETH",
"quoteId": "USDT"
},
"pairSide": "BUY"
},
{
"sourceId": "USDT",
"destId": "SOL",
"feePercent": "0.2",
"pair": {
"groupId": "main",
"baseId": "SOL",
"quoteId": "USDT"
},
"pairSide": "BUY"
}
],
"SOL": [
{
"sourceId": "SOL",
"destId": "USDT",
"feePercent": "0.2",
"pair": {
"groupId": "main",
"baseId": "SOL",
"quoteId": "USDT"
},
"pairSide": "SELL"
},
{
"sourceId": "SOL",
"destId": "USDC",
"feePercent": "0.2",
"pair": {
"groupId": "main",
"baseId": "SOL",
"quoteId": "USDC"
},
"pairSide": "SELL"
}
]
},
"status": 200
}
pairSide field indicates how the conversion is executed:
{
"sourceId": "BTC",
"destId": "ETH",
"pair": {
"baseId": "BTC",
"quoteId": "ETH"
},
"pairSide": "SELL"
}
{
"sourceId": "ETH",
"destId": "BTC",
"pair": {
"baseId": "BTC",
"quoteId": "ETH"
},
"pairSide": "BUY"
}
pollIntervalMs > 0// Refresh pairs every minute
const pairs = useConversionPairs(userId, 60000);
// Disable automatic refresh
const pairs = useConversionPairs(userId, 0);
const pairs = await fetchConversionPairs();
const btcPairs = pairs.data.BTC;
const canConvertToETH = btcPairs.some(pair => pair.destId === "ETH");
if (canConvertToETH) {
console.log("BTC to ETH conversion is supported");
}
const pairs = await fetchConversionPairs();
const ethPairs = pairs.data.ETH;
// Find cheapest way to convert ETH to stablecoins
const stablecoinPairs = ethPairs.filter(pair =>
["USDT", "USDC", "DAI"].includes(pair.destId)
);
const cheapest = stablecoinPairs.reduce((min, pair) =>
parseFloat(pair.feePercent) < parseFloat(min.feePercent) ? pair : min
);
console.log(`Cheapest path: ETH → ${cheapest.destId} (${cheapest.feePercent}% fee)`);
const pairs = await fetchConversionPairs();
// Get all tokens user can convert TO from BTC
const fromBTC = pairs.data.BTC.map(pair => ({
symbol: pair.destId,
fee: pair.feePercent
}));
// Render dropdown of available destination tokens
renderTokenDropdown(fromBTC);
function canConvert(from: string, to: string, pairsData: ConversionPairsData): boolean {
if (!pairsData[from]) {
return false; // Source token not supported
}
return pairsData[from].some(pair => pair.destId === to);
}
if (!canConvert("DOGE", "BTC", pairs.data)) {
throw new Error("Conversion pair not supported");
}
userId is missing