Documentation ¶
Index ¶
- type Balance
- type Balances
- type Bittrex
- func (b *Bittrex) AuthenticateWebsocket() error
- func (b *Bittrex) CancelAllOrders(_ *exchange.OrderCancellation) (exchange.CancelAllOrdersResponse, error)
- func (b *Bittrex) CancelExistingOrder(uuid string) (Balances, error)
- func (b *Bittrex) CancelOrder(order *exchange.OrderCancellation) error
- func (b *Bittrex) GetAccountBalanceByCurrency(currency string) (Balance, error)
- func (b *Bittrex) GetAccountBalances() (Balances, error)
- func (b *Bittrex) GetAccountInfo() (exchange.AccountInfo, error)
- func (b *Bittrex) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
- func (b *Bittrex) GetCryptoDepositAddress(currency string) (DepositAddress, error)
- func (b *Bittrex) GetCurrencies() (Currency, error)
- func (b *Bittrex) GetDepositAddress(cryptocurrency currency.Code, _ string) (string, error)
- func (b *Bittrex) GetDepositHistory(currency string) (WithdrawalHistory, error)
- func (b *Bittrex) GetExchangeHistory(p currency.Pair, assetType string) ([]exchange.TradeHistory, error)
- func (b *Bittrex) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (b *Bittrex) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (b *Bittrex) GetFundingHistory() ([]exchange.FundHistory, error)
- func (b *Bittrex) GetMarketHistory(currencyPair string) (MarketHistory, error)
- func (b *Bittrex) GetMarketSummaries() (MarketSummary, error)
- func (b *Bittrex) GetMarketSummary(currencyPair string) (MarketSummary, error)
- func (b *Bittrex) GetMarkets() (Market, error)
- func (b *Bittrex) GetOpenOrders(currencyPair string) (Order, error)
- func (b *Bittrex) GetOrder(uuid string) (Order, error)
- func (b *Bittrex) GetOrderHistory(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
- func (b *Bittrex) GetOrderHistoryForCurrency(currencyPair string) (Order, error)
- func (b *Bittrex) GetOrderInfo(orderID string) (exchange.OrderDetail, error)
- func (b *Bittrex) GetOrderbook(currencyPair string) (OrderBooks, error)
- func (b *Bittrex) GetOrderbookEx(p currency.Pair, assetType string) (orderbook.Base, error)
- func (b *Bittrex) GetSubscriptions() ([]wshandler.WebsocketChannelSubscription, error)
- func (b *Bittrex) GetTicker(currencyPair string) (Ticker, error)
- func (b *Bittrex) GetTickerPrice(p currency.Pair, assetType string) (ticker.Price, error)
- func (b *Bittrex) GetWebsocket() (*wshandler.Websocket, error)
- func (b *Bittrex) GetWithdrawalFee(c currency.Code) (float64, error)
- func (b *Bittrex) GetWithdrawalHistory(currency string) (WithdrawalHistory, error)
- func (b *Bittrex) ModifyOrder(action *exchange.ModifyOrder) (string, error)
- func (b *Bittrex) PlaceBuyLimit(currencyPair string, quantity, rate float64) (UUID, error)
- func (b *Bittrex) PlaceSellLimit(currencyPair string, quantity, rate float64) (UUID, error)
- func (b *Bittrex) Run()
- func (b *Bittrex) SendAuthenticatedHTTPRequest(path string, values url.Values, result interface{}) (err error)
- func (b *Bittrex) SendHTTPRequest(path string, result interface{}) error
- func (b *Bittrex) SetDefaults()
- func (b *Bittrex) Setup(exch *config.ExchangeConfig)
- func (b *Bittrex) Start(wg *sync.WaitGroup)
- func (b *Bittrex) SubmitOrder(p currency.Pair, side exchange.OrderSide, orderType exchange.OrderType, ...) (exchange.SubmitOrderResponse, error)
- func (b *Bittrex) SubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
- func (b *Bittrex) UnsubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
- func (b *Bittrex) UpdateOrderbook(p currency.Pair, assetType string) (orderbook.Base, error)
- func (b *Bittrex) UpdateTicker(p currency.Pair, assetType string) (ticker.Price, error)
- func (b *Bittrex) Withdraw(currency, paymentID, address string, quantity float64) (UUID, error)
- func (b *Bittrex) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
- func (b *Bittrex) WithdrawFiatFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
- func (b *Bittrex) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.WithdrawRequest) (string, error)
- type Currency
- type DepositAddress
- type Market
- type MarketHistory
- type MarketSummary
- type Order
- type OrderBook
- type OrderBooks
- type Response
- type Ticker
- type UUID
- type WithdrawalHistory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Balance ¶
type Balance struct { Success bool `json:"success"` Message string `json:"message"` Result struct { Currency string `json:"Currency"` Balance float64 `json:"Balance"` Available float64 `json:"Available"` Pending float64 `json:"Pending"` CryptoAddress string `json:"CryptoAddress"` Requested bool `json:"Requested"` UUID string `json:"Uuid"` } `json:"result"` }
Balance holds the balance from your account for a specified currency
type Balances ¶
type Balances struct { Success bool `json:"success"` Message string `json:"message"` Result []struct { Currency string `json:"Currency"` Balance float64 `json:"Balance"` Available float64 `json:"Available"` Pending float64 `json:"Pending"` CryptoAddress string `json:"CryptoAddress"` Requested bool `json:"Requested"` UUID string `json:"Uuid"` } `json:"result"` }
Balances holds the balance from your account for a specified currency
type Bittrex ¶
Bittrex is the overaching type across the bittrex methods
func (*Bittrex) AuthenticateWebsocket ¶
AuthenticateWebsocket sends an authentication message to the websocket
func (*Bittrex) CancelAllOrders ¶
func (b *Bittrex) CancelAllOrders(_ *exchange.OrderCancellation) (exchange.CancelAllOrdersResponse, error)
CancelAllOrders cancels all orders associated with a currency pair
func (*Bittrex) CancelExistingOrder ¶
CancelExistingOrder is used to cancel a buy or sell order.
func (*Bittrex) CancelOrder ¶
func (b *Bittrex) CancelOrder(order *exchange.OrderCancellation) error
CancelOrder cancels an order by its corresponding ID number
func (*Bittrex) GetAccountBalanceByCurrency ¶
GetAccountBalanceByCurrency is used to retrieve the balance from your account for a specific currency. ie. "btc" or "ltc"
func (*Bittrex) GetAccountBalances ¶
GetAccountBalances is used to retrieve all balances from your account
func (*Bittrex) GetAccountInfo ¶
func (b *Bittrex) GetAccountInfo() (exchange.AccountInfo, error)
GetAccountInfo Retrieves balances for all enabled currencies for the Bittrex exchange
func (*Bittrex) GetActiveOrders ¶
func (b *Bittrex) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
GetActiveOrders retrieves any orders that are active/open
func (*Bittrex) GetCryptoDepositAddress ¶
func (b *Bittrex) GetCryptoDepositAddress(currency string) (DepositAddress, error)
GetCryptoDepositAddress is used to retrieve or generate an address for a specific currency. If one does not exist, the call will fail and return ADDRESS_GENERATING until one is available.
func (*Bittrex) GetCurrencies ¶
GetCurrencies is used to get all supported currencies at Bittrex
func (*Bittrex) GetDepositAddress ¶
GetDepositAddress returns a deposit address for a specified currency
func (*Bittrex) GetDepositHistory ¶
func (b *Bittrex) GetDepositHistory(currency string) (WithdrawalHistory, error)
GetDepositHistory is used to retrieve your deposit history. If currency is is omitted it will return the entire deposit history
func (*Bittrex) GetExchangeHistory ¶
func (b *Bittrex) GetExchangeHistory(p currency.Pair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
func (*Bittrex) GetFee ¶
func (b *Bittrex) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFee returns an estimate of fee based on type of transaction
func (*Bittrex) GetFeeByType ¶
func (b *Bittrex) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFeeByType returns an estimate of fee based on type of transaction
func (*Bittrex) GetFundingHistory ¶
func (b *Bittrex) GetFundingHistory() ([]exchange.FundHistory, error)
GetFundingHistory returns funding history, deposits and withdrawals
func (*Bittrex) GetMarketHistory ¶
func (b *Bittrex) GetMarketHistory(currencyPair string) (MarketHistory, error)
GetMarketHistory retrieves the latest trades that have occurred for a specific market
func (*Bittrex) GetMarketSummaries ¶
func (b *Bittrex) GetMarketSummaries() (MarketSummary, error)
GetMarketSummaries is used to get the last 24 hour summary of all active exchanges
func (*Bittrex) GetMarketSummary ¶
func (b *Bittrex) GetMarketSummary(currencyPair string) (MarketSummary, error)
GetMarketSummary is used to get the last 24 hour summary of all active exchanges by currency pair (btc-ltc).
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 all orders that you currently have opened. A specific market can be requested for example "btc-ltc"
func (*Bittrex) GetOrderHistory ¶
func (b *Bittrex) GetOrderHistory(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*Bittrex) GetOrderHistoryForCurrency ¶
GetOrderHistoryForCurrency is used to retrieve your order history. If currencyPair omitted it will return the entire order History.
func (*Bittrex) GetOrderInfo ¶
func (b *Bittrex) GetOrderInfo(orderID string) (exchange.OrderDetail, error)
GetOrderInfo returns information on a current open order
func (*Bittrex) GetOrderbook ¶
func (b *Bittrex) GetOrderbook(currencyPair string) (OrderBooks, error)
GetOrderbook method returns current order book information by currency, type & depth. "Currency Pair" ie btc-ltc "Category" either "buy", "sell" or "both"; for ease of use and reduced complexity this function is set to "both" "Depth" max depth is 50 but you can literally set it any integer you want and it returns full depth. So depth default is 50.
func (*Bittrex) GetOrderbookEx ¶
GetOrderbookEx returns the orderbook for a currency pair
func (*Bittrex) GetSubscriptions ¶
func (b *Bittrex) GetSubscriptions() ([]wshandler.WebsocketChannelSubscription, error)
GetSubscriptions returns a copied list of subscriptions
func (*Bittrex) GetTicker ¶
GetTicker sends a public get request and returns current ticker information on the supplied currency. Example currency input param "btc-ltc".
func (*Bittrex) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*Bittrex) GetWebsocket ¶
GetWebsocket returns a pointer to the exchange websocket
func (*Bittrex) GetWithdrawalFee ¶
GetWithdrawalFee returns the fee for withdrawing from the exchange
func (*Bittrex) GetWithdrawalHistory ¶
func (b *Bittrex) GetWithdrawalHistory(currency string) (WithdrawalHistory, error)
GetWithdrawalHistory is used to retrieve your withdrawal history. If currency omitted it will return the entire history
func (*Bittrex) ModifyOrder ¶
func (b *Bittrex) ModifyOrder(action *exchange.ModifyOrder) (string, error)
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*Bittrex) PlaceBuyLimit ¶
PlaceBuyLimit is used to place a buy order in a specific market. Use buylimit to place limit orders. Make sure you have the proper permissions set on your API keys for this call to work. "Currency" ie "btc-ltc" "Quantity" is the amount to purchase "Rate" is the rate at which to purchase
func (*Bittrex) PlaceSellLimit ¶
PlaceSellLimit is used to place a sell order in a specific market. Use selllimit to place limit orders. Make sure you have the proper permissions set on your API keys for this call to work. "Currency" ie "btc-ltc" "Quantity" is the amount to purchase "Rate" is the rate at which to purchase
func (*Bittrex) SendAuthenticatedHTTPRequest ¶
func (b *Bittrex) SendAuthenticatedHTTPRequest(path string, values url.Values, result interface{}) (err error)
SendAuthenticatedHTTPRequest sends an authenticated http request to a desired path
func (*Bittrex) SendHTTPRequest ¶
SendHTTPRequest sends an unauthenticated HTTP request
func (*Bittrex) SetDefaults ¶
func (b *Bittrex) SetDefaults()
SetDefaults method assignes the default values for Bittrex
func (*Bittrex) Setup ¶
func (b *Bittrex) Setup(exch *config.ExchangeConfig)
Setup method sets current configuration details if enabled
func (*Bittrex) SubmitOrder ¶
func (b *Bittrex) SubmitOrder(p currency.Pair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, _ string) (exchange.SubmitOrderResponse, error)
SubmitOrder submits a new order
func (*Bittrex) SubscribeToWebsocketChannels ¶
func (b *Bittrex) SubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
SubscribeToWebsocketChannels appends to ChannelsToSubscribe which lets websocket.manageSubscriptions handle subscribing
func (*Bittrex) UnsubscribeToWebsocketChannels ¶
func (b *Bittrex) UnsubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
UnsubscribeToWebsocketChannels removes from ChannelsToSubscribe which lets websocket.manageSubscriptions handle unsubscribing
func (*Bittrex) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*Bittrex) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*Bittrex) Withdraw ¶
Withdraw is used to withdraw funds from your account. note: Please account for transaction fee.
func (*Bittrex) WithdrawCryptocurrencyFunds ¶
func (b *Bittrex) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*Bittrex) WithdrawFiatFunds ¶
func (b *Bittrex) WithdrawFiatFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*Bittrex) WithdrawFiatFundsToInternationalBank ¶
func (b *Bittrex) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.WithdrawRequest) (string, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
type Currency ¶
type Currency struct { Success bool `json:"success"` Message string `json:"message"` Result []struct { Currency string `json:"Currency"` CurrencyLong string `json:"CurrencyLong"` MinConfirmation int `json:"MinConfirmation"` TxFee float64 `json:"TxFee"` IsActive bool `json:"IsActive"` CoinType string `json:"CoinType"` BaseAddress string `json:"BaseAddress"` } `json:"result"` }
Currency holds supported currency metadata
type DepositAddress ¶
type DepositAddress struct { Success bool `json:"success"` Message string `json:"message"` Result struct { Currency string `json:"Currency"` Address string `json:"Address"` } `json:"result"` }
DepositAddress holds a generated address to send specific coins to the exchange
type Market ¶
type Market struct { Success bool `json:"success"` Message string `json:"message"` Result []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"` Created string `json:"Created"` } `json:"result"` }
Market holds current market metadata
type MarketHistory ¶
type MarketHistory struct { Success bool `json:"success"` Message string `json:"message"` Result []struct { ID int `json:"Id"` Timestamp string `json:"TimeStamp"` Quantity float64 `json:"Quantity"` Price float64 `json:"Price"` Total float64 `json:"Total"` FillType string `json:"FillType"` OrderType string `json:"OrderType"` } `json:"result"` }
MarketHistory holds an executed trade's data for a market ie "BTC-LTC"
type MarketSummary ¶
type MarketSummary struct { Success bool `json:"success"` Message string `json:"message"` Result []struct { MarketName string `json:"MarketName"` High float64 `json:"High"` Low float64 `json:"Low"` Volume float64 `json:"Volume"` Last float64 `json:"Last"` BaseVolume float64 `json:"BaseVolume"` TimeStamp string `json:"TimeStamp"` Bid float64 `json:"Bid"` Ask float64 `json:"Ask"` OpenBuyOrders int `json:"OpenBuyOrders"` OpenSellOrders int `json:"OpenSellOrders"` PrevDay float64 `json:"PrevDay"` Created string `json:"Created"` DisplayMarketName string `json:"DisplayMarketName"` } `json:"result"` }
MarketSummary holds last 24 hour metadata of an active exchange
type Order ¶
type Order struct { Success bool `json:"success"` Message string `json:"message"` Result []struct { AccountID string `json:"AccountId"` OrderUUID string `json:"OrderUuid"` Exchange string `json:"Exchange"` Type string `json:"Type"` Quantity float64 `json:"Quantity"` QuantityRemaining float64 `json:"QuantityRemaining"` Limit float64 `json:"Limit"` Reserved float64 `json:"Reserved"` ReserveRemaining float64 `json:"ReserveRemaining"` CommissionReserved float64 `json:"CommissionReserved"` CommissionReserveRemaining float64 `json:"CommissionReserveRemaining"` CommissionPaid float64 `json:"CommissionPaid"` Price float64 `json:"Price"` PricePerUnit float64 `json:"PricePerUnit"` Opened string `json:"Opened"` Closed string `json:"Closed"` IsOpen bool `json:"IsOpen"` Sentinel string `json:"Sentinel"` CancelInitiated bool `json:"CancelInitiated"` ImmediateOrCancel bool `json:"ImmediateOrCancel"` IsConditional bool `json:"IsConditional"` Condition string `json:"Condition"` ConditionTarget string `json:"ConditionTarget"` // Below Used in OrderHistory TimeStamp string `json:"TimeStamp"` Commission float64 `json:"Commission"` } `json:"result"` }
Order holds the full order information associated with the UUID supplied
type OrderBooks ¶
type OrderBooks struct { Success bool `json:"success"` Message string `json:"message"` Result struct { Buy []OrderBook `json:"buy"` Sell []OrderBook `json:"sell"` } `json:"result"` }
OrderBooks holds an array of buy & sell orders held on the exchange
type Response ¶
type Response struct { Success bool `json:"success"` Message string `json:"message"` Result json.RawMessage `json:"result"` }
Response is the generalised response type for Bittrex
type Ticker ¶
type Ticker struct { Success bool `json:"success"` Message string `json:"message"` Result struct { Bid float64 `json:"Bid"` Ask float64 `json:"Ask"` Last float64 `json:"Last"` } `json:"result"` }
Ticker holds basic ticker information
type UUID ¶
type UUID struct { Success bool `json:"success"` Message string `json:"message"` Result struct { ID string `json:"uuid"` } `json:"result"` }
UUID contains the universal unique identifier for one or multiple transactions on the exchange
type WithdrawalHistory ¶
type WithdrawalHistory struct { Success bool `json:"success"` Message string `json:"message"` Result []struct { PaymentUUID string `json:"PaymentUuid"` Currency string `json:"Currency"` Amount float64 `json:"Amount"` Address string `json:"Address"` Opened string `json:"Opened"` Authorized bool `json:"Authorized"` PendingPayment bool `json:"PendingPayment"` TxCost float64 `json:"TxCost"` TxID string `json:"TxId"` Canceled bool `json:"Canceled"` InvalidAddress bool `json:"InvalidAddress"` } `json:"result"` }
WithdrawalHistory holds the Withdrawal history data