Documentation ¶
Index ¶
- Constants
- func NewSpotAPI(client *http.Client, apiKey, secretKey, apiPass string) SpotAPI
- func NewSpotWebsocket(wsURL, proxyURL string) (sw SpotWebsocket, err error)
- type OKExSpot
- func (ok *OKExSpot) BatchPlaceOrders(orders []Order) ([]placeOrderResponse, error)
- func (ok *OKExSpot) Cancel(orderId string, pair CurrencyPair) (bool, error)
- func (ok *OKExSpot) GetAccount() (*Account, error)
- func (ok *OKExSpot) GetAllCurrencyPair() (map[string]SymbolSetting, error)
- func (ok *OKExSpot) GetAllCurrencyStatus() (all map[string]CurrencyStatus, err error)
- func (ok *OKExSpot) GetAllTicker() ([]Ticker, error)
- func (ok *OKExSpot) GetCurrencyStatus(currency Currency) (CurrencyStatus, error)
- func (ok *OKExSpot) GetDepth(pair CurrencyPair, size int, step int) (*Depth, error)
- func (ok *OKExSpot) GetExchangeName() string
- func (ok *OKExSpot) GetFinishedOrders(pair CurrencyPair) ([]Order, error)
- func (ok *OKExSpot) GetKlineRecords(pair CurrencyPair, period KlinePeriod, size, since int) ([]Kline, error)
- func (ok *OKExSpot) GetOrder(orderId string, pair CurrencyPair) (*Order, error)
- func (ok *OKExSpot) GetOrderDeal(orderId string, pair CurrencyPair) ([]OrderDeal, error)
- func (ok *OKExSpot) GetPendingOrders(pair CurrencyPair) ([]Order, error)
- func (ok *OKExSpot) GetTicker(pair CurrencyPair) (*Ticker, error)
- func (ok *OKExSpot) GetTradeFee() (tf *TradeFee, err error)
- func (ok *OKExSpot) GetTrades(pair CurrencyPair, size int) ([]Trade, error)
- func (ok *OKExSpot) GetURL() string
- func (ok *OKExSpot) GetUserTrades(currencyPair CurrencyPair) ([]Trade, error)
- func (ok *OKExSpot) LimitBuy(pair CurrencyPair, price, amount string) (*Order, error)
- func (ok *OKExSpot) LimitSell(pair CurrencyPair, price, amount string) (*Order, error)
- func (ok *OKExSpot) MarketBuy(pair CurrencyPair, amount string) (*Order, error)
- func (ok *OKExSpot) MarketSell(pair CurrencyPair, amount string) (*Order, error)
- func (ok *OKExSpot) SetURL(exurl string)
- type OkexSpotWs
- func (ws *OkexSpotWs) FormatTopicName(topic string, pair CurrencyPair) string
- func (ws *OkexSpotWs) FormatTopicSubData(topic string, pair CurrencyPair) []byte
- func (ws *OkexSpotWs) FormatTopicUnsubData(topic string, pair CurrencyPair) []byte
- func (ws *OkexSpotWs) GetExchangeName() string
- func (ws *OkexSpotWs) OnMessage(data []byte) (err error)
- type TradeFee
Constants ¶
View Source
const ( /* http headers */ OK_ACCESS_KEY = "OK-ACCESS-KEY" OK_ACCESS_SIGN = "OK-ACCESS-SIGN" OK_ACCESS_TIMESTAMP = "OK-ACCESS-TIMESTAMP" OK_ACCESS_PASSPHRASE = "OK-ACCESS-PASSPHRASE" /** paging params */ OK_FROM = "OK-FROM" OK_TO = "OK-TO" OK_LIMIT = "OK-LIMIT" CONTENT_TYPE = "Content-Type" ACCEPT = "Accept" COOKIE = "Cookie" LOCALE = "locale=" APPLICATION_JSON = "application/json" APPLICATION_JSON_UTF8 = "application/json; charset=UTF-8" /* i18n: internationalization */ ENGLISH = "en_US" SIMPLIFIED_CHINESE = "zh_CN" //zh_TW || zh_HK TRADITIONAL_CHINESE = "zh_HK" /* http methods */ GET = "GET" POST = "POST" DELETE = "DELETE" /* others */ ResultDataJsonString = "resultDataJsonString" ResultPageJsonString = "resultPageJsonString" BTC_USD_SWAP = "BTC-USD-SWAP" LTC_USD_SWAP = "LTC-USD-SWAP" ETH_USD_SWAP = "ETH-USD-SWAP" ETC_USD_SWAP = "ETC-USD-SWAP" BCH_USD_SWAP = "BCH-USD-SWAP" BSV_USD_SWAP = "BSV-USD-SWAP" EOS_USD_SWAP = "EOS-USD-SWAP" XRP_USD_SWAP = "XRP-USD-SWAP" /*Rest Endpoint*/ Endpoint = "https://www.okex.com" GET_ACCOUNTS = "/api/swap/v3/accounts" PLACE_ORDER = "/api/swap/v3/order" CANCEL_ORDER = "/api/swap/v3/cancel_order/%s/%s" GET_ORDER = "/api/swap/v3/orders/%s/%s" GET_POSITION = "/api/swap/v3/%s/position" GET_DEPTH = "/api/swap/v3/instruments/%s/depth?size=%d" GET_TICKER = "/api/swap/v3/instruments/%s/ticker" GET_ALL_TICKER = "/api/swap/v3/instruments/ticker" GET_UNFINISHED_ORDERS = "/api/swap/v3/orders/%s?status=%d&limit=%d" )
Variables ¶
This section is empty.
Functions ¶
func NewSpotAPI ¶
func NewSpotWebsocket ¶
Types ¶
type OKExSpot ¶
type OKExSpot struct { HttpClient *http.Client Endpoint string ApiKey string ApiSecretKey string ApiPassphrase string //for okex.com v3 api }
func (*OKExSpot) BatchPlaceOrders ¶
* Must Set Client Oid
func (*OKExSpot) GetAccount ¶
func (*OKExSpot) GetAllCurrencyPair ¶
func (*OKExSpot) GetAllCurrencyStatus ¶
func (*OKExSpot) GetAllTicker ¶
func (*OKExSpot) GetCurrencyStatus ¶
func (*OKExSpot) GetExchangeName ¶
func (*OKExSpot) GetFinishedOrders ¶
func (*OKExSpot) GetKlineRecords ¶
func (*OKExSpot) GetOrderDeal ¶
func (*OKExSpot) GetPendingOrders ¶
func (*OKExSpot) GetTradeFee ¶
func (*OKExSpot) GetUserTrades ¶
func (*OKExSpot) MarketSell ¶
type OkexSpotWs ¶
type OkexSpotWs struct {
SpotWsBase
}
func (*OkexSpotWs) FormatTopicName ¶
func (ws *OkexSpotWs) FormatTopicName(topic string, pair CurrencyPair) string
格式化流名称
func (*OkexSpotWs) FormatTopicSubData ¶
func (ws *OkexSpotWs) FormatTopicSubData(topic string, pair CurrencyPair) []byte
格式化流订阅消息
func (*OkexSpotWs) FormatTopicUnsubData ¶
func (ws *OkexSpotWs) FormatTopicUnsubData(topic string, pair CurrencyPair) []byte
格式化流取消订阅消息
func (*OkexSpotWs) GetExchangeName ¶
func (ws *OkexSpotWs) GetExchangeName() string
func (*OkexSpotWs) OnMessage ¶
func (ws *OkexSpotWs) OnMessage(data []byte) (err error)
Click to show internal directories.
Click to hide internal directories.