Documentation ¶
Index ¶
- type AddressData
- type BalanceData
- type Bittrex
- func (b *Bittrex) CancelAllOrders(orderCancellation *order.Cancel) (order.CancelAllResponse, error)
- func (b *Bittrex) CancelBatchOrders(orders []order.Cancel) (order.CancelBatchResponse, error)
- func (b *Bittrex) CancelExistingOrder(uuid string) (OrderData, error)
- func (b *Bittrex) CancelOpenOrders(market string) ([]BulkCancelResultData, error)
- func (b *Bittrex) CancelOrder(ord *order.Cancel) error
- func (b *Bittrex) ConstructOrderDetail(orderData *OrderData) (order.Detail, error)
- func (b *Bittrex) FetchAccountInfo(assetType asset.Item) (account.Holdings, error)
- func (b *Bittrex) FetchOrderbook(currency currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (b *Bittrex) FetchTicker(p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (b *Bittrex) FetchTradablePairs(asset asset.Item) ([]string, error)
- func (b *Bittrex) FormatExchangeKlineInterval(in kline.Interval) string
- func (b *Bittrex) GenerateDefaultSubscriptions() ([]stream.ChannelSubscription, error)
- func (b *Bittrex) GetAccountBalanceByCurrency(currency string) (BalanceData, error)
- func (b *Bittrex) GetActiveOrders(req *order.GetOrdersRequest) ([]order.Detail, error)
- func (b *Bittrex) GetBalances() ([]BalanceData, error)
- func (b *Bittrex) GetClosedDeposits() ([]DepositData, error)
- func (b *Bittrex) GetClosedDepositsForCurrency(currency string) ([]DepositData, error)
- func (b *Bittrex) GetClosedDepositsPaginated(pageSize int, previousPageTokenOptional ...string) ([]DepositData, error)
- func (b *Bittrex) GetClosedWithdrawals() ([]WithdrawalData, error)
- func (b *Bittrex) GetClosedWithdrawalsForCurrency(currency string) ([]WithdrawalData, error)
- func (b *Bittrex) GetCryptoDepositAddress(currency string) (AddressData, error)
- func (b *Bittrex) GetCurrencies() ([]CurrencyData, error)
- func (b *Bittrex) GetDefaultConfig() (*config.ExchangeConfig, error)
- func (b *Bittrex) GetDepositAddress(cryptocurrency currency.Code, _ string) (string, 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) GetHistoricCandles(pair currency.Pair, a asset.Item, start, end time.Time, ...) (kline.Item, error)
- func (b *Bittrex) GetHistoricCandlesExtended(pair currency.Pair, a asset.Item, start, end time.Time, ...) (kline.Item, error)
- func (b *Bittrex) GetHistoricTrades(_ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error)
- func (b *Bittrex) GetHistoricalCandles(marketName, candleInterval, candleType string, year, month, day int) ([]CandleData, error)
- func (b *Bittrex) GetMarketHistory(currency string) ([]TradeData, error)
- func (b *Bittrex) GetMarketSummaries() ([]MarketSummaryData, error)
- func (b *Bittrex) GetMarketSummary(marketName string) (MarketSummaryData, error)
- func (b *Bittrex) GetMarkets() ([]MarketData, error)
- func (b *Bittrex) GetOpenDeposits() ([]DepositData, error)
- func (b *Bittrex) GetOpenDepositsForCurrency(currency string) ([]DepositData, error)
- func (b *Bittrex) GetOpenOrders(marketName string) ([]OrderData, int64, error)
- func (b *Bittrex) GetOpenWithdrawals() ([]WithdrawalData, error)
- func (b *Bittrex) GetOrder(uuid string) (OrderData, error)
- func (b *Bittrex) GetOrderHistory(req *order.GetOrdersRequest) ([]order.Detail, error)
- func (b *Bittrex) GetOrderHistoryForCurrency(currency string) ([]OrderData, error)
- func (b *Bittrex) GetOrderInfo(orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error)
- func (b *Bittrex) GetOrderbook(marketName string, depth int64) (OrderbookData, int64, error)
- func (b *Bittrex) GetRecentCandles(marketName, candleInterval, candleType string) ([]CandleData, error)
- func (b *Bittrex) GetRecentTrades(p currency.Pair, assetType asset.Item) ([]trade.Data, error)
- func (b *Bittrex) GetTicker(marketName string) (TickerData, error)
- func (b *Bittrex) GetWithdrawalFee(c currency.Code) (float64, error)
- func (b *Bittrex) GetWithdrawalsHistory(c currency.Code) (resp []exchange.WithdrawalHistory, err error)
- func (b *Bittrex) ModifyOrder(action *order.Modify) (string, error)
- func (b *Bittrex) Order(marketName, side, orderType string, timeInForce TimeInForce, ...) (OrderData, error)
- func (b *Bittrex) ProcessUpdateOB(pair currency.Pair, message *OrderbookUpdateMessage) error
- func (b *Bittrex) Run()
- func (b *Bittrex) SeedLocalCacheWithOrderBook(p currency.Pair, sequence int64, orderbookNew *OrderbookData) error
- func (b *Bittrex) SeedLocalOBCache(p currency.Pair) error
- func (b *Bittrex) SendAuthHTTPRequest(ep exchange.URL, method, action string, params url.Values, ...) error
- func (b *Bittrex) SendHTTPRequest(ep exchange.URL, path string, result interface{}, resultHeader *http.Header) error
- func (b *Bittrex) SetDefaults()
- func (b *Bittrex) Setup(exch *config.ExchangeConfig) error
- func (b *Bittrex) Start(wg *sync.WaitGroup)
- func (b *Bittrex) SubmitOrder(s *order.Submit) (order.SubmitResponse, error)
- func (b *Bittrex) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error
- func (b *Bittrex) SynchroniseWebsocketOrderbook()
- func (b *Bittrex) Unsubscribe(channelsToUnsubscribe []stream.ChannelSubscription) error
- func (b *Bittrex) UpdateAccountInfo(assetType asset.Item) (account.Holdings, error)
- func (b *Bittrex) UpdateLocalOBBuffer(update *OrderbookUpdateMessage) (bool, error)
- func (b *Bittrex) UpdateOrderbook(p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (b *Bittrex) UpdateTicker(p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (b *Bittrex) UpdateTradablePairs(forceUpdate bool) error
- func (b *Bittrex) ValidateCredentials(assetType asset.Item) error
- func (b *Bittrex) Withdraw(currency, paymentID, address string, quantity float64) (WithdrawalData, error)
- func (b *Bittrex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *Bittrex) WithdrawFiatFunds(_ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *Bittrex) WithdrawFiatFundsToInternationalBank(_ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *Bittrex) WsAuth() error
- func (b *Bittrex) WsConnect() error
- func (b *Bittrex) WsProcessUpdateMarketSummary(marketSummaryData *MarketSummaryData) error
- func (b *Bittrex) WsProcessUpdateOrder(data *OrderUpdateMessage) error
- func (b *Bittrex) WsProcessUpdateTicker(tickerData TickerData) error
- func (b *Bittrex) WsSignalRHandshake(result interface{}) error
- type BulkCancelResultData
- type CancelOrderRequest
- type CandleData
- type CurrencyData
- type DepositData
- type MarketData
- type MarketSummaryData
- type OrderData
- type OrderUpdateMessage
- type OrderbookData
- type OrderbookEntryData
- type OrderbookUpdateMessage
- type TickerCache
- type TickerData
- type TimeInForce
- type TradeData
- type WithdrawalData
- type WsAuthResponse
- type WsEventRequest
- type WsEventResponse
- type WsEventStatus
- type WsPendingRequest
- type WsSignalRHandshakeData
- type WsSubscriptionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressData ¶
type AddressData struct { Status string `json:"status"` CurrencySymbol string `json:"currencySymbol"` CryptoAddress string `json:"cryptoAddress"` CryptoAddressTag string `json:"cryptoAddressTag"` }
AddressData holds address data Status is REQUESTED or PROVISIONED
type BalanceData ¶
type BalanceData struct { CurrencySymbol string `json:"currencySymbol"` Total float64 `json:"total,string"` Available float64 `json:"available,string"` UpdatedAt time.Time `json:"updatedAt"` }
BalanceData holds balance data
type Bittrex ¶
type Bittrex struct { exchange.Base WsSequenceOrders int64 // contains filtered or unexported fields }
Bittrex is the overaching type across the bittrex methods
func (*Bittrex) CancelAllOrders ¶
CancelAllOrders cancels all orders associated with a currency pair, or cancels all orders for all pairs if no pair was specified
func (*Bittrex) CancelBatchOrders ¶
CancelBatchOrders cancels an orders by their corresponding ID numbers
func (*Bittrex) CancelExistingOrder ¶
CancelExistingOrder is used to cancel a buy or sell order.
func (*Bittrex) CancelOpenOrders ¶
func (b *Bittrex) CancelOpenOrders(market string) ([]BulkCancelResultData, error)
CancelOpenOrders is used to cancel all open orders for a specific market Or cancel all orders for all markets if the parameter `markets` is set to ""
func (*Bittrex) CancelOrder ¶
CancelOrder cancels an order by its corresponding ID number
func (*Bittrex) ConstructOrderDetail ¶
ConstructOrderDetail constructs an order detail item from the underlying data
func (*Bittrex) FetchAccountInfo ¶
FetchAccountInfo retrieves balances for all enabled currencies
func (*Bittrex) FetchOrderbook ¶
func (b *Bittrex) FetchOrderbook(currency currency.Pair, assetType asset.Item) (*orderbook.Base, error)
FetchOrderbook returns orderbook base on the currency pair
func (*Bittrex) FetchTicker ¶
FetchTicker returns the ticker for a currency pair
func (*Bittrex) FetchTradablePairs ¶
FetchTradablePairs returns a list of the exchanges tradable pairs
func (*Bittrex) FormatExchangeKlineInterval ¶
FormatExchangeKlineInterval returns Interval to string Overrides Base function
func (*Bittrex) GenerateDefaultSubscriptions ¶
func (b *Bittrex) GenerateDefaultSubscriptions() ([]stream.ChannelSubscription, error)
GenerateDefaultSubscriptions Adds default subscriptions to websocket to be handled by ManageSubscriptions()
func (*Bittrex) GetAccountBalanceByCurrency ¶
func (b *Bittrex) GetAccountBalanceByCurrency(currency string) (BalanceData, error)
GetAccountBalanceByCurrency is used to retrieve the balance from your account for a specific currency. ie. "btc" or "ltc"
func (*Bittrex) GetActiveOrders ¶
GetActiveOrders retrieves any orders that are active/open
func (*Bittrex) GetBalances ¶
func (b *Bittrex) GetBalances() ([]BalanceData, error)
GetBalances is used to retrieve all balances from your account
func (*Bittrex) GetClosedDeposits ¶
func (b *Bittrex) GetClosedDeposits() ([]DepositData, error)
GetClosedDeposits is used to retrieve your deposit history.
func (*Bittrex) GetClosedDepositsForCurrency ¶
func (b *Bittrex) GetClosedDepositsForCurrency(currency string) ([]DepositData, error)
GetClosedDepositsForCurrency is used to retrieve your deposit history for the specified currency
func (*Bittrex) GetClosedDepositsPaginated ¶
func (b *Bittrex) GetClosedDepositsPaginated(pageSize int, previousPageTokenOptional ...string) ([]DepositData, error)
GetClosedDepositsPaginated is used to retrieve your deposit history. The maximum page size is 200 and it defaults to 100. PreviousPageToken is the unique identifier of the item that the resulting query result should end before, in the sort order of the given endpoint. Used for traversing a paginated set in the reverse direction.
func (*Bittrex) GetClosedWithdrawals ¶
func (b *Bittrex) GetClosedWithdrawals() ([]WithdrawalData, error)
GetClosedWithdrawals is used to retrieve your withdrawal history.
func (*Bittrex) GetClosedWithdrawalsForCurrency ¶
func (b *Bittrex) GetClosedWithdrawalsForCurrency(currency string) ([]WithdrawalData, error)
GetClosedWithdrawalsForCurrency is used to retrieve your withdrawal history for the specified currency.
func (*Bittrex) GetCryptoDepositAddress ¶
func (b *Bittrex) GetCryptoDepositAddress(currency string) (AddressData, error)
GetCryptoDepositAddress is used to retrieve an address for a specific currency
func (*Bittrex) GetCurrencies ¶
func (b *Bittrex) GetCurrencies() ([]CurrencyData, error)
GetCurrencies is used to get all supported currencies at Bittrex
func (*Bittrex) GetDefaultConfig ¶
func (b *Bittrex) GetDefaultConfig() (*config.ExchangeConfig, error)
GetDefaultConfig returns a default exchange config
func (*Bittrex) GetDepositAddress ¶
GetDepositAddress returns a deposit address for a specified currency
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) GetHistoricCandles ¶
func (b *Bittrex) GetHistoricCandles(pair currency.Pair, a asset.Item, start, end time.Time, interval kline.Interval) (kline.Item, error)
GetHistoricCandles returns candles between a time period for a set time interval Candles set size returned by Bittrex depends on interval length: - 1m interval: candles for 1 day (0:00 - 23:59) - 5m interval: candles for 1 day (0:00 - 23:55) - 1 hour interval: candles for 31 days - 1 day interval: candles for 366 days This implementation rounds returns candles up to the next interval or to the end time (whichever comes first)
func (*Bittrex) GetHistoricCandlesExtended ¶
func (b *Bittrex) GetHistoricCandlesExtended(pair currency.Pair, a asset.Item, start, end time.Time, interval kline.Interval) (kline.Item, error)
GetHistoricCandlesExtended returns candles between a time period for a set time interval
func (*Bittrex) GetHistoricTrades ¶
func (b *Bittrex) GetHistoricTrades(_ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error)
GetHistoricTrades returns historic trade data within the timeframe provided Bittrex only reports recent trades
func (*Bittrex) GetHistoricalCandles ¶
func (b *Bittrex) GetHistoricalCandles(marketName, candleInterval, candleType string, year, month, day int) ([]CandleData, error)
GetHistoricalCandles retrieves recent candles Type: TRADE or MIDPOINT
func (*Bittrex) GetMarketHistory ¶
GetMarketHistory retrieves the latest trades that have occurred for a specific market
func (*Bittrex) GetMarketSummaries ¶
func (b *Bittrex) GetMarketSummaries() ([]MarketSummaryData, error)
GetMarketSummaries is used to get the last 24 hour summary of all active exchanges
func (*Bittrex) GetMarketSummary ¶
func (b *Bittrex) GetMarketSummary(marketName string) (MarketSummaryData, error)
GetMarketSummary is used to get the last 24 hour summary of all active exchanges by currency pair (ltc-btc).
func (*Bittrex) GetMarkets ¶
func (b *Bittrex) GetMarkets() ([]MarketData, error)
GetMarkets is used to get the open and available trading markets at Bittrex along with other meta data.
func (*Bittrex) GetOpenDeposits ¶
func (b *Bittrex) GetOpenDeposits() ([]DepositData, error)
GetOpenDeposits is used to retrieve your open deposits.
func (*Bittrex) GetOpenDepositsForCurrency ¶
func (b *Bittrex) GetOpenDepositsForCurrency(currency string) ([]DepositData, error)
GetOpenDepositsForCurrency is used to retrieve your open deposits for the specified currency
func (*Bittrex) GetOpenOrders ¶
GetOpenOrders returns all orders that you currently have opened. A specific market can be requested for example "ltc-btc"
func (*Bittrex) GetOpenWithdrawals ¶
func (b *Bittrex) GetOpenWithdrawals() ([]WithdrawalData, error)
GetOpenWithdrawals is used to retrieve your withdrawal history. If currency omitted it will return the entire history
func (*Bittrex) GetOrderHistory ¶
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*Bittrex) GetOrderHistoryForCurrency ¶
GetOrderHistoryForCurrency is used to retrieve your order history. If marketName is omitted it will return the entire order History.
func (*Bittrex) GetOrderInfo ¶
func (b *Bittrex) GetOrderInfo(orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error)
GetOrderInfo returns information on a current open order
func (*Bittrex) GetOrderbook ¶
GetOrderbook method returns current order book information by currency and depth. "marketSymbol" ie ltc-btc "depth" is either 1, 25 or 500. Server side, the depth defaults to 25.
func (*Bittrex) GetRecentCandles ¶
func (b *Bittrex) GetRecentCandles(marketName, candleInterval, candleType string) ([]CandleData, error)
GetRecentCandles retrieves recent candles; Interval: MINUTE_1, MINUTE_5, HOUR_1, or DAY_1 Type: TRADE or MIDPOINT
func (*Bittrex) GetRecentTrades ¶
GetRecentTrades returns the most recent trades for a currency and asset
func (*Bittrex) GetTicker ¶
func (b *Bittrex) GetTicker(marketName string) (TickerData, error)
GetTicker sends a public get request and returns current ticker information on the supplied currency. Example currency input param "ltc-btc".
func (*Bittrex) GetWithdrawalFee ¶
GetWithdrawalFee returns the fee for withdrawing from the exchange
func (*Bittrex) GetWithdrawalsHistory ¶
func (b *Bittrex) GetWithdrawalsHistory(c currency.Code) (resp []exchange.WithdrawalHistory, err error)
GetWithdrawalsHistory returns previous withdrawals data
func (*Bittrex) ModifyOrder ¶
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*Bittrex) Order ¶
func (b *Bittrex) Order(marketName, side, orderType string, timeInForce TimeInForce, price, amount, ceiling float64) (OrderData, error)
Order places an order
func (*Bittrex) ProcessUpdateOB ¶
func (b *Bittrex) ProcessUpdateOB(pair currency.Pair, message *OrderbookUpdateMessage) error
ProcessUpdateOB processes the websocket orderbook update
func (*Bittrex) SeedLocalCacheWithOrderBook ¶
func (b *Bittrex) SeedLocalCacheWithOrderBook(p currency.Pair, sequence int64, orderbookNew *OrderbookData) error
SeedLocalCacheWithOrderBook seeds the local orderbook cache
func (*Bittrex) SeedLocalOBCache ¶
SeedLocalOBCache seeds depth data
func (*Bittrex) SendAuthHTTPRequest ¶
func (b *Bittrex) SendAuthHTTPRequest(ep exchange.URL, method, action string, params url.Values, data, result interface{}, resultHeader *http.Header) error
SendAuthHTTPRequest sends an authenticated request
func (*Bittrex) SendHTTPRequest ¶
func (b *Bittrex) SendHTTPRequest(ep exchange.URL, path string, result interface{}, resultHeader *http.Header) error
SendHTTPRequest sends an unauthenticated HTTP request
func (*Bittrex) SetDefaults ¶
func (b *Bittrex) SetDefaults()
SetDefaults sets the basic defaults for Bittrex
func (*Bittrex) Setup ¶
func (b *Bittrex) Setup(exch *config.ExchangeConfig) error
Setup takes in the supplied exchange configuration details and sets params
func (*Bittrex) SubmitOrder ¶
SubmitOrder submits a new order
func (*Bittrex) Subscribe ¶
func (b *Bittrex) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error
Subscribe sends a websocket message to receive data from the channel
func (*Bittrex) SynchroniseWebsocketOrderbook ¶
func (b *Bittrex) SynchroniseWebsocketOrderbook()
SynchroniseWebsocketOrderbook synchronises full orderbook for currency pair asset
func (*Bittrex) Unsubscribe ¶
func (b *Bittrex) Unsubscribe(channelsToUnsubscribe []stream.ChannelSubscription) error
Unsubscribe sends a websocket message to receive data from the channel
func (*Bittrex) UpdateAccountInfo ¶
UpdateAccountInfo retrieves balances for all enabled currencies
func (*Bittrex) UpdateLocalOBBuffer ¶
func (b *Bittrex) UpdateLocalOBBuffer(update *OrderbookUpdateMessage) (bool, error)
UpdateLocalOBBuffer updates and returns the most recent iteration of the orderbook
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) UpdateTradablePairs ¶
UpdateTradablePairs updates the exchanges available pairs and stores them in the exchanges config
func (*Bittrex) ValidateCredentials ¶
ValidateCredentials validates current credentials used for wrapper functionality
func (*Bittrex) Withdraw ¶
func (b *Bittrex) Withdraw(currency, paymentID, address string, quantity float64) (WithdrawalData, error)
Withdraw is used to withdraw funds from your account.
func (*Bittrex) WithdrawCryptocurrencyFunds ¶
func (b *Bittrex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*Bittrex) WithdrawFiatFunds ¶
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*Bittrex) WithdrawFiatFundsToInternationalBank ¶
func (b *Bittrex) WithdrawFiatFundsToInternationalBank(_ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
func (*Bittrex) WsAuth ¶
WsAuth sends an authentication message to receive auth data Authentications expire after 10 minutes
func (*Bittrex) WsProcessUpdateMarketSummary ¶
func (b *Bittrex) WsProcessUpdateMarketSummary(marketSummaryData *MarketSummaryData) error
WsProcessUpdateMarketSummary processes an update on the ticker
func (*Bittrex) WsProcessUpdateOrder ¶
func (b *Bittrex) WsProcessUpdateOrder(data *OrderUpdateMessage) error
WsProcessUpdateOrder processes an update on the open orders
func (*Bittrex) WsProcessUpdateTicker ¶
func (b *Bittrex) WsProcessUpdateTicker(tickerData TickerData) error
WsProcessUpdateTicker processes an update on the ticker
func (*Bittrex) WsSignalRHandshake ¶
WsSignalRHandshake requests the SignalR connection token over https
type BulkCancelResultData ¶
type BulkCancelResultData struct { ID string `json:"id"` StatusCode string `json:"statusCode"` Result OrderData `json:"result"` }
BulkCancelResultData holds the result of a bulk cancel action
type CancelOrderRequest ¶
type CancelOrderRequest struct {
OrderID int64 `json:"orderId,string"`
}
CancelOrderRequest holds request data for CancelOrder
type CandleData ¶
type CandleData struct { StartsAt time.Time `json:"startsAt"` Open float64 `json:"open,string"` High float64 `json:"high,string"` Low float64 `json:"low,string"` Close float64 `json:"close,string"` Volume float64 `json:"volume,string"` QuoteVolume float64 `json:"quoteVolume,string"` }
CandleData holds candle data
type CurrencyData ¶
type CurrencyData struct { Symbol string `json:"symbol"` Name string `json:"name"` CoinType string `json:"coinType"` Status string `json:"status"` MinConfirmations int32 `json:"minConfirmations"` Notice string `json:"notice"` TxFee float64 `json:"txFee,string"` LogoURL string `json:"logoUrl"` ProhibitedIn []string `json:"prohibitedIn"` }
CurrencyData holds currency data Status is ONLINE or OFFLINE
type DepositData ¶
type DepositData struct { ID string `json:"id"` CurrencySymbol string `json:"currencySymbol"` Quantity float64 `json:"quantity,string"` CryptoAddress string `json:"cryptoAddress"` CryptoAddressTag string `json:"cryptoAddressTag"` TxID string `json:"txId"` Confirmations int32 `json:"confirmations"` UpdatedAt time.Time `json:"updatedAt"` CompletedAt time.Time `json:"completedAt"` Status string `json:"status"` Source string `json:"source"` }
DepositData holds deposit data
type MarketData ¶
type MarketData struct { Symbol string `json:"symbol"` BaseCurrencySymbol string `json:"baseCurrencySymbol"` QuoteCurrencySymbol string `json:"quoteCurrencySymbol"` MinTradeSize float64 `json:"minTradeSize,string"` Precision int32 `json:"precision"` Status string `json:"status"` CreatedAt time.Time `json:"createdAt"` Notice string `json:"notice"` ProhibitedIn []string `json:"prohibitedIn"` }
MarketData stores market data
type MarketSummaryData ¶
type MarketSummaryData struct { Symbol string `json:"symbol"` High float64 `json:"high,string"` Low float64 `json:"low,string"` Volume float64 `json:"volume,string"` QuoteVolume float64 `json:"quoteVolume,string"` PercentChange float64 `json:"percentChange,string"` UpdatedAt time.Time `json:"updatedAt"` }
MarketSummaryData stores market summary data
type OrderData ¶
type OrderData struct { ID string `json:"id"` MarketSymbol string `json:"marketSymbol"` Direction string `json:"direction"` Type string `json:"type"` Quantity float64 `json:"quantity,string"` Limit float64 `json:"limit,string"` Ceiling float64 `json:"ceiling,string"` TimeInForce string `json:"timeInForce"` ClientOrderID string `json:"clientOrderId"` FillQuantity float64 `json:"fillQuantity,string"` Commission float64 `json:"commission,string"` Proceeds float64 `json:"proceeds,string"` Status string `json:"status"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` ClosedAt time.Time `json:"closedAt"` OrderToCancel struct { Type string `json:"type,string"` ID string `json:"id,string"` } `json:"orderToCancel"` }
OrderData holds order data
type OrderUpdateMessage ¶
type OrderUpdateMessage struct { AccountID string `json:"accountId"` Sequence int `json:"int,string"` Delta OrderData `json:"delta"` }
OrderUpdateMessage holds websocket order update messages
type OrderbookData ¶
type OrderbookData struct { Bid []OrderbookEntryData `json:"bid"` Ask []OrderbookEntryData `json:"ask"` }
OrderbookData holds the order book data
type OrderbookEntryData ¶
type OrderbookEntryData struct { Quantity float64 `json:"quantity,string"` Rate float64 `json:"rate,string"` }
OrderbookEntryData holds an order book entry
type OrderbookUpdateMessage ¶
type OrderbookUpdateMessage struct { MarketSymbol string `json:"marketSymbol"` Depth int `json:"depth"` Sequence int64 `json:"sequence"` BidDeltas []OrderbookEntryData `json:"bidDeltas"` AskDeltas []OrderbookEntryData `json:"askDeltas"` }
OrderbookUpdateMessage holds websocket orderbook update messages
type TickerCache ¶
type TickerCache struct { MarketSummaries map[string]*MarketSummaryData Tickers map[string]*TickerData sync.RWMutex }
TickerCache holds ticker and market summary data in order to combine them when processing data
type TickerData ¶
type TickerData struct { Symbol string `json:"symbol"` LastTradeRate float64 `json:"lastTradeRate,string"` BidRate float64 `json:"bidRate,string"` AskRate float64 `json:"askRate,string"` }
TickerData stores ticker data
type TimeInForce ¶
type TimeInForce string
TimeInForce defines timeInForce types
const ( GoodTilCancelled TimeInForce = "GOOD_TIL_CANCELLED" ImmediateOrCancel TimeInForce = "IMMEDIATE_OR_CANCEL" FillOrKill TimeInForce = "FILL_OR_KILL" PostOnlyGoodTilCancelled TimeInForce = "POST_ONLY_GOOD_TIL_CANCELLED" BuyNow TimeInForce = "BUY_NOW" )
All order status types
type TradeData ¶
type TradeData struct { ID string `json:"id"` ExecutedAt time.Time `json:"executedAt"` Quantity float64 `json:"quantity,string"` Rate float64 `json:"rate,string"` TakerSide string `json:"takerSide"` }
TradeData stores trades data
type WithdrawalData ¶
type WithdrawalData struct { ID string `json:"id"` CurrencySymbol string `json:"currencySymbol"` Quantity float64 `json:"quantity,string"` CryptoAddress string `json:"cryptoAddress"` CryptoAddressTag string `json:"cryptoAddressTag"` TxCost float64 `json:"txCost,string"` TxID string `json:"txId"` Status string `json:"status"` CreatedAt time.Time `json:"createdAt"` CompletedAt time.Time `json:"completedAt"` ClientWithdrawalID string `json:"clientWithdrawalId"` }
WithdrawalData holds withdrawal data
type WsAuthResponse ¶
type WsAuthResponse struct { C string `json:"C"` S int `json:"S"` G string `json:"G"` Response WsEventStatus `json:"R"` InvocationID int64 `json:"I,string"` Message []struct { Hub string `json:"H"` Method string `json:"M"` Arguments []string `json:"A"` } `json:"M"` }
WsAuthResponse holds data on the websocket response
type WsEventRequest ¶
type WsEventRequest struct { Hub string `json:"H"` Method string `json:"M"` Arguments interface{} `json:"A"` InvocationID int64 `json:"I"` }
WsEventRequest holds data on websocket requests
type WsEventResponse ¶
type WsEventResponse struct { C string `json:"C"` S int `json:"S"` G string `json:"G"` Response interface{} `json:"R"` InvocationID int64 `json:"I,string"` Message []struct { Hub string `json:"H"` Method string `json:"M"` Arguments []string `json:"A"` } `json:"M"` }
WsEventResponse holds data on the websocket response
type WsEventStatus ¶
WsEventStatus holds data on the websocket event status
type WsPendingRequest ¶
type WsPendingRequest struct { WsEventRequest ChannelsToSubscribe *[]stream.ChannelSubscription }
WsPendingRequest holds pending requests
type WsSignalRHandshakeData ¶
type WsSignalRHandshakeData struct { URL string `json:"Url"` // Path to the SignalR endpoint ConnectionToken string `json:"ConnectionToken"` // Connection token assigned by the server ConnectionID string `json:"ConnectionId"` // The ID of the connection KeepAliveTimeout float64 `json:"KeepAliveTimeout"` // Representing the amount of time to wait before sending a keep alive packet over an idle connection DisconnectTimeout float64 `json:"DisconnectTimeout"` // Represents the amount of time to wait after a connection goes away before raising the disconnect event ConnectionTimeout float64 `json:"ConnectionTimeout"` // Represents the amount of time to leave a connection open before timing out TryWebSockets bool `json:"TryWebSockets"` // Whether the server supports websockets ProtocolVersion string `json:"ProtocolVersion"` // The version of the protocol used for communication TransportConnectTimeout float64 `json:"TransportConnectTimeout"` // The maximum amount of time the client should try to connect to the server using a given transport LongPollDelay float64 `json:"LongPollDelay"` // The time to tell the browser to wait before reestablishing a long poll connection after data is sent from the server. }
WsSignalRHandshakeData holds data for the SignalR websocket wrapper handshake
type WsSubscriptionResponse ¶
type WsSubscriptionResponse struct { C string `json:"C"` S int `json:"S"` G string `json:"G"` Response []WsEventStatus `json:"R"` InvocationID int64 `json:"I,string"` Message []struct { Hub string `json:"H"` Method string `json:"M"` Arguments []string `json:"A"` } `json:"M"` }
WsSubscriptionResponse holds data on the websocket response