Documentation ¶
Overview ¶
Package Bittrex is an implementation of the Bittrex API in Golang.
Index ¶
- Constants
- Variables
- func RequestsPerSecond(intensity int) float64
- type BookEntry
- type Call
- type Client
- func (client *Client) CancelConditionalOrder(orderId OrderId) (err error)
- func (client *Client) CancelOrder(orderId OrderId) (err error)
- func (client *Client) CreateConditionalOrder(marketSymbol string, operand Operand, triggerPrice float64, ...) (*ConditionalOrder, error)
- func (client *Client) CreateOrder(marketSymbol string, direction OrderSide, orderType OrderType, ...) (*Order, error)
- func (client *Client) GetMarketSummary(market string) (*MarketSummary, error)
- func (client *Client) GetMarkets() (markets []Market, err error)
- func (client *Client) GetOpenConditionalOrders(market string) (orders []ConditionalOrder, err error)
- func (client *Client) GetOpenOrders(market string) (orders Orders, err error)
- func (client *Client) GetOrder(orderId OrderId) (*Order, error)
- func (client *Client) GetOrderBook(market string, depth int) (*OrderBook, error)
- func (client *Client) GetOrderHistory(market string) (Orders, error)
- func (client *Client) GetTicker(market string) (*Ticker, error)
- type ConditionalOrder
- type Market
- type MarketSummary
- type NewOrder
- type Operand
- type Order
- type OrderBook
- type OrderId
- type OrderSide
- type OrderType
- type Orders
- type Ticker
- type TimeInForce
Constants ¶
View Source
const ( TIME_FORMAT = time.RFC3339 API_BASE = "https://api.bittrex.com" API_VERSION = "v3" )
View Source
const ( INTENSITY_LOW = 1 // 1 req/second INTENSITY_TWO = 2 // 0.5 req/second INTENSITY_SUPER = 60 // 1 req/minute )
Variables ¶
View Source
var ( BeforeRequest func(path string) (bool, error) = nil // -> (cooled, error) AfterRequest func() = nil HandleRateLimitErr func(path string, cooled bool) error = nil )
View Source
var Calls = []Call{}
View Source
var OperandString = map[Operand]string{ LTE: "LTE", GTE: "GTE", }
View Source
var OrderSideString = map[OrderSide]string{ BUY: "BUY", SELL: "SELL", }
View Source
var OrderTypeString = map[OrderType]string{ LIMIT: "LIMIT", MARKET: "MARKET", }
View Source
var TimeInForceString = map[TimeInForce]string{ GTC: "GOOD_TIL_CANCELLED", IOC: "IMMEDIATE_OR_CANCEL", FOK: "FILL_OR_KILL", }
Functions ¶
func RequestsPerSecond ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CancelConditionalOrder ¶
func (*Client) CancelOrder ¶
func (*Client) CreateConditionalOrder ¶
func (*Client) CreateOrder ¶
func (*Client) GetMarketSummary ¶
func (client *Client) GetMarketSummary(market string) (*MarketSummary, error)
func (*Client) GetMarkets ¶
func (*Client) GetOpenConditionalOrders ¶
func (client *Client) GetOpenConditionalOrders(market string) (orders []ConditionalOrder, err error)
func (*Client) GetOpenOrders ¶
func (*Client) GetOrderBook ¶
func (*Client) GetOrderHistory ¶
type ConditionalOrder ¶
type ConditionalOrder struct { Id OrderId `json:"id"` MarketSymbol string `json:"marketSymbol"` Operand string `json:"operand"` // LTE or GTE TriggerPrice float64 `json:"triggerPrice,string"` TrailingStopPercent float64 `json:"trailingStopPercent,string"` CreatedOrderId OrderId `json:"createdOrderId"` OrderToCreate *newOrder `json:"orderToCreate"` OrderToCancel *newCancelConditionalOrder `json:"orderToCancel"` ClientConditionalOrderId OrderId `json:"clientConditionalOrderId"` Status string `json:"status"` // OPEN or COMPLETED or CANCELLED or FAILED OrderCreationErrorCode string `json:"orderCreationErrorCode"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` ClosedAt string `json:"closedAt"` }
type Market ¶
type Market struct { Symbol string `json:"symbol"` BaseCurrencySymbol string `json:"baseCurrencySymbol"` QuoteCurrencySymbol string `json:"quoteCurrencySymbol"` MinTradeSize float64 `json:"minTradeSize,string"` Precision int `json:"precision"` Status string `json:"status"` CreatedAt string `json:"createdAt"` Notice string `json:"notice,omitempty"` ProhibitedIn []string `json:"prohibitedIn,omitempty"` }
func (*Market) Active ¶
true if this market is currently online (and not about to be removed), otherwise false.
func (*Market) IsProhibited ¶
func (*Market) MarketName ¶
MarketName returns the old (v1) market name that was reversed.
type MarketSummary ¶
type Order ¶
type Order struct { Id OrderId `json:"id"` MarketSymbol string `json:"marketSymbol"` Direction string `json:"direction"` // BUY or SELL OrderType string `json:"type"` // LIMIT or MARKET Quantity float64 `json:"quantity,string"` Limit float64 `json:"limit,string,omitempty"` Ceiling float64 `json:"ceiling,string,omitempty"` TimeInForce string `json:"timeInForce,omitempty"` ClientOrderId OrderId `json:"clientOrderId,omitempty"` FillQuantity float64 `json:"fillQuantity,string,omitempty"` Commission float64 `json:"commission,string,omitempty"` Proceeds float64 `json:"proceeds,string,omitempty"` Status string `json:"status,omitempty"` // OPEN or CLOSED CreatedAt string `json:"createdAt,omitempty"` UpdatedAt string `json:"updatedAt,omitempty"` ClosedAt string `json:"closedAt,omitempty"` OrderToCancel *newCancelConditionalOrder `json:"orderToCancel,omitempty"` }
func (*Order) MarketName ¶
MarketName returns the old (v1) market name that was reversed.
func (*Order) QuantityFilled ¶
type TimeInForce ¶
type TimeInForce int
const ( // Lasts until the order is completed, expired, or cancelled. The maximum lifetime of any order is 28 days. // Any order older then 28 days will be automatically canceled by the system and all reserved funds will be returned to your account. GTC TimeInForce = iota // Must be executed immediately. Any portion of an IOC order that cannot be filled immediately will be cancelled. IOC // This option allows orders to be placed which will be filled immediately and completely, or not at all. FOK )
func (*TimeInForce) String ¶
func (tif *TimeInForce) String() string
Click to show internal directories.
Click to hide internal directories.