API WebSocket de Coinbase

· Componentes

From sgcWebSockets 4.4.7, API WebSocket de Coinbase is supported. Coinbase is a platform that allows to sell, buy and store cryptocurrencies like Ethereum, Bitcoin...

WebSocket API allow to receive in real-time ticker updates, status, tickers, book deepth and more.


Cómo conectar a Coinbase

oClient := TsgcWebSocketClient.Create(nil);
oCoinbase := TsgcWSAPI_Coinbase.Create(nil);
oCoinbase.Client := oClient;
oClient.Active := True; 

Cómo suscribirse al 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
// here you will receive the ticker updates
end; 
});