et

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEtSpotWsSingle

func NewEtSpotWsSingle(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 ErrorStruct

type ErrorStruct struct {
	Code    int    `json:"code"`
	Message string `json:"message"` // 响应消息有此字段
}

type Et

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

func (*Et) Cancel

func (et *Et) Cancel(orderId string, pair CurrencyPair) (bool, error)

func (*Et) GetAccount

func (et *Et) GetAccount() (*Account, error)

func (*Et) GetAllCurrencyPair

func (et *Et) GetAllCurrencyPair() (map[string]SymbolSetting, error)

func (*Et) GetAllCurrencyStatus

func (et *Et) GetAllCurrencyStatus() (all map[string]CurrencyStatus, err error)

func (*Et) GetAllTicker

func (et *Et) GetAllTicker() ([]Ticker, error)

func (*Et) GetCurrencyStatus

func (et *Et) GetCurrencyStatus(currency Currency) (CurrencyStatus, error)

func (*Et) GetDepth

func (et *Et) GetDepth(pair CurrencyPair, size int, step int) (*Depth, error)

func (*Et) GetExchangeName

func (et *Et) GetExchangeName() string

func (*Et) GetFinishedOrders

func (et *Et) GetFinishedOrders(pair CurrencyPair) ([]Order, error)

func (*Et) GetKlineRecords

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

func (*Et) GetOrder

func (et *Et) GetOrder(orderId string, pair CurrencyPair) (*Order, error)

func (*Et) GetOrderDeal

func (et *Et) GetOrderDeal(orderId string, pair CurrencyPair) ([]OrderDeal, error)

func (*Et) GetPendingOrders

func (et *Et) GetPendingOrders(pair CurrencyPair) ([]Order, error)

func (*Et) GetTicker

func (et *Et) GetTicker(pair CurrencyPair) (*Ticker, error)

func (*Et) GetTradeFee

func (et *Et) GetTradeFee() (tf *TradeFee, err error)

func (*Et) GetTrades

func (et *Et) GetTrades(pair CurrencyPair, size int) ([]Trade, error)

func (*Et) GetURL

func (et *Et) GetURL() string

func (*Et) GetUserTrades

func (et *Et) GetUserTrades(pair CurrencyPair) ([]Trade, error)

func (*Et) LimitBuy

func (et *Et) LimitBuy(pair CurrencyPair, price, amount string) (*Order, error)

func (*Et) LimitSell

func (et *Et) LimitSell(pair CurrencyPair, price, amount string) (*Order, error)

func (*Et) MarketBuy

func (et *Et) MarketBuy(pair CurrencyPair, amount string) (*Order, error)

func (*Et) MarketSell

func (et *Et) MarketSell(pair CurrencyPair, amount string) (*Order, error)

func (*Et) SetURL

func (et *Et) SetURL(exurl string)

type EtSpotWs

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

func (*EtSpotWs) FormatTopicName

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

格式化流名称

func (*EtSpotWs) FormatTopicSubData

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

格式化流订阅消息

func (*EtSpotWs) FormatTopicUnsubData

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

格式化流取消订阅消息

func (*EtSpotWs) GetExchangeName

func (ws *EtSpotWs) GetExchangeName() string

func (*EtSpotWs) OnMessage

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

func (*EtSpotWs) SubDepth

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

func (*EtSpotWs) SubTicker

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

func (*EtSpotWs) SubTrade

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

type EtSpotWsSingle

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

func (*EtSpotWsSingle) FormatTopicName

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

格式化流名称

func (*EtSpotWsSingle) FormatTopicSubData

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

格式化流订阅消息

func (*EtSpotWsSingle) FormatTopicUnsubData

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

格式化流取消订阅消息

func (*EtSpotWsSingle) GetExchangeName

func (ws *EtSpotWsSingle) GetExchangeName() string

func (*EtSpotWsSingle) OnMessage

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

type RspOrders

type RspOrders struct {
	Status uint8
	Orders []RspOrdersOrders
}

type RspOrdersOrders

type RspOrdersOrders struct {
	OrderType        uint8
	State            uint8
	Price            float64
	Amount           float64
	FilledAmount     float64
	FilledCashAmount float64
	FilledFees       float64
	CreatedAt        uint64
	FinishedAt       uint64
	CanceledAt       uint64
	Source           []uint8
	Symbol           []uint8
	AccountId        []uint8
	OrderId          []uint8
}

type TradeFee

type TradeFee struct {
	Maker float64 `json:"maker,string"` // 挂单手续费
	Taker float64 `json:"taker,string"` // 吃单手续费
}

"maker": "0.001", "taker": "0.0015", "timestamp": "2019-12-05T09:06:20.260Z"

Jump to

Keyboard shortcuts

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