Documentation ¶
Index ¶
- Constants
- type Gate
- func (g *Gate) CancelOrder(orderId string, currencyPair CurrencyPair) (bool, error)
- func (g *Gate) GetAccount() (*Account, error)
- func (g *Gate) GetBestTicker(currencyPair CurrencyPair) (*BestTicker, error)
- func (g *Gate) GetCurrencyPairs() ([]CurrencyPair, error)
- func (g *Gate) GetDepth(size int, currencyPair CurrencyPair) (*Depth, error)
- func (g *Gate) GetExchangeName() string
- func (g *Gate) GetKlineRecords(currencyPair CurrencyPair, period KlinePeriod, size int, ...) ([]Kline, error)
- func (g *Gate) GetOneOrder(orderId string, currencyPair CurrencyPair) (*Order, error)
- func (g *Gate) GetOrderHistorys(currencyPair CurrencyPair, optional ...OptionalParameter) ([]Order, error)
- func (g *Gate) GetSubAccount(coin Currency) (*SubAccount, error)
- func (g *Gate) GetSubAccounts() ([]SubAccount, error)
- func (g *Gate) GetTicker(currencyPair CurrencyPair) (*Ticker, error)
- func (g *Gate) GetTradeFee(currencyPair CurrencyPair) (*TradeFee, error)
- func (g *Gate) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)
- func (g *Gate) GetUnfinishOrders(currencyPair CurrencyPair) ([]Order, error)
- func (g *Gate) LimitBuy(amount, price string, currencyPair CurrencyPair, ...) (*Order, error)
- func (g *Gate) LimitSell(amount, price string, currencyPair CurrencyPair, ...) (*Order, error)
- func (g *Gate) MarketBuy(amount, price string, currencyPair CurrencyPair) (*Order, error)
- func (g *Gate) MarketSell(amount, price string, currencyPair CurrencyPair) (*Order, error)
- func (g *Gate) PlaceOrder(amount, price string, currencyPair CurrencyPair, orderType, orderSide string) (*Order, error)
- type ServiceError
- type SpotWs
- func (s *SpotWs) BestTickerCallback(f func(ticker *gocoinex.BestTicker, exchange string))
- func (s *SpotWs) DepthCallback(f func(depth *gocoinex.Depth, exchange string))
- func (s *SpotWs) SubscribeBestTicker(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) SubscribeDepth(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) SubscribeTicker(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) SubscribeTrade(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) SubscribeUserBalance() error
- func (s *SpotWs) SubscribeUserOrder() error
- func (s *SpotWs) TickerCallback(f func(ticker *gocoinex.Ticker, exchange string))
- func (s *SpotWs) TradeCallback(f func(trade *gocoinex.Trade, exchange string))
- func (s *SpotWs) UnSubscribeBestTicker(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) UnSubscribeDepth(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) UnSubscribeTicker(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) UnSubscribeTrade(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) UnSubscribeUserBalance() error
- func (s *SpotWs) UnSubscribeUserOrder() error
- func (s *SpotWs) UserBalanceCallback(f func(trade *gocoinex.SubAccount, exchange string))
- func (s *SpotWs) UserOrderCallback(f func(trade *gocoinex.Order, exchange string))
Constants ¶
View Source
const ( FuturesBtcUrl = "wss://fx-ws.gateio.ws/v4/ws/btc" FuturesUsdtUrl = "wss://fx-ws.gateio.ws/v4/ws/usdt" AuthMethodApiKey = "api_key" )
View Source
const ( ChannelSpotOrderBook = "spot.order_book" ChannelSpotTicker = "spot.tickers" ChannelSpotBestTicker = "spot.book_ticker" ChannelSpotPublicTrade = "spot.trades" ChannelSpotUserOrder = "spot.orders" // 现货订单变动 ChannelSpotUserBalance = "spot.balances" // 现货余额变动 )
spot channels
View Source
const ( Subscribe = "subscribe" UnSubscribe = "unsubscribe" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gate ¶
type Gate struct {
// contains filtered or unexported fields
}
func (*Gate) CancelOrder ¶
func (*Gate) GetAccount ¶
func (*Gate) GetBestTicker ¶
最佳买1卖价,从orderbook中获取
func (*Gate) GetExchangeName ¶
func (*Gate) GetKlineRecords ¶
func (*Gate) GetOneOrder ¶
func (*Gate) GetOrderHistorys ¶
func (*Gate) GetSubAccount ¶
func (*Gate) GetSubAccounts ¶
func (*Gate) GetTradeFee ¶
私有权限
func (*Gate) GetUnfinishOrders ¶
查询指定交易对所有挂单
func (*Gate) LimitBuy ¶
func (g *Gate) LimitBuy(amount, price string, currencyPair CurrencyPair, optional ...LimitOrderOptionalParameter) (*Order, error)
限价买单
func (*Gate) MarketSell ¶
type ServiceError ¶
type SpotWs ¶
type SpotWs struct {
// contains filtered or unexported fields
}
func (*SpotWs) BestTickerCallback ¶
func (s *SpotWs) BestTickerCallback(f func(ticker *gocoinex.BestTicker, exchange string))
func (*SpotWs) DepthCallback ¶
func (*SpotWs) SubscribeBestTicker ¶
func (s *SpotWs) SubscribeBestTicker(pair gocoinex.CurrencyPair) error
func (*SpotWs) SubscribeDepth ¶
func (s *SpotWs) SubscribeDepth(pair gocoinex.CurrencyPair) error
func (*SpotWs) SubscribeTicker ¶
func (s *SpotWs) SubscribeTicker(pair gocoinex.CurrencyPair) error
func (*SpotWs) SubscribeTrade ¶
func (s *SpotWs) SubscribeTrade(pair gocoinex.CurrencyPair) error
func (*SpotWs) SubscribeUserBalance ¶
func (*SpotWs) SubscribeUserOrder ¶
func (*SpotWs) TickerCallback ¶
func (*SpotWs) TradeCallback ¶
func (*SpotWs) UnSubscribeBestTicker ¶
func (s *SpotWs) UnSubscribeBestTicker(pair gocoinex.CurrencyPair) error
func (*SpotWs) UnSubscribeDepth ¶
func (s *SpotWs) UnSubscribeDepth(pair gocoinex.CurrencyPair) error
func (*SpotWs) UnSubscribeTicker ¶
func (s *SpotWs) UnSubscribeTicker(pair gocoinex.CurrencyPair) error
func (*SpotWs) UnSubscribeTrade ¶
func (s *SpotWs) UnSubscribeTrade(pair gocoinex.CurrencyPair) error
func (*SpotWs) UnSubscribeUserBalance ¶
func (*SpotWs) UnSubscribeUserOrder ¶
func (*SpotWs) UserBalanceCallback ¶
func (s *SpotWs) UserBalanceCallback(f func(trade *gocoinex.SubAccount, exchange string))
Click to show internal directories.
Click to hide internal directories.