JavaScript SDK
We publish @navoswap/sdk with a typed NavoSwapClient around the public API. It uses fetch—Node 18+, browsers, edge workers, whatever already has fetch.
Install
npm install @navoswap/sdkConstruction
import { NavoSwapClient } from "@navoswap/sdk";
const client = new NavoSwapClient({
baseUrl: "https://api.navoswap.com/api/v1",
apiKey: process.env.NAVOSWAP_PARTNER_API_KEY, // optional; only sent on createSwapOrder
});Methods (high level)
getHealth():GET /healthestimateUsd(currency_from, amount_from):GET /swap/usdgetSwapPrice(params):GET /swap/quotecreateSwapOrder(body):POST /swap/create(adds API key header if configured)getSwapStatus(order_id):GET /swap/statuslistAssets(network?):GET /assets(optionalnetworkquery)getPublicAnalytics(days?):GET /analytics/public(optionaldays)
Failed calls raise NavoSwapApiError with status + parsed JSON when we have it.
Types
CreateSwapOrderInput, SwapQuote, SwapOrderInfo, AssetInfo line up with Swap REST.