btce

package
v0.0.0-...-77ca9cc Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BTCE_API_PUBLIC_URL      = "https://btc-e.com/api"
	BTCE_API_PRIVATE_URL     = "https://btc-e.com/tapi"
	BTCE_API_PUBLIC_VERSION  = "3"
	BTCE_API_PRIVATE_VERSION = "1"
	BTCE_INFO                = "info"
	BTCE_TICKER              = "ticker"
	BTCE_DEPTH               = "depth"
	BTCE_TRADES              = "trades"
	BTCE_ACCOUNT_INFO        = "getInfo"
	BTCE_TRADE               = "Trade"
	BTCE_ACTIVE_ORDERS       = "ActiveOrders"
	BTCE_ORDER_INFO          = "OrderInfo"
	BTCE_CANCEL_ORDER        = "CancelOrder"
	BTCE_TRADE_HISTORY       = "TradeHistory"
	BTCE_TRANSACTION_HISTORY = "TransHistory"
	BTCE_WITHDRAW_COIN       = "WithdrawCoin"
	BTCE_CREATE_COUPON       = "CreateCoupon"
	BTCE_REDEEM_COUPON       = "RedeemCoupon"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BTCE

type BTCE struct {
	exchange.ExchangeBase
	Ticker map[string]BTCeTicker
}

func (*BTCE) CancelOrder

func (b *BTCE) CancelOrder(OrderID int64) (bool, error)

func (*BTCE) CreateCoupon

func (b *BTCE) CreateCoupon(currency string, amount float64) (BTCECreateCoupon, error)

func (*BTCE) GetAccountInfo

func (b *BTCE) GetAccountInfo() (BTCEAccountInfo, error)

func (*BTCE) GetActiveOrders

func (b *BTCE) GetActiveOrders(pair string) (map[string]BTCEActiveOrders, error)

func (*BTCE) GetDepth

func (b *BTCE) GetDepth(symbol string) (BTCEOrderbook, error)

func (*BTCE) GetExchangeAccountInfo

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

GetExchangeAccountInfo : Retrieves balances for all enabled currencies for the BTCE exchange

func (*BTCE) GetFee

func (b *BTCE) GetFee() float64

func (*BTCE) GetInfo

func (b *BTCE) GetInfo() (BTCEInfo, error)

func (*BTCE) GetOrderInfo

func (b *BTCE) GetOrderInfo(OrderID int64) (map[string]BTCEOrderInfo, error)

func (*BTCE) GetOrderbookEx

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

func (*BTCE) GetTicker

func (b *BTCE) GetTicker(symbol string) (map[string]BTCeTicker, error)

func (*BTCE) GetTickerPrice

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

func (*BTCE) GetTradeHistory

func (b *BTCE) GetTradeHistory(TIDFrom, Count, TIDEnd int64, order, since, end, pair string) (map[string]BTCETradeHistory, error)

func (*BTCE) GetTrades

func (b *BTCE) GetTrades(symbol string) ([]BTCETrades, error)

func (*BTCE) GetTransactionHistory

func (b *BTCE) GetTransactionHistory(TIDFrom, Count, TIDEnd int64, order, since, end string) (map[string]BTCETransHistory, error)

func (*BTCE) RedeemCoupon

func (b *BTCE) RedeemCoupon(coupon string) (BTCERedeemCoupon, error)

func (*BTCE) Run

func (b *BTCE) Run()

func (*BTCE) SendAuthenticatedHTTPRequest

func (b *BTCE) SendAuthenticatedHTTPRequest(method string, values url.Values, result interface{}) (err error)

func (*BTCE) SetDefaults

func (b *BTCE) SetDefaults()

func (*BTCE) Setup

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

func (*BTCE) Start

func (b *BTCE) Start()

func (*BTCE) Trade

func (b *BTCE) Trade(pair, orderType string, amount, price float64) (float64, error)

to-do: convert orderid to int64

func (*BTCE) WithdrawCoins

func (b *BTCE) WithdrawCoins(coin string, amount float64, address string) (BTCEWithdrawCoins, error)

type BTCEAccountInfo

type BTCEAccountInfo struct {
	Funds      map[string]float64 `json:"funds"`
	OpenOrders int                `json:"open_orders"`
	Rights     struct {
		Info     int `json:"info"`
		Trade    int `json:"trade"`
		Withdraw int `json:"withdraw"`
	} `json:"rights"`
	ServerTime       float64 `json:"server_time"`
	TransactionCount int     `json:"transaction_count"`
}

type BTCEActiveOrders

type BTCEActiveOrders struct {
	Pair             string  `json:"pair"`
	Type             string  `json:"sell"`
	Amount           float64 `json:"amount"`
	Rate             float64 `json:"rate"`
	TimestampCreated float64 `json:"time_created"`
	Status           int     `json:"status"`
}

type BTCECancelOrder

type BTCECancelOrder struct {
	OrderID float64            `json:"order_id"`
	Funds   map[string]float64 `json:"funds"`
}

type BTCECreateCoupon

type BTCECreateCoupon struct {
	Coupon  string             `json:"coupon"`
	TransID int64              `json:"transID"`
	Funds   map[string]float64 `json:"funds"`
}

type BTCEInfo

type BTCEInfo struct {
	ServerTime int64               `json:"server_time"`
	Pairs      map[string]BTCEPair `json:"pairs"`
}

type BTCEOrderInfo

type BTCEOrderInfo struct {
	Pair             string  `json:"pair"`
	Type             string  `json:"sell"`
	StartAmount      float64 `json:"start_amount"`
	Amount           float64 `json:"amount"`
	Rate             float64 `json:"rate"`
	TimestampCreated float64 `json:"time_created"`
	Status           int     `json:"status"`
}

type BTCEOrderbook

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

type BTCEPair

type BTCEPair struct {
	DecimalPlaces int     `json:"decimal_places"`
	MinPrice      float64 `json:"min_price"`
	MaxPrice      float64 `json:"max_price"`
	MinAmount     float64 `json:"min_amount"`
	Hidden        int     `json:"hidden"`
	Fee           float64 `json:"fee"`
}

type BTCERedeemCoupon

type BTCERedeemCoupon struct {
	CouponAmount   float64 `json:"couponAmount,string"`
	CouponCurrency string  `json:"couponCurrency"`
	TransID        int64   `json:"transID"`
}

type BTCEResponse

type BTCEResponse struct {
	Return  interface{} `json:"return"`
	Success int         `json:"success"`
	Error   string      `json:"error"`
}

type BTCETrade

type BTCETrade struct {
	Received float64            `json:"received"`
	Remains  float64            `json:"remains"`
	OrderID  float64            `json:"order_id"`
	Funds    map[string]float64 `json:"funds"`
}

type BTCETradeHistory

type BTCETradeHistory struct {
	Pair      string  `json:"pair"`
	Type      string  `json:"type"`
	Amount    float64 `json:"amount"`
	Rate      float64 `json:"rate"`
	OrderID   float64 `json:"order_id"`
	MyOrder   int     `json:"is_your_order"`
	Timestamp float64 `json:"timestamp"`
}

type BTCETrades

type BTCETrades struct {
	Type      string  `json:"type"`
	Price     float64 `json:"bid"`
	Amount    float64 `json:"amount"`
	TID       int64   `json:"tid"`
	Timestamp int64   `json:"timestamp"`
}

type BTCETransHistory

type BTCETransHistory struct {
	Type        int     `json:"type"`
	Amount      float64 `json:"amount"`
	Currency    string  `json:"currency"`
	Description string  `json:"desc"`
	Status      int     `json:"status"`
	Timestamp   float64 `json:"timestamp"`
}

type BTCEWithdrawCoins

type BTCEWithdrawCoins struct {
	TID        int64              `json:"tId"`
	AmountSent float64            `json:"amountSent"`
	Funds      map[string]float64 `json:"funds"`
}

type BTCeTicker

type BTCeTicker struct {
	High    float64
	Low     float64
	Avg     float64
	Vol     float64
	Vol_cur float64
	Last    float64
	Buy     float64
	Sell    float64
	Updated int64
}

Jump to

Keyboard shortcuts

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