A partir do sgcWebSockets 4.4.7, Coinbase WebSocket API é suportado. Coinbase is um platform that permite sell, buy e store cryptocurrencies like Ethereum, Bitcoin...
WebSocket API allow para receber em em tempo real ticker updates, status, tickers, book deepth e more.
Como Conectar ao Coinbase
oClient := TsgcWebSocketClient.Create(nil); oCoinbase := TsgcWSAPI_Coinbase.Create(nil); oCoinbase.Client := oClient; oClient.Active := True;
Como Inscrever-se no 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;
});
