gateio

package
v0.0.0-...-41d977e Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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 New

func New(client *http.Client, accesskey, secretkey string) *Gate

func (*Gate) CancelOrder

func (g *Gate) CancelOrder(orderId string, currencyPair CurrencyPair) (bool, error)

func (*Gate) GetAccount

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

func (*Gate) GetBestTicker

func (g *Gate) GetBestTicker(currencyPair CurrencyPair) (*BestTicker, error)

最佳买1卖价,从orderbook中获取

func (*Gate) GetCurrencyPairs

func (g *Gate) GetCurrencyPairs() ([]CurrencyPair, error)

获取所有交易对

func (*Gate) GetDepth

func (g *Gate) GetDepth(size int, currencyPair CurrencyPair) (*Depth, error)

func (*Gate) GetExchangeName

func (g *Gate) GetExchangeName() string

func (*Gate) GetKlineRecords

func (g *Gate) GetKlineRecords(currencyPair CurrencyPair, period KlinePeriod, size int, optional ...OptionalParameter) ([]Kline, error)

func (*Gate) GetOneOrder

func (g *Gate) GetOneOrder(orderId string, currencyPair CurrencyPair) (*Order, error)

func (*Gate) GetOrderHistorys

func (g *Gate) GetOrderHistorys(currencyPair CurrencyPair, optional ...OptionalParameter) ([]Order, error)

func (*Gate) GetSubAccount

func (g *Gate) GetSubAccount(coin Currency) (*SubAccount, error)

func (*Gate) GetSubAccounts

func (g *Gate) GetSubAccounts() ([]SubAccount, error)

func (*Gate) GetTicker

func (g *Gate) GetTicker(currencyPair CurrencyPair) (*Ticker, error)

func (*Gate) GetTradeFee

func (g *Gate) GetTradeFee(currencyPair CurrencyPair) (*TradeFee, error)

私有权限

func (*Gate) GetTrades

func (g *Gate) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)

非个人,整个交易所的交易记录

func (*Gate) GetUnfinishOrders

func (g *Gate) GetUnfinishOrders(currencyPair CurrencyPair) ([]Order, error)

查询指定交易对所有挂单

func (*Gate) LimitBuy

func (g *Gate) LimitBuy(amount, price string, currencyPair CurrencyPair, optional ...LimitOrderOptionalParameter) (*Order, error)

限价买单

func (*Gate) LimitSell

func (g *Gate) LimitSell(amount, price string, currencyPair CurrencyPair, optional ...LimitOrderOptionalParameter) (*Order, error)

func (*Gate) MarketBuy

func (g *Gate) MarketBuy(amount, price string, currencyPair CurrencyPair) (*Order, error)

func (*Gate) MarketSell

func (g *Gate) MarketSell(amount, price string, currencyPair CurrencyPair) (*Order, error)

func (*Gate) PlaceOrder

func (g *Gate) PlaceOrder(amount, price string, currencyPair CurrencyPair, orderType, orderSide string) (*Order, error)

限价买单

type ServiceError

type ServiceError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type SpotWs

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

func NewSpotWs

func NewSpotWs(accesskey, secretkey, proxy string) *SpotWs

func (*SpotWs) BestTickerCallback

func (s *SpotWs) BestTickerCallback(f func(ticker *gocoinex.BestTicker, exchange string))

func (*SpotWs) DepthCallback

func (s *SpotWs) DepthCallback(f func(depth *gocoinex.Depth, exchange string))

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 (s *SpotWs) SubscribeUserBalance() error

func (*SpotWs) SubscribeUserOrder

func (s *SpotWs) SubscribeUserOrder() error

func (*SpotWs) TickerCallback

func (s *SpotWs) TickerCallback(f func(ticker *gocoinex.Ticker, exchange string))

func (*SpotWs) TradeCallback

func (s *SpotWs) TradeCallback(f func(trade *gocoinex.Trade, exchange string))

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 (s *SpotWs) UnSubscribeUserBalance() error

func (*SpotWs) UnSubscribeUserOrder

func (s *SpotWs) UnSubscribeUserOrder() error

func (*SpotWs) UserBalanceCallback

func (s *SpotWs) UserBalanceCallback(f func(trade *gocoinex.SubAccount, exchange string))

func (*SpotWs) UserOrderCallback

func (s *SpotWs) UserOrderCallback(f func(trade *gocoinex.Order, exchange string))

Jump to

Keyboard shortcuts

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