Use this file to discover all available pages before exploring further.
The @kashdao/sdk package is a hand-written TypeScript client for the REST API. It’s the recommended way to integrate from any TS/JS runtime — Node 22+, modern browsers, Deno, Bun, or Cloudflare Workers.
Every list method returns a Page<T> that’s both the first page and an AsyncIterable<T>:
const page = await kash.trades.list({ limit: 25, status: 'completed' });// First page onlyconsole.log(page.data.length, page.pagination.hasMore);// Or walk every trade across every pagefor await (const trade of page) { console.log(trade.id, trade.txHash);}
A throwing hook never breaks the request — exceptions are swallowed and the call proceeds. Hooks are safe to add for telemetry without thinking about resilience.
withConfig returns a new client with overridden fields. Useful for tenant switching or per-request key swaps:
const tenantA = new KashClient({ apiKey: 'kash_live_AAAA...' });const tenantB = tenantA.withConfig({ apiKey: 'kash_live_BBBB...' });// tenantA and tenantB are independent — same baseUrl, different keys
withConfig re-validates — passing an invalid override throws KashConfigurationError.
The SDK follows SemVer. The KashError shape, public method signatures, and exported types are SemVer-stable. Internals (private fields, pagination tokens, transport details) are not — pin to a major version range in package.json.The SDK auto-includes a User-Agent header identifying its version, so we can correlate API logs with SDK versions when investigating issues.
Send the X-Kash-Api-Version request header to lock your integration against a specific contract date. The SDK can be configured to send it on every request:
const kash = new KashClient({ apiKey: process.env.KASH_API_KEY!, apiVersion: '2026-04-29', // optional; omits the header (server defaults) when not set});
Server response carries X-API-Version (the canonical version) plus Sunset / Deprecation headers when your pinned version is winding down (12-month deprecation window per RFC 8594). The SDK’s onResponse hook surfaces both — wire it into your monitoring to flag deprecations early. Pinning to an unknown date returns 410 API_VERSION_UNSUPPORTED with the supported list in metadata.supported.
The SDK ships with strict quality gates that are part of the public contract:
Bundle size budgets — main entry ≤ 24 KB gzipped, /testing subpath ≤ 8 KB. Enforced at publish time via size-limit.
Static type tests — pnpm test:types runs vitest’s typecheck mode against tests/types/public-types.test-d.ts. The public TypeScript surface is locked: any change to a public type’s shape fails compilation, forcing a deliberate CHANGELOG + version bump.
Public-barrel snapshot — tests/unit/barrel-snapshot.test.ts pins the exact set of exported names. Accidental removals fail the build.
Wire-shape contract — tests/contract/wire-shape.test.ts asserts every resource schema matches canonical fixtures. Ships to the public mirror.