Versions in this module Expand all Collapse all v1 v1.0.5 May 2, 2020 v1.0.4 Apr 30, 2020 v1.0.3 Apr 30, 2020 v1.0.2 Apr 28, 2020 v1.0.1 Apr 28, 2020 Changes in this version + type WSDepth struct + Asks [][]float64 + Bids [][]float64 + Channel string + DataType string + Timestamp int64 + type WSTicker struct + Channel string + DataType string + Date int64 + Ticker WSTickerData + type WSTickerData struct + Buy float64 + High float64 + Last float64 + Low float64 + Sell float64 + Vol float64 + type WSTrade struct + Amount float64 + Date int64 + Price float64 + Tid int64 + TradeType string + Type string + type WSTrades struct + Channel string + Data []WSTrade + DataType string + type ZBWebsocket struct + func NewZBWebsocket(accessKey string, secretKey string, debugMode bool) *ZBWebsocket + func (ws *ZBWebsocket) SetDepthCallback(callback func(depth *WSDepth)) + func (ws *ZBWebsocket) SetTickerCallback(callback func(ticker *WSTicker)) + func (ws *ZBWebsocket) SetTradesCallback(callback func(trades *WSTrades)) + func (ws *ZBWebsocket) Start() + func (ws *ZBWebsocket) Subscribe(event string, channel string) (err error) + func (ws *ZBWebsocket) SubscribeDepth(symbol string) (err error) + func (ws *ZBWebsocket) SubscribeTicker(symbol string) (err error) + func (ws *ZBWebsocket) SubscribeTrades(symbol string) (err error) v1.0.0 Apr 27, 2020 Changes in this version + const OK + var DefaultTransport *http.Transport + func CloneDefaultTransport() *http.Transport + func GetParamHmacMD5Sign(secret, params string) (string, error) + func GetParamHmacSHA256Base64Sign(secret, params string) (string, error) + func GetParamHmacSHA256Sign(secret, params string) (string, error) + func GetParamMD5Sign(secret, params string) (string, error) + func GetSHA(text string) (string, error) + func ParseProxy(proxyURL string) (res func(*http.Request) (*url.URL, error), err error) + type AccountInfo struct + AssetPerm bool + EntrustPerm bool + LeverPerm bool + MoneyPerm bool + OtcPerm bool + Result AccountInfoResult + SubUserPerm bool + type AccountInfoBase struct + AuthGoogleEnabled bool + AuthMobileEnabled bool + TradePasswordEnabled bool + Username string + type AccountInfoCoin struct + Available float64 + CanLoan bool + CnName string + EnName string + FreeZ float64 + FundsType int + IsCanRecharge bool + IsCanWithdraw bool + Key string + ShowName string + UnitDecimal int + UnitTag string + type AccountInfoResult struct + Base AccountInfoBase + Coins []AccountInfoCoin + Version int64 + type AllTicker map[string]TickerData + type Depth struct + Asks [][]float64 + Bids [][]float64 + Timestamp int64 + type GeneralResult struct + Code int + Message string + type KLine struct + Data [][]float64 + MoneyType string + Symbol string + type LeverAssetsInfo struct + Code int + Message LeverAssetsInfoData + type LeverAssetsInfoData struct + Datas LeverAssetsInfoDatas + Des string + IsSuc bool + type LeverAssetsInfoDatas struct + LeverPerm bool + Levers []LeverAssetsInfoLever + type LeverAssetsInfoLever struct + CAvailable string + CCanLoanIn int + CEnName string + CFreeze string + CLoanIn string + CLoanOut string + COverdraft string + CShowName string + CUnitDecimal float64 + CUnitTag string + CouldTransferOutCoin string + CouldTransferOutFiat string + FAvailable string + FCanLoanIn float64 + FEnName string + FFreeze string + FLoanIn string + FLoanOut string + FOverdraft string + FShowName string + FUnitDecimal int + Key string + Level int + LeverMultiple string + LoanInConvertCNY string + LoanInConvertUSD string + LoanOutConvertCNY string + LoanOutConvertUSD string + NetConvertCNY string + NetConvertUSD string + RepayLevel int + RepayLeverShow string + RepayLock bool + ShowName string + Status int + StatusShow string + TotalConvertCNY string + TotalConvertUSD string + UnwindPrice string + type Loan struct + Amount float64 + Balance float64 + CoinName string + InterestRateOfDay float64 + LowestAmount float64 + RateOfDayShow string + RepaymentDay int + type LoanRecord struct + Amount string + ArrearsLx string + BalanceAmount string + BalanceWithoutLxDays int + CoinName string + CreateTime int64 + DikouLx string + FreezID string + FundType int + FwfScale string + HasLx string + HasRepay string + ID int64 + InUserID int64 + InUserLock bool + InUserName string + InvestMark bool + IsIn bool + LoanID int64 + MarketName string + NextRepayDate int64 + OutUserFees string + OutUserID int64 + OutUserName string + Rate string + RateAddVal string + RateForm int + RepayDate int64 + Reward string + RiskManage int + SourceType int + Status int + StatusShow string + Tstatus int + WithoutLxAmount string + WithoutLxDays int + ZheLx string + type LoanRecordResponse struct + Code int + Message string + Result []LoanRecord + type LoansResponse struct + Code int + Message string + Result []Loan + type Order struct + Currency string + ID string + Price float64 + Status int + TotalAmount float64 + TradeAmount float64 + TradeDate int64 + TradeMoney float64 + Type int + type OrderMoreV2Response struct + Code int + Data []int64 + Message string + type OrderResponse struct + Code int + ID string + Message string + type Repayment struct + ActureDate int64 + BenJin string + ID int64 + LiXi string + Status int + StatusShow string + type RepaymentsResponse struct + Code int + Message string + Result []Repayment + type Ticker struct + Date int64 + Ticker TickerData + type TickerData struct + Buy float64 + High float64 + Last float64 + Low float64 + Sell float64 + Vol float64 + type Trade struct + Amount float64 + Date int64 + Price float64 + Tid int64 + TradeType string + Type string + type ZB struct + func NewZB(httpClient *http.Client, host string, accessKey string, secretKey string, ...) *ZB + func (z *ZB) AutoBorrow(marketName string, coin string, amount float64, interestRateOfDay float64, ...) (result GeneralResult, err error) + func (z *ZB) Borrow(marketName string, coin string, amount float64, interestRateOfDay float64, ...) (result GeneralResult, err error) + func (z *ZB) CancelOrder(symbol string, id int64, customOrderID string) (result OrderResponse, err error) + func (z *ZB) DoAllRepay(marketName string) (result GeneralResult, err error) + func (z *ZB) DoTransferFunds(amount float64, currency string, fromUserName string, toUserName string) (result GeneralResult, err error) + func (z *ZB) GetAccountInfo() (result AccountInfo, err error) + func (z *ZB) GetAllTicker() (tickers AllTicker, err error) + func (z *ZB) GetDepth(symbol string, size int) (depth Depth, err error) + func (z *ZB) GetKLine(symbol string, _type string, since int64, size int) (kLine KLine, err error) + func (z *ZB) GetLeverAssetsInfo() (result LeverAssetsInfo, err error) + func (z *ZB) GetLoanRecords(loanId string, marketName string, status int, pageIndex int, pageSize int) (result []LoanRecord, err error) + func (z *ZB) GetLoans(coin string, pageIndex int, pageSize int) (result []Loan, err error) + func (z *ZB) GetOrder(symbol string, id int64, customOrderID string) (result Order, err error) + func (z *ZB) GetOrders(symbol string, tradeType int, pageIndex int) (result []Order, err error) + func (z *ZB) GetOrdersIgnoreTradeType(symbol string, pageIndex int, pageSize int) (result []Order, err error) + func (z *ZB) GetRepayments(loanRecordId string, pageIndex int, pageSize int) (result []Repayment, err error) + func (z *ZB) GetTicker(symbol string) (ticker Ticker, err error) + func (z *ZB) GetTrades(symbol string) (trades []Trade, err error) + func (z *ZB) GetUnfinishedOrdersIgnoreTradeType(symbol string, pageIndex int, pageSize int) (result []Order, err error) + func (z *ZB) HttpGet(reqUrl string, postData string, headers map[string]string, result interface{}) ([]byte, error) + func (z *ZB) HttpPost(reqUrl string, postData string, headers map[string]string, result interface{}) ([]byte, error) + func (z *ZB) NewHttpRequest(method string, reqUrl string, postData string, ...) ([]byte, error) + func (z *ZB) PlaceOrder(symbol string, price float64, amount float64, tradeType int, acctType int, ...) (result OrderResponse, err error) + func (z *ZB) PlaceOrderMore(symbol string, tradeParams [][]float64, tradeType int, acctType int) (result OrderMoreV2Response, err error) + func (z *ZB) Repay(loanRecordId string, repayAmount float64, repayType int) (result GeneralResult, err error) + func (z *ZB) SetProxy(proxyURL string) (err error)