Documentation ¶
Index ¶
Constants ¶
View Source
const ( ALL = iota BASESPOT BASEFUTURE )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Market ¶
type Market struct { Type string `json:"type"` Name string `json:"name"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` Underlying string `json:"underlying"` Last float64 `json:"last"` Ask float64 `json:"ask"` Bid float64 `json:"bid"` Price float64 `json:"price"` PriceIncrement float64 `json:"priceIncrement"` SizeIncrement float64 `json:"sizeIncrement"` ChangeBod float64 `json:"changeBod"` Change1H float64 `json:"change1h"` Change24H float64 `json:"change24h"` QuoteVolume24H float64 `json:"quoteVolume24h"` VolumeUsd24H float64 `json:"volumeUsd24h"` Enabled bool `json:"enabled"` }
type RequestForCandles ¶
type RequestForCandles struct { ProductCode string `url:"-"` // Resolution is sec length, window length in seconds. options: 15, 60(1m), 300(5m), 900(15m), 3600(60m), 14400(4h), 86400(1D) Resolution int `url:"resolution"` Limit int `url:"limit,omitempty"` Start int64 `url:"start_time,omitempty"` End int64 `url:"end_time,omitempty"` }
query ?resolution={resolution}&limit={limit}&start_time={start_time}&end_time={end_time}
func (*RequestForCandles) Method ¶
func (req *RequestForCandles) Method() string
func (*RequestForCandles) Path ¶
func (req *RequestForCandles) Path() string
func (*RequestForCandles) Payload ¶
func (req *RequestForCandles) Payload() []byte
func (*RequestForCandles) Query ¶
func (req *RequestForCandles) Query() string
type RequestForMarkets ¶
type RequestForMarkets struct {
ProductCode string `url:"-"`
}
RequestForMarkets arg productcode can be blank
func (*RequestForMarkets) Method ¶
func (req *RequestForMarkets) Method() string
func (*RequestForMarkets) Path ¶
func (req *RequestForMarkets) Path() string
func (*RequestForMarkets) Payload ¶
func (req *RequestForMarkets) Payload() []byte
func (*RequestForMarkets) Query ¶
func (req *RequestForMarkets) Query() string
type RequestForOrderbook ¶
query ?depth={depth}
func (*RequestForOrderbook) Method ¶
func (req *RequestForOrderbook) Method() string
func (*RequestForOrderbook) Path ¶
func (req *RequestForOrderbook) Path() string
func (*RequestForOrderbook) Payload ¶
func (req *RequestForOrderbook) Payload() []byte
func (*RequestForOrderbook) Query ¶
func (req *RequestForOrderbook) Query() string
type RequestForTrades ¶
type RequestForTrades struct { ProductCode string `url:"-"` Limit int `url:"limit,omitempty"` Start int64 `url:"start,omitempty"` End int64 `url:"end,omitempty"` }
query ?limit={limit}&start_time={start_time}&end_time={end_time}
func (*RequestForTrades) Method ¶
func (req *RequestForTrades) Method() string
func (*RequestForTrades) Path ¶
func (req *RequestForTrades) Path() string
This syntax works to request historical prices https://ftx.com/api/markets/DEFI-PERP/trades?&start_time=1597687200&end_time=1597773600
func (*RequestForTrades) Payload ¶
func (req *RequestForTrades) Payload() []byte
func (*RequestForTrades) Query ¶
func (req *RequestForTrades) Query() string
type ResponseForCandles ¶
type ResponseForCandles []Candle
func (ResponseForCandles) Less ¶
func (a ResponseForCandles) Less(i, j int) bool
func (ResponseForCandles) Swap ¶
func (a ResponseForCandles) Swap(i, j int)
type ResponseForMarkets ¶
type ResponseForMarkets []Market
func (ResponseForMarkets) Len ¶
func (a ResponseForMarkets) Len() int
func (ResponseForMarkets) Less ¶
func (a ResponseForMarkets) Less(i, j int) bool
func (ResponseForMarkets) List ¶
func (markets ResponseForMarkets) List() []string
func (ResponseForMarkets) Ranking ¶
func (markets ResponseForMarkets) Ranking(base int) []string
Ranking return USD volume in 24hours.
func (ResponseForMarkets) Swap ¶
func (a ResponseForMarkets) Swap(i, j int)
type ResponseForOrderbook ¶
type ResponseForOrderbook Orderbook
type ResponseForTrades ¶
type ResponseForTrades []Trade
Click to show internal directories.
Click to hide internal directories.