@sodax/swaps-api
Minimal, type-safe HTTP client for the SODAX backend Swaps API v2 — the wire client that @sodax/sdk's sodax.api.swaps wraps.
Install
pnpm add @sodax/swaps-api valibotUsage
import { SwapsApi, SwapsApiError } from '@sodax/swaps-api';
const api = new SwapsApi({ baseUrl: 'https://<swaps-api-host>' });
const tokens = await api.getTokens();
const quote = await api.getQuote({
tokenSrc,
tokenSrcChainKey,
tokenDst,
tokenDstChainKey,
amount,
quoteType: 'exact_input',
});Errors
Last updated