Documentation ¶
Index ¶
- Variables
- type BTCC
- func (b *BTCC) CancelAllExchangeOrders(p pair.CurrencyPair) error
- func (b *BTCC) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error)
- func (b *BTCC) CancelIcebergOrder(orderID int64, symbol string)
- func (b *BTCC) CancelOrder(orderID int64, symbol string)
- func (b *BTCC) CancelStopOrder(orderID int64, symbol string)
- func (b *BTCC) GetAccountInfo(infoType string) error
- func (b *BTCC) GetDeposits(currency string, pending bool)
- func (b *BTCC) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (b *BTCC) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error)
- func (b *BTCC) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
- func (b *BTCC) GetExchangeOrderInfo(orderID int64) (float64, error)
- func (b *BTCC) GetFee() float64
- func (b *BTCC) GetIcebergOrder(orderID int64, symbol string)
- func (b *BTCC) GetIcebergOrders(limit, offset int64, symbol string)
- func (b *BTCC) GetMarketDepth(symbol string, limit int64)
- func (b *BTCC) GetOrder(orderID int64, symbol string, detailed bool)
- func (b *BTCC) GetOrderBook(currencyPair string, limit int) (Orderbook, error)
- func (b *BTCC) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (b *BTCC) GetOrders(openonly bool, symbol string, limit, offset, since int64, detailed bool)
- func (b *BTCC) GetStopOrder(orderID int64, symbol string)
- func (b *BTCC) GetStopOrders(status, orderType string, stopPrice float64, limit, offset int64, ...)
- func (b *BTCC) GetTicker(currencyPair string) (Ticker, error)
- func (b *BTCC) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (b *BTCC) GetTradeHistory(currencyPair string, limit, sinceTid int64, time time.Time) ([]Trade, error)
- func (b *BTCC) GetTransactions(transType string, limit, offset, since int64, sinceType string)
- func (b *BTCC) GetWithdrawal(withdrawalID int64, currency string)
- func (b *BTCC) GetWithdrawals(currency string, pending bool)
- func (b *BTCC) IcebergOrder(buyOrder bool, price, amount, discAmount, variance float64, symbol string)
- func (b *BTCC) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error)
- func (b *BTCC) OnConnect(output chan socketio.Message)
- func (b *BTCC) OnDisconnect(output chan socketio.Message)
- func (b *BTCC) OnError()
- func (b *BTCC) OnGroupOrder(message []byte, output chan socketio.Message)
- func (b *BTCC) OnMessage(message []byte, output chan socketio.Message)
- func (b *BTCC) OnTicker(message []byte, output chan socketio.Message)
- func (b *BTCC) OnTrade(message []byte, output chan socketio.Message)
- func (b *BTCC) PlaceOrder(buyOrder bool, price, amount float64, symbol string)
- func (b *BTCC) PlaceStopOrder(buyOder bool, stopPrice, price, amount, trailingAmt, trailingPct float64, ...)
- func (b *BTCC) RequestWithdrawal(currency string, amount float64)
- func (b *BTCC) Run()
- func (b *BTCC) SendAuthenticatedHTTPRequest(method string, params []interface{}) (err error)
- func (b *BTCC) SendHTTPRequest(path string, result interface{}) error
- func (b *BTCC) SetDefaults()
- func (b *BTCC) Setup(exch config.ExchangeConfig)
- func (b *BTCC) Start(wg *sync.WaitGroup)
- func (b *BTCC) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error)
- func (b *BTCC) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (b *BTCC) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (b *BTCC) WebsocketClient()
- func (b *BTCC) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error)
- type BidAsk
- type CurrencyGeneric
- type Deposit
- type Depth
- type IcebergOrder
- type Order
- type OrderDetail
- type Orderbook
- type Profile
- type Response
- type StopOrder
- type Ticker
- type Trade
- type Transaction
- type WebsocketGroupOrder
- type WebsocketOrder
- type WebsocketTicker
- type WebsocketTrade
- type Withdrawal
Constants ¶
This section is empty.
Variables ¶
var BTCCSocket *socketio.SocketIO
BTCCSocket is a pointer to a IO socket
Functions ¶
This section is empty.
Types ¶
type BTCC ¶
type BTCC struct {
exchange.Base
}
BTCC is the main overaching type across the BTCC package
func (*BTCC) CancelAllExchangeOrders ¶
func (b *BTCC) CancelAllExchangeOrders(p pair.CurrencyPair) error
CancelAllExchangeOrders cancels all orders associated with a currency pair
func (*BTCC) CancelExchangeOrder ¶
CancelExchangeOrder cancels an order by its corresponding ID number
func (*BTCC) CancelIcebergOrder ¶
CancelIcebergOrder cancels iceberg order
func (*BTCC) CancelOrder ¶
CancelOrder cancels an order
func (*BTCC) CancelStopOrder ¶
CancelStopOrder cancels a stop order
func (*BTCC) GetAccountInfo ¶
GetAccountInfo returns account information
func (*BTCC) GetDeposits ¶
GetDeposits returns deposit information
func (*BTCC) GetExchangeAccountInfo ¶
func (b *BTCC) GetExchangeAccountInfo() (exchange.AccountInfo, error)
GetExchangeAccountInfo : Retrieves balances for all enabled currencies for the Kraken exchange - TODO
func (*BTCC) GetExchangeDepositAddress ¶
func (b *BTCC) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error)
GetExchangeDepositAddress returns a deposit address for a specified currency
func (*BTCC) GetExchangeHistory ¶
func (b *BTCC) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
func (*BTCC) GetExchangeOrderInfo ¶
GetExchangeOrderInfo returns information on a current open order
func (*BTCC) GetIcebergOrder ¶
GetIcebergOrder returns information on your iceberg order
func (*BTCC) GetIcebergOrders ¶
GetIcebergOrders returns information on all iceberg orders
func (*BTCC) GetMarketDepth ¶
GetMarketDepth returns market depth at limit
func (*BTCC) GetOrderBook ¶
GetOrderBook returns current symbol order book currencyPair - Example "btccny", "ltccny" or "ltcbtc" limit - limits the returned trades example "10" if 0 will return full orderbook
func (*BTCC) GetOrderbookEx ¶
GetOrderbookEx returns the orderbook for a currency pair
func (*BTCC) GetStopOrder ¶
GetStopOrder returns a stop order
func (*BTCC) GetStopOrders ¶
func (b *BTCC) GetStopOrders(status, orderType string, stopPrice float64, limit, offset int64, symbol string)
GetStopOrders returns all stop orders
func (*BTCC) GetTicker ¶
GetTicker returns ticker information currencyPair - Example "btccny", "ltccny" or "ltcbtc"
func (*BTCC) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*BTCC) GetTradeHistory ¶
func (b *BTCC) GetTradeHistory(currencyPair string, limit, sinceTid int64, time time.Time) ([]Trade, error)
GetTradeHistory returns trade history data currencyPair - Example "btccny", "ltccny" or "ltcbtc" limit - limits the returned trades example "10" sinceTid - returns trade records starting from id supplied example "5000" time - returns trade records starting from unix time 1406794449
func (*BTCC) GetTransactions ¶
GetTransactions returns transaction lists
func (*BTCC) GetWithdrawal ¶
GetWithdrawal returns information about a withdrawal process
func (*BTCC) GetWithdrawals ¶
GetWithdrawals gets information about all withdrawals
func (*BTCC) IcebergOrder ¶
func (b *BTCC) IcebergOrder(buyOrder bool, price, amount, discAmount, variance float64, symbol string)
IcebergOrder intiates a large order but at intervals to preserve orderbook integrity
func (*BTCC) ModifyExchangeOrder ¶
ModifyExchangeOrder will allow of changing orderbook placement and limit to market conversion
func (*BTCC) OnDisconnect ¶
OnDisconnect alerts when disconnection occurs
func (*BTCC) OnGroupOrder ¶
OnGroupOrder handles group order information
func (*BTCC) PlaceOrder ¶
PlaceOrder places a new order
func (*BTCC) PlaceStopOrder ¶
func (b *BTCC) PlaceStopOrder(buyOder bool, stopPrice, price, amount, trailingAmt, trailingPct float64, symbol string)
PlaceStopOrder inserts a stop loss order
func (*BTCC) RequestWithdrawal ¶
RequestWithdrawal requests a new withdrawal
func (*BTCC) SendAuthenticatedHTTPRequest ¶
SendAuthenticatedHTTPRequest sends a valid authenticated HTTP request
func (*BTCC) SendHTTPRequest ¶
SendHTTPRequest sends an unauthenticated HTTP request
func (*BTCC) SetDefaults ¶
func (b *BTCC) SetDefaults()
SetDefaults sets default values for the exchange
func (*BTCC) Setup ¶
func (b *BTCC) Setup(exch config.ExchangeConfig)
Setup is run on startup to setup exchange with config values
func (*BTCC) SubmitExchangeOrder ¶
func (b *BTCC) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error)
SubmitExchangeOrder submits a new order
func (*BTCC) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*BTCC) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*BTCC) WebsocketClient ¶
func (b *BTCC) WebsocketClient()
WebsocketClient initiates a websocket client
func (*BTCC) WithdrawExchangeFunds ¶
func (b *BTCC) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error)
WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
type CurrencyGeneric ¶
type CurrencyGeneric struct { Currency string Symbol string Amount string AmountInt int64 `json:"amount_integer"` AmountDecimal float64 `json:"amount_decimal"` }
CurrencyGeneric holds currency information
type Deposit ¶
type Deposit struct { ID int64 Address string Currency string Amount float64 Date int64 Status string }
Deposit holds deposit address information
type IcebergOrder ¶
type IcebergOrder struct { ID int64 Type string Price float64 Market string Amount float64 AmountOrig float64 `json:"amount_original"` DisclosedAmount float64 `json:"disclosed_amount"` Variance float64 Date int64 Status string }
IcebergOrder holds iceberg lettuce
type Order ¶
type Order struct { ID int64 Type string Price float64 Currency string Amount float64 AmountOrig float64 `json:"amount_original"` Date int64 Status string Detail OrderDetail }
Order holds order information
type OrderDetail ¶
OrderDetail holds order detail information
type Orderbook ¶
type Orderbook struct { Bids [][]float64 `json:"bids"` Asks [][]float64 `json:"asks"` Date int64 `json:"date"` }
Orderbook holds orderbook data
type Profile ¶
type Profile struct { Username string TradePasswordEnabled bool `json:"trade_password_enabled,bool"` OTPEnabled bool `json:"otp_enabled,bool"` TradeFee float64 `json:"trade_fee"` TradeFeeCNYLTC float64 `json:"trade_fee_cnyltc"` TradeFeeBTCLTC float64 `json:"trade_fee_btcltc"` DailyBTCLimit float64 `json:"daily_btc_limit"` DailyLTCLimit float64 `json:"daily_ltc_limit"` BTCDespoitAddress string `json:"btc_despoit_address"` BTCWithdrawalAddress string `json:"btc_withdrawal_address"` LTCDepositAddress string `json:"ltc_deposit_address"` LTCWithdrawalAddress string `json:"ltc_withdrawal_request"` APIKeyPermission int64 `json:"api_key_permission"` }
Profile holds profile information
type Response ¶
type Response struct {
Ticker Ticker `json:"ticker"`
}
Response is the generalized response type
type StopOrder ¶
type StopOrder struct { ID int64 Type string StopPrice float64 `json:"stop_price"` TrailingAmt float64 `json:"trailing_amount"` TrailingPct float64 `json:"trailing_percentage"` Price float64 Market string Amount float64 Date int64 Status string OrderID int64 `json:"order_id"` }
StopOrder holds stop order information
type Ticker ¶
type Ticker struct { BidPrice float64 `json:"BidPrice"` AskPrice float64 `json:"AskPrice"` Open float64 `json:"Open"` High float64 `json:"High"` Low float64 `json:"Low"` Last float64 `json:"Last"` LastQuantity float64 `json:"LastQuantity"` PrevCls float64 `json:"PrevCls"` Volume float64 `json:"Volume"` Volume24H float64 `json:"Volume24H"` Timestamp int64 `json:"Timestamp"` ExecutionLimitDown float64 `json:"ExecutionLimitDown"` ExecutionLimitUp float64 `json:"ExecutionLimitUp"` }
Ticker holds basic ticker information
type Trade ¶
type Trade struct { ID int64 `json:"Id"` Timestamp int64 `json:"Timestamp"` Price float64 `json:"Price"` Quantity float64 `json:"Quantity"` Side string `json:"Side"` }
Trade holds executed trade data
type Transaction ¶
type Transaction struct { ID int64 Type string BTCAmount float64 `json:"btc_amount"` LTCAmount float64 `json:"ltc_amount"` CNYAmount float64 `json:"cny_amount"` Date int64 }
Transaction holds transaction information
type WebsocketGroupOrder ¶
type WebsocketGroupOrder struct { Asks []WebsocketOrder `json:"ask"` Bids []WebsocketOrder `json:"bid"` Market string `json:"market"` }
WebsocketGroupOrder holds websocket group order book information
type WebsocketOrder ¶
type WebsocketOrder struct { Price float64 `json:"price"` TotalAmount float64 `json:"totalamount"` Type string `json:"type"` }
WebsocketOrder holds websocket order information
type WebsocketTicker ¶
type WebsocketTicker struct { Buy float64 `json:"buy"` Date float64 `json:"date"` High float64 `json:"high"` Last float64 `json:"last"` Low float64 `json:"low"` Market string `json:"market"` Open float64 `json:"open"` PrevClose float64 `json:"prev_close"` Sell float64 `json:"sell"` Volume float64 `json:"vol"` Vwap float64 `json:"vwap"` }
WebsocketTicker holds websocket ticker information