mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-18 09:54:35 +08:00
feat: implement coinank free kline api and kline websocket (#1281)
- implement coinank free kline api in coinank_api.Kline - implement coinank free kline ws in coinank_api.KlineWs. if needKline is true, kline data read from KlineCh. if needTicker is true, tickers data read from TickersCh.
This commit is contained in:
21
provider/coinank/coinank_api/kline_test.go
Normal file
21
provider/coinank/coinank_api/kline_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package coinank_api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"nofx/provider/coinank/coinank_enum"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestKline(t *testing.T) {
|
||||
resp, err := Kline(context.TODO(), "BTCUSDT", coinank_enum.Binance, time.Now().UnixMilli(), coinank_enum.To, 10, coinank_enum.Hour1)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
res, err := json.Marshal(resp)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
t.Logf("%s", res)
|
||||
}
|
||||
Reference in New Issue
Block a user