Documentation ¶
Overview ¶
Package Bittrex is an implementation of the Biitrex API in Golang.
Index ¶
- Constants
- Variables
- func NewClient(apiKey, apiSecret string) (c *client)
- func NewClientWithCustomHttpConfig(apiKey, apiSecret string, httpClient *http.Client) (c *client)
- func NewClientWithCustomTimeout(apiKey, apiSecret string, timeout time.Duration) (c *client)
- type BalanceD
- type Bittrex
- func (b *Bittrex) BuyLimit(market string, quantity, rate decimal.Decimal) (uuid string, err error)
- func (b *Bittrex) CancelOrder(orderID string) (err error)
- func (b *Bittrex) Done()
- func (b *Bittrex) GetBalance(currency string) (balance btBalance, err error)
- func (b *Bittrex) GetBalances() (balances []btBalance, err error)
- func (b *Bittrex) GetCurrencies() (currencies []btCurrency, err error)
- func (b *Bittrex) GetCurrencyByName(name string) *common.Currency
- func (b *Bittrex) GetDepositAddress(currency string) (address btAddress, err error)
- func (b *Bittrex) GetDepositHistory(currency string) (deposits []btDeposit, err error)
- func (b *Bittrex) GetDistribution(market string) (distribution btDistribution, err error)
- func (b *Bittrex) GetLatestTick(market string, interval string) ([]btCandle, error)
- func (b *Bittrex) GetMarketHistory(market string) (trades []btTrade, err error)
- func (b *Bittrex) GetMarketSummaries() (marketSummaries []btMarketSummary, err error)
- func (b *Bittrex) GetMarketSummary(market string) (marketSummary []btMarketSummary, err error)
- func (b *Bittrex) GetMarkets() (markets []btMarket, err error)
- func (b *Bittrex) GetOpenOrders(market string) (openOrders []btOrder, err error)
- func (b *Bittrex) GetOrder(order_uuid string) (order btOrder2, err error)
- func (b *Bittrex) GetOrderBook(market, cat string) (orderBook btOrderBook, err error)
- func (b *Bittrex) GetOrderBookBuySell(market, cat string) (orderb []Orderb, err error)
- func (b *Bittrex) GetOrderHistory(market string) (orders []btOrder, err error)
- func (b *Bittrex) GetTicker(market string) (ticker btTicker, err error)
- func (b *Bittrex) GetTicks(market string, interval string) ([]btCandle, error)
- func (b *Bittrex) GetWithdrawalHistory(currency string) (withdrawals []btWithdrawal, err error)
- func (b *Bittrex) Logf(format string, v ...interface{})
- func (b *Bittrex) Logln(v ...interface{})
- func (b *Bittrex) NewLogger()
- func (b *Bittrex) Panic(v ...interface{})
- func (b *Bittrex) Panicf(format string, v ...interface{})
- func (b *Bittrex) SellLimit(market string, quantity, rate decimal.Decimal) (uuid string, err error)
- func (b *Bittrex) SetDebug(enable bool)
- func (b *Bittrex) Setup() error
- func (b *Bittrex) Start(wg *sync.WaitGroup)
- func (b *Bittrex) Stop()
- func (b *Bittrex) SubscribeExchangeUpdate(market string, dataCh chan<- ExchangeState, stop <-chan bool) error
- func (b *Bittrex) Withdraw(address, currency string, quantity decimal.Decimal) (withdrawUuid string, err error)
- type CandleTime
- type ExchangeState
- type Fill
- type OrderUpdate
- type Orderb
- type Uuid
Constants ¶
const ( API_BASE = "https://bittrex.com/api/" // Bittrex API endpoint API_VERSION = "v1.1" WS_BASE = "socket.bittrex.com" // Bittrex WS API endpoint WS_HUB = "CoreHub" // SignalR main hub )
const ( BittrexWebURL = "https://Bittrex.com" BittrexWebTradingEndpoint = "tradingApi" BittrexWebVersion = "1" BittrexTradeHistory = "returnTradeHistory" BittrexBalances = "returnBalances" BittrexBalancesComplete = "returnCompleteBalances" BittrexDepositAddresses = "returnDepositAddresses" BittrexGenerateNewAddress = "generateNewAddress" BittrexDepositsWithdrawals = "returnDepositsWithdrawals" BittrexOrders = "returnOpenOrders" BittrexOrderBuy = "buy" BittrexOrderSell = "sell" BittrexOrderCancel = "cancelOrder" BittrexOrderMove = "moveOrder" BittrexWithdraw = "withdraw" BittrexFeeInfo = "returnFeeInfo" BittrexAvailableBalances = "returnAvailableAccountBalances" BittrexTradableBalances = "returnTradableBalances" BittrexTransferBalance = "transferBalance" BittrexMarginAccountSummary = "returnMarginAccountSummary" BittrexMarginBuy = "marginBuy" BittrexMarginSell = "marginSell" BittrexMarginPosition = "getMarginPosition" BittrexMarginPositionClose = "closeMarginPosition" BittrexCreateLoanOffer = "createLoanOffer" BittrexCancelLoanOffer = "cancelLoanOffer" BittrexOpenLoanOffers = "returnOpenLoanOffers" BittrexActiveLoans = "returnActiveLoans" BittrexLendingHistory = "returnLendingHistory" BittrexAutoRenew = "toggleAutoRenew" BittrexAuthRate = 6 BittrexUnauthRate = 6 )
const TIME_FORMAT = "2006-01-02T15:04:05"
Variables ¶
var ( API_KEY = "" API_SECRET = "" )
Functions ¶
func NewClient ¶
func NewClient(apiKey, apiSecret string) (c *client)
NewClient return a new Bittrex HTTP client
func NewClientWithCustomHttpConfig ¶
NewClientWithCustomHttpConfig returns a new Bittrex HTTP client using the predefined http client
func NewClientWithCustomTimeout ¶
NewClient returns a new Bittrex HTTP client with custom timeout
Types ¶
type Bittrex ¶
type Bittrex struct {
// contains filtered or unexported fields
}
Bittrex struct
func NewBittrex ¶
func NewBittrex() *Bittrex
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) GetCurrencies ¶
GetCurrencies is used to get all supported currencies at Bittrex along with other meta data.
func (*Bittrex) GetCurrencyByName ¶
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
func (*Bittrex) GetDistribution ¶
GetDistribution is used to get the distribution.
func (*Bittrex) GetLatestTick ¶
GetLatestTick returns array with a single element latest candle object
func (*Bittrex) GetMarketHistory ¶
GetMarketHistory is used to retrieve the latest trades that have occured for a specific market. market a string literal for the market (ex: BTC-LTC)
func (*Bittrex) GetMarketSummaries ¶
GetMarketSummaries is used to get the last 24 hour summary of all active exchanges
func (*Bittrex) GetMarketSummary ¶
GetMarketSummary is used to get the last 24 hour summary for a given market
func (*Bittrex) GetMarkets ¶
GetMarkets is used to get the open and available trading markets at Bittrex along with other meta data.
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.
func (*Bittrex) GetOrderBookBuySell ¶
GetOrderBookBuySell is used to get retrieve the buy or sell side of an orderbook for a given market market: a string literal for the market (ex: BTC-LTC) cat: buy or sell to identify the type of orderbook to return.
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
func (*Bittrex) GetTicks ¶
GetTicks is used to get ticks history values for a market. Interval can be -> ["oneMin", "fiveMin", "thirtyMin", "hour", "day"]
func (*Bittrex) GetWithdrawalHistory ¶
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
func (*Bittrex) SubscribeExchangeUpdate ¶
func (b *Bittrex) SubscribeExchangeUpdate(market string, dataCh chan<- ExchangeState, stop <-chan bool) error
SubscribeExchangeUpdate subscribes for updates of the market. Updates will be sent to dataCh. To stop subscription, send to, or close 'stop'.
func (*Bittrex) Withdraw ¶
func (b *Bittrex) Withdraw(address, currency string, quantity decimal.Decimal) (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 decimal.Decimal the quantity of coins to withdraw
type CandleTime ¶
func (*CandleTime) UnmarshalJSON ¶
func (t *CandleTime) UnmarshalJSON(b []byte) error
type ExchangeState ¶
type ExchangeState struct { MarketName string Nounce int Buys []OrderUpdate Sells []OrderUpdate Fills []Fill Initial bool }
ExchangeState contains fills and order book updates for a market.