Bitfinex WebSocket API
Subscribe to Bitfinex v2 public channels (ticker, trades, books, candles) and authenticate to receive private order, position and wallet updates.
Subscribe to Bitfinex v2 public channels (ticker, trades, books, candles) and authenticate to receive private order, position and wallet updates.
Typed Delphi/C++Builder client for the Bitfinex WebSocket v2 API — public channels (ticker, trades, book, candles, status) and authenticated order/position/wallet streams.
TsgcWSAPI_Bitfinex
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
Pair the component with a TsgcWebSocketClient, then call SubscribeTicker, SubscribeTrades or Authenticate to start receiving private updates.
uses
sgcWebSocket, sgcWebSocket_API_Bitfinex;
var
WSClient: TsgcWebSocketClient;
Bitfinex: TsgcWSAPI_Bitfinex;
begin
WSClient := TsgcWebSocketClient.Create(nil);
Bitfinex := TsgcWSAPI_Bitfinex.Create(nil);
Bitfinex.Client := WSClient;
Bitfinex.Bitfinex.ApiKey := 'your-api-key';
Bitfinex.Bitfinex.ApiSecret := 'your-api-secret';
WSClient.Active := True;
// public channels
Bitfinex.SubscribeTicker('tBTCUSD');
Bitfinex.SubscribeTrades('tBTCUSD');
Bitfinex.SubscribeBook('tBTCUSD');
// authenticated channels
Bitfinex.Authenticate;
end;
// uses: sgcWebSocket, sgcWebSocket_API_Bitfinex
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_Bitfinex *Bitfinex = new TsgcWSAPI_Bitfinex(this);
Bitfinex->Client = WSClient;
WSClient->Active = true;
Bitfinex->SubscribeTicker("tBTCUSD");
Bitfinex->SubscribeTrades("tBTCUSD");
Bitfinex->SubscribeBook("tBTCUSD");
Multi-channel router, typed handlers per public channel and authenticated streams.
SubscribeTicker, SubscribeTrades, SubscribeBook, SubscribeRawBook, SubscribeCandles and SubscribeStatus register every public Bitfinex v2 channel.
Authenticate signs the auth payload with HMAC-SHA384 against Bitfinex.ApiSecret and opens the private channel for orders, positions, wallets, balance updates and trade executions.
Each subscribe call returns a chanId. The component tracks which symbol/timeframe maps to which chanId and delivers each channel through its own typed event.
NewOrder, CancelOrder, UpdateOrder, CancelMultipleOrders and the order-multi-op envelope are typed methods that send the corresponding auth-channel input messages.
Conf sends the Bitfinex configuration bitmask to enable sequencing, checksums, raw order IDs and the rest of the v2 wire-format options.
Bind to the underlying TsgcWebSocketClient for WatchDog / HeartBeat / TLS — resubscribe-on-reconnect is wired through OnConnect.
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_Bitfinex Full property, method and event reference for this component. | Open | |
| Demo Project — Demos\05.Crypto\21.Bitfinex 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 |