Documentation
¶
Index ¶
- Variables
- type Asset
- type AssetPair
- type Candle
- type Client
- func (c *Client) AddOrder() (r json.RawMessage, err error)
- func (c *Client) AssetPairs(pairs []string, info string) (r map[string]AssetPair, err error)
- func (c *Client) Assets() (r map[string]Asset, err error)
- func (c *Client) Balance() (r map[string]Decimal, err error)
- func (c *Client) Candles(pair string, interval time.Duration, since string) (cs []Candle, last string, err error)
- func (c *Client) Depth(pair string, cnt int) (d Depth, err error)
- func (c *Client) OpenOrders(trades bool, userref string) (r json.RawMessage, err error)
- func (c *Client) PrivateWebsocket(ctx context.Context) (s *Websocket, err error)
- func (c *Client) Spread(pair string, since string) (ss []Spread, last string, err error)
- func (c *Client) SystemStatus() (s SystemStatus, err error)
- func (c *Client) Ticker(pairs []string) (r map[string]Ticker, err error)
- func (c *Client) Time() (t time.Time, err error)
- func (c *Client) TradeBalance(asset, aclass string) (r TradeBalance, err error)
- func (c *Client) Trades(pair string, since string) (ts []Trade, last string, err error)
- func (c *Client) Websocket(ctx context.Context) (s *Websocket, err error)
- type Decimal
- type Depth
- type Event
- type Fees
- type NumberSummary
- type Option
- type Order
- type PriceLevel
- type PriceSummary
- type RemoteError
- type RemoteErrors
- type Side
- type Spread
- type SystemStatus
- type Ticker
- type Trade
- type TradeBalance
- type VolumeSummary
- type Websocket
- func (s *Websocket) AddOrder(ctx context.Context, o Order) (txid string, err error)
- func (s *Websocket) C() <-chan Event
- func (s *Websocket) CancelOrder(ctx context.Context, txid ...string) (err error)
- func (s *Websocket) Err() <-chan error
- func (s *Websocket) Subscribe(ctx context.Context, topic string, pairs []string, args ...Option) (err error)
- func (s *Websocket) Sys() <-chan interface{}
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrStopped = errors.New("stopped")
Functions ¶
This section is empty.
Types ¶
type AssetPair ¶
type AssetPair struct {
Name string `json:"name"`
AltName string `json:"altname,omitempty"`
WSName string `json:"wsname,omitempty"`
AssetClassBase string `json:"aclass_base,omitempty"`
Base string `json:"base,omitempty"`
AssetClassQuote string `json:"aclass_quote,omitempty"`
Quote string `json:"quote,omitempty"`
Lot string `json:"lot,omitempty"`
PairDecimals int `json:"pair_decimals,omitempty"`
LotDecimals int `json:"lot_decimals,omitempty"`
LotMultiplier int `json:"lot_multiplier,omitempty"`
LeverageBuy []int `json:"leverage_buy,omitempty"`
LeverageSell []int `json:"leverage_sell,omitempty"`
Fees Fees `json:"fees,omitempty"`
FeesMaker Fees `json:"fees_maker,omitempty"`
FeeVolumeCurrency string `json:"fee_volume_currency,omitempty"`
MarginCall int `json:"margin_call,omitempty"`
MarginStop int `json:"margin_stop,omitempty"`
MarginLevel int `json:"margin_level,omitempty"`
OrderMin Decimal `json:"ordermin,omitempty"`
}
type Candle ¶
type Candle struct {
Time int64 `json:"time"`
Open Decimal `json:"open"`
High Decimal `json:"high"`
Low Decimal `json:"low"`
Close Decimal `json:"close"`
VWap Decimal `json:"vwap"`
Volume Decimal `json:"volume"`
Count int64 `json:"count"`
}
func (*Candle) UnmarshalJSON ¶
type Client ¶
type Client struct {
UserAgent string
// contains filtered or unexported fields
}
func (*Client) AssetPairs ¶
func (*Client) OpenOrders ¶
func (*Client) PrivateWebsocket ¶
func (*Client) SystemStatus ¶
func (c *Client) SystemStatus() (s SystemStatus, err error)
func (*Client) TradeBalance ¶
func (c *Client) TradeBalance(asset, aclass string) (r TradeBalance, err error)
type Depth ¶
type Depth struct {
Asks []PriceLevel `json:"asks"`
Bids []PriceLevel `json:"bids"`
C Decimal `json:"c"`
}
func (*Depth) UnmarshalJSON ¶
type Fees ¶
func (*Fees) UnmarshalJSON ¶
type NumberSummary ¶
type Order ¶
type Order struct {
TxID string `json:"txid,omitempty"`
Status string `json:"status,omitempty"`
Pair string `json:"pair,omitempty"`
Side Side `json:"side,omitempty"` // buy/sell
Type string `json:"type,omitempty"` // market/limit
Price Decimal `json:"price,omitempty"`
Volume Decimal `json:"volume,omitempty"`
Rest map[string]interface{} `json:"rest"`
}
func (*Order) UnmarshalJSON ¶
type PriceLevel ¶
type PriceLevel struct {
Price Decimal `json:"price"`
Volume Decimal `json:"volume"`
Timestamp int64 `json:"timestamp"`
}
func (*PriceLevel) UnmarshalJSON ¶
func (l *PriceLevel) UnmarshalJSON(data []byte) (err error)
type PriceSummary ¶
type PriceSummary = VolumeSummary
type RemoteError ¶
type RemoteError string
func (RemoteError) Error ¶
func (e RemoteError) Error() string
type RemoteErrors ¶
type RemoteErrors []RemoteError
func (RemoteErrors) Error ¶
func (e RemoteErrors) Error() string
type Spread ¶
type Spread struct {
Time int64 `json:"time"`
Bid Decimal `json:"bid"`
Ask Decimal `json:"ask"`
BidVolume Decimal `json:"bid_volume"`
AskVolume Decimal `json:"ask_volume"`
}
func (*Spread) UnmarshalJSON ¶
type SystemStatus ¶
type Ticker ¶
type Ticker struct {
AskPrice Decimal
AskLotVolume Decimal
AskWholeLotVolume Decimal
BidPrice Decimal
BidLotVolume Decimal
BidWholeLotVolume Decimal
LastPrice Decimal
LastVolume Decimal
Volume VolumeSummary
TotalTrades NumberSummary
Weighted PriceSummary
Low PriceSummary
High PriceSummary
TodayOpeningPrice Decimal
}
func (*Ticker) UnmarshalJSON ¶
type Trade ¶
type Trade struct {
ID string `json:"id"`
Pair string `json:"pair"`
Price Decimal `json:"price"`
Volume Decimal `json:"volume"`
Timestamp int64 `json:"time"`
Side Side `json:"side"` // buy/sell
OrderType string `json:"ordertype"`
Cost Decimal `json:"cost,omitempty"`
Fee Decimal `json:"fee,omitempty"`
Margin Decimal `json:"margin,omitempty"`
OrderTxID string `json:"ordertxid,omitempty"`
PosTxID string `json:"postxid,omitempty"`
Miscellaneous string `json:"miscellaneous,omitempty"`
}
func (*Trade) UnmarshalJSON ¶
type TradeBalance ¶
type TradeBalance struct {
Equivalent Decimal `json:"equivalent"`
Trade Decimal `json:"trade"`
Margin Decimal `json:"margin"`
Unrealized Decimal `json:"unrealized"`
Cost Decimal `json:"cost"`
Valuation Decimal `json:"valuation"`
Equity Decimal `json:"equity"`
MarginFree Decimal `json:"margin_free"`
MarginLevel Decimal `json:"margin_level"`
}
func (*TradeBalance) UnmarshalJSON ¶
func (b *TradeBalance) UnmarshalJSON(data []byte) (err error)
type VolumeSummary ¶
Click to show internal directories.
Click to hide internal directories.