zb

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

Documentation

Index

Constants

View Source
const (
	MARKET_URL = "http://api.zb.live/data/v1/"
	TRADE_URL  = "https://trade.zb.live/api/"
)

Variables

This section is empty.

Functions

func NewSpotAPI

func NewSpotAPI(client *http.Client, apiKey, secretKey string) SpotAPI

func NewSpotWebsocket

func NewSpotWebsocket(wsURL, proxyURL string) (sw SpotWebsocket, err error)

Types

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"

type Zb

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

func (*Zb) Cancel

func (zb *Zb) Cancel(orderId string, pair CurrencyPair) (bool, error)

func (*Zb) CancelWithdraw

func (zb *Zb) CancelWithdraw(id string, currency Currency, safePwd string) (bool, error)

func (*Zb) GetAccount

func (zb *Zb) GetAccount() (*Account, error)

func (*Zb) GetAllCurrencyPair

func (zb *Zb) GetAllCurrencyPair() (map[string]SymbolSetting, error)

func (*Zb) GetAllCurrencyStatus

func (zb *Zb) GetAllCurrencyStatus() (all map[string]CurrencyStatus, err error)

func (*Zb) GetAllTicker

func (zb *Zb) GetAllTicker() ([]Ticker, error)

func (*Zb) GetCurrencyStatus

func (zb *Zb) GetCurrencyStatus(currency Currency) (CurrencyStatus, error)

func (*Zb) GetDepth

func (zb *Zb) GetDepth(pair CurrencyPair, size int, step int) (*Depth, error)

func (*Zb) GetExchangeName

func (zb *Zb) GetExchangeName() string

func (*Zb) GetFinishedOrders

func (zb *Zb) GetFinishedOrders(pair CurrencyPair) ([]Order, error)

func (*Zb) GetKlineRecords

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

func (*Zb) GetOrder

func (zb *Zb) GetOrder(orderId string, pair CurrencyPair) (*Order, error)

func (*Zb) GetOrderDeal

func (zb *Zb) GetOrderDeal(orderId string, pair CurrencyPair) ([]OrderDeal, error)

func (*Zb) GetOrders

func (zb *Zb) GetOrders(pair CurrencyPair, size int) ([]Order, error)

返回最近的n条记录

func (*Zb) GetPendingOrders

func (zb *Zb) GetPendingOrders(pair CurrencyPair) ([]Order, error)

func (*Zb) GetTicker

func (zb *Zb) GetTicker(pair CurrencyPair) (*Ticker, error)

func (*Zb) GetTradeFee

func (zb *Zb) GetTradeFee() (tf *TradeFee, err error)

func (*Zb) GetTrades

func (zb *Zb) GetTrades(pair CurrencyPair, size int) ([]Trade, error)

func (*Zb) GetURL

func (zb *Zb) GetURL() string

func (*Zb) GetUserTrades

func (zb *Zb) GetUserTrades(pair CurrencyPair) ([]Trade, error)

func (*Zb) LimitBuy

func (zb *Zb) LimitBuy(pair CurrencyPair, price, amount string) (*Order, error)

func (*Zb) LimitSell

func (zb *Zb) LimitSell(pair CurrencyPair, price, amount string) (*Order, error)

func (*Zb) MarketBuy

func (zb *Zb) MarketBuy(pair CurrencyPair, amount string) (*Order, error)

func (*Zb) MarketSell

func (zb *Zb) MarketSell(pair CurrencyPair, amount string) (*Order, error)

func (*Zb) SetURL

func (zb *Zb) SetURL(exurl string)

func (*Zb) Withdraw

func (zb *Zb) Withdraw(amount string, currency Currency, fees, receiveAddr, safePwd string) (string, error)

type ZbSpotWs

type ZbSpotWs struct {
	SpotWsBase
}

func (*ZbSpotWs) FormatTopicName

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

格式化流名称

func (*ZbSpotWs) FormatTopicSubData

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

格式化流订阅消息

func (*ZbSpotWs) FormatTopicUnsubData

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

格式化流取消订阅消息

func (*ZbSpotWs) GetExchangeName

func (ws *ZbSpotWs) GetExchangeName() string

func (*ZbSpotWs) OnMessage

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

Jump to

Keyboard shortcuts

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