JavaScript SDK

The official package @navoswap/sdk ships a small, typed NavoSwapClient that wraps the public JSON API. It targets modern runtimes with fetch (Node 18+, browsers, edge).

Install

npm install @navoswap/sdk

Construction

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 /health
  • estimateUsd(currency_from, amount_from): GET /swap/usd
  • getSwapPrice(params): GET /swap/quote
  • createSwapOrder(body): POST /swap/create (adds API key header if configured)
  • getSwapStatus(order_id): GET /swap/status
  • listAssets(): Asset catalog for UI builders
  • getPublicAnalytics(): When exposed by the API

Errors throw NavoSwapApiError with HTTP status and parsed body when available.

Types

CreateSwapOrderInput, SwapQuote, SwapOrderInfo, and AssetInfo mirror the wire format documented under Swap REST endpoints.