Kraken TypeScript SDK

Installation and integration guidance for the Kraken SDK in TypeScript.

TypeScript SDK Usage

Use typed requests, responses, and event flows in stricter TypeScript services and shared libraries.

In TypeScript, use the package types to check request shapes, response fields, WebSocket payloads, and refactors around exchange-specific code.

What This SDK Covers

  • Complete Kraken REST API integrations for exchange-specific workflows.
  • Robust Kraken WebSocket support for market and account stream handling.
  • TypeScript-friendly usage patterns for production integration work.
  • Adaptable TypeScript examples & guides under /examples for implementation reference.
  • Type-rich examples that emphasize request and response shapes, editor hints, and safer refactors.
  • Implementation patterns for larger TypeScript services, shared libraries, and stricter TypeScript application code.

Install Package

npm install @siebly/kraken-api
# or
pnpm install @siebly/kraken-api
yarn add @siebly/kraken-api

Quickstart REST API Walkthrough

Easily start working with Kraken Derivatives REST APIs in JavaScript.

  • Install the Kraken JavaScript SDK via NPM: npm install @siebly/kraken-api.
  • Import the DerivativesClient class for Kraken futures and derivatives REST endpoints.
  • If spot is preferred, import the SpotClient, which is the dedicated utility class wrapped around Kraken's Spot REST APIs.
  • Create an authenticated DerivativesClient instance with your API credentials.
  • Call REST API methods as functions and await their responses.

In this example, we:

  • Edit an existing order by updating parameters such as the limit price.
  • Cancel a single open order by order_id.
  • Cancel all open orders on the account.
  • Cancel all open orders for a specific symbol such as PF_ETHUSD.
  • Demonstrate batch order management by combining edit and cancel actions in one request.

This script is designed as a practical order management walkthrough for Kraken Derivatives, showing common authenticated API calls in JavaScript and the shapes of the request payloads involved.

For a full map of available REST API methods, check out the endpoint reference below.

Quickstart REST API Example

/* eslint-disable @typescript-eslint/no-unused-vars */
// This example shows how to call Kraken API endpoint with either node.js,
// javascript (js) or typescript (ts) with the npm module "@siebly/kraken-api" for Kraken exchange
// for ORDER MANAGEMENT

import { DerivativesClient } from '@siebly/kraken-api';

// initialise the client
/**
 *
 * Kraken Futures API uses API Key and API Secret
 *
 * Example:
 * {
 *   apiKey: 'your-api-key',
 *   apiSecret: 'your-api-secret',
 * }
 */
const client = new DerivativesClient({
  apiKey: process.env.API_FUTURES_KEY || 'insertApiKeyHere',
  apiSecret: process.env.API_FUTURES_SECRET || 'insertApiSecretHere',
});
async function editOrder() {
  try {
    // Edit an existing order
    const editResult = await client.editOrder({
      orderId: 'a04d0f84-36d4-4499-8382-96fcfc3ce7aa', // Or use cliOrdId instead
      limitPrice: 1100, // New limit price
      // or add some other parameters you want to edit
    });
    console.log('Edit Order Result: ', JSON.stringify(editResult, null, 2));

    // Response includes:
    // - status: edited, invalidSize, invalidPrice, etc.
    // - orderEvents: Array of order events
  } catch (e) {
    console.error('Edit order error: ', e);
  }
}

async function cancelOrder() {
  try {
    // Cancel a single order
    const cancelResult = await client.cancelOrder({
      order_id: 'a04d0f84-36d4-4499-8382-96fcfc3ce7aa', // Or use cliOrdId
    });
    console.log('Cancel Order Result: ', JSON.stringify(cancelResult, null, 2));

    // Response status:
    // - cancelled: Successfully cancelled
    // - filled: Order was already filled
    // - notFound: Order not found
  } catch (e) {
    console.error('Cancel order error: ', e);
  }
}

async function cancelAllOrders() {
  try {
    // Cancel all open orders
    const cancelAllResult = await client.cancelAllOrders();
    console.log(
      'Cancel All Orders Result: ',
      JSON.stringify(cancelAllResult, null, 2),
    );

    // Response includes:
    // - status: cancelled or noOrdersToCancel
    // - cancelledOrders: Array of cancelled order IDs
  } catch (e) {
    console.error('Cancel all orders error: ', e);
  }
}

