gate

package
v1.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGateSpotWsSingle

func NewGateSpotWsSingle(wsURL, proxyURL string) (sw SpotWebsocket, err error)

func NewSpotAPI

func NewSpotAPI(client *http.Client, apiKey, secretKey string) SpotAPI

func NewSpotWebsocket

func NewSpotWebsocket(wsURL, proxyURL string) (sw SpotWebsocket, err error)

Types

type Gate

type Gate struct {
	// contains filtered or unexported fields
}

func (*Gate) Cancel

func (gate *Gate) Cancel(orderId string, pair CurrencyPair) (bool, error)

func (*Gate) GetAccount

func (gate *Gate) GetAccount() (*Account, error)

func (*Gate) GetAllCurrencyPair

func (gate *Gate) GetAllCurrencyPair() (map[string]SymbolSetting, error)

func (*Gate) GetAllCurrencyStatus

func (gate *Gate) GetAllCurrencyStatus() (all map[string]CurrencyStatus, err error)

func (*Gate) GetAllTicker

func (gate *Gate) GetAllTicker() ([]Ticker, error)

func (*Gate) GetCurrencyStatus

func (gate *Gate) GetCurrencyStatus(currency Currency) (CurrencyStatus, error)

func (*Gate) GetDepth

func (gate *Gate) GetDepth(pair CurrencyPair, size int, step int) (*Depth, error)

func (*Gate) GetExchangeName

func (gate *Gate) GetExchangeName() string

func (*Gate) GetFinishedOrders

func (gate *Gate) GetFinishedOrders(pair CurrencyPair) ([]Order, error)

func (*Gate) GetKlineRecords

func (gate *Gate) GetKlineRecords(pair CurrencyPair, period KlinePeriod, size, since int) ([]Kline, error)

func (*Gate) GetOrder

func (gate *Gate) GetOrder(orderId string, pair CurrencyPair) (*Order, error)

func (*Gate) GetOrderDeal

func (gate *Gate) GetOrderDeal(orderId string, pair CurrencyPair) ([]OrderDeal, error)

func (*Gate) GetPendingOrders

func (gate *Gate) GetPendingOrders(pair CurrencyPair) ([]Order, error)

func (*Gate) GetTicker

func (gate *Gate) GetTicker(pair CurrencyPair) (*Ticker, error)

func (*Gate) GetTrades

func (gate *Gate) GetTrades(pair CurrencyPair, size int) ([]Trade, error)

func (*Gate) GetURL

func (gate *Gate) GetURL() string

func (*Gate) GetUserTrades

func (gate *Gate) GetUserTrades(pair CurrencyPair) ([]Trade, error)

func (*Gate) LimitBuy

func (gate *Gate) LimitBuy(pair CurrencyPair, price, amount string) (*Order, error)

func (*Gate) LimitSell

func (gate *Gate) LimitSell(pair CurrencyPair, price, amount string) (*Order, error)

func (*Gate) MarketBuy

func (gate *Gate) MarketBuy(pair CurrencyPair, amount string) (*Order, error)

func (*Gate) MarketSell

func (gate *Gate) MarketSell(pair CurrencyPair, amount string) (*Order, error)

func (*Gate) SetURL

func (gate *Gate) SetURL(exurl string)

type GateSpotWs

type GateSpotWs struct {
	SpotWsBase
	// contains filtered or unexported fields
}

func (*GateSpotWs) FormatTopicName

func (ws *GateSpotWs) FormatTopicName(topic string, pair CurrencyPair) string

格式化流名称

func (*GateSpotWs) FormatTopicSubData

func (ws *GateSpotWs) FormatTopicSubData(topic string, pair CurrencyPair) []byte

格式化流订阅消息

func (*GateSpotWs) FormatTopicUnsubData

func (ws *GateSpotWs) FormatTopicUnsubData(topic string, pair CurrencyPair) []byte

格式化流取消订阅消息

func (*GateSpotWs) GetExchangeName

func (ws *GateSpotWs) GetExchangeName() string

func (*GateSpotWs) OnMessage

func (ws *GateSpotWs) OnMessage(data []byte) (err error)

func (*GateSpotWs) SubDepth

func (ws *GateSpotWs) SubDepth(pair CurrencyPair, cb func(*Depth) error) (err error)

func (*GateSpotWs) SubTicker

func (ws *GateSpotWs) SubTicker(pair CurrencyPair, cb func(*Ticker) error) (err error)

func (*GateSpotWs) SubTrade

func (ws *GateSpotWs) SubTrade(pair CurrencyPair, cb func([]Trade) error) (err error)

type GateSpotWsSingle

type GateSpotWsSingle struct {
	SpotWsBase
	// contains filtered or unexported fields
}

func (*GateSpotWsSingle) FormatTopicName

func (ws *GateSpotWsSingle) FormatTopicName(topic string, pair CurrencyPair) string

格式化流名称

func (*GateSpotWsSingle) FormatTopicSubData

func (ws *GateSpotWsSingle) FormatTopicSubData(topic string, pair CurrencyPair) []byte

格式化流订阅消息

func (*GateSpotWsSingle) FormatTopicUnsubData

func (ws *GateSpotWsSingle) FormatTopicUnsubData(topic string, pair CurrencyPair) []byte

格式化流取消订阅消息

func (*GateSpotWsSingle) GetExchangeName

func (ws *GateSpotWsSingle) GetExchangeName() string

func (*GateSpotWsSingle) OnMessage

func (ws *GateSpotWsSingle) OnMessage(data []byte) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL