btcc

package
v0.0.0-...-3c53fe9 Latest Latest
Warning

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

Go to latest
Published: May 21, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BTCC_API_URL                  = "https://api.btcc.com/"
	BTCC_API_AUTHENTICATED_METHOD = "api_trade_v1.php"
	BTCC_API_VER                  = "2.0.1.3"
	BTCC_ORDER_BUY                = "buyOrder2"
	BTCC_ORDER_SELL               = "sellOrder2"
	BTCC_ORDER_CANCEL             = "cancelOrder"
	BTCC_ICEBERG_BUY              = "buyIcebergOrder"
	BTCC_ICEBERG_SELL             = "sellIcebergOrder"
	BTCC_ICEBERG_ORDER            = "getIcebergOrder"
	BTCC_ICEBERG_ORDERS           = "getIcebergOrders"
	BTCC_ICEBERG_CANCEL           = "cancelIcebergOrder"
	BTCC_ACCOUNT_INFO             = "getAccountInfo"
	BTCC_DEPOSITS                 = "getDeposits"
	BTCC_MARKETDEPTH              = "getMarketDepth2"
	BTCC_ORDER                    = "getOrder"
	BTCC_ORDERS                   = "getOrders"
	BTCC_TRANSACTIONS             = "getTransactions"
	BTCC_WITHDRAWAL               = "getWithdrawal"
	BTCC_WITHDRAWALS              = "getWithdrawals"
	BTCC_WITHDRAWAL_REQUEST       = "requestWithdrawal"
	BTCC_STOPORDER_BUY            = "buyStopOrder"
	BTCC_STOPORDER_SELL           = "sellStopOrder"
	BTCC_STOPORDER_CANCEL         = "cancelStopOrder"
	BTCC_STOPORDER                = "getStopOrder"
	BTCC_STOPORDERS               = "getStopOrders"
)
View Source
const (
	BTCC_SOCKETIO_ADDRESS = "https://websocket.btcc.com"
)

Variables

View Source
var BTCCSocket *socketio.SocketIO

Functions

This section is empty.

Types

type BTCC

type BTCC struct {
	exchange.ExchangeBase
}

func (*BTCC) CancelIcebergOrder

func (b *BTCC) CancelIcebergOrder(orderID int64, market string)

func (*BTCC) CancelOrder

func (b *BTCC) CancelOrder(orderID int64, market string)

func (*BTCC) CancelStopOrder

func (b *BTCC) CancelStopOrder(orderID int64, market string)

func (*BTCC) GetAccountInfo

func (b *BTCC) GetAccountInfo(infoType string)

func (*BTCC) GetDeposits

func (b *BTCC) GetDeposits(currency string, pending bool)

func (*BTCC) GetExchangeAccountInfo

func (e *BTCC) GetExchangeAccountInfo() (exchange.ExchangeAccountInfo, error)

TODO: Retrieve BTCC info GetExchangeAccountInfo : Retrieves balances for all enabled currencies for the Kraken exchange

func (*BTCC) GetFee

func (b *BTCC) GetFee() float64

func (*BTCC) GetIcebergOrder

func (b *BTCC) GetIcebergOrder(orderID int64, market string)

func (*BTCC) GetIcebergOrders

func (b *BTCC) GetIcebergOrders(limit, offset int64, market string)

func (*BTCC) GetMarketDepth

func (b *BTCC) GetMarketDepth(market string, limit int64)

func (*BTCC) GetOrder

func (b *BTCC) GetOrder(orderID int64, market string, detailed bool)

func (*BTCC) GetOrderBook

func (b *BTCC) GetOrderBook(symbol string, limit int) (BTCCOrderbook, error)

func (*BTCC) GetOrderbookEx

func (b *BTCC) GetOrderbookEx(p pair.CurrencyPair) (orderbook.OrderbookBase, error)

func (*BTCC) GetOrders

func (b *BTCC) GetOrders(openonly bool, market string, limit, offset, since int64, detailed bool)

func (*BTCC) GetStopOrder

func (b *BTCC) GetStopOrder(orderID int64, market string)

func (*BTCC) GetStopOrders

func (b *BTCC) GetStopOrders(status, orderType string, stopPrice float64, limit, offset int64, market string)

func (*BTCC) GetTicker

func (b *BTCC) GetTicker(symbol string) (BTCCTicker, error)

func (*BTCC) GetTickerPrice

func (b *BTCC) GetTickerPrice(p pair.CurrencyPair) (ticker.TickerPrice, error)

func (*BTCC) GetTradeHistory

func (b *BTCC) GetTradeHistory(symbol string, limit, sinceTid int64, time time.Time) bool

func (*BTCC) GetTradesLast24h

func (b *BTCC) GetTradesLast24h(symbol string) bool

func (*BTCC) GetTransactions

func (b *BTCC) GetTransactions(transType string, limit, offset, since int64, sinceType string)

func (*BTCC) GetWithdrawal

func (b *BTCC) GetWithdrawal(withdrawalID int64, currency string)

func (*BTCC) GetWithdrawals

func (b *BTCC) GetWithdrawals(currency string, pending bool)

func (*BTCC) IcebergOrder

