Documentation ¶
Index ¶
- type BookService
- type CandleService
- func (c *CandleService) History(symbol string, resolution bitfinex.CandleResolution) (*bitfinex.CandleSnapshot, error)
- func (c *CandleService) HistoryWithQuery(symbol string, resolution bitfinex.CandleResolution, start bitfinex.Mts, ...) (*bitfinex.CandleSnapshot, error)
- func (c *CandleService) Last(symbol string, resolution bitfinex.CandleResolution) (*bitfinex.Candle, error)
- type Client
- func NewClient() *Client
- func NewClientWithHttpDo(httpDo func(c *http.Client, r *http.Request) (*http.Response, error)) *Client
- func NewClientWithSynchronousNonce(sync Synchronous, nonce utils.NonceGenerator) *Client
- func NewClientWithSynchronousURLNonce(sync Synchronous, url string, nonce utils.NonceGenerator) *Client
- func NewClientWithURL(url string) *Client
- func NewClientWithURLHttpDo(base string, ...) *Client
- func NewClientWithURLHttpDoNonce(base string, ...) *Client
- func NewClientWithURLNonce(url string, nonce utils.NonceGenerator) *Client
- type ErrorResponse
- type HttpTransport
- type OrderService
- func (s *OrderService) All(symbol string) (*bitfinex.OrderSnapshot, error)
- func (s *OrderService) History(symbol string) (*bitfinex.OrderSnapshot, error)
- func (s *OrderService) OrderTrades(symbol string, orderID int64) (*bitfinex.TradeExecutionUpdateSnapshot, error)
- func (s *OrderService) Status(orderID int64) (o *bitfinex.Order, err error)
- type PlatformService
- type PositionService
- type Request
- type Response
- type Synchronous
- type TradeService
- type WalletService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookService ¶
type BookService struct {
Synchronous
}
type CandleService ¶
type CandleService struct {
Synchronous
}
CandleService manages the Candles endpoint.
func (*CandleService) History ¶
func (c *CandleService) History(symbol string, resolution bitfinex.CandleResolution) (*bitfinex.CandleSnapshot, error)
Return Candles for the public account.
func (*CandleService) HistoryWithQuery ¶
func (c *CandleService) HistoryWithQuery( symbol string, resolution bitfinex.CandleResolution, start bitfinex.Mts, end bitfinex.Mts, limit bitfinex.QueryLimit, sort bitfinex.SortOrder, ) (*bitfinex.CandleSnapshot, error)
Return Candles for the public account.
func (*CandleService) Last ¶
func (c *CandleService) Last(symbol string, resolution bitfinex.CandleResolution) (*bitfinex.Candle, error)
Return Candles for the public account.
type Client ¶
type Client struct { // service providers Candles CandleService Orders OrderService Positions PositionService Trades TradeService Platform PlatformService Book BookService Wallet WalletService Synchronous // contains filtered or unexported fields }
func NewClientWithHttpDo ¶
func NewClientWithSynchronousNonce ¶
func NewClientWithSynchronousNonce(sync Synchronous, nonce utils.NonceGenerator) *Client
func NewClientWithSynchronousURLNonce ¶
func NewClientWithSynchronousURLNonce(sync Synchronous, url string, nonce utils.NonceGenerator) *Client
mock me in tests
func NewClientWithURL ¶
func NewClientWithURLHttpDo ¶
func NewClientWithURLNonce ¶
func NewClientWithURLNonce(url string, nonce utils.NonceGenerator) *Client
func (*Client) NewAuthenticatedRequest ¶
type ErrorResponse ¶
type ErrorResponse struct { Response *Response Message string `json:"message"` Code int `json:"code"` }
In case if API will wrong response code ErrorResponse will be returned to caller
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type HttpTransport ¶
type HttpTransport struct { BaseURL *url.URL HTTPClient *http.Client // contains filtered or unexported fields }
func (HttpTransport) Request ¶
func (h HttpTransport) Request(req Request) ([]interface{}, error)
type OrderService ¶
type OrderService struct { Synchronous // contains filtered or unexported fields }
OrderService manages data flow for the Order API endpoint
func (*OrderService) All ¶
func (s *OrderService) All(symbol string) (*bitfinex.OrderSnapshot, error)
All returns all orders for the authenticated account.
func (*OrderService) History ¶
func (s *OrderService) History(symbol string) (*bitfinex.OrderSnapshot, error)
All returns all orders for the authenticated account.
func (*OrderService) OrderTrades ¶
func (s *OrderService) OrderTrades(symbol string, orderID int64) (*bitfinex.TradeExecutionUpdateSnapshot, error)
OrderTrades returns a set of executed trades related to an order.
func (*OrderService) Status ¶
func (s *OrderService) Status(orderID int64) (o *bitfinex.Order, err error)
Status retrieves the given order from the API. This is just a wrapper around the All() method, since the API does not provide lookup for a single Order.
type PlatformService ¶
type PlatformService struct {
Synchronous
}
func (*PlatformService) Status ¶
func (p *PlatformService) Status() (bool, error)
Status indicates whether the platform is currently operative or not.
type PositionService ¶
type PositionService struct { Synchronous // contains filtered or unexported fields }
PositionService manages the Position endpoint.
func (*PositionService) All ¶
func (s *PositionService) All() (*bitfinex.PositionSnapshot, error)
All returns all positions for the authenticated account.
type Request ¶
type Request struct { RefURL string // ref url Data map[string]interface{} // body data Method string // http method Params url.Values // query parameters Headers map[string]string }
Request is a wrapper for standard http.Request. Default method is POST with no data.
func NewRequest ¶
func NewRequestWithData ¶
func NewRequestWithMethod ¶
type Synchronous ¶
type TradeService ¶
type TradeService struct { Synchronous // contains filtered or unexported fields }
TradeService manages the Trade endpoint.
func (*TradeService) All ¶
func (s *TradeService) All(symbol string) (*bitfinex.TradeSnapshot, error)
All returns all orders for the authenticated account.
type WalletService ¶
type WalletService struct { Synchronous // contains filtered or unexported fields }
WalletService manages data flow for the Wallet API endpoint
func (*WalletService) Wallet ¶
func (s *WalletService) Wallet() (*bitfinex.WalletSnapshot, error)
All returns all orders for the authenticated account.