okcoin

package
v0.0.0-...-3240a16 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OKCOIN_API_URL                 = "https://www.okcoin.com/api/v1/"
	OKCOIN_API_URL_CHINA           = "https://www.okcoin.cn/api/v1/"
	OKCOIN_API_VERSION             = "1"
	OKCOIN_WEBSOCKET_URL           = "wss://real.okcoin.com:10440/websocket/okcoinapi"
	OKCOIN_WEBSOCKET_URL_CHINA     = "wss://real.okcoin.cn:10440/websocket/okcoinapi"
	OKCOIN_TICKER                  = "ticker.do"
	OKCOIN_DEPTH                   = "depth.do"
	OKCOIN_TRADES                  = "trades.do"
	OKCOIN_KLINE                   = "kline.do"
	OKCOIN_USERINFO                = "userinfo.do"
	OKCOIN_TRADE                   = "trade.do"
	OKCOIN_TRADE_HISTORY           = "trade_history.do"
	OKCOIN_TRADE_BATCH             = "batch_trade.do"
	OKCOIN_ORDER_CANCEL            = "cancel_order.do"
	OKCOIN_ORDER_INFO              = "order_info.do"
	OKCOIN_ORDERS_INFO             = "orders_info.do"
	OKCOIN_ORDER_HISTORY           = "order_history.do"
	OKCOIN_WITHDRAW                = "withdraw.do"
	OKCOIN_WITHDRAW_CANCEL         = "cancel_withdraw.do"
	OKCOIN_WITHDRAW_INFO           = "withdraw_info.do"
	OKCOIN_ORDER_FEE               = "order_fee.do"
	OKCOIN_LEND_DEPTH              = "lend_depth.do"
	OKCOIN_BORROWS_INFO            = "borrows_info.do"
	OKCOIN_BORROW_MONEY            = "borrow_money.do"
	OKCOIN_BORROW_CANCEL           = "cancel_borrow.do"
	OKCOIN_BORROW_ORDER_INFO       = "borrow_order_info.do"
	OKCOIN_REPAYMENT               = "repayment.do"
	OKCOIN_UNREPAYMENTS_INFO       = "unrepayments_info.do"
	OKCOIN_ACCOUNT_RECORDS         = "account_records.do"
	OKCOIN_FUTURES_TICKER          = "future_ticker.do"
	OKCOIN_FUTURES_DEPTH           = "future_depth.do"
	OKCOIN_FUTURES_TRADES          = "future_trades.do"
	OKCOIN_FUTURES_INDEX           = "future_index.do"
	OKCOIN_EXCHANGE_RATE           = "exchange_rate.do"
	OKCOIN_FUTURES_ESTIMATED_PRICE = "future_estimated_price.do"
	OKCOIN_FUTURES_KLINE           = "future_kline.do"
	OKCOIN_FUTURES_HOLD_AMOUNT     = "future_hold_amount.do"
	OKCOIN_FUTURES_USERINFO        = "future_userinfo.do"
	OKCOIN_FUTURES_POSITION        = "future_position.do"
	OKCOIN_FUTURES_TRADE           = "future_trade.do"
	OKCOIN_FUTURES_TRADE_HISTORY   = "future_trades_history.do"
	OKCOIN_FUTURES_TRADE_BATCH     = "future_batch_trade.do"
	OKCOIN_FUTURES_CANCEL          = "future_cancel.do"
	OKCOIN_FUTURES_ORDER_INFO      = "future_order_info.do"
	OKCOIN_FUTURES_ORDERS_INFO     = "future_orders_info.do"
	OKCOIN_FUTURES_USERINFO_4FIX   = "future_userinfo_4fix.do"
	OKCOIN_FUTURES_POSITION_4FIX   = "future_position_4fix.do"
	OKCOIN_FUTURES_EXPLOSIVE       = "future_explosive.do"
	OKCOIN_FUTURES_DEVOLVE         = "future_devolve.do"
)
View Source
const (
	OKCOIN_WEBSOCKET_USD_REALTRADES       = "ok_usd_realtrades"
	OKCOIN_WEBSOCKET_CNY_REALTRADES       = "ok_cny_realtrades"
	OKCOIN_WEBSOCKET_SPOTUSD_TRADE        = "ok_spotusd_trade"
	OKCOIN_WEBSOCKET_SPOTCNY_TRADE        = "ok_spotcny_trade"
	OKCOIN_WEBSOCKET_SPOTUSD_CANCEL_ORDER = "ok_spotusd_cancel_order"
	OKCOIN_WEBSOCKET_SPOTCNY_CANCEL_ORDER = "ok_spotcny_cancel_order"
	OKCOIN_WEBSOCKET_SPOTUSD_USERINFO     = "ok_spotusd_userinfo"
	OKCOIN_WEBSOCKET_SPOTCNY_USERINFO     = "ok_spotcny_userinfo"
	OKCOIN_WEBSOCKET_SPOTUSD_ORDER_INFO   = "ok_spotusd_order_info"
	OKCOIN_WEBSOCKET_SPOTCNY_ORDER_INFO   = "ok_spotcny_order_info"
	OKCOIN_WEBSOCKET_FUTURES_TRADE        = "ok_futuresusd_trade"
	OKCOIN_WEBSOCKET_FUTURES_CANCEL_ORDER = "ok_futuresusd_cancel_order"
	OKCOIN_WEBSOCKET_FUTURES_REALTRADES   = "ok_usd_future_realtrades"
	OKCOIN_WEBSOCKET_FUTURES_USERINFO     = "ok_futureusd_userinfo"
	OKCOIN_WEBSOCKET_FUTURES_ORDER_INFO   = "ok_futureusd_order_info"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OKCoin

type OKCoin struct {
	exchange.Base
	RESTErrors      map[string]string
	WebsocketErrors map[string]string
	FuturesValues   []string
	WebsocketConn   *websocket.Conn
}

func (*OKCoin) AddChannel

func (o *OKCoin) AddChannel(channel string)

func (*OKCoin) AddChannelAuthenticated

func (o *OKCoin) AddChannelAuthenticated(channel string, values map[string]string)

func (*OKCoin) BatchTrade

func (o *OKCoin) BatchTrade(orderData string, symbol, orderType string) (OKCoinBatchTrade, error)

func (*OKCoin) Borrow

func (o *OKCoin) Borrow(symbol, days string, amount, rate float64) (int, error)

func (*OKCoin) CancelBorrow

func (o *OKCoin) CancelBorrow(symbol string, borrowID int64) (bool, error)

func (*OKCoin) CancelFuturesOrder

func (o *OKCoin) CancelFuturesOrder(orderID int64, symbol, contractType string)

func (*OKCoin) CancelOrder

func (o *OKCoin) CancelOrder(orderID []int64, symbol string) (OKCoinCancelOrderResponse, error)

func (*OKCoin) CancelWithdrawal

func (o *OKCoin) CancelWithdrawal(symbol string, withdrawalID int64) (int, error)

func (*OKCoin) ConvertToURLValues

func (o *OKCoin) ConvertToURLValues(values map[string]string) url.Values

func (*OKCoin) FuturesBatchTrade

func (o *OKCoin) FuturesBatchTrade(orderData, symbol, contractType string, leverage int64, orderType string)

func (*OKCoin) FuturesTrade

func (o *OKCoin) FuturesTrade(amount, price float64, matchPrice, leverage int64, symbol, contractType, orderType string)

func (*OKCoin) GetAccountRecords

func (o *OKCoin) GetAccountRecords(symbol string, recType, currentPage, pageLength int) ([]OKCoinAccountRecords, error)

func (*OKCoin) GetBorrowInfo

func (o *OKCoin) GetBorrowInfo(symbol string) (OKCoinBorrowInfo, error)

func (*OKCoin) GetBorrowOrderInfo

func (o *OKCoin) GetBorrowOrderInfo(borrowID int64) (OKCoinBorrowInfo, error)

func (*OKCoin) GetExchangeAccountInfo

func (o *OKCoin) GetExchangeAccountInfo() (exchange.AccountInfo, error)

GetExchangeAccountInfo retrieves balances for all enabled currencies for the OKCoin exchange

func (*OKCoin) GetFee

func (o *OKCoin) GetFee(maker bool) float64

func (*OKCoin) GetFutureOrdersInfo

func (o *OKCoin) GetFutureOrdersInfo(orderID int64, contractType, symbol string)

func (*OKCoin) GetFuturesDepth

func (o *OKCoin) GetFuturesDepth(symbol, contractType string, size int64, merge bool) (OKCoinOrderbook, error)

func (*OKCoin) GetFuturesEstimatedPrice

func (o *OKCoin) GetFuturesEstimatedPrice(symbol string) (float64, error)

func (*OKCoin) GetFuturesExchangeRate

func (o *OKCoin) GetFuturesExchangeRate() (float64, error)

func (*OKCoin) GetFuturesExplosive

func (o *OKCoin) GetFuturesExplosive(symbol, contractType string, status, currentPage, pageLength int64) ([]OKCoinFuturesExplosive, error)

func (*OKCoin) GetFuturesHoldAmount

func (o *OKCoin) GetFuturesHoldAmount(symbol, contractType string) ([]OKCoinFuturesHoldAmount, error)

func (*OKCoin) GetFuturesIndex

func (o *OKCoin) GetFuturesIndex(symbol string) (float64, error)

func (*OKCoin) GetFuturesKline

func (o *OKCoin) GetFuturesKline(symbol, klineType, contractType string, size, since int64) ([]interface{}, error)

func (*OKCoin) GetFuturesOrderInfo

func (o *OKCoin) GetFuturesOrderInfo(orderID, status, currentPage, pageLength int64, symbol, contractType string)

func (*OKCoin) GetFuturesPosition

func (o *OKCoin) GetFuturesPosition(symbol, contractType string)

func (*OKCoin) GetFuturesTicker

func (o *OKCoin) GetFuturesTicker(symbol, contractType string) (OKCoinFuturesTicker, error)

func (*OKCoin) GetFuturesTrades

func (o *OKCoin) GetFuturesTrades(symbol, contractType string) ([]OKCoinFuturesTrades, error)

func (*OKCoin) GetFuturesUserInfo

func (o *OKCoin) GetFuturesUserInfo()

func (*OKCoin) GetFuturesUserInfo4Fix

func (o *OKCoin) GetFuturesUserInfo4Fix()

func (*OKCoin) GetFuturesUserPosition4Fix

func (o *OKCoin) GetFuturesUserPosition4Fix(symbol, contractType string)

func (*OKCoin) GetKline

func (o *OKCoin) GetKline(symbol, klineType string, size, since int64) ([]interface{}, error)

func (*OKCoin) GetLendDepth

func (o *OKCoin) GetLendDepth(symbol string) ([]OKCoinLendDepth, error)

func (*OKCoin) GetOrderBook

func (o *OKCoin) GetOrderBook(symbol string, size int64, merge bool) (OKCoinOrderbook, error)

func (*OKCoin) GetOrderFeeInfo

func (o *OKCoin) GetOrderFeeInfo(symbol string, orderID int64) (OKCoinOrderFeeInfo, error)

func (*OKCoin) GetOrderHistory

func (o *OKCoin) GetOrderHistory(pageLength, currentPage int64, status, symbol string) (OKCoinOrderHistory, error)

func (*OKCoin) GetOrderInfo

func (o *OKCoin) GetOrderInfo(orderID int64, symbol string) ([]OKCoinOrderInfo, error)

func (*OKCoin) GetOrderInfoBatch

func (o *OKCoin) GetOrderInfoBatch(orderID []int64, symbol string) ([]OKCoinOrderInfo, error)

func (*OKCoin) GetOrderbookEx

func (o *OKCoin) GetOrderbookEx(currency pair.CurrencyPair, assetType string) (orderbook.Base, error)

GetOrderbookEx returns orderbook base on the currency pair

func (*OKCoin) GetRepaymentInfo

func (o *OKCoin) GetRepaymentInfo(borrowID int64) (bool, error)

func (*OKCoin) GetTicker

func (o *OKCoin) GetTicker(symbol string) (OKCoinTicker, error)

func (*OKCoin) GetTickerPrice

func (o *OKCoin) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)

GetTickerPrice returns the ticker for a currency pair

func (*OKCoin) GetTradeHistory

func (o *OKCoin) GetTradeHistory(symbol string, TradeID int64) ([]OKCoinTrades, error)

func (*OKCoin) GetTrades

func (o *OKCoin) GetTrades(symbol string, since int64) ([]OKCoinTrades, error)

func (*OKCoin) GetUnrepaymentsInfo

func (o *OKCoin) GetUnrepaymentsInfo(symbol string, currentPage, pageLength int) ([]OKCoinBorrowOrder, error)

func (*OKCoin) GetUserInfo

func (o *OKCoin) GetUserInfo() (OKCoinUserInfo, error)

func (*OKCoin) GetWithdrawalInfo

func (o *OKCoin) GetWithdrawalInfo(symbol string, withdrawalID int64) ([]OKCoinWithdrawInfo, error)

func (*OKCoin) PingHandler

func (o *OKCoin) PingHandler(message string) error

func (*OKCoin) RemoveChannel

func (o *OKCoin) RemoveChannel(channel string)

func (*OKCoin) RemoveChannelAuthenticated

func (o *OKCoin) RemoveChannelAuthenticated(conn *websocket.Conn, channel string, values map[string]string)

func (*OKCoin) Run

func (o *OKCoin) Run()

