zb

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MARKET_URL = "http://api.zb.com/data/v1/"
	TICKER_API = "ticker?market=%s"
	DEPTH_API  = "depth?market=%s&size=%d"

	TRADE_URL                 = "https://trade.zb.com/api/"
	GET_ACCOUNT_API           = "getAccountInfo"
	GET_ORDER_API             = "getOrder"
	GET_UNFINISHED_ORDERS_API = "getUnfinishedOrdersIgnoreTradeType"
	CANCEL_ORDER_API          = "cancelOrder"
	PLACE_ORDER_API           = "order"
	WITHDRAW_API              = "withdraw"
	CANCELWITHDRAW_API        = "cancelWithdraw"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Zb

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

func New

func New(httpClient *http.Client, accessKey, secretKey string) *Zb

func (*Zb) CancelOrder

func (zb *Zb) CancelOrder(orderId string, currency common.TradingPair) (bool, error)

func (*Zb) CancelWithdraw

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

func (*Zb) GetAccount

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

func (*Zb) GetDepth

func (zb *Zb) GetDepth(size int, currency common.TradingPair) (*common.Depth, error)

func (*Zb) GetExchangeName

func (zb *Zb) GetExchangeName() string

func (*Zb) GetKlineRecords

func (zb *Zb) GetKlineRecords(currency common.TradingPair, period, size, since int) ([]common.Kline, error)

func (*Zb) GetOneOrder

func (zb *Zb) GetOneOrder(orderId string, currency common.TradingPair) (*common.Order, error)

func (*Zb) GetOrderHistorys

func (zb *Zb) GetOrderHistorys(currency common.TradingPair, currentPage, pageSize int) ([]common.Order, error)

func (*Zb) GetTicker

func (zb *Zb) GetTicker(currency common.TradingPair) (*common.Ticker, error)

func (*Zb) GetTrades

func (zb *Zb) GetTrades(currencyPair common.TradingPair, since int64) ([]common.Trade, error)

func (*Zb) GetUnfinishOrders

func (zb *Zb) GetUnfinishOrders(currency common.TradingPair) ([]common.Order, error)

func (*Zb) LimitBuy

func (zb *Zb) LimitBuy(amount, price string, currency common.TradingPair, opt ...common.LimitOrderOptionalParameter) (*common.Order, error)

func (*Zb) LimitSell

func (zb *Zb) LimitSell(amount, price string, currency common.TradingPair, opt ...common.LimitOrderOptionalParameter) (*common.Order, error)

func (*Zb) MarketBuy

func (zb *Zb) MarketBuy(amount, price string, currency common.TradingPair) (*common.Order, error)

func (*Zb) MarketSell

func (zb *Zb) MarketSell(amount, price string, currency common.TradingPair) (*common.Order, error)

func (*Zb) Withdraw

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

Jump to

Keyboard shortcuts

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