Documentation ¶
Index ¶
- Constants
- 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
- func (c *Client) Credentials(key string, secret string) *Client
- func (c *Client) NewAuthenticatedRequest(permissionType bitfinex.PermissionType, refURL string) (Request, error)
- func (c *Client) NewAuthenticatedRequestWithData(permissionType bitfinex.PermissionType, refURL string, ...) (Request, error)
- type CurrenciesService
- type DerivativesService
- type ErrorResponse
- type HttpTransport
- type LedgerService
- type OrderService
- func (s *OrderService) All() (*bitfinex.OrderSnapshot, error)
- func (s *OrderService) AllHistory() (*bitfinex.OrderSnapshot, error)
- func (s *OrderService) GetByOrderId(orderID int64) (o *bitfinex.Order, err error)
- func (s *OrderService) GetBySymbol(symbol string) (*bitfinex.OrderSnapshot, error)
- func (s *OrderService) GetHistoryByOrderId(orderID int64) (o *bitfinex.Order, err error)
- func (s *OrderService) GetHistoryBySymbol(symbol string) (*bitfinex.OrderSnapshot, error)
- func (s *OrderService) OrderTrades(symbol string, orderID int64) (*bitfinex.TradeExecutionUpdateSnapshot, error)
- type PlatformService
- type PositionService
- type Request
- type Response
- type StatsService
- func (ss *StatsService) CreditSizeHistory(symbol string, side bitfinex.OrderSide) ([]bitfinex.Stat, error)
- func (ss *StatsService) CreditSizeLast(symbol string, side bitfinex.OrderSide) (*bitfinex.Stat, error)
- func (ss *StatsService) FundingHistory(symbol string) ([]bitfinex.Stat, error)
- func (ss *StatsService) FundingLast(symbol string) (*bitfinex.Stat, error)
- func (ss *StatsService) PositionHistory(symbol string, side bitfinex.OrderSide) ([]bitfinex.Stat, error)
- func (ss *StatsService) PositionLast(symbol string, side bitfinex.OrderSide) (*bitfinex.Stat, error)
- func (ss *StatsService) SymbolCreditSizeHistory(fundingSymbol string, tradingSymbol string) ([]bitfinex.Stat, error)
- func (ss *StatsService) SymbolCreditSizeLast(fundingSymbol string, tradingSymbol string) (*bitfinex.Stat, error)
- type StatusService
- type Synchronous
- type TickerService
- type TradeService
- func (s *TradeService) AccountAll() (*bitfinex.TradeExecutionUpdateSnapshot, error)
- func (s *TradeService) AccountAllWithSymbol(symbol string) (*bitfinex.TradeExecutionUpdateSnapshot, error)
- func (s *TradeService) AccountHistoryWithQuery(symbol string, start bitfinex.Mts, end bitfinex.Mts, limit bitfinex.QueryLimit, ...) (*bitfinex.TradeExecutionUpdateSnapshot, error)
- func (s *TradeService) PublicHistoryWithQuery(symbol string, start bitfinex.Mts, end bitfinex.Mts, limit bitfinex.QueryLimit, ...) (*bitfinex.TradeSnapshot, error)
- type WalletService
Constants ¶
const (
DERIV_TYPE = "deriv"
)
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 Tickers TickerService Currencies CurrenciesService Platform PlatformService Book BookService Wallet WalletService Ledgers LedgerService Stats StatsService Status StatusService Derivatives DerivativesService 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 CurrenciesService ¶
type CurrenciesService struct { Synchronous // contains filtered or unexported fields }
TradeService manages the Trade endpoint.
func (*CurrenciesService) Conf ¶
func (cs *CurrenciesService) Conf(label, symbol, unit, explorer, pairs bool) ([]bitfinex.CurrencyConf, error)
All returns all orders for the authenticated account.
type DerivativesService ¶
type DerivativesService struct { Synchronous // contains filtered or unexported fields }
OrderService manages data flow for the Order API endpoint
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 LedgerService ¶
type LedgerService struct { Synchronous // contains filtered or unexported fields }
LedgerService manages the Ledgers endpoint.
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() (*bitfinex.OrderSnapshot, error)
Get all active orders
func (*OrderService) AllHistory ¶
func (s *OrderService) AllHistory() (*bitfinex.OrderSnapshot, error)
Get all historical orders
func (*OrderService) GetByOrderId ¶
func (s *OrderService) GetByOrderId(orderID int64) (o *bitfinex.Order, err error)
Get an active order using its order id
func (*OrderService) GetBySymbol ¶
func (s *OrderService) GetBySymbol(symbol string) (*bitfinex.OrderSnapshot, error)
Get all active orders with the given symbol
func (*OrderService) GetHistoryByOrderId ¶
func (s *OrderService) GetHistoryByOrderId(orderID int64) (o *bitfinex.Order, err error)
Get a historical order using its order id
func (*OrderService) GetHistoryBySymbol ¶
func (s *OrderService) GetHistoryBySymbol(symbol string) (*bitfinex.OrderSnapshot, error)
Get all historical orders with the given symbol
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.
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 StatsService ¶
type StatsService struct { Synchronous // contains filtered or unexported fields }
TradeService manages the Trade endpoint.
func (*StatsService) CreditSizeHistory ¶
func (ss *StatsService) CreditSizeHistory(symbol string, side bitfinex.OrderSide) ([]bitfinex.Stat, error)
func (*StatsService) CreditSizeLast ¶
func (ss *StatsService) CreditSizeLast(symbol string, side bitfinex.OrderSide) (*bitfinex.Stat, error)
func (*StatsService) FundingHistory ¶
func (ss *StatsService) FundingHistory(symbol string) ([]bitfinex.Stat, error)
func (*StatsService) FundingLast ¶
func (ss *StatsService) FundingLast(symbol string) (*bitfinex.Stat, error)
func (*StatsService) PositionHistory ¶
func (ss *StatsService) PositionHistory(symbol string, side bitfinex.OrderSide) ([]bitfinex.Stat, error)
func (*StatsService) PositionLast ¶
func (ss *StatsService) PositionLast(symbol string, side bitfinex.OrderSide) (*bitfinex.Stat, error)
func (*StatsService) SymbolCreditSizeHistory ¶
func (ss *StatsService) SymbolCreditSizeHistory(fundingSymbol string, tradingSymbol string) ([]bitfinex.Stat, error)
func (*StatsService) SymbolCreditSizeLast ¶
func (ss *StatsService) SymbolCreditSizeLast(fundingSymbol string, tradingSymbol string) (*bitfinex.Stat, error)
type StatusService ¶
type StatusService struct { Synchronous // contains filtered or unexported fields }
TradeService manages the Trade endpoint.
func (*StatusService) DerivativeStatus ¶
func (ss *StatusService) DerivativeStatus(symbol string) (*bitfinex.DerivativeStatus, error)
func (*StatusService) DerivativeStatusAll ¶
func (ss *StatusService) DerivativeStatusAll() ([]*bitfinex.DerivativeStatus, error)
func (*StatusService) DerivativeStatusMulti ¶
func (ss *StatusService) DerivativeStatusMulti(symbols []string) ([]*bitfinex.DerivativeStatus, error)
type Synchronous ¶
type TickerService ¶
type TickerService struct { Synchronous // contains filtered or unexported fields }
TradeService manages the Trade endpoint.
func (*TickerService) All ¶
func (s *TickerService) All() (*[]bitfinex.Ticker, error)
func (*TickerService) Get ¶
func (s *TickerService) Get(symbol string) (*bitfinex.Ticker, error)
All returns all orders for the authenticated account.
func (*TickerService) GetMulti ¶
func (s *TickerService) GetMulti(symbols []string) (*[]bitfinex.Ticker, error)
type TradeService ¶
type TradeService struct { Synchronous // contains filtered or unexported fields }
TradeService manages the Trade endpoint.
func (*TradeService) AccountAll ¶
func (s *TradeService) AccountAll() (*bitfinex.TradeExecutionUpdateSnapshot, error)
func (*TradeService) AccountAllWithSymbol ¶
func (s *TradeService) AccountAllWithSymbol(symbol string) (*bitfinex.TradeExecutionUpdateSnapshot, error)
func (*TradeService) AccountHistoryWithQuery ¶
func (s *TradeService) AccountHistoryWithQuery( symbol string, start bitfinex.Mts, end bitfinex.Mts, limit bitfinex.QueryLimit, sort bitfinex.SortOrder, ) (*bitfinex.TradeExecutionUpdateSnapshot, error)
return account trades that fit the given conditions
func (*TradeService) PublicHistoryWithQuery ¶
func (s *TradeService) PublicHistoryWithQuery( symbol string, start bitfinex.Mts, end bitfinex.Mts, limit bitfinex.QueryLimit, sort bitfinex.SortOrder, ) (*bitfinex.TradeSnapshot, error)
return publicly executed trades that fit the given query conditions
type WalletService ¶
type WalletService struct { Synchronous // contains filtered or unexported fields }
WalletService manages data flow for the Wallet API endpoint
func (*WalletService) SetCollateral ¶
func (s *WalletService) SetCollateral(symbol string, amount float64) (bool, error)
All returns all orders for the authenticated account.
func (*WalletService) Wallet ¶
func (s *WalletService) Wallet() (*bitfinex.WalletSnapshot, error)
All returns all orders for the authenticated account.