Run implements the OKCoin wrapper

func (*OKCoin) SendAuthenticatedHTTPRequest

func (o *OKCoin) SendAuthenticatedHTTPRequest(method string, v url.Values, result interface{}) (err error)

func (*OKCoin) SetDefaults

func (o *OKCoin) SetDefaults()

func (*OKCoin) SetErrorDefaults

func (o *OKCoin) SetErrorDefaults()

func (*OKCoin) SetWebsocketErrorDefaults

func (o *OKCoin) SetWebsocketErrorDefaults()

func (*OKCoin) Setup

func (o *OKCoin) Setup(exch config.ExchangeConfig)

func (*OKCoin) Start

func (o *OKCoin) Start()

Start starts the OKCoin go routine

func (*OKCoin) Trade

func (o *OKCoin) Trade(amount, price float64, symbol, orderType string) (int64, error)

func (*OKCoin) UpdateOrderbook

func (o *OKCoin) UpdateOrderbook(currency pair.CurrencyPair, assetType string) (orderbook.Base, error)

UpdateOrderbook updates and returns the orderbook for a currency pair

func (*OKCoin) UpdateTicker

func (o *OKCoin) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)

UpdateTicker updates and returns the ticker for a currency pair

func (*OKCoin) WebsocketClient

func (o *OKCoin) WebsocketClient()

