Kraken JavaScript SDK
Use @siebly/kraken-api to read Kraken market data, manage orders, and consume streams from Node.js. JavaScript and TypeScript use the same clients; request and response types are included.
Choose a client
- SpotClient
- Spot REST
- DerivativesClient
- Futures REST
- WebsocketClient
- Public and private streams
- WebsocketAPIClient
- Spot API commands
Make a first public request
In a Node.js project, install the package once. The REST and WebSocket API examples below use .mjs files so Node.js can run their imports directly.
npm install @siebly/kraken-api
REST walkthrough
Read public XBTUSD Spot data with SpotClient. These public requests require no credentials.
Save the code as rest-public.mjs and run:
node rest-public.mjs
import { SpotClient } from '@siebly/kraken-api'; const client = new SpotClient(); async function main() { const serverTime = await client.getServerTime(); const systemStatus = await client.getSystemStatus(); const ticker = await client.getTicker({ pair: 'XBTUSD' }); const orderBook = await client.getOrderBook({ pair: 'XBTUSD', count: 10 }); console.log({ serverTime, systemStatus, ticker, orderBook, });} // Since each of the above API calls is wrapped in an awaited promise, a high level catch will detect any exceptions:main().catch(console.error);Expected response
Market values change on each run. These are the fields to check in the logged output.
| Field | Expected result |
|---|---|
| error / result | Each logged response retains the Kraken envelope. An empty error array indicates success; data is under result. |
| serverTime | result.unixtime is Unix seconds; result.rfc1123 is a readable time string. |
| ticker / orderBook | Result objects keyed by the returned pair name, such as XXBTZUSD. Book levels contain price, quantity, and timestamp. |
WebSocket walkthrough
Connecting to Kraken Derivatives private WebSocket streams is straightforward with the WebsocketClient.
- Install the Kraken JavaScript SDK via NPM:
npm install @siebly/kraken-api. - Import the
WebsocketClient,WS_KEY_MAP, and any typed topic helpers you want to use. - Create an authenticated client instance with your Kraken futures API credentials.
- Configure event handlers for key lifecycle events such as
open,message,response,reconnecting,reconnected,close,exception, andauthenticated. - Subscribe to private topics on the
derivativesPrivateV1connection key for private derivatives topics.- Spot is also available via the dedicated spot connection key.
In this example, we:
- Subscribe to private derivatives topics including
open_orders,open_orders_verbose,fills,balances,open_positions,account_log, andnotifications_auth. - Show both typed topic request objects and simple topic-name subscriptions.
- Rely on the SDK to automatically fetch, cache, and sign the challenge parameters required for private derivatives subscriptions.
- Authentication is completely automatic with the provided API keys.
- If the connection drops or goes stale, the highly resilient WebsocketClient for Kraken will quickly detect any issues, respawn a replacement connection and resubscribe to the topics you were consuming before the drop.
This setup lets you monitor derivatives account activity in real time without polling the REST API for the same information.
// eslint-disable-next-line @typescript-eslint/no-unused-varsimport { DefaultLogger, LogParams, WebsocketClient, WS_KEY_MAP, WSTopicRequest,} from '@siebly/kraken-api';import { WSDerivativesTopic } from '@siebly/kraken-api'; const customLogger: DefaultLogger = { // eslint-disable-next-line @typescript-eslint/no-unused-vars trace: (...params: LogParams): void => { // console.log(new Date(), '--> trace', ...params); }, info: (...params: LogParams): void => { console.log(new Date(), '--> info', ...params); }, error: (...params: LogParams): void => { console.error(new Date(), '--> error', ...params); },}; async function start() { const account = { key: process.env.API_FUTURES_KEY || 'keyHere', secret: process.env.API_FUTURES_SECRET || 'secretHere', }; /** * The WebsocketClient is the core class to manage WebSocket subscriptions. Give it the topics you want to subscribe to, and it will handle the rest: * - Connection management (connect, disconnect, reconnect) * - Authentication for private topics * - Subscription management (subscribe, unsubscribe, resubscribe on reconnect) * - Message handling (dispatch messages to appropriate handlers) * * All you need to do is provide the topics you want to subscribe to when calling `subscribe()`, and the client will take care of the rest. * * Here we create a WebsocketClient instance with API key/secret for private topic subscriptions. * * In terms of product groups such as Spot, Derivatives, etc., the WebsocketClient understand the product group from the WsKey you provide when subscribing. For example, using `WS_KEY_MAP.spotPrivateV2` indicates that the subscription is for Spot private topics, as shown below. * * Refer to WS_KEY_MAP in the source code for all available WsKey options. */ const client = new WebsocketClient( { apiKey: account.key, apiSecret: account.secret, }, customLogger, ); client.on('open', (data) => { console.log(new Date(), 'connected ', data?.wsKey); }); // Data received client.on('message', (data) => { console.info(new Date(), 'data received: ', JSON.stringify(data)); }); // Something happened, attempting to reconnect client.on('reconnecting', (data) => { console.log(new Date(), 'reconnect: ', data?.wsKey); }); // Reconnect successful client.on('reconnected', (data) => { console.log(new Date(), 'reconnected: ', data?.wsKey); }); // Connection closed. If unexpected, expect reconnect -> reconnected. client.on('close', (data) => { console.error(new Date(), 'close: ', data); }); // Reply to a request, e.g. "subscribe"/"unsubscribe"/"authenticate" client.on('response', (data) => { console.info(new Date(), 'server reply: ', JSON.stringify(data), '\n'); }); client.on('exception', (data) => { console.error(new Date(), 'exception: ', data); }); client.on('authenticated', (data) => { console.error(new Date(), 'authenticated: ', data); }); /** * The below examples demonstrate how you can subscribe to private topics. * * Note: while the documentation specifies "api_key", "original_challenge" and "signed_challenge" as required parameters, but don't worry about that. The SDK will automatically: * - Fetch the challenge using your API key, * - Cache the challenge * - Include the key, original challenge and signed challenge parameters for you when subscribing to private topics on the derivativesPrivateV1 WebSocket connection. * * You do NOT need to manually fetch or provide the "original_challenge" and "signed_challenge" tokens when subscribing to private topics. * * Do note that all of these include the "derivativesPrivateV1" WsKey reference. This tells the WebsocketClient to use the private "wss://futures.kraken.com/ws/v1" endpoint for these private subscription requests. It will also automatically authenticate the connection when it is established. */ try { /** * All of the following parameters require API keys for Derivatives APIs. * * Note: your "WsTopicRequest" does not need to include "api_key", "original_challenge" and "signed_challenge". See above for details, or below for examples. */ // Open orders: https://docs.kraken.com/api/docs/futures-api/websocket/open_orders const openOrdersTopicRequest: WSTopicRequest<WSDerivativesTopic> = { topic: 'open_orders', }; client.subscribe(openOrdersTopicRequest, WS_KEY_MAP.derivativesPrivateV1); // Note: if there are no parameters needed, you can also just request the topic by name // This is the same as openOrdersTopicRequest, since openOrdersTopicRequest contains no parameters // client.subscribe('open_orders', WS_KEY_MAP.derivativesPrivateV1); // Open orders (verbose): https://docs.kraken.com/api/docs/futures-api/websocket/open_orders client.subscribe('open_orders_verbose', WS_KEY_MAP.derivativesPrivateV1); // Fills: https://docs.kraken.com/api/docs/futures-api/websocket/fills const accountFillsTopicRequest: WSTopicRequest<WSDerivativesTopic> = { topic: 'fills', // Optionally, the product_ids field can be used to subscribe only to specific product. // payload: { // product_ids: ['PF_XBTUSD'], // }, }; client.subscribe(accountFillsTopicRequest, WS_KEY_MAP.derivativesPrivateV1); // Balances: https://docs.kraken.com/api/docs/futures-api/websocket/balances client.subscribe('balances', WS_KEY_MAP.derivativesPrivateV1); // Open Position: https://docs.kraken.com/api/docs/futures-api/websocket/open_position client.subscribe('open_positions', WS_KEY_MAP.derivativesPrivateV1); // Account Log: https://docs.kraken.com/api/docs/futures-api/websocket/account_log client.subscribe('account_log', WS_KEY_MAP.derivativesPrivateV1); // Notification: https://docs.kraken.com/api/docs/futures-api/websocket/notifications client.subscribe('notifications_auth', WS_KEY_MAP.derivativesPrivateV1); } catch (e) { console.error('Req error: ', e); }} start();WebSocket API walkthrough
WebSocket API commands require API credentials. Set the environment variables shown in the code using credentials for the live environment. This example only constructs the client; it sends no request and places no order. Continue with the maintained example below for supported commands and connection handling.
Save the code as ws-api-setup.mjs and run:
node ws-api-setup.mjs
import { WebsocketAPIClient } from '@siebly/kraken-api'; const credentials = { apiKey: process.env.KRAKEN_SPOT_API_KEY, apiSecret: process.env.KRAKEN_SPOT_API_SECRET,}; if (Object.values(credentials).some((value) => !value)) { throw new Error('Set KRAKEN_SPOT_API_KEY, KRAKEN_SPOT_API_SECRET before running.');} const wsApi = new WebsocketAPIClient(credentials);console.log('Client configured. No request sent.');Kraken API JavaScript Tutorial
A richer JavaScript guide for building Kraken Spot REST, Futures REST, public and private WebSockets, WebSocket API trading, proxy configuration, reconnect handling, and production rollout patterns with @siebly/kraken-api.
Your app / service
bot, dashboard, worker
@siebly/kraken-api
SpotClient, DerivativesClient, WebsocketClient
Kraken APIs
Spot REST, Futures REST, WebSockets, WebSocket API
Common Kraken implementation tasks
Start from the behavior you need, not just from REST or WebSocket as a transport. Market-data driven systems should be event driven. Backfill via the REST API once and let WebSockets passively stream new data to you, as it becomes available.
REST API hydration or backfill
Start from the REST API quickstart and endpoint reference, then normalize exchange-specific IDs, timestamps, symbols, and product scope.
Open endpoint referenceWebSocket consumer
Start from the WebSocket quickstart that matches the task boundary, verify subscription acknowledgement semantics, and keep reconnect handling explicit.
Open WebSocket quickstartAgent prompt recipe
Use the AI prompt generator when the task combines REST API hydration, live streams, in-memory state, operational outputs, or strategy code.
Build an agent promptFor coding agents
Give these files to an agent before implementation so it can find the package, examples, task guidance, and safety rules from the normal SDK-page flow.
AI prompt framework
Prompt generator and task recipes for exchange API projects.
llms.txt
Compact discovery file for agents choosing where to start.
llms-full.txt
Full route and implementation guidance index for machine readers.
SDK catalog
Machine-readable package, docs, examples, and task guidance.
Agent skill
Reusable workflow rules for coding agents using exchange APIs.
Endpoint Function Reference
Endpoint maps
Each REST client is a JavaScript class, which provides functions individually mapped to each endpoint available in the exchange's API offering.
The following table shows all methods available in each REST client, whether the method requires authentication (automatically handled if API keys are provided), as well as the exact endpoint each method is connected to.
This can be used to easily find which method to call, once you have found which endpoint you're looking to use.
All REST clients are in the src folder. For usage examples, make sure to check the examples folder.
List of clients:
If anything is missing or wrong, please open an issue or let us know in our Node.js Traders telegram group!
How to use table
Table consists of 4 parts:
- Function name
- AUTH
- HTTP Method
- Endpoint
Function name is the name of the function that can be called through the SDK. Check examples folder in the repo for more help on how to use them!
AUTH is a boolean value that indicates if the function requires authentication - which means you need to pass your API key and secret to the SDK.
HTTP Method shows HTTP method that the function uses to call the endpoint. Sometimes endpoints can have same URL, but different HTTP method so you can use this column to differentiate between them.
Endpoint is the URL that the function uses to call the endpoint. Best way to find exact function you need for the endpoint is to search for URL in this table and find corresponding function name.
SpotClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in SpotClient.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| getSystemStatus() | GET | 0/public/SystemStatus | |
| getMaintenanceSchedule() | GET | 0/public/MaintenanceSchedule | |
| getAssetInfo() | GET | 0/public/Assets | |
| getAssetPairs() | GET | 0/public/AssetPairs | |
| getTicker() | GET | 0/public/Ticker | |
| getCandles() | GET | 0/public/OHLC | |
| getOrderBook() | GET | 0/public/Depth | |
| getGroupedBook() | GET | 0/public/GroupedBook | |
| getLevel3OrderBook() | 🔐 | POST | 0/private/Level3 |
| getRecentTrades() | GET | 0/public/Trades | |
| getRecentSpreads() | GET | 0/public/Spread | |
| getAccountBalance() | 🔐 | POST | 0/private/Balance |
| getApiKeyInfo() | 🔐 | POST | 0/private/GetApiKeyInfo |
| getWalletAccounts() | 🔐 | POST | 0/private/ListWalletAccounts |
| getExtendedBalance() | 🔐 | POST | 0/private/BalanceEx |
| getCreditLines() | 🔐 | POST | 0/private/CreditLines |
| getTradeBalance() | 🔐 | POST | 0/private/TradeBalance |
| getOpenOrders() | 🔐 | POST | 0/private/OpenOrders |
| getClosedOrders() | 🔐 | POST | 0/private/ClosedOrders |
| getOrders() | 🔐 | POST | 0/private/QueryOrders |
| getOrderAmends() | 🔐 | POST | 0/private/OrderAmends |
| getTradesHistory() | 🔐 | POST | 0/private/TradesHistory |
| getTrades() | 🔐 | POST | 0/private/QueryTrades |
| getOpenPositions() | 🔐 | POST | 0/private/OpenPositions |
| getLedgersInfo() | 🔐 | POST | 0/private/Ledgers |
| getLedgers() | 🔐 | POST | 0/private/QueryLedgers |
| getTradingVolume() | 🔐 | POST | 0/private/TradeVolume |
| requestLedgersExport() | 🔐 | POST | 0/private/AddExport |
| getLedgersExportStatus() | 🔐 | POST | 0/private/ExportStatus |
| getLedgersExport() | 🔐 | POST | 0/private/RetrieveExport |
| deleteLedgersExport() | 🔐 | POST | 0/private/RemoveExport |
| submitOrder() | 🔐 | POST | 0/private/AddOrder |
| amendOrder() | 🔐 | POST | 0/private/AmendOrder |
| cancelOrder() | 🔐 | POST | 0/private/CancelOrder |
| cancelAllOrders() | 🔐 | POST | 0/private/CancelAll |
| cancelAllOrdersAfter() | 🔐 | POST | 0/private/CancelAllOrdersAfter |
| getWebSocketsToken() | 🔐 | POST | 0/private/GetWebSocketsToken |
| submitBatchOrders() | 🔐 | POST | 0/private/AddOrderBatch |
| cancelBatchOrders() | 🔐 | POST | 0/private/CancelOrderBatch |
| getDepositMethods() | 🔐 | POST | 0/private/DepositMethods |
| getDepositAddresses() | 🔐 | POST | 0/private/DepositAddresses |
| getDepositsStatus() | 🔐 | POST | 0/private/DepositStatus |
| getWithdrawalMethods() | 🔐 | POST | 0/private/WithdrawMethods |
| getWithdrawalAddresses() | 🔐 | POST | 0/private/WithdrawAddresses |
| getWithdrawalInfo() | 🔐 | POST | 0/private/WithdrawInfo |
| submitWithdrawal() | 🔐 | POST | 0/private/Withdraw |
| getWithdrawalsStatus() | 🔐 | POST | 0/private/WithdrawStatus |
| cancelWithdrawal() | 🔐 | POST | 0/private/WithdrawCancel |
| submitTransferToFutures() | 🔐 | POST | 0/private/WalletTransfer |
| createSubaccount() | 🔐 | POST | 0/private/CreateSubaccount |
| submitSubaccountTransfer() | 🔐 | POST | 0/private/AccountTransfer |
| allocateEarnFunds() | 🔐 | POST | 0/private/Earn/Allocate |
| deallocateEarnFunds() | 🔐 | POST | 0/private/Earn/Deallocate |
| getEarnAllocationStatus() | 🔐 | POST | 0/private/Earn/AllocateStatus |
| getEarnDeallocationStatus() | 🔐 | POST | 0/private/Earn/DeallocateStatus |
| getEarnStrategies() | 🔐 | POST | 0/private/Earn/Strategies |
| getEarnAllocations() | 🔐 | POST | 0/private/Earn/Allocations |
| getPreTradeData() | GET | 0/public/PreTrade | |
| getPostTradeData() | GET | 0/public/PostTrade | |
| getOAuthAccessToken() | POST | oauth/token | |
| getOAuthUserInfo() | 🔐 | GET | oauth/userinfo |
| createOAuthFastApiKey() | 🔐 | POST | oauth/fast-api-key |
| deleteOAuthFastApiKey() | 🔐 | DELETE | oauth/fast-api-key |
| updateOAuthFastApiKey() | 🔐 | PUT | oauth/fast-api-key |
| listOAuthFastApiKeys() | 🔐 | GET | oauth/fast-api-keys |
DerivativesClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in DerivativesClient.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| getTradeHistory() | GET | derivatives/api/v3/history | |
| getOrderbook() | GET | derivatives/api/v3/orderbook | |
| getTickers() | GET | derivatives/api/v3/tickers | |
| getTicker() | GET | derivatives/api/v3/tickers/{symbol} | |
| getInstruments() | GET | derivatives/api/v3/instruments | |
| getTradingInstruments() | 🔐 | GET | derivatives/api/v3/trading/instruments |
| getInstrumentStatusList() | GET | derivatives/api/v3/instruments/status | |
| getInstrumentStatus() | GET | derivatives/api/v3/instruments/{symbol}/status | |
| batchOrderManagement() | 🔐 | POST | derivatives/api/v3/batchorder |
| cancelAllOrders() | 🔐 | POST | derivatives/api/v3/cancelallorders |
| cancelAllOrdersAfter() | 🔐 | POST | derivatives/api/v3/cancelallordersafter |
| cancelOrder() | 🔐 | POST | derivatives/api/v3/cancelorder |
| editOrder() | 🔐 | POST | derivatives/api/v3/editorder |
| getOpenOrders() | 🔐 | GET | derivatives/api/v3/openorders |
| submitOrder() | 🔐 | POST | derivatives/api/v3/sendorder |
| getOrderStatus() | 🔐 | POST | derivatives/api/v3/orders/status |
| getPnlPreferences() | 🔐 | GET | derivatives/api/v3/pnlpreferences |
| setPnlPreference() | 🔐 | PUT | derivatives/api/v3/pnlpreferences |
| getLeverageSettings() | 🔐 | GET | derivatives/api/v3/leveragepreferences |
| setLeverageSettings() | 🔐 | PUT | derivatives/api/v3/leveragepreferences |
| getRfqAssignmentMaxLeverage() | 🔐 | GET | derivatives/api/v3/rfq-assignment/max-leverage |
| setRfqAssignmentMaxLeverage() | 🔐 | PUT | derivatives/api/v3/rfq-assignment/max-leverage |
| deleteRfqAssignmentMaxLeverage() | 🔐 | DELETE | derivatives/api/v3/rfq-assignment/max-leverage |
| getAccounts() | 🔐 | GET | derivatives/api/v3/accounts |
| getOpenPositions() | 🔐 | GET | derivatives/api/v3/openpositions |
| getPositionPercentile() | 🔐 | GET | derivatives/api/v3/unwindqueue |
| getPortfolioMarginParameters() | 🔐 | GET | derivatives/api/v3/portfolio-margining/parameters |
| simulateMarginRequirements() | 🔐 | POST | derivatives/api/v3/portfolio-margining/simulate |
| getAssignmentPrograms() | 🔐 | GET | derivatives/api/v3/assignmentprogram/current |
| addAssignmentPreference() | 🔐 | POST | derivatives/api/v3/assignmentprogram/add |
| deleteAssignmentPreference() | 🔐 | POST | derivatives/api/v3/assignmentprogram/delete |
| getAssignmentPreferencesHistory() | 🔐 | GET | derivatives/api/v3/assignmentprogram/history |
| getFeeSchedules() | GET | derivatives/api/v3/feeschedules | |
| getFeeScheduleVolumes() | 🔐 | GET | derivatives/api/v3/feeschedules/volumes |
| getNotifications() | 🔐 | GET | derivatives/api/v3/notifications |
| getFills() | 🔐 | GET | derivatives/api/v3/fills |
| getHistoricalFundingRates() | GET | derivatives/api/v3/historical-funding-rates | |
| getSelfTradeStrategy() | 🔐 | GET | derivatives/api/v3/self-trade-strategy |
| updateSelfTradeStrategy() | 🔐 | PUT | derivatives/api/v3/self-trade-strategy |
| getSubaccountTradingStatus() | 🔐 | GET | derivatives/api/v3/subaccount/{subaccountUid}/trading-enabled |
| updateSubaccountTradingStatus() | 🔐 | PUT | derivatives/api/v3/subaccount/{subaccountUid}/trading-enabled |
| getSubaccounts() | 🔐 | GET | derivatives/api/v3/subaccounts |
| submitWalletTransfer() | 🔐 | POST | derivatives/api/v3/transfer |
| submitSubaccountTransfer() | 🔐 | POST | derivatives/api/v3/transfer/subaccount |
| submitTransferToSpot() | 🔐 | POST | derivatives/api/v3/withdrawal |
| getOpenRFQs() | GET | derivatives/api/v3/rfqs | |
| getOpenRFQ() | GET | derivatives/api/v3/rfqs/{rfqUid} | |
| getRFQOpenOffers() | 🔐 | GET | derivatives/api/v3/rfqs/open-offers |
| submitRFQNewOffer() | 🔐 | POST | derivatives/api/v3/rfqs/{rfqUid}/place-offer |
| updateRFQOpenOffer() | 🔐 | PUT | derivatives/api/v3/rfqs/{rfqUid}/replace-offer |
| cancelRFQOffer() | 🔐 | DELETE | derivatives/api/v3/rfqs/{rfqUid}/cancel-offer |
| getExecutionEvents() | 🔐 | GET | api/history/v3/executions |
| getOrderEvents() | 🔐 | GET | api/history/v3/orders |
| getTriggerEvents() | 🔐 | GET | api/history/v3/triggers |
| getPositionEvents() | 🔐 | GET | api/history/v3/positions |
| getAccountLog() | 🔐 | GET | api/history/v3/account-log |
| getAccountLogCsv() | 🔐 | GET | api/history/v3/accountlogcsv |
| getPublicExecutionEvents() | GET | api/history/v3/market/{tradeable}/executions | |
| getPublicOrderEvents() | GET | api/history/v3/market/{tradeable}/orders | |
| getPublicMarkPriceEvents() | GET | api/history/v3/market/{tradeable}/price | |
| getTickTypes() | GET | api/charts/v1/ | |
| getMarketsForTickType() | GET | api/charts/v1/{tickType} | |
| getResolutions() | GET | api/charts/v1/{tickType}/{symbol} | |
| getCandles() | GET | api/charts/v1/{tickType}/{symbol}/{resolution} | |
| getLiquidityPoolStatistic() | GET | api/charts/v1/analytics/liquidity-pool | |
| getMarketAnalytics() | GET | api/charts/v1/analytics/{symbol}/{analyticsType} | |
| checkApiKeyV3() | 🔐 | GET | api/auth/v1/api-keys/v3/check |
| getAccountMarketShare() | 🔐 | GET | api/stats/v1/rebates/self-market-share |
InstitutionalClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in InstitutionalClient.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| listCustodyVaults() | 🔐 | POST | 0/private/ListCustodyVaults |
| getCustodyVaultbyId() | 🔐 | POST | 0/private/GetCustodyVault |
| getCustodyDepositMethods() | 🔐 | POST | 0/private/DepositMethods |
| getCustodyDepositAddresses() | 🔐 | POST | 0/private/DepositAddresses |
| listCustodyTransactions() | 🔐 | POST | 0/private/ListCustodyTransactions |
| getCustodyTransactionbyId() | 🔐 | POST | 0/private/GetCustodyTransaction |
| getCustodyWithdrawMethods() | 🔐 | POST | 0/private/WithdrawMethods |
| getCustodyWithdrawAddresses() | 🔐 | POST | 0/private/WithdrawAddresses |
| listCustodyTasks() | 🔐 | POST | 0/private/ListCustodyTasks |
| getCustodyTaskbyId() | 🔐 | POST | 0/private/GetCustodyTask |
| listCustodyActivities() | 🔐 | POST | 0/private/ListCustodyActivities |
| getCustodyActivitybyId() | 🔐 | POST | 0/private/GetCustodyActivity |
| createOtcQuoteRequest() | 🔐 | POST | 0/private/CreateOtcQuoteRequest |
| updateOtcQuote() | 🔐 | POST | 0/private/UpdateOtcQuote |
| getOtcPairs() | 🔐 | POST | 0/private/GetOtcPairs |
| getOtcActiveQuotes() | 🔐 | POST | 0/private/GetOtcActiveQuotes |
| getOtcHistoricalQuotes() | 🔐 | POST | 0/private/GetOtcHistoricalQuotes |
| getOtcExposures() | 🔐 | POST | 0/private/GetOtcExposures |
| checkOtcClient() | 🔐 | POST | 0/private/CheckOtcClient |
PartnerClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in PartnerClient.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| createEmbedUser() | 🔐 | POST | b2b/users |
| getEmbedUser() | 🔐 | GET | b2b/users/{user} |
| updateEmbedUser() | 🔐 | PATCH | b2b/users/{user} |
| submitEmbedVerification() | 🔐 | POST | b2b/verifications/{user} |
| listEmbedAssets() | 🔐 | GET | b2b/assets |
| getEmbedAsset() | 🔐 | GET | b2b/assets/{asset} |
| listEmbedAssetRates() | 🔐 | GET | b2b/assets/{asset}/rates |
| requestEmbedQuote() | 🔐 | POST | b2b/quotes |
| getEmbedQuote() | 🔐 | GET | b2b/quotes/{quote_id} |
| executeEmbedQuote() | 🔐 | PUT | b2b/quotes/{quote_id} |
| getEmbedQuoteLimits() | 🔐 | GET | b2b/quotes/limits |
| requestEmbedProspectiveQuote() | 🔐 | POST | b2b/quotes/prospective |
| createEmbedCustomOrder() | 🔐 | POST | b2b/custom-orders |
| listEmbedCustomOrders() | 🔐 | GET | b2b/custom-orders |
| getEmbedCustomOrder() | 🔐 | GET | b2b/custom-orders/{order_id} |
| cancelEmbedCustomOrder() | 🔐 | POST | b2b/custom-orders/{id}/cancel |
| getEmbedPortfolioSummary() | 🔐 | GET | b2b/portfolio/{user}/summary |
| getEmbedPortfolioHistory() | 🔐 | GET | b2b/portfolio/{user}/history |
| listEmbedPortfolioDetails() | 🔐 | GET | b2b/portfolio/{user}/details |
| listEmbedPortfolioTransactions() | 🔐 | GET | b2b/portfolio/{user}/transactions |
| getEmbedEarnSummary() | 🔐 | GET | b2b/earn/{user} |
| listEmbedEarnAssets() | 🔐 | GET | b2b/earn/assets |
| toggleEmbedAutoEarn() | 🔐 | PUT | b2b/earn/{user}/auto |
| withdrawEmbedFunds() | 🔐 | POST | b2b/funds/withdrawals |
| listEmbedFundingTransactions() | 🔐 | GET | b2b/funds/transactions |
| listEmbedSettlementReports() | 🔐 | GET | b2b/reports/settlement |
| getEmbedSettlementReport() | 🔐 | GET | b2b/reports/settlement/{id} |
| listRampBuyCryptoAssets() | 🔐 | GET | b2b/ramp/buy/crypto |
| listRampFiatCurrencies() | 🔐 | GET | b2b/ramp/fiat-currencies |
| listRampPaymentMethods() | 🔐 | GET | b2b/ramp/payment-methods |
| listRampCountries() | 🔐 | GET | b2b/ramp/countries |
| getRampLimits() | 🔐 | GET | b2b/ramp/limits |
| getRampProspectiveQuote() | 🔐 | GET | b2b/ramp/quotes/prospective |
| getRampCheckoutUrl() | 🔐 | GET | b2b/ramp/checkout |
AffiliateClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in AffiliateClient.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| getCpaProgress() | 🔐 | GET | affiliate/v1/cpa-progress |
| getPayoutHistory() | 🔐 | GET | affiliate/v1/payout-history |
| getDailyActivity() | 🔐 | GET | affiliate/v1/daily-activity |
WebsocketAPIClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in WebsocketAPIClient.ts.
This client provides WebSocket API endpoints which allow for faster interactions with the Kraken API via a WebSocket connection.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| submitSpotOrder() | 🔐 | WS | add_order |
| amendSpotOrder() | 🔐 | WS | amend_order |
| cancelSpotOrder() | 🔐 | WS | cancel_order |
| cancelAllSpotOrders() | 🔐 | WS | cancel_all |
| cancelAllSpotOrdersAfter() | 🔐 | WS | cancel_all_orders_after |
| batchSubmitSpotOrders() | 🔐 | WS | batch_add |
| batchCancelSpotOrders() | 🔐 | WS | batch_cancel |
| editSpotOrder() | 🔐 | WS | edit_order |
Kraken JavaScript FAQ
What does the Kraken JavaScript SDK cover?
Kraken supports Spot, Futures, Margin, WebSockets, and WebSocket API workflows. The JavaScript guide covers the main REST and WebSocket integration patterns.
How do I authenticate private Kraken API calls in JavaScript?
The public REST example above needs no credentials. For private calls, follow the authentication setup for @siebly/kraken-api in the full tutorial, including the credentials or signer required by your exchange.
Kraken authentication and setupDoes the Kraken JavaScript SDK help with WebSocket connection management?
Yes. Use the SDK WebSocket client for subscriptions, reconnect handling, and stream lifecycle management instead of building raw socket flows yourself.
When should I use the Kraken WebSocket API instead of REST?
Use REST for standard request and response workflows such as account queries and order management. Use the WebSocket API flow when you want persistent low-latency interactions over a connected session.
Direct Example Files
Open the example files below for JavaScript and TypeScript-compatible request, authentication, WebSocket, and Node.js service patterns.