mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
kucoin: refactor ticker request
This commit is contained in:
parent
be408055a6
commit
25f01b8837
|
@ -1,6 +1,8 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
@ -26,7 +28,8 @@ var tickersCmd = &cobra.Command{
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
ticker, err := client.MarketDataService.GetTicker(args[0])
|
req := client.MarketDataService.NewGetTickerRequest(args[0])
|
||||||
|
ticker, err := req.Do(context.Background())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,11 +97,6 @@ func (s *MarketDataService) NewGetTickerRequest(symbol string) *GetTickerRequest
|
||||||
return &GetTickerRequest{client: s.client, symbol: symbol}
|
return &GetTickerRequest{client: s.client, symbol: symbol}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *MarketDataService) GetTicker(symbol string) (*Ticker, error) {
|
|
||||||
req := s.NewGetTickerRequest(symbol)
|
|
||||||
return req.Do(context.Background())
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
"time":1602832092060,
|
"time":1602832092060,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user