func (*OKCoin) WebsocketFuturesCancel

func (o *OKCoin) WebsocketFuturesCancel(symbol, contractType string, orderID int64)

func (*OKCoin) WebsocketFuturesOrderInfo

func (o *OKCoin) WebsocketFuturesOrderInfo(symbol, contractType string, orderID int64, orderStatus, currentPage, pageLength int)

func (*OKCoin) WebsocketFuturesTrade

func (o *OKCoin) WebsocketFuturesTrade(symbol, contractType string, price, amount float64, orderType, matchPrice, leverage int)

func (*OKCoin) WebsocketSign

func (o *OKCoin) WebsocketSign(values map[string]string) string

func (*OKCoin) WebsocketSpotCancel

func (o *OKCoin) WebsocketSpotCancel(symbol string, orderID int64)

func (*OKCoin) WebsocketSpotOrderInfo

func (o *OKCoin) WebsocketSpotOrderInfo(symbol string, orderID int64)

func (*OKCoin) WebsocketSpotTrade

func (o *OKCoin) WebsocketSpotTrade(symbol, orderType string, price, amount float64)

func (*OKCoin) Withdrawal

func (o *OKCoin) Withdrawal(symbol string, fee float64, tradePWD, address string, amount float64) (int, error)

type OKCoinAccountRecords

