Skip to main content
The @krono/core SDK makes it easier to connect to the Kraken Websocket API and store / retrieve historical data for time traveling. You can find the @krono/core SDK source code on Github. To get started, install the required packages.
pnpm add @krono/core

Orderbook

The Orderbook class is the main entry point for real-time market data.
create-orderbook.ts
import { Orderbook } from '@krono/core'

export const orderbook = new Orderbook({
    symbol: "BTC/USD",
    limit: 25,
    depth: 500,
    debug: true
})
config
OrderbookConfigOptions
required
The configuration object to initialize the orderbook.View full Orderbook Configuration
type OrderbookConfigOptions = {
symbol: string;
limit?: number;
depth?: 10 | 25 | 100 | 500 | 1000;
// ... other partial options
}

AssetPairs

The AssetPairs class handles fetching available trading pairs and their metadata (like icons and display names).
create-assets.ts
import { AssetPairs } from '@krono/core'

export const assetPairs = new AssetPairs({
    topN: 50,
    autoFetch: true,
    debug: false
})
config
AssetPairsConfig
Configuration for the asset fetcher.View full AssetPairs Configuration
type AssetPairsConfig = {
topN?: number;
autoFetch?: boolean;
debug?: boolean;
}