func (b *BTCC) IcebergOrder(buyOrder bool, price, amount, discAmount, variance float64, market string)

func (*BTCC) OnConnect

func (b *BTCC) OnConnect(output chan socketio.Message)

func (*BTCC) OnDisconnect

func (b *BTCC) OnDisconnect(output chan socketio.Message)

func (*BTCC) OnError

func (b *BTCC) OnError()

func (*BTCC) OnGroupOrder

func (b *BTCC) OnGroupOrder(message []byte, output chan socketio.Message)

func (*BTCC) OnMessage

func (b *BTCC) OnMessage(message []byte, output chan socketio.Message)

func (*BTCC) OnTicker

func (b *BTCC) OnTicker(message []byte, output chan socketio.Message)

func (*BTCC) OnTrade

func (b *BTCC) OnTrade(message []byte, output chan socketio.Message)

func (*BTCC) PlaceOrder

func (b *BTCC) PlaceOrder(buyOrder bool, price, amount float64, market string)

func (*BTCC) PlaceStopOrder

func (b *BTCC) PlaceStopOrder(buyOder bool, stopPrice, price, amount, trailingAmt, trailingPct float64, market string)

func (*BTCC) RequestWithdrawal

func (b *BTCC) RequestWithdrawal(currency string, amount float64)

func (*BTCC) Run

func (b *BTCC) Run()

func (*BTCC) SendAuthenticatedHTTPRequest

func (b *BTCC) SendAuthenticatedHTTPRequest(method string, params []interface{}) (err error)

func (*BTCC) SetDefaults

func (b *BTCC) SetDefaults()

func (*BTCC) Setup

func (b *BTCC) Setup(exch config.ExchangeConfig)

Setup is run on startup to setup exchange with config values

func (*BTCC) Start

func (b *BTCC) Start()

func (*BTCC) WebsocketClient

func (b *BTCC) WebsocketClient()

type BTCCBidAsk

type BTCCBidAsk struct {
	Price  float64
	Amount float64
}

type BTCCCurrencyGeneric

type BTCCCurrencyGeneric struct {
	Currency      string
	Symbol        string
	Amount        string
	AmountInt     int64   `json:"amount_integer"`
	AmountDecimal float64 `json:"amount_decimal"`
}

type BTCCDeposit

type BTCCDeposit struct {
	ID       int64
	Address  string
	Currency string
	Amount   float64
	Date     int64
	Status   string
}

type BTCCDepth

type BTCCDepth struct {
	Bid []BTCCBidAsk
	Ask []BTCCBidAsk
}

type BTCCIcebergOrder

type BTCCIcebergOrder 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
}

type BTCCOrder

type BTCCOrder struct {
	ID         int64
	Type       string
	Price      float64
	Currency   string
	Amount     float64
	AmountOrig float64 `json:"amount_original"`
	Date       int64
	Status     string
	Detail     BTCCOrderDetail
}

type BTCCOrderDetail

type BTCCOrderDetail struct {
	Dateline int64
	Price    float64
	Amount   float64
}

type BTCCOrderbook

type BTCCOrderbook struct {
	Bids [][]float64 `json:"bids"`
	Asks [][]float64 `json:"asks"`
	Date int64       `json:"date"`
}

type BTCCProfile

type BTCCProfile 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"`
}

type BTCCStopOrder

type BTCCStopOrder 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"`
}

type BTCCTicker

type BTCCTicker struct {
	High       float64 `json:",string"`
	Low        float64 `json:",string"`
	Buy        float64 `json:",string"`
	Sell       float64 `json:",string"`
	Last       float64 `json:",string"`
	Vol        float64 `json:",string"`
	Date       int64
	Vwap       float64 `json:",string"`
	Prev_close float64 `json:",string"`
	Open       float64 `json:",string"`
}

type BTCCTransaction

type BTCCTransaction struct {
	ID        int64
	Type      string
	BTCAmount float64 `json:"btc_amount"`
	LTCAmount float64 `json:"ltc_amount"`
	CNYAmount float64 `json:"cny_amount"`
	Date      int64
}

type BTCCWebsocketGroupOrder

type BTCCWebsocketGroupOrder struct {
	Asks   []BTCCWebsocketOrder `json:"ask"`
	Bids   []BTCCWebsocketOrder `json:"bid"`
	Market string               `json:"market"`
}

type BTCCWebsocketOrder

type BTCCWebsocketOrder struct {
	Price       float64 `json:"price"`
	TotalAmount float64 `json:"totalamount"`
	Type        string  `json:"type"`
}

type BTCCWebsocketTicker

type BTCCWebsocketTicker 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"`
}

type BTCCWebsocketTrade

type BTCCWebsocketTrade struct {
	Amount  float64 `json:"amount"`
	Date    float64 `json:"date"`
	Market  string  `json:"market"`
	Price   float64 `json:"price"`
	TradeID float64 `json:"trade_id"`
	Type    string  `json:"type"`
}

type BTCCWithdrawal

type BTCCWithdrawal struct {
	ID          int64
	Address     string
	Currency    string
	Amount      float64
	Date        int64
	Transaction string
	Status      string
}

Jump to

Keyboard shortcuts

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