kucoin: refactor ticker request

This commit is contained in:
c9s 2022-01-01 02:07:48 +08:00
parent be408055a6
commit 25f01b8837
2 changed files with 4 additions and 6 deletions

View File

@ -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
}

View File

@ -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,