sgcWebSockets 4.4.7 より、Coinbase WebSocket API をサポートしています。Coinbase はイーサリアム・ビットコインなどの暗号資産の売買・保管を可能にするプラットフォームです。
WebSocket API を使用すると、ティッカー更新・ステータス・板情報などをリアルタイムで受信できます。
Coinbase への接続方法
oClient := TsgcWebSocketClient.Create(nil); oCoinbase := TsgcWSAPI_Coinbase.Create(nil); oCoinbase.Client := oClient; oClient.Active := True;
How Subscribe Ticker
oClient := TsgcWebSocketClient.Create(nil);
oCoinbase := TsgcWSAPI_Coinbase.Create(nil);
oCoinbase.Client := oClient;
oCoinbase.SubscribeTicker('ETH-USD']);
procedure OnCoinbaseMessage(Sender: TObject; aType, aRawMessage: string);
begin
// ここでティッカーの更新を受信します
end;
});
