Documentation ¶
Index ¶
- Constants
- Variables
- type Gate
- type Spot
- func (spot *Spot) CancelOrder(order *Order) ([]byte, error)
- func (spot *Spot) GetAccount() (*Account, []byte, error)
- func (spot *Spot) GetDepth(pair Pair, size int) (*Depth, []byte, error)
- func (spot *Spot) GetExchangeRule(pair Pair) (*Rule, []byte, error)
- func (spot *Spot) GetKlineRecords(pair Pair, period, size, since int) ([]*Kline, []byte, error)
- func (spot *Spot) GetOHLCs(symbol string, period, size, since int) ([]*OHLC, []byte, error)
- func (spot *Spot) GetOrder(order *Order) ([]byte, error)
- func (spot *Spot) GetOrders(pair Pair) ([]*Order, error)
- func (spot *Spot) GetTicker(pair Pair) (*Ticker, []byte, error)
- func (spot *Spot) GetTrades(pair Pair, since int64) ([]*Trade, error)
- func (spot *Spot) GetUnFinishOrders(pair Pair) ([]*Order, []byte, error)
- func (spot *Spot) KeepAlive()
- func (spot *Spot) PlaceOrder(order *Order) ([]byte, error)
- type Swap
- func (swap *Swap) AddMargin(pair Pair, openType FutureType, marginAmount float64) ([]byte, error)
- func (swap *Swap) CancelOrder(order *SwapOrder) ([]byte, error)
- func (swap *Swap) GetAccount() (*SwapAccount, []byte, error)
- func (swap *Swap) GetAccountFlow() ([]*SwapAccountItem, []byte, error)
- func (swap *Swap) GetContract(pair Pair) *SwapContract
- func (swap *Swap) GetDepth(pair Pair, size int) (*SwapDepth, []byte, error)
- func (swap *Swap) GetFundingFee(pair Pair) (float64, error)
- func (swap *Swap) GetFundingFees(pair Pair) ([][]interface{}, []byte, error)
- func (swap *Swap) GetKline(pair Pair, period, size, since int) ([]*SwapKline, []byte, error)
- func (swap *Swap) GetLimit(pair Pair) (float64, float64, error)
- func (swap *Swap) GetOpenAmount(pair Pair) (float64, int64, []byte, error)
- func (swap *Swap) GetOrder(order *SwapOrder) ([]byte, error)
- func (swap *Swap) GetOrders(pair Pair) ([]*SwapOrder, []byte, error)
- func (swap *Swap) GetPosition(pair Pair, openType FutureType) (*SwapPosition, []byte, error)
- func (swap *Swap) GetTicker(pair Pair) (*SwapTicker, []byte, error)
- func (swap *Swap) GetUnFinishOrders(pair Pair) ([]*SwapOrder, []byte, error)
- func (swap *Swap) KeepAlive()
- func (swap *Swap) PlaceOrder(order *SwapOrder) ([]byte, error)
- func (swap *Swap) ReduceMargin(pair Pair, openType FutureType, marginAmount float64) ([]byte, error)
- type SwapOrderGate
Constants ¶
View Source
const ( ACCEPT = "Accept" CONTENT_TYPE = "Content-Type" APPLICATION_JSON = "application/json" APPLICATION_JSON_UTF8 = "application/json; charset=UTF-8" ENDPOINT = "https://api.gateio.ws" )
Variables ¶
View Source
var GATE_PLACE_TYPE_CONVERTER = map[PlaceType]string{
NORMAL: "gtc",
IOC: "ioc",
ONLY_MAKER: "poc",
}
View Source
var GATE_PLACE_TYPE_REVERTER = map[string]PlaceType{
"gtc": NORMAL,
"ioc": IOC,
"poc": ONLY_MAKER,
}
Functions ¶
This section is empty.
Types ¶
type Spot ¶
type Spot struct {
*Gate
}
func (*Spot) CancelOrder ¶
func (*Spot) GetAccount ¶
func (*Spot) GetExchangeRule ¶
func (*Spot) GetKlineRecords ¶
func (*Spot) GetUnFinishOrders ¶
func (*Spot) PlaceOrder ¶
type Swap ¶
type Swap struct {
*Gate
}
func (*Swap) CancelOrder ¶
func (*Swap) GetAccount ¶
func (*Swap) GetAccountFlow ¶
func (*Swap) GetContract ¶
func (swap *Swap) GetContract(pair Pair) *SwapContract
func (*Swap) GetFundingFee ¶
func (*Swap) GetFundingFees ¶
func (*Swap) GetOpenAmount ¶
func (*Swap) GetPosition ¶
func (*Swap) GetUnFinishOrders ¶
func (*Swap) PlaceOrder ¶
type SwapOrderGate ¶
type SwapOrderGate struct { Id int64 `json:"id,omitempty"` User int64 `json:"user,omitempty"` Contract string `json:"contract"` CreateTime int64 `json:"create_time,omitempty"` Size int64 `json:"size"` Left int64 `json:"left,omitempty"` Price float64 `json:"price,string"` FillPrice float64 `json:"fill_price,string"` Status string `json:"status,omitempty"` Close bool `json:"close"` ReduceOnly bool `json:"reduce_only"` IsReduceOnly bool `json:"is_reduce_only,omitempty"` Tif string `json:"tif"` Text string `json:"text"` FinishTime int64 `json:"finish_time"` FinishAt string `json:"finish_at"` }
func (*SwapOrderGate) Merge ¶
func (sog *SwapOrderGate) Merge(order *SwapOrder)
func (*SwapOrderGate) New ¶
func (sog *SwapOrderGate) New(loc *time.Location) *SwapOrder
Click to show internal directories.
Click to hide internal directories.