Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 1.18 KB

README.md

File metadata and controls

36 lines (29 loc) · 1.18 KB

goexws

Hard fork from goex to generate new websocks interface

It's only support public market data

package goexws

import (
	"github.com/nntaoli-project/goex"
)


type FuturesWsApi interface {
	DepthCallback(func(depth *goex.Depth))
	TickerCallback(func(ticker *goex.FutureTicker))
	TradeCallback(func(trade *goex.Trade, contract string))
	KlineCallback(func(kline *goex.FutureKline, period int, contract string))
	SubscribeDepth(pair goex.CurrencyPair, size int, contractType string) error
	SubscribeTicker(pair goex.CurrencyPair, contractType string) error
	SubscribeTrade(pair goex.CurrencyPair, contractType string) error
	SubscribeKline(pair goex.CurrencyPair, period int, contractType string) error
}

type SpotWsApi interface {
	DepthCallback(func(depth *goex.Depth))
	TickerCallback(func(ticker *goex.Ticker))
	TradeCallback(func(trade *goex.Trade))
	KlineCallback(func(*goex.Kline, int))
	SubscribeDepth(pair goex.CurrencyPair, size int) error
	SubscribeTicker(pair goex.CurrencyPair) error
	SubscribeTrade(pair goex.CurrencyPair) error
	SubscribeKline(pair goex.CurrencyPair, period int) error
}