async function cancelAllOrdersBySymbol() {
  try {
    // Cancel all orders for specific symbol
    const cancelBySymbol = await client.cancelAllOrders({
      symbol: 'PF_ETHUSD',
    });
    console.log(
      'Cancel Orders by Symbol Result: ',
      JSON.stringify(cancelBySymbol, null, 2),
    );
  } catch (e) {
    console.error('Cancel orders by symbol error: ', e);
  }
}

async function batchOrderManagement() {
  try {
    // Send, edit, and cancel orders in a single batch request
    const batchResult = await client.batchOrderManagement({
      json: {
        batchOrder: [
          // Edit existing order
          {
            order: 'edit',
            order_id: 'a04d1143-757a-4dba-a0a7-687303b9c62d',
            limitPrice: 900,
          },
          // Cancel existing order
          {
            order: 'cancel',
            order_id: 'a04d116e-fb9c-4bcf-9eaf-ea90254439b3',
          },
        ],
      },
    });
    console.log('Batch Order Result: ', JSON.stringify(batchResult, null, 2));

    // Response includes batchStatus array with results for each order
    // - status: placed, edited, cancelled, or rejection reason
    // - order_tag: Maps back to your request
  } catch (e) {
    console.error('Batch order management error: ', e);
  }
}

// Uncomment the function you want to test:

// editOrder();
// cancelOrder();
// cancelAllOrders();
// cancelAllOrdersBySymbol();
// batchOrderManagement();

Quickstart 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, and authenticated.
  • Subscribe to private topics on the derivativesPrivateV1 connection 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, and notifications_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.

Quickstart WebSocket Example

