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