Documentation ¶
Overview ¶
Package HitBTC is an implementation of the HitBTC 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 Book
- type BookEntry
- type HitBtc
- func (b *HitBtc) CancelClientOrderId(clientOrderId string) (order Order, err error)
- func (b *HitBtc) CancelOrder(currencyPair string) (orders []Order, err error)
- func (b *HitBtc) GetOpenOrders(currencyPair string) (orders []Order, err error)
- func (b *HitBtc) GetOrder(orderId string) (orders []Order, err error)
- func (b *HitBtc) GetOrderBook(currencyPair string, limit uint32) (book Book, err error)
- func (b *HitBtc) GetOrderHistory() (orders []Order, err error)
- func (b *HitBtc) GetSymbols() (symbols []Symbol, err error)
- func (b *HitBtc) GetTicker(market string) (ticker Ticker, err error)
- func (b *HitBtc) GetTrades(currencyPair string) (trades []Trade, err error)
- func (b *HitBtc) PlaceOrder(clientOrderId string, symbol string, side string, orderType string, ...) (responseOrder Order, err error)
- type Order
- type Symbol
- type Ticker
- type Trade
Constants ¶
View Source
const ( ORDER_TYPE_LIMIT = "limit" ORDER_TYPE_MARKET = "market" ORDER_TYPE_STOP_LIMIT = "stopLimit" ORDER_TYPE_STOP_MARKET = "stopMarket" )
View Source
const ( GTC = "GTC" IOC = "IOC" FOK = "FOK" GTD = "GTD" )
View Source
const (
API_BASE = "https://api.hitbtc.com/api/2" // HitBtc API endpoint
)
Variables ¶
Functions ¶
func NewClient ¶
func NewClient(apiKey, apiSecret string) (c *client)
NewClient return a new HitBtc HTTP client
func NewClientWithCustomHttpConfig ¶
NewClientWithCustomHttpConfig returns a new HitBtc HTTP client using the predefined http client
func NewClientWithCustomTimeout ¶
NewClient returns a new HitBtc HTTP client with custom timeout
Types ¶
type HitBtc ¶
type HitBtc struct {
// contains filtered or unexported fields
}
HitBtc represent a HitBTC client
func NewWithCustomHttpClient ¶
NewWithCustomHttpClient returns an instantiated HitBTC struct with custom http client
func NewWithCustomTimeout ¶
NewWithCustomTimeout returns an instantiated HitBTC struct with custom timeout
func (*HitBtc) CancelClientOrderId ¶
func (*HitBtc) CancelOrder ¶
func (*HitBtc) GetOpenOrders ¶
func (*HitBtc) GetOrderBook ¶
func (*HitBtc) GetOrderHistory ¶
func (*HitBtc) GetSymbols ¶
GetSymbols is used to get the open and available trading markets at HitBtc along with other meta data.
type Order ¶
type Order struct { Id uint64 `json:"id"` ClientOrderId string `json:"clientOrderId"` Symbol string `json:"symbol"` Side string `json:"side"` Status string `json:"status"` Type string `json:"type"` TimeInForce string `json:"timeInForce"` Quantity float64 `json:"quantity,string"` Price string `json:"price,omitempty"` CumQuantity float64 `json:"cumQuantity,string,omitempty"` Created time.Time `json:"createdAt,omitempty"` Updated time.Time `json:"updatedAt,omitempty"` StopPrice string `json:"stopPrice,omitempty"` Expire time.Time `json:"expireTime,omitempty"` }
func (*Order) ParsePrice ¶
func (*Order) ParseStopPrice ¶
func (*Order) UnmarshalJSON ¶
type Symbol ¶
type Symbol struct { Id string `json:"id"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` QuantityIncrement float64 `json:"quantityIncrement,string"` TickSize float64 `json:"tickSize,string"` TakeLiquidityRate float64 `json:"takeLiquidityRate,string"` ProvideLiquidityRate float64 `json:"provideLiquidityRate,string"` FeeCurrency string `json:"feeCurrency"` }
type Ticker ¶
type Ticker struct { Ask float64 `json:"ask,string"` Bid float64 `json:"bid,string"` Last float64 `json:"last,string"` Open float64 `json:"open,string"` Low float64 `json:"low,string"` High float64 `json:"high,string"` Volume float64 `json:"volume,string"` VolumeQuote float64 `json:"volumeQuote,string"` Timestamp time.Time `json:"timestamp"` Symbol string `json:"symbol"` }
func (*Ticker) UnmarshalJSON ¶
type Trade ¶
type Trade struct { Id uint64 `json:"id"` OrderId uint64 `json:"orderId"` ClientOrderId string `json:"clientOrderId"` Symbol string `json:"symbol"` Side string `json:"side"` Price float64 `json:"price,string"` Quantity float64 `json:"quantity,string"` Fee float64 `json:"fee,string"` Timestamp time.Time `json:"timestamp"` }
func (*Trade) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.