// eslint-disable-next-line @typescript-eslint/no-unused-vars
import {
  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();

Quickstart WebSocket API Walkthrough

Kraken's Spot WebSocket API (WS-API) lets you send commands & requests over a persistent authenticated WebSocket connection, reducing overhead compared to opening separate REST requests. If you're building a latency sensitive system this is the ideal way to avoid the overhead seen while making REST API calls.

This Kraken JavaScript SDK's WebsocketAPIClient wraps these WS-API requests with promise-based helper methods so each command can be awaited similarly to a REST call. All the power & benefits of WebSocket API integration without the complexity of asynchronous messaging over WebSockets.

To use the WebSocket API:

  • Install the Kraken JavaScript SDK via NPM: npm install @siebly/kraken-api.
  • Import the dedicated WebsocketAPIClient.
  • Create an authenticated WebsocketAPIClient instance with your API credentials.
  • Optionally inject a custom logger for request and connection diagnostics.
  • Call the dedicated helper methods and await each response.

In this example, we:

  • Submit spot orders including a basic limit order, a conditional order, and a trigger-based stop-loss order.
  • Amend existing spot orders using either cl_ord_id or order_id.
  • Cancel specific orders, cancel all spot orders, and configure a cancel-all-after timeout.
  • Batch submit and batch cancel spot orders.

Note that:

  • The SDK automatically fetches, caches, and refreshes the private WS token required for authenticated spot WS-API requests.
  • The SDK will automatically handle any connection issues. Any midflight commands during a connection drop will see a rejected promise / throw, allowing you to easily handle and resubmit any failed requests as part of your standard error handling.
  • The script includes placeholder order IDs and example order values that should be replaced before live use.

Quickstart WebSocket API Example

// eslint-disable-next-line @typescript-eslint/no-unused-vars
import {
  DefaultLogger,
  LogParams,
  WebsocketAPIClient,
} from '@siebly/kraken-api';

const customLogger: DefaultLogger = {
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  trace: (...params: LogParams): void => {
    // console.log('trace', ...params);
  },
  info: (...params: LogParams): void => {
    console.log('info', ...params);
  },
  error: (...params: LogParams): void => {
    console.error('error', ...params);
  },
};

async function start() {
  const account = {
    key: process.env.API_SPOT_KEY || 'keyHere',
    secret: process.env.API_SPOT_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 WebsocketAPIClient(
    {
      apiKey: account.key,
      apiSecret: account.secret,
    },
    customLogger,
  );

  /**
   * The below examples demonstrate how you can subscribe to private topics.
   *
   * Note: while the documentation specifies "token" as a required parameter, the SDK will automatically:
   * - fetch the token using your API key/secret,
   * - manage token caching/refreshing,
   * - include the token in the request for you.
   *
   * So you do NOT need to manually fetch or provide the token when subscribing to private topics.
   *
   * Do note that all of these include the "spotPrivateV2" WsKey reference. This tells the WebsocketClient to use the private "wss://ws-auth.kraken.com/v2" endpoint for these private subscription requests.
   */

  try {
    const addOrderResponse = await client.submitSpotOrder({
      order_type: 'limit',
      side: 'buy',
      limit_price: 26500.4,
      order_userref: 100054,
      order_qty: 1.2,
      symbol: 'BTC/USD',
    });
    console.log('addOrderResponse: ', addOrderResponse);

    const addOrderConditionalResponse = await client.submitSpotOrder({
      order_type: 'limit',
      side: 'buy',
      order_qty: 1.2,
      symbol: 'BTC/USD',
      limit_price: 28440,
      conditional: {
        order_type: 'stop-loss-limit',
        trigger_price: 28410,
        limit_price: 28400,
      },
    });
    console.log('addOrderConditionalResponse: ', addOrderConditionalResponse);

    const addOrderTriggersResponse = await client.submitSpotOrder({
      order_type: 'stop-loss',
      side: 'sell',
      order_qty: 100,
      symbol: 'MATIC/USD',
      triggers: {
        reference: 'last',
        price: 10.0,
        price_type: 'pct',
      },
    });
    console.log('addOrderTriggersResponse: ', addOrderTriggersResponse);

    const amendOrderResponse = await client.amendSpotOrder({
      cl_ord_id: '2c6be801-1f53-4f79-a0bb-4ea1c95dfae9',
      limit_price: 10000,
      order_qty: 1.2,
    });
    console.log('amendOrderResponse: ', amendOrderResponse);

    const amendOrderPostOnlyResponse = await client.amendSpotOrder({
      order_id: 'OAIYAU-LGI3M-PFM5VW',
      order_qty: 1.2,
      limit_price: 1100.3,
      deadline: '2025-11-19T09:53:59.050Z',
      post_only: true,
    });
    console.log('amendOrderPostOnlyResponse: ', amendOrderPostOnlyResponse);

    const cancelOrderResponse = await client.cancelSpotOrder({
      order_id: ['OM5CRX-N2HAL-GFGWE9', 'OLUMT4-UTEGU-ZYM7E9'],
    });
    console.log('cancelOrderResponse: ', cancelOrderResponse);

    const cancelAllResponse = await client.cancelAllSpotOrders();
    console.log('cancelAllResponse: ', cancelAllResponse);

    const cancelAllOrdersAfterResponse = await client.cancelAllSpotOrdersAfter({
      timeout: 100,
    });
    console.log('cancelAllOrdersAfterResponse: ', cancelAllOrdersAfterResponse);

    const batchAddResponse = await client.batchSubmitSpotOrders({
      deadline: '2025-11-19T09:53:59.050Z',
      orders: [
        {
          limit_price: 1010.1,
          order_qty: 1.2,
          order_type: 'limit',
          order_userref: 1,
          side: 'buy',
        },
        {
          limit_price: 1100.3,
          order_qty: 1.2,
          order_type: 'limit',
          order_userref: 2,
          side: 'sell',
          stp_type: 'cancel_both',
        },
      ],
      symbol: 'BTC/USD',
      validate: false,
    });
    console.log('batchAddResponse: ', batchAddResponse);

    const batchCancelResponse = await client.batchCancelSpotOrders({
      orders: ['OM5CRX-N2HAL-GFGWE9', 'OLUMT4-UTEGU-ZYM7E9'],
    });
    console.log('batchCancelResponse: ', batchCancelResponse);
  } catch (e) {
    console.error('Req error: ', e);
  }
}

start();

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.

FunctionAUTHHTTP MethodEndpoint
getSystemStatus()GET0/public/SystemStatus
getAssetInfo()GET0/public/Assets
getAssetPairs()GET0/public/AssetPairs
getTicker()GET0/public/Ticker
getCandles()GET0/public/OHLC
getOrderBook()GET0/public/Depth
getRecentTrades()GET0/public/Trades
getRecentSpreads()GET0/public/Spread
getAccountBalance()🔐POST0/private/Balance
getExtendedBalance()🔐POST0/private/BalanceEx
getCreditLines()🔐POST0/private/CreditLines
getTradeBalance()🔐POST0/private/TradeBalance
getOpenOrders()🔐POST0/private/OpenOrders
getClosedOrders()🔐POST0/private/ClosedOrders
getOrders()🔐POST0/private/QueryOrders
getOrderAmends()🔐POST0/private/OrderAmends
getTradesHistory()🔐POST0/private/TradesHistory
getTrades()🔐POST0/private/QueryTrades
getOpenPositions()🔐POST0/private/OpenPositions
getLedgersInfo()🔐POST0/private/Ledgers
getLedgers()🔐POST0/private/QueryLedgers
getTradingVolume()🔐POST0/private/TradeVolume
requestLedgersExport()🔐POST0/private/AddExport
getLedgersExportStatus()🔐POST0/private/ExportStatus
getLedgersExport()🔐POST0/private/RetrieveExport
deleteLedgersExport()🔐POST0/private/RemoveExport
submitOrder()🔐POST0/private/AddOrder
amendOrder()🔐POST0/private/AmendOrder
cancelOrder()🔐POST0/private/CancelOrder
cancelAllOrders()🔐POST0/private/CancelAll
cancelAllOrdersAfter()🔐POST0/private/CancelAllOrdersAfter
getWebSocketsToken()🔐POST0/private/GetWebSocketsToken
submitBatchOrders()🔐POST0/private/AddOrderBatch
cancelBatchOrders()🔐POST0/private/CancelOrderBatch
getDepositMethods()🔐POST0/private/DepositMethods
getDepositAddresses()🔐POST0/private/DepositAddresses
getDepositsStatus()🔐POST0/private/DepositStatus
getWithdrawalMethods()🔐POST0/private/WithdrawMethods
getWithdrawalAddresses()🔐POST0/private/WithdrawAddresses
getWithdrawalInfo()🔐POST0/private/WithdrawInfo
submitWithdrawal()🔐POST0/private/Withdraw
getWithdrawalsStatus()🔐POST0/private/WithdrawStatus
cancelWithdrawal()🔐POST0/private/WithdrawCancel
submitTransferToFutures()🔐POST0/private/WalletTransfer
createSubaccount()🔐POST0/private/CreateSubaccount
submitSubaccountTransfer()🔐POST0/private/AccountTransfer
allocateEarnFunds()🔐POST0/private/Earn/Allocate
deallocateEarnFunds()🔐POST0/private/Earn/Deallocate
getEarnAllocationStatus()🔐POST0/private/Earn/AllocateStatus
getEarnDeallocationStatus()🔐POST0/private/Earn/DeallocateStatus
getEarnStrategies()🔐POST0/private/Earn/Strategies
getEarnAllocations()🔐POST0/private/Earn/Allocations
getPreTradeData()GET0/public/PreTrade
getPostTradeData()GET0/public/PostTrade
getOAuthAccessToken()POSToauth/token
getOAuthUserInfo()🔐GEToauth/userinfo
createOAuthFastApiKey()🔐POSToauth/fast-api-key
deleteOAuthFastApiKey()🔐DELETEoauth/fast-api-key
updateOAuthFastApiKey()🔐PUToauth/fast-api-key
listOAuthFastApiKeys()🔐GEToauth/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.

FunctionAUTHHTTP MethodEndpoint
getTradeHistory()GETderivatives/api/v3/history
getOrderbook()GETderivatives/api/v3/orderbook
getTickers()GETderivatives/api/v3/tickers
getTicker()GETderivatives/api/v3/tickers/{symbol}
getInstruments()GETderivatives/api/v3/instruments
getInstrumentStatusList()GETderivatives/api/v3/instruments/status
getInstrumentStatus()GETderivatives/api/v3/instruments/{symbol}/status
batchOrderManagement()🔐POSTderivatives/api/v3/batchorder
cancelAllOrders()🔐POSTderivatives/api/v3/cancelallorders
cancelAllOrdersAfter()🔐POSTderivatives/api/v3/cancelallordersafter
cancelOrder()🔐POSTderivatives/api/v3/cancelorder
editOrder()🔐POSTderivatives/api/v3/editorder
getOpenOrders()🔐GETderivatives/api/v3/openorders
submitOrder()🔐POSTderivatives/api/v3/sendorder
getOrderStatus()🔐POSTderivatives/api/v3/orders/status
getPnlPreferences()🔐GETderivatives/api/v3/pnlpreferences
setPnlPreference()🔐PUTderivatives/api/v3/pnlpreferences
getLeverageSettings()🔐GETderivatives/api/v3/leveragepreferences
setLeverageSettings()🔐PUTderivatives/api/v3/leveragepreferences
getAccounts()🔐GETderivatives/api/v3/accounts
getOpenPositions()🔐GETderivatives/api/v3/openpositions
getPositionPercentile()🔐GETderivatives/api/v3/unwindqueue
getPortfolioMarginParameters()🔐GETderivatives/api/v3/portfolio-margining/parameters
simulateMarginRequirements()🔐POSTderivatives/api/v3/portfolio-margining/simulate
getAssignmentPrograms()🔐GETderivatives/api/v3/assignmentprogram/current
addAssignmentPreference()🔐POSTderivatives/api/v3/assignmentprogram/add
deleteAssignmentPreference()🔐POSTderivatives/api/v3/assignmentprogram/delete
getAssignmentPreferencesHistory()🔐GETderivatives/api/v3/assignmentprogram/history
getFeeSchedules()GETderivatives/api/v3/feeschedules
getFeeScheduleVolumes()🔐GETderivatives/api/v3/feeschedules/volumes
getNotifications()🔐GETderivatives/api/v3/notifications
getFills()🔐GETderivatives/api/v3/fills
getHistoricalFundingRates()GETderivatives/api/v3/historical-funding-rates
getSelfTradeStrategy()🔐GETderivatives/api/v3/self-trade-strategy
updateSelfTradeStrategy()🔐PUTderivatives/api/v3/self-trade-strategy
getSubaccountTradingStatus()🔐GETderivatives/api/v3/subaccount/{subaccountUid}/trading-enabled
updateSubaccountTradingStatus()🔐PUTderivatives/api/v3/subaccount/{subaccountUid}/trading-enabled
getSubaccounts()🔐GETderivatives/api/v3/subaccounts
submitWalletTransfer()🔐POSTderivatives/api/v3/transfer
submitSubaccountTransfer()🔐POSTderivatives/api/v3/transfer/subaccount
submitTransferToSpot()🔐POSTderivatives/api/v3/withdrawal
getOpenRFQs()GETderivatives/api/v3/rfqs
getOpenRFQ()GETderivatives/api/v3/rfqs/{rfqUid}
getRFQOpenOffers()🔐GETderivatives/api/v3/rfqs/open-offers
submitRFQNewOffer()🔐POSTderivatives/api/v3/rfqs/{rfqUid}/place-offer
updateRFQOpenOffer()🔐PUTderivatives/api/v3/rfqs/{rfqUid}/replace-offer
cancelRFQOffer()🔐DELETEderivatives/api/v3/rfqs/{rfqUid}/cancel-offer
getExecutionEvents()🔐GETapi/history/v3/executions
getOrderEvents()🔐GETapi/history/v3/orders
getTriggerEvents()🔐GETapi/history/v3/triggers
getPositionEvents()🔐GETapi/history/v3/positions
getAccountLog()🔐GETapi/history/v3/account-log
getAccountLogCsv()🔐GETapi/history/v3/accountlogcsv
getPublicExecutionEvents()GETapi/history/v3/market/{tradeable}/executions
getPublicOrderEvents()GETapi/history/v3/market/{tradeable}/orders
getPublicMarkPriceEvents()GETapi/history/v3/market/{tradeable}/price
getTickTypes()GETapi/charts/v1/
getMarketsForTickType()GETapi/charts/v1/{tickType}
getResolutions()GETapi/charts/v1/{tickType}/{symbol}
getCandles()GETapi/charts/v1/{tickType}/{symbol}/{resolution}
getLiquidityPoolStatistic()GETapi/charts/v1/analytics/liquidity-pool
getMarketAnalytics()GETapi/charts/v1/analytics/{symbol}/{analyticsType}
checkApiKeyV3()🔐GETapi/auth/v1/api-keys/v3/check
getAccountMarketShare()🔐GETapi/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.

FunctionAUTHHTTP MethodEndpoint
listCustodyVaults()🔐POST0/private/ListCustodyVaults
getCustodyVaultbyId()🔐POST0/private/GetCustodyVault
getCustodyDepositMethods()🔐POST0/private/DepositMethods
getCustodyDepositAddresses()🔐POST0/private/DepositAddresses
listCustodyTransactions()🔐POST0/private/ListCustodyTransactions
getCustodyTransactionbyId()🔐POST0/private/GetCustodyTransaction
getCustodyWithdrawMethods()🔐POST0/private/WithdrawMethods
getCustodyWithdrawAddresses()🔐POST0/private/WithdrawAddresses
listCustodyTasks()🔐POST0/private/ListCustodyTasks
getCustodyTaskbyId()🔐POST0/private/GetCustodyTask
listCustodyActivities()🔐POST0/private/ListCustodyActivities
getCustodyActivitybyId()🔐POST0/private/GetCustodyActivity
createOtcQuoteRequest()🔐POST0/private/CreateOtcQuoteRequest
updateOtcQuote()🔐POST0/private/UpdateOtcQuote
getOtcPairs()🔐POST0/private/GetOtcPairs
getOtcActiveQuotes()🔐POST0/private/GetOtcActiveQuotes
getOtcHistoricalQuotes()🔐POST0/private/GetOtcHistoricalQuotes
getOtcExposures()🔐POST0/private/GetOtcExposures
checkOtcClient()🔐POST0/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.

FunctionAUTHHTTP MethodEndpoint
createEmbedUser()🔐POSTb2b/users
getEmbedUser()🔐GETb2b/users/{user}
updateEmbedUser()🔐PATCHb2b/users/{user}
submitEmbedVerification()🔐POSTb2b/verifications/{user}
listEmbedAssets()🔐GETb2b/assets
getEmbedAsset()🔐GETb2b/assets/{asset}
listEmbedAssetRates()🔐GETb2b/assets/{asset}/rates
requestEmbedQuote()🔐POSTb2b/quotes
getEmbedQuote()🔐GETb2b/quotes/{quote_id}
executeEmbedQuote()🔐PUTb2b/quotes/{quote_id}
getEmbedQuoteLimits()🔐GETb2b/quotes/limits
requestEmbedProspectiveQuote()🔐POSTb2b/quotes/prospective
createEmbedCustomOrder()🔐POSTb2b/custom-orders
listEmbedCustomOrders()🔐GETb2b/custom-orders
getEmbedCustomOrder()🔐GETb2b/custom-orders/{order_id}
cancelEmbedCustomOrder()🔐POSTb2b/custom-orders/{id}/cancel
getEmbedPortfolioSummary()🔐GETb2b/portfolio/{user}/summary
getEmbedPortfolioHistory()🔐GETb2b/portfolio/{user}/history
listEmbedPortfolioDetails()🔐GETb2b/portfolio/{user}/details
listEmbedPortfolioTransactions()🔐GETb2b/portfolio/{user}/transactions
getEmbedEarnSummary()🔐GETb2b/earn/{user}
listEmbedEarnAssets()🔐GETb2b/earn/assets
toggleEmbedAutoEarn()🔐PUTb2b/earn/{user}/auto
withdrawEmbedFunds()🔐POSTb2b/funds/withdrawals
listEmbedFundingTransactions()🔐GETb2b/funds/transactions
listEmbedSettlementReports()🔐GETb2b/reports/settlement
getEmbedSettlementReport()🔐GETb2b/reports/settlement/{id}
listRampBuyCryptoAssets()🔐GETb2b/ramp/buy/crypto
listRampFiatCurrencies()🔐GETb2b/ramp/fiat-currencies
listRampPaymentMethods()🔐GETb2b/ramp/payment-methods
listRampCountries()🔐GETb2b/ramp/countries
getRampLimits()🔐GETb2b/ramp/limits
getRampProspectiveQuote()🔐GETb2b/ramp/quotes/prospective
getRampCheckoutUrl()🔐GETb2b/ramp/checkout

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.

FunctionAUTHHTTP MethodEndpoint
submitSpotOrder()🔐WSadd_order
amendSpotOrder()🔐WSamend_order
cancelSpotOrder()🔐WScancel_order
cancelAllSpotOrders()🔐WScancel_all
cancelAllSpotOrdersAfter()🔐WScancel_all_orders_after
batchSubmitSpotOrders()🔐WSbatch_add
batchCancelSpotOrders()🔐WSbatch_cancel
editSpotOrder()🔐WSedit_order

Source: View endpoint map source

Kraken TypeScript FAQ

What does the Kraken TypeScript SDK cover?

Kraken supports Spot, Futures, WebSockets, and WebSocket API workflows. The TypeScript guide covers the main REST and WebSocket integration patterns.

How do I authenticate private Kraken API calls in TypeScript?

Install @siebly/kraken-api from npm & pass API credentials into the SDK client options, as shown in the Kraken TypeScript examples above. The SDK handles the exchange-specific signing requirements for private requests.

Does the Kraken TypeScript 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 for typed patterns that translate well into shared interfaces, services, and stricter application code.

Reference Links