type OKCoinAccountRecords struct {
	Records []OKCoinRecord `json:"records"`
	Symbol  string         `json:"symbol"`
}

type OKCoinBatchTrade

type OKCoinBatchTrade struct {
	OrderInfo []struct {
		OrderID   int64 `json:"order_id"`
		ErrorCode int64 `json:"error_code"`
	} `json:"order_info"`
	Result bool `json:"result"`
}

type OKCoinBorrowInfo

type OKCoinBorrowInfo struct {
	BorrowBTC        float64 `json:"borrow_btc"`
	BorrowLTC        float64 `json:"borrow_ltc"`
	BorrowCNY        float64 `json:"borrow_cny"`
	CanBorrow        float64 `json:"can_borrow"`
	InterestBTC      float64 `json:"interest_btc"`
	InterestLTC      float64 `json:"interest_ltc"`
	Result           bool    `json:"result"`
	DailyInterestBTC float64 `json:"today_interest_btc"`
	DailyInterestLTC float64 `json:"today_interest_ltc"`
	DailyInterestCNY float64 `json:"today_interest_cny"`
}

type OKCoinBorrowOrder

type OKCoinBorrowOrder struct {
	Amount      float64 `json:"amount"`
	BorrowDate  int64   `json:"borrow_date"`
	BorrowID    int64   `json:"borrow_id"`
	Days        int64   `json:"days"`
	TradeAmount float64 `json:"deal_amount"`
	Rate        float64 `json:"rate"`
	Status      int64   `json:"status"`
	Symbol      string  `json:"symbol"`
}

type OKCoinBorrowResponse

type OKCoinBorrowResponse struct {
	Result   bool `json:"result"`
	BorrowID int  `json:"borrow_id"`
}

type OKCoinCancelOrderResponse

type OKCoinCancelOrderResponse struct {
	Success string
	Error   string
}

type OKCoinFuturesExplosive

type OKCoinFuturesExplosive struct {
	Amount      float64 `json:"amount,string"`
	DateCreated string  `json:"create_date"`
	Loss        float64 `json:"loss,string"`
	Type        int64   `json:"type"`
}

type OKCoinFuturesHoldAmount

type OKCoinFuturesHoldAmount struct {
	Amount       float64 `json:"amount"`
	ContractName string  `json:"contract_name"`
}

type OKCoinFuturesOrder

type OKCoinFuturesOrder struct {
	Amount       float64 `json:"amount"`
	ContractName string  `json:"contract_name"`
	DateCreated  float64 `json:"create_date"`
	TradeAmount  float64 `json:"deal_amount"`
	Fee          float64 `json:"fee"`
	LeverageRate float64 `json:"lever_rate"`
	OrderID      int64   `json:"order_id"`
	Price        float64 `json:"price"`
	AvgPrice     float64 `json:"avg_price"`
	Status       float64 `json:"status"`
	Symbol       string  `json:"symbol"`
	Type         int64   `json:"type"`
	UnitAmount   int64   `json:"unit_amount"`
}

type OKCoinFuturesTicker

type OKCoinFuturesTicker struct {
	Last        float64
	Buy         float64
	Sell        float64
	High        float64
	Low         float64
	Vol         float64
	Contract_ID int64
	Unit_Amount float64
}

type OKCoinFuturesTickerResponse

type OKCoinFuturesTickerResponse struct {
	Date   string
	Ticker OKCoinFuturesTicker
}

