mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-09 22:10:57 +08:00
35 lines
670 B
Go
35 lines
670 B
Go
package coinank
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"nofx/provider/coinank/coinank_enum"
|
|
"testing"
|
|
)
|
|
|
|
func TestListCoin(t *testing.T) {
|
|
client := NewCoinankClient(coinank_enum.MainUrl, TestApikey)
|
|
resp, err := client.ListCoin(context.TODO(), "SPOT")
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
res, err := json.Marshal(resp)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
t.Logf("%s", res)
|
|
}
|
|
|
|
func TestListSymbols(t *testing.T) {
|
|
client := NewCoinankClient(coinank_enum.MainUrl, TestApikey)
|
|
resp, err := client.ListSymbols(context.TODO(), "Binance", "SWAP")
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
res, err := json.Marshal(resp)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
t.Logf("%s", res)
|
|
}
|