mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 17:13:51 +00:00
32 lines
1.0 KiB
Go
32 lines
1.0 KiB
Go
package bitgetapi
|
|
|
|
//go:generate -command GetRequest requestgen -method GET -responseType .APIResponse -responseDataField Data
|
|
//go:generate -command PostRequest requestgen -method POST -responseType .APIResponse -responseDataField Data
|
|
|
|
import (
|
|
"github.com/c9s/requestgen"
|
|
|
|
"github.com/c9s/bbgo/pkg/fixedpoint"
|
|
"github.com/c9s/bbgo/pkg/types"
|
|
)
|
|
|
|
type Candle struct {
|
|
Open fixedpoint.Value `json:"open"`
|
|
High fixedpoint.Value `json:"high"`
|
|
Low fixedpoint.Value `json:"low"`
|
|
Close fixedpoint.Value `json:"close"`
|
|
QuoteVol fixedpoint.Value `json:"quoteVol"`
|
|
BaseVol fixedpoint.Value `json:"baseVol"`
|
|
UsdtVol fixedpoint.Value `json:"usdtVol"`
|
|
Ts types.MillisecondTimestamp `json:"ts"`
|
|
}
|
|
|
|
//go:generate GetRequest -url "/api/spot/v1/market/candles" -type GetCandlesRequest -responseDataType []Candle
|
|
type GetCandlesRequest struct {
|
|
client requestgen.APIClient
|
|
}
|
|
|
|
func (c *RestClient) NewGetCandlesRequest() *GetCandlesRequest {
|
|
return &GetCandlesRequest{client: c}
|
|
}
|