gateio

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const BaseUrl = "https://api.gateio.ws/api/v4"

Variables

This section is empty.

Functions

func Sym2duo

func Sym2duo(pair string) q.D

Types

type EventMap

type EventMap map[int64]SubscribeEvent

type Gate

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

func New

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

func (*Gate) AllTicker

func (g *Gate) AllTicker(SymPair map[string]q.D) (mdt *sync.Map, err error)

func (*Gate) AllTickerV2

func (g *Gate) AllTickerV2(SymPair map[string]q.D) (mdt *sync.Map, err error)

func (*Gate) Balances

func (g *Gate) Balances() (availables, frozens *sync.Map, err error)

func (*Gate) CancelOrder

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

func (*Gate) Fee

func (g *Gate) Fee() float64

func (*Gate) GetAccount

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

func (*Gate) GetAttr

func (g *Gate) GetAttr() (a q.Attr)

func (*Gate) GetDepth

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

func (*Gate) GetKlineRecords

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

func (*Gate) GetOneOrder

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

func (*Gate) GetOrderHistorys

func (g *Gate) GetOrderHistorys(currency CurrencyPair, para ...wstrader.OptionalParameter) ([]Order, error)

func (*Gate) GetTicker

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

func (*Gate) GetTrades

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

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

func (*Gate) GetUnfinishedOrders

func (g *Gate) GetUnfinishedOrders(currency CurrencyPair) ([]Order, error)

func (*Gate) LimitBuy

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

func (*Gate) LimitSell

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

func (*Gate) MarketBuy

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

func (*Gate) MarketSell

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

func (*Gate) OneTicker

func (g *Gate) OneTicker(d q.D) (ticker q.Bbo, err error)

func (*Gate) PairArray

func (g *Gate) PairArray() (sm map[string]q.D, ps map[q.D]q.P, err error)

func (*Gate) PlaceOrders

func (g *Gate) PlaceOrders(places [3]q.Order) (orders [3]q.Order, err error)

func (*Gate) String

func (g *Gate) String() string

func (*Gate) Test

func (g *Gate) Test() bool

type SubscribeEvent

type SubscribeEvent struct {
	Event     string `json:"event"`
	SubID     string `json:"subId"`
	Channel   string `json:"channel"`
	ChanID    int64  `json:"chanId"`
	Symbol    string `json:"symbol"`
	Precision string `json:"prec,omitempty"`
	Frequency string `json:"freq,omitempty"`
	Key       string `json:"key,omitempty"`
	Len       string `json:"len,omitempty"`
	Pair      string `json:"pair"`
}

type Ws

type Ws struct {
	*WsBuilder
	sync.Once
	// contains filtered or unexported fields
}

func NewWs

func NewWs() *Ws

func (*Ws) BBOCallback

func (ws *Ws) BBOCallback(bboCallback func(*Bbo))

func (*Ws) DepthCallback

func (ws *Ws) DepthCallback(depthCallback func(*Depth))

func (*Ws) SubscribeBBO

func (ws *Ws) SubscribeBBO(sm []string) (err error)

func (*Ws) SubscribeDepth

func (ws *Ws) SubscribeDepth(pair CurrencyPair) error

func (*Ws) SubscribeTicker

func (ws *Ws) SubscribeTicker(pair CurrencyPair) error

func (*Ws) SubscribeTrade

func (ws *Ws) SubscribeTrade(pair CurrencyPair) error

func (*Ws) TickerCallback

func (ws *Ws) TickerCallback(tickerCallback func(*Ticker))

func (*Ws) TradeCallback

func (ws *Ws) TradeCallback(tradeCallback func(*Trade))

Jump to

Keyboard shortcuts

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