type OKCoinFuturesTrades

type OKCoinFuturesTrades struct {
	Amount  float64 `json:"amount"`
	Date    int64   `json:"date"`
	DateMS  int64   `json:"date_ms"`
	Price   float64 `json:"price"`
	TradeID int64   `json:"tid"`
	Type    string  `json:"type"`
}

type OKCoinLendDepth

type OKCoinLendDepth struct {
	Amount float64 `json:"amount"`
	Days   string  `json:"days"`
	Num    int64   `json:"num"`
	Rate   float64 `json:"rate,string"`
}

type OKCoinOrderFeeInfo

type OKCoinOrderFeeInfo struct {
	Fee     float64 `json:"fee,string"`
	OrderID int64   `json:"order_id"`
	Type    string  `json:"type"`
}

type OKCoinOrderHistory

type OKCoinOrderHistory struct {
	CurrentPage int               `json:"current_page"`
	Orders      []OKCoinOrderInfo `json:"orders"`
	PageLength  int               `json:"page_length"`
	Result      bool              `json:"result"`
	Total       int               `json:"total"`
}

type OKCoinOrderInfo

type OKCoinOrderInfo struct {
	Amount     float64 `json:"amount"`
	AvgPrice   float64 `json:"avg_price"`
	Created    int64   `json:"create_date"`
	DealAmount float64 `json:"deal_amount"`
	OrderID    int64   `json:"order_id"`
	OrdersID   int64   `json:"orders_id"`
	Price      float64 `json:"price"`
	Status     int     `json:"status"`
	Symbol     string  `json:"symbol"`
	Type       string  `json:"type"`
}

type OKCoinOrderbook

type OKCoinOrderbook struct {
	Asks [][]float64 `json:"asks"`
	Bids [][]float64 `json:"bids"`
}

type OKCoinRecord

type OKCoinRecord struct {
	Address            string  `json:"addr"`
	Account            int64   `json:"account,string"`
	Amount             float64 `json:"amount"`
	Bank               string  `json:"bank"`
	BenificiaryAddress string  `json:"benificiary_addr"`
	TransactionValue   float64 `json:"transaction_value"`
	Fee                float64 `json:"fee"`
	Date               float64 `json:"date"`
}

type OKCoinTicker

type OKCoinTicker struct {
	Buy  float64 `json:",string"`
	High float64 `json:",string"`
	Last float64 `json:",string"`
	Low  float64 `json:",string"`
	Sell float64 `json:",string"`
	Vol  float64 `json:",string"`
}

type OKCoinTickerResponse

type OKCoinTickerResponse struct {
	Date   string
	Ticker OKCoinTicker
}

type OKCoinTrades

type OKCoinTrades struct {
	Amount  float64 `json:"amount,string"`
	Date    int64   `json:"date"`
	DateMS  int64   `json:"date_ms"`
	Price   float64 `json:"price,string"`
	TradeID int64   `json:"tid"`
	Type    string  `json:"type"`
}

type OKCoinUserInfo

type OKCoinUserInfo struct {
	Info struct {
		Funds struct {
			Asset struct {
				Net   float64 `json:"net,string"`
				Total float64 `json:"total,string"`
			} `json:"asset"`
			Borrow struct {
				BTC float64 `json:"btc,string"`
				LTC float64 `json:"ltc,string"`
				USD float64 `json:"usd,string"`
				CNY float64 `json:"cny,string"`
			} `json:"borrow"`
			Free struct {
				BTC float64 `json:"btc,string"`
				LTC float64 `json:"ltc,string"`
				USD float64 `json:"usd,string"`
				CNY float64 `json:"cny,string"`
			} `json:"free"`
			Freezed struct {
				BTC float64 `json:"btc,string"`
				LTC float64 `json:"ltc,string"`
				USD float64 `json:"usd,string"`
				CNY float64 `json:"cny,string"`
			} `json:"freezed"`
			UnionFund struct {
				BTC float64 `json:"btc,string"`
				LTC float64 `json:"ltc,string"`
			} `json:"union_fund"`
		} `json:"funds"`
	} `json:"info"`
	Result bool `json:"result"`
}

