Documentation
¶
Index ¶
- Constants
- type Balance
- type CEX
- type Error
- type Event
- type History
- type MarketData
- type MarketDataUpdate
- type OHLCV24
- type Order
- type OrderCancelled
- type OrderStatus
- type PriceLevel
- type SymbolBalance
- type TickEvent
- type Ticker
- type Trade
- type Tx
- type Websocket
- func (ws *Websocket) CancelOrder(id string) (ev Event, err error)
- func (ws *Websocket) Events() <-chan Event
- func (ws *Websocket) GetBalance() (ev Event, err error)
- func (ws *Websocket) Orders(sym1, sym2 string) (ev Event, err error)
- func (ws *Websocket) PlaceOrder(o Order) (ev Event, err error)
- func (ws *Websocket) SubscribeOrderbook(sym1, sym2 string) (err error)
- func (ws *Websocket) SubscribePublic(tickers []string) (err error)
- func (ws *Websocket) Ticker(s1, s2 string) (ev Event, err error)
Constants ¶
View Source
const ( Buy = "buy" Sell = "sell" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type MarketData ¶
type MarketData struct {
ID int64 `json:"id"`
Timestamp int64 `json:"timestamp"`
Pair string `json:"pair"`
BuyTotal decimal.Decimal `json:"buy_total"`
SellTotal decimal.Decimal `json:"sell_total"`
Buy []PriceLevel `json:"buy"`
Sell []PriceLevel `json:"sell"`
Symbol1 string `json:"symbol1"`
Symbol2 string `json:"symbol2"`
Full bool `json:"-"`
}
type MarketDataUpdate ¶
type MarketDataUpdate struct {
ID int64 `json:"id"`
Timestamp int64 `json:"timestamp"`
Pair string `json:"pair"`
BuyTotal decimal.Decimal `json:"buy_total"`
SellTotal decimal.Decimal `json:"sell_total"`
Bids []PriceLevel `json:"bids"`
Asks []PriceLevel `json:"asks"`
Symbol1 string `json:"symbol1"`
Symbol2 string `json:"symbol2"`
Full bool `json:"-"`
}
type OrderCancelled ¶
type OrderStatus ¶
type OrderStatus struct {
ID string `json:"id"`
Action string `json:"action"`
Time int64 `json:"time"`
Price decimal.Decimal `json:"price"`
Amount decimal.Decimal `json:"amount"`
Pending decimal.Decimal `json:"pending"`
Remains decimal.Decimal `json:"remains"`
Symbol1 string `json:"symbol1"`
Symbol2 string `json:"symbol2"`
Completed bool `json:"complete"`
Cancel bool `json:"cancel"`
}
type PriceLevel ¶
type SymbolBalance ¶
type Ticker ¶
type Ticker struct {
Timestamp int64 `json:"timestamp,omitempty,string"`
Low decimal.Decimal `json:"low,omitempty"`
High decimal.Decimal `json:"high,omitempty"`
Last decimal.Decimal `json:"last,omitempty"`
Volume decimal.Decimal `json:"volume,omitempty"`
Volume30d decimal.Decimal `json:"volume30d,omitempty"`
Bid decimal.Decimal `json:"bid,omitempty"`
Ask decimal.Decimal `json:"ask,omitempty"`
PriceChange decimal.Decimal `json:"priceChange,omitempty"`
PriceChangePercent decimal.Decimal `json:"priceChangePercentage,omitempty"`
Pair []string `json:"pair,omitempty"`
Symbol1 string `json:"-"`
Symbol2 string `json:"-"`
}
type Tx ¶
type Tx struct {
ID string `json:"id"`
Action string `json:"action"`
Order string `json:"order"`
BuyOrder string `json:"buy_order"`
SellOrder string `json:"sell_order"`
Time int64 `json:"time"`
User string `json:"user"`
Price decimal.Decimal `json:"price"`
Amount decimal.Decimal `json:"amount"`
Balance decimal.Decimal `json:"balance"`
Fee decimal.Decimal `json:"fee"`
Symbol1 string `json:"symbol1"`
Symbol2 string `json:"symbol2"`
}
type Websocket ¶
type Websocket struct {
// contains filtered or unexported fields
}
func (*Websocket) GetBalance ¶
func (*Websocket) SubscribeOrderbook ¶
func (*Websocket) SubscribePublic ¶
Subscribe subscribes to "tickers" (trades) or "pair-A-B" where A and B are BTC, ETH, USD and so on.
Click to show internal directories.
Click to hide internal directories.