Kraken WebSocket API
Subscribe to Kraken v2 public channels (ticker, book, trade, ohlc, spread) and authenticated private channels (openOrders, ownTrades) from a typed Delphi component.
Subscribe to Kraken v2 public channels (ticker, book, trade, ohlc, spread) and authenticated private channels (openOrders, ownTrades) from a typed Delphi component.
Kraken WebSocket v2 client — ticker, book, trade, ohlc and spread channels plus signed openOrders / ownTrades private streams.
TsgcWSAPI_Kraken
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
Pair with a TsgcWebSocketClient, fetch a WebSocket token if you need private channels, then subscribe to public or authenticated streams.
uses
sgcWebSocket, sgcWebSocket_API_Kraken;
var
WSClient: TsgcWebSocketClient;
Kraken: TsgcWSAPI_Kraken;
begin
WSClient := TsgcWebSocketClient.Create(nil);
Kraken := TsgcWSAPI_Kraken.Create(nil);
Kraken.Client := WSClient;
Kraken.Kraken.ApiKey := 'your-api-key';
Kraken.Kraken.ApiSecret := 'your-api-secret';
WSClient.Active := True;
Kraken.SubscribeTicker(['XBT/USD']);
Kraken.SubscribeBook(['XBT/USD'], 25);
Kraken.SubscribeTrade(['XBT/USD']);
end;
// uses: sgcWebSocket, sgcWebSocket_API_Kraken
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_Kraken *Kraken = new TsgcWSAPI_Kraken(this);
Kraken->Client = WSClient;
WSClient->Active = true;
Kraken->SubscribeTicker(OPENARRAY(UnicodeString, ("XBT/USD")));
Kraken->SubscribeBook(OPENARRAY(UnicodeString, ("XBT/USD")), 25);
Per-symbol ticker, book deltas, ohlc, spread and trade streams, plus the signed openOrders / ownTrades channels.
SubscribeTicker, SubscribeBook, SubscribeTrade, SubscribeOHLC, SubscribeSpread and SubscribeInstrument cover every Kraken WebSocket v2 public channel.
SubscribeOpenOrders, SubscribeOwnTrades, SubscribeBalances open authenticated streams — the component obtains the WebSocket token via the signed REST call automatically.
Every subscribe call accepts an array of symbols so one connection multiplexes any number of pairs.
The v2 RPC verbs (add_order, cancel_order, cancel_all, edit_order, batch_add, batch_cancel) are exposed as typed methods.
Book subscriptions deliver an initial snapshot followed by incremental updates — ideal for maintaining a synchronised local order book.
Kraken v2 messages carry a sequence_num inside the relevant channels — the component watches for gaps and signals via OnException if resubscription is needed.
Authoritative sources for the APIs this component implements.
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.
| Online Help — API_Kraken Full property, method and event reference for this component. | Open | |
| Demo Project — Demos\05.Crypto\08.Kraken Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |