Documentation ¶
Overview ¶
Package Bittrex is an implementation of the Biitrex API (public and private).
Index ¶
- Constants
- func NewClient(apiKey, apiSecret string) (c *client)
- type Address
- type Balance
- type Bittrex
- func (b *Bittrex) BuyLimit(market string, quantity, rate float64) (uuid string, err error)
- func (b *Bittrex) BuyMarket(market string, quantity float64) (uuid string, err error)
- func (b *Bittrex) CancelOrder(orderID string) (err error)
- func (b *Bittrex) GetBalance(currency string) (balance Balance, err error)
- func (b *Bittrex) GetBalances() (balances map[string]Balance, err error)
- func (b *Bittrex) GetDepositAddress(currency string) (address Address, err error)
- func (b *Bittrex) GetDepositHistory(currency string, count int) (deposits []Deposit, err error)
- func (b *Bittrex) GetHisCandles(market string) (candles []Candle, err error)
- func (b *Bittrex) GetMarketHistory(market string, count int) (trades []Trade, err error)
- func (b *Bittrex) GetMarketSummaries() (marketSummaries []MarketSummary, err error)
- func (b *Bittrex) GetMarkets() (markets []Market, err error)
- func (b *Bittrex) GetNewCandles(market, LastEpoch string) (candles []Candle, err error)
- func (b *Bittrex) GetOpenOrders(market string) (openOrders []Order, err error)
- func (b *Bittrex) GetOrderBook(market, cat string, depth int) (orderBook OrderBook, err error)
- func (b *Bittrex) GetOrderHistory(market string, count int) (orders []Order, err error)
- func (b *Bittrex) GetTicker(market string) (ticker Ticker, err error)
- func (b *Bittrex) GetWithdrawalHistory(currency string, count int) (withdrawals []Withdrawal, err error)
- func (b *Bittrex) SellLimit(market string, quantity, rate float64) (uuid string, err error)
- func (b *Bittrex) SellMarket(market string, quantity float64) (uuid string, err error)
- func (b *Bittrex) Withdraw(address, currency string, quantity float64) (withdrawUuid string, err error)
- type Candle
- type Deposit
- type Market
- type MarketSummary
- type NewCandles
- type Order
- type OrderBook
- type Orderb
- type Ticker
- type Trade
- type Uuid
- type Withdrawal
Constants ¶
const ( API_BASE = "https://bittrex.com/api/" // Bittrex API endpoint API_VERSION = "v1.1" // Bittrex API version DEFAULT_HTTPCLIENT_TIMEOUT = 30 // HTTP client timeout )
const TIME_FORMAT = "2006-01-02T15:04:05"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bittrex ¶
type Bittrex struct {
// contains filtered or unexported fields
}
bittrex represent a bittrex client
func (*Bittrex) CancelOrder ¶
CancelOrder is used to cancel a buy or sell order.
func (*Bittrex) GetBalance ¶
Getbalance is used to retrieve the balance from your account for a specific currency. currency: a string literal for the currency (ex: LTC)
func (*Bittrex) GetBalances ¶
GetBalances is used to retrieve all balances from your account
func (*Bittrex) GetDepositAddress ¶
GetDepositAddress is sed to generate or retrieve an address for a specific currency. currency a string literal for the currency (ie. BTC)
func (*Bittrex) GetDepositHistory ¶
GetDepositHistory is used to retrieve your deposit history currency string a string literal for the currency (ie. BTC). If set to "all", will return for all currencies count int the number of records to return. Is set to 0 will return the max set.
func (*Bittrex) GetHisCandles ¶
GetCandles is used to get the ohlcv.
func (*Bittrex) GetMarketHistory ¶
GetMarketHistory is used to retrieve the latest trades that have occured for a specific market. mark a string literal for the market (ex: BTC-LTC) count a number between 1-100 for the number of entries to return
func (*Bittrex) GetMarketSummaries ¶
func (b *Bittrex) GetMarketSummaries() (marketSummaries []MarketSummary, err error)
GetMarketSummaries is used to get the last 24 hour summary of all active exchanges
func (*Bittrex) GetMarkets ¶
GetMarkets is used to get the open and available trading markets at Bittrex along with other meta data.
func (*Bittrex) GetNewCandles ¶
GetCandles is used to get the ohlcv.
func (*Bittrex) GetOpenOrders ¶
GetOpenOrders returns orders that you currently have opened. If market is set to "all", GetOpenOrders return all orders If market is set to a specific order, GetOpenOrders return orders for this market
func (*Bittrex) GetOrderBook ¶
GetOrderBook is used to get retrieve the orderbook for a given market market: a string literal for the market (ex: BTC-LTC) cat: buy, sell or both to identify the type of orderbook to return. depth: how deep of an order book to retrieve. Max is 100
func (*Bittrex) GetOrderHistory ¶
GetOrderHistory used to retrieve your order history. market string literal for the market (ie. BTC-LTC). If set to "all", will return for all market count int : the number of records to return. Is set to 0, will return max history
func (*Bittrex) GetWithdrawalHistory ¶
func (b *Bittrex) GetWithdrawalHistory(currency string, count int) (withdrawals []Withdrawal, err error)
GetWithdrawalHistory is used to retrieve your withdrawal history currency string a string literal for the currency (ie. BTC). If set to "all", will return for all currencies count int the number of records to return. Is set to 0 will return the max set.
func (*Bittrex) SellMarket ¶
SellMarket is used to place a market sell order in a specific market.
func (*Bittrex) Withdraw ¶
func (b *Bittrex) Withdraw(address, currency string, quantity float64) (withdrawUuid string, err error)
Withdraw is used to withdraw funds from your account. address string the address where to send the funds. currency string literal for the currency (ie. BTC) quantity float the quantity of coins to withdraw
type Market ¶
type Market struct { MarketCurrency string `json:"MarketCurrency"` BaseCurrency string `json:"BaseCurrency"` MarketCurrencyLong string `json:"MarketCurrencyLong"` BaseCurrencyLong string `json:"BaseCurrencyLong"` MinTradeSize float64 `json:"MinTradeSize"` MarketName string `json:"MarketName"` IsActive bool `json:"IsActive"` }
type MarketSummary ¶
type MarketSummary struct { MarketName string `json:"MarketName"` High float64 `json:"High"` Low float64 `json:"Low"` Ask float64 `json:"Ask"` Bid float64 `json:"Bid"` OpenBuyOrders int `json:"OpenBuyOrders"` OpenSellOrders int `json:"OpenSellOrders"` Volume float64 `json:"Volume"` Last float64 `json:"Last"` BaseVolume float64 `json:"BaseVolume"` TimeStamp string `json:"TimeStamp"` }
type NewCandles ¶
type NewCandles struct {
Ticks []Candle `json:"ticks"`
}
type Order ¶
type Order struct { OrderUuid string `json:"OrderUuid"` Exchange string `json:"Exchange"` TimeStamp string `json:"TimeStamp"` OrderType string `json:"OrderType"` Limit float64 `json:"Limit"` Quantity float64 `json:"Quantity"` QuantityRemaining float64 `json:"QuantityRemaining"` Commission float64 `json:"Commission"` Price float64 `json:"Price"` PricePerUnit float64 `json:"PricePerUnit"` }
type Trade ¶
type Trade struct { OrderUuid string `json:"OrderUuid"` Timestamp jTime `json:"TimeStamp"` Quantity float64 `json:"Quantity"` Price float64 `json:"Price"` Total float64 `json:"Total"` }
Used in getmarkethistory
type Withdrawal ¶
type Withdrawal struct { PaymentUuid string `json:"PaymentUuid"` Currency string `json:"Currency"` Amount float64 `json:"Amount"` Address string `json:"Address"` Opened jTime `json:"Opened"` Authorized bool `json:"Authorized"` PendingPayment bool `json:"PendingPayment"` TxCost float64 `json:"TxCost"` TxId string `json:"TxId"` Canceled bool `json:"Canceled"` }