mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-19 02:14:35 +08:00
feat: implement coinank openapi netPositions interface (#1258)
- implement Net long & Net short interface
This commit is contained in:
25
provider/coinank/net_positions_test.go
Normal file
25
provider/coinank/net_positions_test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package coinank
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"nofx/provider/coinank/coinank_enum"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestNetPositions(t *testing.T) {
|
||||
client := NewCoinankClient(coinank_enum.MainUrl, TestApikey)
|
||||
resp, err := client.NetPositions(context.TODO(), coinank_enum.Binance, "BTCUSDT", coinank_enum.Hour1, time.Now().UnixMilli(), 10)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if resp[0].Begin <= 0 {
|
||||
t.Errorf("begin timestamp error")
|
||||
}
|
||||
res, err := json.Marshal(resp)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
t.Logf("%s", res)
|
||||
}
|
||||
Reference in New Issue
Block a user