Versions in this module Expand all Collapse all v1 v1.1.3 Jan 15, 2020 v1.0.4 Aug 27, 2019 Changes in this version + const EXCHANGE_NAME_COM + const FUTURE_API_BASE_URL + const FUTURE_CANCEL_URI + const FUTURE_DEPTH_URI + const FUTURE_ESTIMATED_PRICE + const FUTURE_INDEX_PRICE + const FUTURE_ORDERS_INFO_URI + const FUTURE_ORDER_INFO_URI + const FUTURE_POSITION_URI + const FUTURE_TICKER_URI + const FUTURE_TRADE_URI + const FUTURE_USERINFO_URI + const TRADES_URI + const V3_EXCHANGE_RATE_URI + const V3_FUTRUR_INSTRUMENTS_URL + const V3_FUTURE_API_BASE_URL + const V3_FUTURE_CANCEL_URI + const V3_FUTURE_DEPTH_URI + const V3_FUTURE_ESTIMATED_PRICE + const V3_FUTURE_FILLS_URI + const V3_FUTURE_HOST_URL + const V3_FUTURE_INDEX_PRICE + const V3_FUTURE_ORDERS_INFO_URI + const V3_FUTURE_ORDER_INFO_URI + const V3_FUTURE_ORDER_URI + const V3_FUTURE_POSITION_URI + const V3_FUTURE_TICKER_URI + const V3_FUTURE_TRADES_URI + const V3_FUTURE_USERINFOS_URI + const V3_GET_KLINE_URI + const V3_SWAP_API_BASE_URL + const V3_SWAP_DEPTH_URI + var KlineTypeSecondsMap = map[int]int + var OKEX_MARGIN_MODE_CROSSED = "crossed" + var OKEX_MARGIN_MODE_FIXED = "fixed" + var OKexOrderTypeMap = map[int]int + type AddChannelData struct + Channel string + Result bool + type DepthData struct + Asks [][]string + Bids [][]string + Timestamp int64 + type IContractIDProvider interface + GetContractID func(CurrencyPair, string) (string, error) + ParseContractID func(string) (CurrencyPair, string, error) + type KlineData [][]string + type OKCoinCN_API struct + func NewOKCoinCn(client *http.Client, api_key, secret_key string) *OKCoinCN_API + func (ctx *OKCoinCN_API) CancelOrder(orderId string, currency CurrencyPair) (bool, error) + func (ctx *OKCoinCN_API) GetAccount() (*Account, error) + func (ctx *OKCoinCN_API) GetDepth(size int, currency CurrencyPair) (*Depth, error) + func (ctx *OKCoinCN_API) GetExchangeName() string + func (ctx *OKCoinCN_API) GetKlineRecords(currency CurrencyPair, period, size, since int) ([]Kline, error) + func (ctx *OKCoinCN_API) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error) + func (ctx *OKCoinCN_API) GetOrderHistorys(currency CurrencyPair, currentPage, pageSize int) ([]Order, error) + func (ctx *OKCoinCN_API) GetTicker(currency CurrencyPair) (*Ticker, error) + func (ctx *OKCoinCN_API) GetUnfinishOrders(currency CurrencyPair) ([]Order, error) + func (ctx *OKCoinCN_API) LimitBuy(amount, price string, currency CurrencyPair) (*Order, error) + func (ctx *OKCoinCN_API) LimitSell(amount, price string, currency CurrencyPair) (*Order, error) + func (ctx *OKCoinCN_API) MarketBuy(amount, price string, currency CurrencyPair) (*Order, error) + func (ctx *OKCoinCN_API) MarketSell(amount, price string, currency CurrencyPair) (*Order, error) + func (ok *OKCoinCN_API) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error) + type OKCoinCOM_API struct + func NewCOM(client *http.Client, api_key, secret_key string) *OKCoinCOM_API + func (ctx *OKCoinCOM_API) GetAccount() (*Account, error) + func (ctx *OKCoinCOM_API) GetExchangeName() string + type OKEx struct + func NewOKEx(client *http.Client, api_key, secret_key string) *OKEx + func (ok *OKEx) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, error) + func (ok *OKEx) GetContractValue(currencyPair CurrencyPair) (float64, error) + func (ok *OKEx) GetDeliveryTime() (int, int, int, int) + func (ok *OKEx) GetExchangeName() string + func (ok *OKEx) GetExchangeRate() (float64, error) + func (ok *OKEx) GetFee() (float64, error) + func (ok *OKEx) GetFutureDepth(currencyPair CurrencyPair, contractType string, size int) (*Depth, error) + func (ok *OKEx) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error) + func (ok *OKEx) GetFutureIndex(currencyPair CurrencyPair) (float64, error) + func (ok *OKEx) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error) + func (ok *OKEx) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (ok *OKEx) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error) + func (ok *OKEx) GetFutureTicker(currencyPair CurrencyPair, contractType string) (*Ticker, error) + func (ok *OKEx) GetFutureUserinfo() (*FutureAccount, error) + func (ok *OKEx) GetKlineRecords(contract_type string, currencyPair CurrencyPair, period, size, since int) ([]FutureKline, error) + func (ok *OKEx) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (ok *OKEx) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error) + func (okFuture *OKEx) GetTrades(contract_type string, currencyPair CurrencyPair, since int64) ([]Trade, error) + type OKExFutureWs struct + func NewOKExFutureWs() *OKExFutureWs + func (okWs *OKExFutureWs) SetCallbacks(tickerCallback func(*FutureTicker), depthCallback func(*Depth), ...) + func (okWs *OKExFutureWs) SubscribeDepth(pair CurrencyPair, contract string, size int) error + func (okWs *OKExFutureWs) SubscribeTicker(pair CurrencyPair, contract string) error + func (okWs *OKExFutureWs) SubscribeTrade(pair CurrencyPair, contract string) error + type OKExSpot struct + func NewOKExSpot(client *http.Client, accesskey, secretkey string) *OKExSpot + func (ctx *OKExSpot) GetAccount() (*Account, error) + func (ctx *OKExSpot) GetExchangeName() string + type OKExSpotWs struct + func NewOKExSpotWs() *OKExSpotWs + func (okWs *OKExSpotWs) SetCallbacks(tickerCallback func(*Ticker), depthCallback func(*Depth), ...) + func (okWs *OKExSpotWs) SubscribeDepth(pair CurrencyPair, size int) error + func (okWs *OKExSpotWs) SubscribeKline(pair CurrencyPair, period int) error + func (okWs *OKExSpotWs) SubscribeTicker(pair CurrencyPair) error + func (okWs *OKExSpotWs) SubscribeTrade(pair CurrencyPair) error + type OKExV3 struct + func NewOKExV3(client *http.Client, api_key, secret_key, passphrase, endpoint string) *OKExV3 + func (okv3 *OKExV3) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderID string) (bool, error) + func (okv3 *OKExV3) GetContract(currencyPair CurrencyPair, contractType string) (*futureContract, error) + func (okv3 *OKExV3) GetContractID(currencyPair CurrencyPair, contractType string) (string, error) + func (okv3 *OKExV3) GetContractValue(currencyPair CurrencyPair) (float64, error) + func (okv3 *OKExV3) GetDeliveryTime() (int, int, int, int) + func (okv3 *OKExV3) GetExchangeName() string + func (okv3 *OKExV3) GetFee() (float64, error) + func (okv3 *OKExV3) GetFinishedFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (okv3 *OKExV3) GetFinishedFutureOrdersByIDs(orderIDs []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (okv3 *OKExV3) GetFutureDepth(currencyPair CurrencyPair, contractType string, size int) (*Depth, error) + func (okv3 *OKExV3) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error) + func (okv3 *OKExV3) GetFutureIndex(currencyPair CurrencyPair) (float64, error) + func (okv3 *OKExV3) GetFutureOrder(orderID string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error) + func (okv3 *OKExV3) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (okv3 *OKExV3) GetFutureOrdersByIDsAndState(orderIDs []string, state string, currencyPair CurrencyPair, ...) ([]FutureOrder, error) + func (okv3 *OKExV3) GetFutureOrdersByState(state string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (okv3 *OKExV3) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error) + func (okv3 *OKExV3) GetFutureTicker(currencyPair CurrencyPair, contractType string) (*Ticker, error) + func (okv3 *OKExV3) GetFutureUserinfo() (*FutureAccount, error) + func (okv3 *OKExV3) GetKlineRecords(contractType string, currencyPair CurrencyPair, period, size, since int) ([]FutureKline, error) + func (okv3 *OKExV3) GetTrades(contractType string, currencyPair CurrencyPair, since int64) ([]Trade, error) + func (okv3 *OKExV3) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (okv3 *OKExV3) GetUnfinishFutureOrdersByIDs(orderIDs []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (okv3 *OKExV3) GetUrlRoot() (url string) + func (okv3 *OKExV3) ParseContractID(contractID string) (CurrencyPair, string, error) + func (okv3 *OKExV3) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error) + func (okv3 *OKExV3) PlaceFutureOrder2(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error) + type OKExV3DataParser struct + func NewOKExV3DataParser(contractIDProvider IContractIDProvider) *OKExV3DataParser + func (okV3dp *OKExV3DataParser) ParseDepth(depth *Depth, data interface{}, size int) (*Depth, error) + func (okV3dp *OKExV3DataParser) ParseFutureOrder(data interface{}) (*FutureOrder, string, error) + func (okV3dp *OKExV3DataParser) ParseFutureTicker(data interface{}) (*FutureTicker, error) + func (okV3dp *OKExV3DataParser) ParseTrade(trade *Trade, contractType string, data interface{}) (*Trade, string, error) + type OKExV3FutureWs struct + func NewOKExV3FutureWs(contractIDProvider IContractIDProvider) *OKExV3FutureWs + func (okV3Ws *OKExV3FutureWs) DepthCallback(depthCallback func(*Depth)) *OKExV3FutureWs + func (okV3Ws *OKExV3FutureWs) Login(apiKey string, apiSecretKey string, passphrase string) error + func (okV3Ws *OKExV3FutureWs) OrderCallback(orderCallback func(*FutureOrder, string)) *OKExV3FutureWs + func (okV3Ws *OKExV3FutureWs) SetCallbacks(tickerCallback func(*FutureTicker), depthCallback func(*Depth), ...) + func (okV3Ws *OKExV3FutureWs) SubscribeDepth(currencyPair CurrencyPair, contractType string, size int) error + func (okV3Ws *OKExV3FutureWs) SubscribeKline(currencyPair CurrencyPair, contractType string, period int) error + func (okV3Ws *OKExV3FutureWs) SubscribeOrder(currencyPair CurrencyPair, contractType string) error + func (okV3Ws *OKExV3FutureWs) SubscribeTicker(currencyPair CurrencyPair, contractType string) error + func (okV3Ws *OKExV3FutureWs) SubscribeTrade(currencyPair CurrencyPair, contractType string) error + func (okV3Ws *OKExV3FutureWs) TickerCallback(tickerCallback func(*FutureTicker)) *OKExV3FutureWs + func (okV3Ws *OKExV3FutureWs) TradeCallback(tradeCallback func(*Trade, string)) *OKExV3FutureWs + type TickerData struct + Buy float64 + High float64 + Last float64 + Low float64 + Sell float64 + Timestamp int64 + Vol float64 + type TradeData [][]string + type WsBaseResp struct + Channel string + Data json.RawMessage