zb

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: MIT Imports: 10 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 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) GetDepth

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

func (*Zb) GetExchangeName

func (zb *Zb) GetExchangeName() string

func (*Zb) GetKlineRecords

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

func (*Zb) GetOneOrder

func (zb *Zb) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)

func (*Zb) GetOrderHistorys

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

func (*Zb) GetTicker

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

func (*Zb) GetTrades

func (zb *Zb) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)

func (*Zb) GetUnfinishOrders

func (zb *Zb) GetUnfinishOrders(currency CurrencyPair) ([]Order, error)

func (*Zb) LimitBuy

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

func (*Zb) LimitSell

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

func (*Zb) MarketBuy

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

func (*Zb) MarketSell

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

func (*Zb) Withdraw

func (zb *Zb) Withdraw(amount string, currency 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