From 6065af0bc13c86cbd5202f002b008dcffc1ab009 Mon Sep 17 00:00:00 2001 From: Adrian Gallagher Date: Thu, 9 Apr 2015 22:12:08 +1000 Subject: [PATCH] Added OKCoin Websocket kline handling. --- okcoinwebsocket.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/okcoinwebsocket.go b/okcoinwebsocket.go index 928ddec4..088ebbf3 100644 --- a/okcoinwebsocket.go +++ b/okcoinwebsocket.go @@ -546,7 +546,13 @@ func (o *OKCoin) WebsocketClient(currencies []string) { } // to-do: convert from string array to trade struct case strings.Contains(channelStr, "kline"): - // to-do + klines := []interface{}{} + err := JSONDecode(dataJSON, &klines) + + if err != nil { + log.Println(err) + continue + } case strings.Contains(channelStr, "spot") && strings.Contains(channelStr, "realtrades"): if string(dataJSON) == "null" { continue