type OKCoinWebsocketEvent

type OKCoinWebsocketEvent struct {
	Event   string `json:"event"`
	Channel string `json:"channel"`
}

type OKCoinWebsocketEventAuth

type OKCoinWebsocketEventAuth struct {
	Event      string            `json:"event"`
	Channel    string            `json:"channel"`
	Parameters map[string]string `json:"parameters"`
}

type OKCoinWebsocketEventAuthRemove

type OKCoinWebsocketEventAuthRemove struct {
	Event      string            `json:"event"`
	Channel    string            `json:"channel"`
	Parameters map[string]string `json:"parameters"`
}

type OKCoinWebsocketFutureIndex

type OKCoinWebsocketFutureIndex struct {
	FutureIndex float64 `json:"futureIndex"`
	Timestamp   int64   `json:"timestamp,string"`
}

type OKCoinWebsocketFuturesContract

type OKCoinWebsocketFuturesContract struct {
	Available    float64 `json:"available"`
	Balance      float64 `json:"balance"`
	Bond         float64 `json:"bond"`
	ContractID   float64 `json:"contract_id"`
	ContractType string  `json:"contract_type"`
	Frozen       float64 `json:"freeze"`
	Profit       float64 `json:"profit"`
	Loss         float64 `json:"unprofit"`
}

type OKCoinWebsocketFuturesOrder

type OKCoinWebsocketFuturesOrder struct {
	Amount         float64 `json:"amount"`
	ContractName   string  `json:"contract_name"`
	DateCreated    float64 `json:"createdDate"`
	TradeAmount    float64 `json:"deal_amount"`
	Fee            float64 `json:"fee"`
	LeverageAmount int     `json:"lever_rate"`
	OrderID        float64 `json:"order_id"`
	Price          float64 `json:"price"`
	AvgPrice       float64 `json:"avg_price"`
	Status         int     `json:"status"`
	Symbol         string  `json:"symbol"`
	TradeType      int     `json:"type"`
	UnitAmount     float64 `json:"unit_amount"`
}

type OKCoinWebsocketFuturesRealtrades

type OKCoinWebsocketFuturesRealtrades struct {
	Amount         float64 `json:"amount,string"`
	ContractID     float64 `json:"contract_id,string"`
	ContractName   string  `json:"contract_name"`
	ContractType   string  `json:"contract_type"`
	TradeAmount    float64 `json:"deal_amount,string"`
	Fee            float64 `json:"fee,string"`
	OrderID        float64 `json:"orderid"`
	Price          float64 `json:"price,string"`
	AvgPrice       float64 `json:"price_avg,string"`
	Status         int     `json:"status,string"`
	TradeType      int     `json:"type,string"`
	UnitAmount     float64 `json:"unit_amount,string"`
	LeverageAmount int     `json:"lever_rate,string"`
}

type OKCoinWebsocketFuturesTicker

type OKCoinWebsocketFuturesTicker struct {
	Buy        float64 `json:"buy"`
	ContractID string  `json:"contractId"`
	High       float64 `json:"high"`
	HoldAmount float64 `json:"hold_amount"`
	Last       float64 `json:"last,string"`
	Low        float64 `json:"low"`
	Sell       float64 `json:"sell"`
	UnitAmount float64 `json:"unitAmount"`
	Volume     float64 `json:"vol,string"`
}

type OKCoinWebsocketFuturesUserInfo

type OKCoinWebsocketFuturesUserInfo struct {
	Info struct {
		BTC struct {
			Balance   float64                          `json:"balance"`
			Contracts []OKCoinWebsocketFuturesContract `json:"contracts"`
			Rights    float64                          `json:"rights"`
		} `json:"btc"`
		LTC struct {
			Balance   float64                          `json:"balance"`
			Contracts []OKCoinWebsocketFuturesContract `json:"contracts"`
			Rights    float64                          `json:"rights"`
		} `json:"ltc"`
	} `json:"info"`
	Result bool `json:"result"`
}

