TypeScript SDK
The official TypeScript SDK for the Burn & Claim API. It handles authentication, request serialization, and provides typed responses for every endpoint.
Installation
npm install @burnandclaim/sdkpnpm add @burnandclaim/sdkyarn add @burnandclaim/sdkRequirements
- Node.js 18+ or any modern browser
- TypeScript 5.0+ (recommended, not required)
Quick setup
Server-side (API key)
import { BurnerClient } from '@burnandclaim/sdk'
const client = new BurnerClient({
apiKey: process.env.BURNER_API_KEY,
})Client-side (session token)
import { BurnerClient } from '@burnandclaim/sdk'
const client = new BurnerClient({
sessionToken: tokenFromBackend,
})Configuration options
The BurnerClientOptions interface accepts:
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | — | Long-lived API key. Server-side only. Sent as X-Api-Key header. |
sessionToken | string | — | Short-lived session token. Sent as Authorization: Bearer header. |
baseUrl | string | https://api.aerosol.com | Override the API base URL (useful for testing). |
ky | KyOptions | — | Pass-through options to the underlying ky HTTP client (timeout, hooks, retry, etc). |
If both apiKey and sessionToken are provided, the SDK uses the session token and ignores the API key.
Exports
The SDK exports all public API types you need:
import {
BurnerClient,
SessionScope,
BurnerAction,
SESSION_SCOPES_DEFAULT,
} from '@burnandclaim/sdk'
import type {
BurnerClientOptions,
LeaderboardFilter,
WalletAssets,
WalletItem,
WalletItemType,
BuildTransactionsRequest,
BuildTransactionsResponse,
BuiltTransaction,
ItemSelection,
SignedTransaction,
SubmitTransactionsRequest,
SubmitTransactionsResponse,
SubmissionResult,
CreateSessionRequest,
CreateSessionResponse,
ProjectBurnerStats,
BurnerLeaderboardEntry,
WalletAssetsChunk,
StreamWalletAssetsRequest,
} from '@burnandclaim/sdk'SDK pages
- BurnerClient Reference — Every method with signatures, parameters, and examples
- Sessions — Creating and managing session tokens
- Errors — Error response shapes and handling
- Streaming — Real-time wallet asset streaming via WebSocket
Last updated on