Documentation ¶
Index ¶
- type AccountRecords
- type BatchTrade
- type BorrowInfo
- type BorrowOrder
- type BorrowResponse
- type CancelOrderResponse
- type FuturesExplosive
- type FuturesHoldAmount
- type FuturesOrder
- type FuturesTicker
- type FuturesTickerResponse
- type FuturesTrades
- type LendDepth
- type OKCoin
- func (o *OKCoin) AddChannel(channel string)
- func (o *OKCoin) AddChannelAuthenticated(channel string, values map[string]string)
- func (o *OKCoin) BatchTrade(orderData string, symbol, orderType string) (BatchTrade, error)
- func (o *OKCoin) Borrow(symbol, days string, amount, rate float64) (int, error)
- func (o *OKCoin) CancelAllExchangeOrders() error
- func (o *OKCoin) CancelBorrow(symbol string, borrowID int64) (bool, error)
- func (o *OKCoin) CancelExchangeOrder(orderID int64) error
- func (o *OKCoin) CancelFuturesOrder(orderID int64, symbol, contractType string)
- func (o *OKCoin) CancelOrder(orderID []int64, symbol string) (CancelOrderResponse, error)
- func (o *OKCoin) CancelWithdrawal(symbol string, withdrawalID int64) (int, error)
- func (o *OKCoin) ConvertToURLValues(values map[string]string) url.Values
- func (o *OKCoin) FuturesBatchTrade(orderData, symbol, contractType string, leverage int64, orderType string)
- func (o *OKCoin) FuturesTrade(amount, price float64, matchPrice, leverage int64, ...)
- func (o *OKCoin) GetAccountRecords(symbol string, recType, currentPage, pageLength int) ([]AccountRecords, error)
- func (o *OKCoin) GetBorrowInfo(symbol string) (BorrowInfo, error)
- func (o *OKCoin) GetBorrowOrderInfo(borrowID int64) (BorrowInfo, error)
- func (o *OKCoin) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (o *OKCoin) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error)
- func (o *OKCoin) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error)
- func (o *OKCoin) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
- func (o *OKCoin) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error)
- func (o *OKCoin) GetFee(maker bool) float64
- func (o *OKCoin) GetFutureOrdersInfo(orderID int64, contractType, symbol string)
- func (o *OKCoin) GetFuturesDepth(symbol, contractType string, size int64, merge bool) (Orderbook, error)
- func (o *OKCoin) GetFuturesEstimatedPrice(symbol string) (float64, error)
- func (o *OKCoin) GetFuturesExchangeRate() (float64, error)
- func (o *OKCoin) GetFuturesExplosive(symbol, contractType string, status, currentPage, pageLength int64) ([]FuturesExplosive, error)
- func (o *OKCoin) GetFuturesHoldAmount(symbol, contractType string) ([]FuturesHoldAmount, error)
- func (o *OKCoin) GetFuturesIndex(symbol string) (float64, error)
- func (o *OKCoin) GetFuturesKline(symbol, klineType, contractType string, size, since int64) ([]interface{}, error)
- func (o *OKCoin) GetFuturesOrderInfo(orderID, status, currentPage, pageLength int64, symbol, contractType string)
- func (o *OKCoin) GetFuturesPosition(symbol, contractType string)
- func (o *OKCoin) GetFuturesTicker(symbol, contractType string) (FuturesTicker, error)
- func (o *OKCoin) GetFuturesTrades(symbol, contractType string) ([]FuturesTrades, error)
- func (o *OKCoin) GetFuturesUserInfo()
- func (o *OKCoin) GetFuturesUserInfo4Fix()
- func (o *OKCoin) GetFuturesUserPosition4Fix(symbol, contractType string)
- func (o *OKCoin) GetKline(symbol, klineType string, size, since int64) ([]interface{}, error)
- func (o *OKCoin) GetLendDepth(symbol string) ([]LendDepth, error)
- func (o *OKCoin) GetOrderBook(symbol string, size int64, merge bool) (Orderbook, error)
- func (o *OKCoin) GetOrderFeeInfo(symbol string, orderID int64) (OrderFeeInfo, error)
- func (o *OKCoin) GetOrderHistory(pageLength, currentPage int64, status, symbol string) (OrderHistory, error)
- func (o *OKCoin) GetOrderInfo(orderID int64, symbol string) ([]OrderInfo, error)
- func (o *OKCoin) GetOrderInfoBatch(orderID []int64, symbol string) ([]OrderInfo, error)
- func (o *OKCoin) GetOrderbookEx(currency pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (o *OKCoin) GetRepaymentInfo(borrowID int64) (bool, error)
- func (o *OKCoin) GetTicker(symbol string) (Ticker, error)
- func (o *OKCoin) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (o *OKCoin) GetTradeHistory(symbol string, TradeID int64) ([]Trades, error)
- func (o *OKCoin) GetTrades(symbol string, since int64) ([]Trades, error)
- func (o *OKCoin) GetUnrepaymentsInfo(symbol string, currentPage, pageLength int) ([]BorrowOrder, error)
- func (o *OKCoin) GetUserInfo() (UserInfo, error)
- func (o *OKCoin) GetWithdrawalInfo(symbol string, withdrawalID int64) ([]WithdrawInfo, error)
- func (o *OKCoin) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error)
- func (o *OKCoin) PingHandler(message string) error
- func (o *OKCoin) RemoveChannel(channel string)
- func (o *OKCoin) RemoveChannelAuthenticated(conn *websocket.Conn, channel string, values map[string]string)
- func (o *OKCoin) Run()
- func (o *OKCoin) SendAuthenticatedHTTPRequest(method string, v url.Values, result interface{}) (err error)
- func (o *OKCoin) SendHTTPRequest(path string, result interface{}) error
- func (o *OKCoin) SetDefaults()
- func (o *OKCoin) SetErrorDefaults()
- func (o *OKCoin) SetWebsocketErrorDefaults()
- func (o *OKCoin) Setup(exch config.ExchangeConfig)
- func (o *OKCoin) Start(wg *sync.WaitGroup)
- func (o *OKCoin) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, ...) (int64, error)
- func (o *OKCoin) Trade(amount, price float64, symbol, orderType string) (int64, error)
- func (o *OKCoin) UpdateOrderbook(currency pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (o *OKCoin) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (o *OKCoin) WebsocketClient()
- func (o *OKCoin) WebsocketFuturesCancel(symbol, contractType string, orderID int64)
- func (o *OKCoin) WebsocketFuturesOrderInfo(symbol, contractType string, orderID int64, ...)
- func (o *OKCoin) WebsocketFuturesTrade(symbol, contractType string, price, amount float64, ...)
- func (o *OKCoin) WebsocketSign(values map[string]string) string
- func (o *OKCoin) WebsocketSpotCancel(symbol string, orderID int64)
- func (o *OKCoin) WebsocketSpotOrderInfo(symbol string, orderID int64)
- func (o *OKCoin) WebsocketSpotTrade(symbol, orderType string, price, amount float64)
- func (o *OKCoin) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error)
- func (o *OKCoin) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error)
- func (o *OKCoin) WithdrawFiatExchangeFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error)
- func (o *OKCoin) Withdrawal(symbol string, fee float64, tradePWD, address string, amount float64) (int, error)
- type OrderFeeInfo
- type OrderHistory
- type OrderInfo
- type Orderbook
- type Record
- type Ticker
- type TickerResponse
- type Trades
- type UserInfo
- type WebsocketEvent
- type WebsocketEventAuth
- type WebsocketEventAuthRemove
- type WebsocketFutureIndex
- type WebsocketFuturesContract
- type WebsocketFuturesOrder
- type WebsocketFuturesRealtrades
- type WebsocketFuturesTicker
- type WebsocketFuturesUserInfo
- type WebsocketOrder
- type WebsocketOrderbook
- type WebsocketRealtrades
- type WebsocketResponse
- type WebsocketTicker
- type WebsocketTradeOrderResponse
- type WebsocketUserinfo
- type WithdrawInfo
- type WithdrawalResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountRecords ¶
AccountRecords holds account record data
type BatchTrade ¶
type BatchTrade struct { OrderInfo []struct { OrderID int64 `json:"order_id"` ErrorCode int64 `json:"error_code"` } `json:"order_info"` Result bool `json:"result"` }
BatchTrade holds data on a batch of trades
type BorrowInfo ¶
type BorrowInfo 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"` }
BorrowInfo holds borrowing amount data
type BorrowOrder ¶
type BorrowOrder 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"` }
BorrowOrder holds order data
type BorrowResponse ¶
BorrowResponse is a response type for borrow
type CancelOrderResponse ¶
CancelOrderResponse is a response type for a cancelled order
type FuturesExplosive ¶
type FuturesExplosive struct { Amount float64 `json:"amount,string"` DateCreated string `json:"create_date"` Loss float64 `json:"loss,string"` Type int64 `json:"type"` }
FuturesExplosive holds inforamtion about explosive futures
type FuturesHoldAmount ¶
type FuturesHoldAmount struct { Amount float64 `json:"amount"` ContractName string `json:"contract_name"` }
FuturesHoldAmount contains futures hold amount data
type FuturesOrder ¶
type FuturesOrder 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"` }
FuturesOrder holds information about a futures order
type FuturesTicker ¶
type FuturesTicker struct { Last float64 Buy float64 Sell float64 High float64 Low float64 Vol float64 ContractID int64 UnitAmount float64 }
FuturesTicker holds futures ticker data
type FuturesTickerResponse ¶
type FuturesTickerResponse struct { Date string Ticker FuturesTicker }
FuturesTickerResponse is a response type
type FuturesTrades ¶
type FuturesTrades 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"` }
FuturesTrades holds trade data for the futures market
type LendDepth ¶
type LendDepth struct { Amount float64 `json:"amount"` Days string `json:"days"` Num int64 `json:"num"` Rate float64 `json:"rate,string"` }
LendDepth hold lend depths
type OKCoin ¶
type OKCoin struct { exchange.Base RESTErrors map[string]string WebsocketErrors map[string]string FuturesValues []string WebsocketConn *websocket.Conn }
OKCoin is the overarching type across this package
func (*OKCoin) AddChannel ¶
AddChannel adds a new channel on the websocket client
func (*OKCoin) AddChannelAuthenticated ¶
AddChannelAuthenticated adds an authenticated channel on the websocket client
func (*OKCoin) BatchTrade ¶
func (o *OKCoin) BatchTrade(orderData string, symbol, orderType string) (BatchTrade, error)
BatchTrade initiates a trade by batch order
func (*OKCoin) CancelAllExchangeOrders ¶
CancelAllExchangeOrders cancels all orders associated with a currency pair
func (*OKCoin) CancelBorrow ¶
CancelBorrow cancels a borrow request
func (*OKCoin) CancelExchangeOrder ¶
CancelExchangeOrder cancels an order by its corresponding ID number
func (*OKCoin) CancelFuturesOrder ¶
CancelFuturesOrder cancels a futures contract order
func (*OKCoin) CancelOrder ¶
func (o *OKCoin) CancelOrder(orderID []int64, symbol string) (CancelOrderResponse, error)
CancelOrder cancels a specific order or list of orders by orderID
func (*OKCoin) CancelWithdrawal ¶
CancelWithdrawal cancels a withdrawal
func (*OKCoin) ConvertToURLValues ¶
ConvertToURLValues converts values to url.Values
func (*OKCoin) FuturesBatchTrade ¶
func (o *OKCoin) FuturesBatchTrade(orderData, symbol, contractType string, leverage int64, orderType string)
FuturesBatchTrade initiates a batch of futures contract trades
func (*OKCoin) FuturesTrade ¶
func (o *OKCoin) FuturesTrade(amount, price float64, matchPrice, leverage int64, symbol, contractType, orderType string)
FuturesTrade initiates a new futures trade
func (*OKCoin) GetAccountRecords ¶
func (o *OKCoin) GetAccountRecords(symbol string, recType, currentPage, pageLength int) ([]AccountRecords, error)
GetAccountRecords returns account records
func (*OKCoin) GetBorrowInfo ¶
func (o *OKCoin) GetBorrowInfo(symbol string) (BorrowInfo, error)
GetBorrowInfo returns borrow information
func (*OKCoin) GetBorrowOrderInfo ¶
func (o *OKCoin) GetBorrowOrderInfo(borrowID int64) (BorrowInfo, error)
GetBorrowOrderInfo returns information about a borrow order
func (*OKCoin) GetExchangeAccountInfo ¶
GetExchangeAccountInfo retrieves balances for all enabled currencies for the OKCoin exchange
func (*OKCoin) GetExchangeDepositAddress ¶
func (o *OKCoin) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error)
GetExchangeDepositAddress returns a deposit address for a specified currency
func (*OKCoin) GetExchangeFundTransferHistory ¶
GetExchangeFundTransferHistory returns funding history, deposits and withdrawals
func (*OKCoin) GetExchangeHistory ¶
func (o *OKCoin) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
func (*OKCoin) GetExchangeOrderInfo ¶
GetExchangeOrderInfo returns information on a current open order
func (*OKCoin) GetFutureOrdersInfo ¶
GetFutureOrdersInfo returns information on a range of futures orders
func (*OKCoin) GetFuturesDepth ¶
func (o *OKCoin) GetFuturesDepth(symbol, contractType string, size int64, merge bool) (Orderbook, error)
GetFuturesDepth returns current depth for the futures market
func (*OKCoin) GetFuturesEstimatedPrice ¶
GetFuturesEstimatedPrice returns a current estimated futures price for a currency
func (*OKCoin) GetFuturesExchangeRate ¶
GetFuturesExchangeRate returns the exchange rate for the futures market
func (*OKCoin) GetFuturesExplosive ¶
func (o *OKCoin) GetFuturesExplosive(symbol, contractType string, status, currentPage, pageLength int64) ([]FuturesExplosive, error)
GetFuturesExplosive returns the explosive for a futures contract
func (*OKCoin) GetFuturesHoldAmount ¶
func (o *OKCoin) GetFuturesHoldAmount(symbol, contractType string) ([]FuturesHoldAmount, error)
GetFuturesHoldAmount returns the hold amount for a futures trade
func (*OKCoin) GetFuturesIndex ¶
GetFuturesIndex returns an index for the futures market
func (*OKCoin) GetFuturesKline ¶
func (o *OKCoin) GetFuturesKline(symbol, klineType, contractType string, size, since int64) ([]interface{}, error)
GetFuturesKline returns kline data for a specific currency on the futures market
func (*OKCoin) GetFuturesOrderInfo ¶
func (o *OKCoin) GetFuturesOrderInfo(orderID, status, currentPage, pageLength int64, symbol, contractType string)
GetFuturesOrderInfo returns information on a specific futures contract order
func (*OKCoin) GetFuturesPosition ¶
GetFuturesPosition returns position on a futures contract
func (*OKCoin) GetFuturesTicker ¶
func (o *OKCoin) GetFuturesTicker(symbol, contractType string) (FuturesTicker, error)
GetFuturesTicker returns a current ticker for the futures market
func (*OKCoin) GetFuturesTrades ¶
func (o *OKCoin) GetFuturesTrades(symbol, contractType string) ([]FuturesTrades, error)
GetFuturesTrades returns historic trades for the futures market
func (*OKCoin) GetFuturesUserInfo ¶
func (o *OKCoin) GetFuturesUserInfo()
GetFuturesUserInfo returns information on a users futures
func (*OKCoin) GetFuturesUserInfo4Fix ¶
func (o *OKCoin) GetFuturesUserInfo4Fix()
GetFuturesUserInfo4Fix returns futures user info fix rate
func (*OKCoin) GetFuturesUserPosition4Fix ¶
GetFuturesUserPosition4Fix returns futures user info on a fixed position
func (*OKCoin) GetLendDepth ¶
GetLendDepth returns the depth of lends
func (*OKCoin) GetOrderBook ¶
GetOrderBook returns the current order book by size
func (*OKCoin) GetOrderFeeInfo ¶
func (o *OKCoin) GetOrderFeeInfo(symbol string, orderID int64) (OrderFeeInfo, error)
GetOrderFeeInfo returns order fee information
func (*OKCoin) GetOrderHistory ¶
func (o *OKCoin) GetOrderHistory(pageLength, currentPage int64, status, symbol string) (OrderHistory, error)
GetOrderHistory returns a history of orders
func (*OKCoin) GetOrderInfo ¶
GetOrderInfo returns order information by orderID
func (*OKCoin) GetOrderInfoBatch ¶
GetOrderInfoBatch returns order info on a batch of orders
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 ¶
GetRepaymentInfo returns information on a repayment
func (*OKCoin) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*OKCoin) GetTradeHistory ¶
GetTradeHistory returns client trade history
func (*OKCoin) GetUnrepaymentsInfo ¶
func (o *OKCoin) GetUnrepaymentsInfo(symbol string, currentPage, pageLength int) ([]BorrowOrder, error)
GetUnrepaymentsInfo returns information on an unrepayment
func (*OKCoin) GetUserInfo ¶
GetUserInfo returns user information associated with the calling APIkeys
func (*OKCoin) GetWithdrawalInfo ¶
func (o *OKCoin) GetWithdrawalInfo(symbol string, withdrawalID int64) ([]WithdrawInfo, error)
GetWithdrawalInfo returns withdrawal information
func (*OKCoin) ModifyExchangeOrder ¶
ModifyExchangeOrder will allow of changing orderbook placement and limit to market conversion
func (*OKCoin) PingHandler ¶
PingHandler handles the keep alive
func (*OKCoin) RemoveChannel ¶
RemoveChannel removes a channel on the websocket client
func (*OKCoin) RemoveChannelAuthenticated ¶
func (o *OKCoin) RemoveChannelAuthenticated(conn *websocket.Conn, channel string, values map[string]string)
RemoveChannelAuthenticated removes the added authenticated channel on the websocket client
func (*OKCoin) SendAuthenticatedHTTPRequest ¶
func (o *OKCoin) SendAuthenticatedHTTPRequest(method string, v url.Values, result interface{}) (err error)
SendAuthenticatedHTTPRequest sends an authenticated HTTP request
func (*OKCoin) SendHTTPRequest ¶
SendHTTPRequest sends an unauthenticated HTTP request
func (*OKCoin) SetDefaults ¶
func (o *OKCoin) SetDefaults()
SetDefaults sets current default values for this package
func (*OKCoin) SetErrorDefaults ¶
func (o *OKCoin) SetErrorDefaults()
SetErrorDefaults sets default error map
func (*OKCoin) SetWebsocketErrorDefaults ¶
func (o *OKCoin) SetWebsocketErrorDefaults()
SetWebsocketErrorDefaults sets default errors for websocket
func (*OKCoin) Setup ¶
func (o *OKCoin) Setup(exch config.ExchangeConfig)
Setup sets exchange configuration parameters
func (*OKCoin) SubmitExchangeOrder ¶
func (o *OKCoin) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error)
SubmitExchangeOrder submits a new order
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 ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*OKCoin) WebsocketClient ¶
func (o *OKCoin) WebsocketClient()
WebsocketClient starts a websocket client
func (*OKCoin) WebsocketFuturesCancel ¶
WebsocketFuturesCancel cancels a futures contract on the websocket client
func (*OKCoin) WebsocketFuturesOrderInfo ¶
func (o *OKCoin) WebsocketFuturesOrderInfo(symbol, contractType string, orderID int64, orderStatus, currentPage, pageLength int)
WebsocketFuturesOrderInfo requests futures order info on the websocket client
func (*OKCoin) WebsocketFuturesTrade ¶
func (o *OKCoin) WebsocketFuturesTrade(symbol, contractType string, price, amount float64, orderType, matchPrice, leverage int)
WebsocketFuturesTrade handles a futures trade on the websocket client
func (*OKCoin) WebsocketSign ¶
WebsocketSign signs values on the webcoket client
func (*OKCoin) WebsocketSpotCancel ¶
WebsocketSpotCancel cancels a spot trade on the websocket client
func (*OKCoin) WebsocketSpotOrderInfo ¶
WebsocketSpotOrderInfo request information on an order on the websocket client
func (*OKCoin) WebsocketSpotTrade ¶
WebsocketSpotTrade handles spot trade request on the websocket client
func (*OKCoin) WithdrawCryptoExchangeFunds ¶
func (o *OKCoin) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error)
WithdrawCryptoExchangeFunds returns a withdrawal ID when a withdrawal is submitted
func (*OKCoin) WithdrawFiatExchangeFunds ¶
func (o *OKCoin) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error)
WithdrawFiatExchangeFunds returns a withdrawal ID when a withdrawal is submitted
func (*OKCoin) WithdrawFiatExchangeFundsToInternationalBank ¶
func (o *OKCoin) WithdrawFiatExchangeFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error)
WithdrawFiatExchangeFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
type OrderFeeInfo ¶
type OrderFeeInfo struct { Fee float64 `json:"fee,string"` OrderID int64 `json:"order_id"` Type string `json:"type"` }
OrderFeeInfo holds data on order fees
type OrderHistory ¶
type OrderHistory struct { CurrentPage int `json:"current_page"` Orders []OrderInfo `json:"orders"` PageLength int `json:"page_length"` Result bool `json:"result"` Total int `json:"total"` }
OrderHistory holds information on order history
type OrderInfo ¶
type OrderInfo 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"` }
OrderInfo holds data on an order
type Record ¶
type Record 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"` }
Record hold record data
type Ticker ¶
type Ticker 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"` }
Ticker holds ticker data
type TickerResponse ¶
TickerResponse is the response type for ticker
type Trades ¶
type Trades 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"` }
Trades holds trade data
type UserInfo ¶
type UserInfo 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"` }
UserInfo holds user account details
type WebsocketEvent ¶
WebsocketEvent holds websocket events
type WebsocketEventAuth ¶
type WebsocketEventAuth struct { Event string `json:"event"` Channel string `json:"channel"` Parameters map[string]string `json:"parameters"` }
WebsocketEventAuth holds websocket authenticated events
type WebsocketEventAuthRemove ¶
type WebsocketEventAuthRemove struct { Event string `json:"event"` Channel string `json:"channel"` Parameters map[string]string `json:"parameters"` }
WebsocketEventAuthRemove holds websocket remove authenticated events
type WebsocketFutureIndex ¶
type WebsocketFutureIndex struct { FutureIndex float64 `json:"futureIndex"` Timestamp int64 `json:"timestamp,string"` }
WebsocketFutureIndex holds future index data for websocket
type WebsocketFuturesContract ¶
type WebsocketFuturesContract 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"` }
WebsocketFuturesContract holds futures contract information for websocket
type WebsocketFuturesOrder ¶
type WebsocketFuturesOrder 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"` }
WebsocketFuturesOrder holds futures order data for websocket
type WebsocketFuturesRealtrades ¶
type WebsocketFuturesRealtrades 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"` }
WebsocketFuturesRealtrades holds futures real trade data for websocket
type WebsocketFuturesTicker ¶
type WebsocketFuturesTicker 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"` }
WebsocketFuturesTicker holds futures ticker data for websocket
type WebsocketFuturesUserInfo ¶
type WebsocketFuturesUserInfo struct { Info struct { BTC struct { Balance float64 `json:"balance"` Contracts []WebsocketFuturesContract `json:"contracts"` Rights float64 `json:"rights"` } `json:"btc"` LTC struct { Balance float64 `json:"balance"` Contracts []WebsocketFuturesContract `json:"contracts"` Rights float64 `json:"rights"` } `json:"ltc"` } `json:"info"` Result bool `json:"result"` }
WebsocketFuturesUserInfo holds futures user information for websocket
type WebsocketOrder ¶
type WebsocketOrder 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"` }
WebsocketOrder holds order data for websocket
type WebsocketOrderbook ¶
type WebsocketOrderbook struct { Asks [][]float64 `json:"asks"` Bids [][]float64 `json:"bids"` Timestamp int64 `json:"timestamp,string"` }
WebsocketOrderbook holds orderbook data for websocket
type WebsocketRealtrades ¶
type WebsocketRealtrades 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"` }
WebsocketRealtrades holds real trade data for WebSocket
type WebsocketResponse ¶
type WebsocketResponse struct { Channel string `json:"channel"` Data interface{} `json:"data"` }
WebsocketResponse holds websocket responses
type WebsocketTicker ¶
type WebsocketTicker struct { Timestamp float64 Vol string Buy float64 High float64 Last float64 Low float64 Sell float64 }
WebsocketTicker holds ticker data for websocket
type WebsocketTradeOrderResponse ¶
type WebsocketTradeOrderResponse struct { OrderID int64 `json:"order_id,string"` Result bool `json:"result,string"` }
WebsocketTradeOrderResponse holds trade order responses for websocket
type WebsocketUserinfo ¶
type WebsocketUserinfo 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"` }
WebsocketUserinfo holds user info for websocket
type WithdrawInfo ¶
type WithdrawInfo 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"` }
WithdrawInfo holds data on a withdraw
type WithdrawalResponse ¶
WithdrawalResponse is a response type for withdrawal