type OKCoinWebsocketOrder

type OKCoinWebsocketOrder struct {
	Amount      float64 `json:"amount"`
	AvgPrice    float64 `json:"avg_price"`
	DateCreated float64 `json:"create_date"`
	TradeAmount float64 `json:"deal_amount"`
	OrderID     float64 `json:"order_id"`
	OrdersID    float64 `json:"orders_id"`
	Price       float64 `json:"price"`
	Status      int64   `json:"status"`
	Symbol      string  `json:"symbol"`
	OrderType   string  `json:"type"`
}

type OKCoinWebsocketOrderbook

type OKCoinWebsocketOrderbook struct {
	Asks      [][]float64 `json:"asks"`
	Bids      [][]float64 `json:"bids"`
	Timestamp int64       `json:"timestamp,string"`
}

type OKCoinWebsocketRealtrades

type OKCoinWebsocketRealtrades struct {
	AveragePrice         float64 `json:"averagePrice,string"`
	CompletedTradeAmount float64 `json:"completedTradeAmount,string"`
	DateCreated          float64 `json:"createdDate"`
	ID                   float64 `json:"id"`
	OrderID              float64 `json:"orderId"`
	SigTradeAmount       float64 `json:"sigTradeAmount,string"`
	SigTradePrice        float64 `json:"sigTradePrice,string"`
	Status               int64   `json:"status"`
	Symbol               string  `json:"symbol"`
	TradeAmount          float64 `json:"tradeAmount,string"`
	TradePrice           float64 `json:"buy,string"`
	TradeType            string  `json:"tradeType"`
	TradeUnitPrice       float64 `json:"tradeUnitPrice,string"`
	UnTrade              float64 `json:"unTrade,string"`
}

type OKCoinWebsocketResponse

type OKCoinWebsocketResponse struct {
	Channel string      `json:"channel"`
	Data    interface{} `json:"data"`
}

type OKCoinWebsocketTicker

type OKCoinWebsocketTicker struct {
	Timestamp float64
	Vol       string
	Buy       float64
	High      float64
	Last      float64
	Low       float64
	Sell      float64
}

type OKCoinWebsocketTradeOrderResponse

type OKCoinWebsocketTradeOrderResponse struct {
	OrderID int64 `json:"order_id,string"`
	Result  bool  `json:"result,string"`
}

type OKCoinWebsocketUserinfo

type OKCoinWebsocketUserinfo struct {
	Info struct {
		Funds struct {
			Asset struct {
				Net   float64 `json:"net,string"`
				Total float64 `json:"total,string"`
			} `json:"asset"`
			Free struct {
				BTC float64 `json:"btc,string"`
				LTC float64 `json:"ltc,string"`
				USD float64 `json:"usd,string"`
				CNY float64 `json:"cny,string"`
			} `json:"free"`
			Frozen struct {
				BTC float64 `json:"btc,string"`
				LTC float64 `json:"ltc,string"`
				USD float64 `json:"usd,string"`
				CNY float64 `json:"cny,string"`
			} `json:"freezed"`
		} `json:"funds"`
	} `json:"info"`
	Result bool `json:"result"`
}

type OKCoinWithdrawInfo

type OKCoinWithdrawInfo struct {
	Address    string  `json:"address"`
	Amount     float64 `json:"amount"`
	Created    int64   `json:"created_date"`
	ChargeFee  float64 `json:"chargefee"`
	Status     int     `json:"status"`
	WithdrawID int64   `json:"withdraw_id"`
}

type OKCoinWithdrawalResponse

type OKCoinWithdrawalResponse struct {
	WithdrawID int  `json:"withdraw_id"`
	Result     bool `json:"result"`
}

Jump to

Keyboard shortcuts

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