Documentation
¶
Index ¶
Constants ¶
const ( // CSubscribeOrderbook method name CSubscribeOrderbook = "subscribeOrderbook" // CSnapshotOrderbookMethod notification snapshot CSnapshotOrderbookMethod = "snapshotOrderbook" // CUpdateOrderbookMethod notification update CUpdateOrderbookMethod = "updateOrderbook" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client engine
func NewWithHTTPClient ¶
func NewWithHTTPClient(httpClient httpFetcher) *Client
NewWithHTTPClient create and return Client instance with http client
func (*Client) FetchSymbol ¶
FetchSymbol return symbol
func (*Client) FetchSymbols ¶
FetchSymbols return symbols list
func (*Client) SubscribeToOrderBookFor ¶
func (c *Client) SubscribeToOrderBookFor(symbol string, tickHandler TickHandler, doneChan DoneChan, errHandler ErrorHandler) error
SubscribeToOrderBookFor return symbol
type Err ¶
type Err struct { Data struct { Code int `json:"code"` Message string `json:"message"` Description string `json:"description"` } `json:"error"` }
Err struct easyjson:json
func (Err) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Err) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Err) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Err) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Order ¶
Order ...
func (Order) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Order) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Order) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Order) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type SubscribeOrderBookResponse ¶
type SubscribeOrderBookResponse struct { JSONRPC string `json:"jsonrpc"` Method string `json:"method"` Params struct { Ask []Order `json:"ask"` Bid []Order `json:"bid"` Symbol string `json:"symbol"` Sequence int64 `json:"sequence"` Timestamp string `json:"timestamp"` } `json:"params"` }
SubscribeOrderBookResponse ws response
func (SubscribeOrderBookResponse) MarshalEasyJSON ¶
func (v SubscribeOrderBookResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SubscribeOrderBookResponse) MarshalJSON ¶
func (v SubscribeOrderBookResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SubscribeOrderBookResponse) UnmarshalEasyJSON ¶
func (v *SubscribeOrderBookResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SubscribeOrderBookResponse) UnmarshalJSON ¶
func (v *SubscribeOrderBookResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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"` }
Symbol model easyjson:json
func (Symbol) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Symbol) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Symbol) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Symbol) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Symbols ¶
type Symbols []Symbol
Symbols list
func (Symbols) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Symbols) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Symbols) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Symbols) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type TickHandler ¶
type TickHandler func(tick SubscribeOrderBookResponse)
TickHandler handler for tick