github.com/bitfinexcom/bitfinex-api-go@v0.0.0-20210608095005-9e0b26f200fb/docs/v1.md (about)

     1  # bitfinex
     2  --
     3      import "github.com/bitfinexcom/bitfinex-api-go/v1"
     4  
     5  Package bitfinex is the official client to access to bitfinex.com API
     6  
     7  ## Usage
     8  
     9  ```go
    10  const (
    11  	// BaseURL is the v1 REST endpoint.
    12  	BaseURL = "https://api.bitfinex.com/v1/"
    13  	// WebSocketURL the v1 Websocket endpoint.
    14  	WebSocketURL = "wss://api-pub.bitfinex.com/ws/"
    15  )
    16  ```
    17  
    18  ```go
    19  const (
    20  	LEND = "lend"
    21  	LOAN = "loan"
    22  )
    23  ```
    24  
    25  ```go
    26  const (
    27  	OrderTypeMarket               = "market"
    28  	OrderTypeLimit                = "limit"
    29  	OrderTypeStop                 = "stop"
    30  	OrderTypeTrailingStop         = "trailing-stop"
    31  	OrderTypeFillOrKill           = "fill-or-kill"
    32  	OrderTypeExchangeMarket       = "exchange market"
    33  	OrderTypeExchangeLimit        = "exchange limit"
    34  	OrderTypeExchangeStop         = "exchange stop"
    35  	OrderTypeExchangeTrailingStop = "exchange trailing-stop"
    36  	OrderTypeExchangeFillOrKill   = "exchange fill-or-kill"
    37  )
    38  ```
    39  Order types that the API can return.
    40  
    41  ```go
    42  const (
    43  	WALLET_TRADING  = "trading"
    44  	WALLET_EXCHANGE = "exchange"
    45  	WALLET_DEPOSIT  = "deposit"
    46  )
    47  ```
    48  
    49  ```go
    50  const (
    51  	// Pairs
    52  	BTCUSD = "BTCUSD"
    53  	LTCUSD = "LTCUSD"
    54  	LTCBTC = "LTCBTC"
    55  	ETHUSD = "ETHUSD"
    56  	ETHBTC = "ETHBTC"
    57  	ETCUSD = "ETCUSD"
    58  	ETCBTC = "ETCBTC"
    59  	BFXUSD = "BFXUSD"
    60  	BFXBTC = "BFXBTC"
    61  	ZECUSD = "ZECUSD"
    62  	ZECBTC = "ZECBTC"
    63  	XMRUSD = "XMRUSD"
    64  	XMRBTC = "XMRBTC"
    65  	RRTUSD = "RRTUSD"
    66  	RRTBTC = "RRTBTC"
    67  	XRPUSD = "XRPUSD"
    68  	XRPBTC = "XRPBTC"
    69  	EOSETH = "EOSETH"
    70  	EOSUSD = "EOSUSD"
    71  	EOSBTC = "EOSBTC"
    72  	IOTUSD = "IOTUSD"
    73  	IOTBTC = "IOTBTC"
    74  	IOTETH = "IOTETH"
    75  	BCCBTC = "BCCBTC"
    76  	BCUBTC = "BCUBTC"
    77  	BCCUSD = "BCCUSD"
    78  	BCUUSD = "BCUUSD"
    79  
    80  	// Channels
    81  	ChanBook   = "book"
    82  	ChanTrade  = "trades"
    83  	ChanTicker = "ticker"
    84  )
    85  ```
    86  Pairs available
    87  
    88  #### type AccountInfo
    89  
    90  ```go
    91  type AccountInfo struct {
    92  	MakerFees float64 `json:"maker_fees,string"`
    93  	TakerFees float64 `json:"taker_fees,string"`
    94  	Fees      []AccountPairFee
    95  }
    96  ```
    97  
    98  
    99  #### type AccountPairFee
   100  
   101  ```go
   102  type AccountPairFee struct {
   103  	Pair      string
   104  	MakerFees float64 `json:"maker_fees,string"`
   105  	TakerFees float64 `json:"taker_fees,string"`
   106  }
   107  ```
   108  
   109  
   110  #### type AccountService
   111  
   112  ```go
   113  type AccountService struct {
   114  }
   115  ```
   116  
   117  
   118  #### func (*AccountService) Info
   119  
   120  ```go
   121  func (a *AccountService) Info() (AccountInfo, error)
   122  ```
   123  GET account_infos
   124  
   125  #### func (*AccountService) KeyPermission
   126  
   127  ```go
   128  func (a *AccountService) KeyPermission() (Permissions, error)
   129  ```
   130  
   131  #### func (*AccountService) Summary
   132  
   133  ```go
   134  func (a *AccountService) Summary() (Summary, error)
   135  ```
   136  
   137  #### type ActiveOffer
   138  
   139  ```go
   140  type ActiveOffer struct {
   141  	ID              int64
   142  	Currency        string
   143  	Rate            string
   144  	Period          int
   145  	Direction       string
   146  	Timestamp       string
   147  	IsLive          bool   `json:"is_live"`
   148  	IsCancelled     bool   `json:"is_cancelled"`
   149  	OriginalAmount  string `json:"original_amount"`
   150  	RemainingAmount string `json:"remaining_amount"`
   151  	ExecutedAmount  string `json:"executed_amount"`
   152  }
   153  ```
   154  
   155  
   156  #### type Balance
   157  
   158  ```go
   159  type Balance struct {
   160  	Currency    string
   161  	Amount      string
   162  	Balance     string
   163  	Description string
   164  	Timestamp   string
   165  }
   166  ```
   167  
   168  
   169  #### type BalancesService
   170  
   171  ```go
   172  type BalancesService struct {
   173  }
   174  ```
   175  
   176  
   177  #### func (*BalancesService) All
   178  
   179  ```go
   180  func (b *BalancesService) All() ([]WalletBalance, error)
   181  ```
   182  GET balances
   183  
   184  #### type BankAccount
   185  
   186  ```go
   187  type BankAccount struct {
   188  	AccountName   string // Account name
   189  	AccountNumber string // Account number or IBAN
   190  	BankName      string // Bank Name
   191  	BankAddress   string // Bank Address
   192  	BankCity      string // Bank City
   193  	BankCountry   string // Bank Country
   194  	SwiftCode     string // SWIFT Code
   195  }
   196  ```
   197  
   198  
   199  #### type Client
   200  
   201  ```go
   202  type Client struct {
   203  	// Base URL for API requests.
   204  	BaseURL                *url.URL
   205  	WebSocketURL           string
   206  	WebSocketTLSSkipVerify bool
   207  
   208  	// Auth data
   209  	APIKey    string
   210  	APISecret string
   211  
   212  	// Services
   213  	Pairs         *PairsService
   214  	Stats         *StatsService
   215  	Ticker        *TickerService
   216  	Account       *AccountService
   217  	Balances      *BalancesService
   218  	Offers        *OffersService
   219  	Credits       *CreditsService
   220  	Deposit       *DepositService
   221  	Lendbook      *LendbookService
   222  	MarginInfo    *MarginInfoService
   223  	MarginFunding *MarginFundingService
   224  	OrderBook     *OrderBookService
   225  	Orders        *OrderService
   226  	Trades        *TradesService
   227  	Positions     *PositionsService
   228  	History       *HistoryService
   229  	WebSocket     *WebSocketService
   230  	Wallet        *WalletService
   231  }
   232  ```
   233  
   234  Client manages all the communication with the Bitfinex API.
   235  
   236  #### func  NewClient
   237  
   238  ```go
   239  func NewClient() *Client
   240  ```
   241  NewClient creates new Bitfinex.com API client.
   242  
   243  #### func (*Client) Auth
   244  
   245  ```go
   246  func (c *Client) Auth(key string, secret string) *Client
   247  ```
   248  Auth sets api key and secret for usage is requests that requires authentication.
   249  
   250  #### type Credit
   251  
   252  ```go
   253  type Credit struct {
   254  	Id        int
   255  	Currency  string
   256  	Status    string
   257  	Rate      float64 `json:",string"`
   258  	Period    float64
   259  	Amount    float64 `json:",string"`
   260  	Timestamp string
   261  }
   262  ```
   263  
   264  
   265  #### type CreditsService
   266  
   267  ```go
   268  type CreditsService struct {
   269  }
   270  ```
   271  
   272  
   273  #### func (*CreditsService) All
   274  
   275  ```go
   276  func (c *CreditsService) All() ([]Credit, error)
   277  ```
   278  Returns an array of Credit
   279  
   280  #### type DepositResponse
   281  
   282  ```go
   283  type DepositResponse struct {
   284  	Result   string
   285  	Method   string
   286  	Currency string
   287  	Address  string
   288  }
   289  ```
   290  
   291  
   292  #### func (*DepositResponse) Success
   293  
   294  ```go
   295  func (d *DepositResponse) Success() (bool, error)
   296  ```
   297  
   298  #### type DepositService
   299  
   300  ```go
   301  type DepositService struct {
   302  }
   303  ```
   304  
   305  
   306  #### func (*DepositService) New
   307  
   308  ```go
   309  func (s *DepositService) New(method, walletName string, renew int) (DepositResponse, error)
   310  ```
   311  
   312  #### type ErrorResponse
   313  
   314  ```go
   315  type ErrorResponse struct {
   316  	Response *Response
   317  	Message  string `json:"message"`
   318  }
   319  ```
   320  
   321  ErrorResponse is the custom error type that is returned if the API returns an
   322  error.
   323  
   324  #### func (*ErrorResponse) Error
   325  
   326  ```go
   327  func (r *ErrorResponse) Error() string
   328  ```
   329  
   330  #### type HistoryService
   331  
   332  ```go
   333  type HistoryService struct {
   334  }
   335  ```
   336  
   337  
   338  #### func (*HistoryService) Balance
   339  
   340  ```go
   341  func (s *HistoryService) Balance(currency, wallet string, since, until time.Time, limit int) ([]Balance, error)
   342  ```
   343  
   344  #### func (*HistoryService) Movements
   345  
   346  ```go
   347  func (s *HistoryService) Movements(currency, method string, since, until time.Time, limit int) ([]Movement, error)
   348  ```
   349  
   350  #### func (*HistoryService) Trades
   351  
   352  ```go
   353  func (s *HistoryService) Trades(pair string, since, until time.Time, limit int, reverse bool) ([]PastTrade, error)
   354  ```
   355  
   356  #### type KeyPerm
   357  
   358  ```go
   359  type KeyPerm struct {
   360  	Read  bool
   361  	Write bool
   362  }
   363  ```
   364  
   365  
   366  #### type Lend
   367  
   368  ```go
   369  type Lend struct {
   370  	Rate      string
   371  	Amount    string
   372  	Period    int
   373  	Timestamp string
   374  	Frr       string
   375  }
   376  ```
   377  
   378  
   379  #### func (*Lend) ParseTime
   380  
   381  ```go
   382  func (el *Lend) ParseTime() (*time.Time, error)
   383  ```
   384  
   385  #### type Lendbook
   386  
   387  ```go
   388  type Lendbook struct {
   389  	Bids []Lend
   390  	Asks []Lend
   391  }
   392  ```
   393  
   394  
   395  #### type LendbookService
   396  
   397  ```go
   398  type LendbookService struct {
   399  }
   400  ```
   401  
   402  
   403  #### func (*LendbookService) Get
   404  
   405  ```go
   406  func (s *LendbookService) Get(currency string, limitBids, limitAsks int) (Lendbook, error)
   407  ```
   408  GET /lendbook/:currency
   409  
   410  #### func (*LendbookService) Lends
   411  
   412  ```go
   413  func (s *LendbookService) Lends(currency string) ([]Lends, error)
   414  ```
   415  GET /lends/:currency
   416  
   417  #### type Lends
   418  
   419  ```go
   420  type Lends struct {
   421  	Rate       string
   422  	AmountLent string `json:"amount_lent"`
   423  	AmountUsed string `json:"amount_used"`
   424  	Timestamp  int64
   425  }
   426  ```
   427  
   428  
   429  #### func (*Lends) Time
   430  
   431  ```go
   432  func (el *Lends) Time() *time.Time
   433  ```
   434  
   435  #### type MarginFundingService
   436  
   437  ```go
   438  type MarginFundingService struct {
   439  }
   440  ```
   441  
   442  
   443  #### func (*MarginFundingService) Cancel
   444  
   445  ```go
   446  func (s *MarginFundingService) Cancel(offerId int64) (MarginOffer, error)
   447  ```
   448  
   449  #### func (*MarginFundingService) Credits
   450  
   451  ```go
   452  func (s *MarginFundingService) Credits() ([]ActiveOffer, error)
   453  ```
   454  
   455  #### func (*MarginFundingService) NewLend
   456  
   457  ```go
   458  func (s *MarginFundingService) NewLend(currency string, amount, rate float64, period int) (MarginOffer, error)
   459  ```
   460  
   461  #### func (*MarginFundingService) NewLoan
   462  
   463  ```go
   464  func (s *MarginFundingService) NewLoan(currency string, amount, rate float64, period int) (MarginOffer, error)
   465  ```
   466  
   467  #### func (*MarginFundingService) Offers
   468  
   469  ```go
   470  func (s *MarginFundingService) Offers() ([]ActiveOffer, error)
   471  ```
   472  
   473  #### func (*MarginFundingService) Status
   474  
   475  ```go
   476  func (s *MarginFundingService) Status(offerId int64) (MarginOffer, error)
   477  ```
   478  
   479  #### type MarginInfo
   480  
   481  ```go
   482  type MarginInfo struct {
   483  	MarginBalance     float64       `json:"margin_balance,string"`
   484  	TradableBalance   float64       `json:"tradable_balance,string"`
   485  	UnrealizedPl      float64       `json:"unrealized_pl,string"`
   486  	UnrealizedSwap    float64       `json:"unrealized_swap,string"`
   487  	NetValue          float64       `json:"net_value,string"`
   488  	RequiredMargin    float64       `json:"required_margin,string"`
   489  	Leverage          float64       `json:"leverage,string"`
   490  	MarginRequirement float64       `json:"margin_requirement,string"`
   491  	MarginLimits      []MarginLimit `json:"margin_limits,string"`
   492  	Message           string        `json:"message"`
   493  }
   494  ```
   495  
   496  
   497  #### type MarginInfoService
   498  
   499  ```go
   500  type MarginInfoService struct {
   501  }
   502  ```
   503  
   504  
   505  #### func (*MarginInfoService) All
   506  
   507  ```go
   508  func (s *MarginInfoService) All() ([]MarginInfo, error)
   509  ```
   510  GET /margin_infos
   511  
   512  #### type MarginLimit
   513  
   514  ```go
   515  type MarginLimit struct {
   516  	OnPair            string  `json:"on_pair"`
   517  	InitialMargin     float64 `json:"initial_margin,string"`
   518  	MarginRequirement float64 `json:"margin_requirement,string"`
   519  	TradableBalance   float64 `json:"tradable_balance,string"`
   520  }
   521  ```
   522  
   523  
   524  #### type MarginOffer
   525  
   526  ```go
   527  type MarginOffer struct {
   528  	ID              int64
   529  	Currency        string
   530  	Rate            string
   531  	Period          int
   532  	Direction       string
   533  	Timestamp       string
   534  	IsLive          bool   `json:"is_live"`
   535  	IsCancelled     bool   `json:"is_cancelled"`
   536  	OriginalAmount  string `json:"original_amount"`
   537  	RemainingAmount string `json:"remaining_amount"`
   538  	ExecutedAmount  string `json:"executed_amount"`
   539  	OfferId         int
   540  }
   541  ```
   542  
   543  
   544  #### type Movement
   545  
   546  ```go
   547  type Movement struct {
   548  	ID          int64 `json:",int"`
   549  	Currency    string
   550  	Method      string
   551  	Type        string
   552  	Amount      string
   553  	Description string
   554  	Status      string
   555  	Timestamp   string
   556  }
   557  ```
   558  
   559  
   560  #### type MultipleOrderResponse
   561  
   562  ```go
   563  type MultipleOrderResponse struct {
   564  	Orders []Order `json:"order_ids"`
   565  	Status string
   566  }
   567  ```
   568  
   569  MultipleOrderResponse bundles orders returned by the CreateMulti method.
   570  
   571  #### type Offer
   572  
   573  ```go
   574  type Offer struct {
   575  	Id              int64
   576  	Currency        string
   577  	Rate            string
   578  	Period          int64
   579  	Direction       string
   580  	Timestamp       string
   581  	IsLive          bool   `json:"is_live"`
   582  	IsCancelled     bool   `json:"is_cancelled"`
   583  	OriginalAmount  string `json:"original_amount:string"`
   584  	RemainingAmount string `json:"remaining_amount:string"`
   585  	ExecutedAmount  string `json:"executed_amount:string"`
   586  	OfferId         int64  `json:"offer_id"`
   587  }
   588  ```
   589  
   590  
   591  #### type OffersService
   592  
   593  ```go
   594  type OffersService struct {
   595  }
   596  ```
   597  
   598  
   599  #### func (*OffersService) Cancel
   600  
   601  ```go
   602  func (s *OffersService) Cancel(offerId int64) (Offer, error)
   603  ```
   604  
   605  #### func (*OffersService) New
   606  
   607  ```go
   608  func (s *OffersService) New(currency string, amount, rate float64, period int64, direction string) (Offer, error)
   609  ```
   610  Create new offer for LEND or LOAN a currency, use LEND or LOAN constants as
   611  direction
   612  
   613  #### func (*OffersService) Status
   614  
   615  ```go
   616  func (s *OffersService) Status(offerId int64) (Offer, error)
   617  ```
   618  
   619  #### type Order
   620  
   621  ```go
   622  type Order struct {
   623  	ID                int64
   624  	Symbol            string
   625  	Exchange          string
   626  	Price             string
   627  	AvgExecutionPrice string `json:"avg_execution_price"`
   628  	Side              string
   629  	Type              string
   630  	Timestamp         string
   631  	IsLive            bool   `json:"is_live"`
   632  	IsCanceled        bool   `json:"is_cancelled"`
   633  	IsHidden          bool   `json:"is_hidden"`
   634  	WasForced         bool   `json:"was_forced"`
   635  	OriginalAmount    string `json:"original_amount"`
   636  	RemainingAmount   string `json:"remaining_amount"`
   637  	ExecutedAmount    string `json:"executed_amount"`
   638  }
   639  ```
   640  
   641  Order represents one order on the bitfinex platform.
   642  
   643  #### type OrderBook
   644  
   645  ```go
   646  type OrderBook struct {
   647  	Bids []OrderBookEntry
   648  	Asks []OrderBookEntry
   649  }
   650  ```
   651  
   652  
   653  #### type OrderBookEntry
   654  
   655  ```go
   656  type OrderBookEntry struct {
   657  	Price     string
   658  	Rate      string
   659  	Amount    string
   660  	Period    int
   661  	Timestamp string
   662  	Frr       string
   663  }
   664  ```
   665  
   666  
   667  #### func (*OrderBookEntry) ParseTime
   668  
   669  ```go
   670  func (el *OrderBookEntry) ParseTime() (*time.Time, error)
   671  ```
   672  
   673  #### type OrderBookService
   674  
   675  ```go
   676  type OrderBookService struct {
   677  }
   678  ```
   679  
   680  
   681  #### func (*OrderBookService) Get
   682  
   683  ```go
   684  func (s *OrderBookService) Get(pair string, limitBids, limitAsks int, noGroup bool) (OrderBook, error)
   685  ```
   686  GET /book
   687  
   688  #### type OrderService
   689  
   690  ```go
   691  type OrderService struct {
   692  }
   693  ```
   694  
   695  OrderService manages the Order endpoint.
   696  
   697  #### func (*OrderService) All
   698  
   699  ```go
   700  func (s *OrderService) All() ([]Order, error)
   701  ```
   702  All returns all orders for the authenticated account.
   703  
   704  #### func (*OrderService) Cancel
   705  
   706  ```go
   707  func (s *OrderService) Cancel(orderID int64) error
   708  ```
   709  Cancel the order with id `orderID`.
   710  
   711  #### func (*OrderService) CancelAll
   712  
   713  ```go
   714  func (s *OrderService) CancelAll() error
   715  ```
   716  CancelAll active orders for the authenticated account.
   717  
   718  #### func (*OrderService) CancelMulti
   719  
   720  ```go
   721  func (s *OrderService) CancelMulti(orderIDS []int64) (string, error)
   722  ```
   723  CancelMulti allows batch cancellation of orders.
   724  
   725  #### func (*OrderService) Create
   726  
   727  ```go
   728  func (s *OrderService) Create(symbol string, amount float64, price float64, orderType string) (*Order, error)
   729  ```
   730  Create a new order.
   731  
   732  #### func (*OrderService) CreateMulti
   733  
   734  ```go
   735  func (s *OrderService) CreateMulti(orders []SubmitOrder) (MultipleOrderResponse, error)
   736  ```
   737  CreateMulti allows batch creation of orders.
   738  
   739  #### func (*OrderService) Replace
   740  
   741  ```go
   742  func (s *OrderService) Replace(orderID int64, useRemaining bool, newOrder SubmitOrder) (Order, error)
   743  ```
   744  Replace an Order
   745  
   746  #### func (*OrderService) Status
   747  
   748  ```go
   749  func (s *OrderService) Status(orderID int64) (Order, error)
   750  ```
   751  Status retrieves the given order from the API.
   752  
   753  #### type Pair
   754  
   755  ```go
   756  type Pair struct {
   757  	Pair             string
   758  	PricePrecision   int     `json:"price_precision,int"`
   759  	InitialMargin    float64 `json:"initial_margin,string"`
   760  	MinimumMargin    float64 `json:"minimum_margin,string"`
   761  	MaximumOrderSize float64 `json:"maximum_order_size,string"`
   762  	MinimumOrderSize float64 `json:"minimum_order_size,string"`
   763  	Expiration       string
   764  	Margin           bool
   765  }
   766  ```
   767  
   768  Detailed Pair
   769  
   770  #### type PairsService
   771  
   772  ```go
   773  type PairsService struct {
   774  }
   775  ```
   776  
   777  
   778  #### func (*PairsService) All
   779  
   780  ```go
   781  func (p *PairsService) All() ([]string, error)
   782  ```
   783  Get all Pair names as array of strings
   784  
   785  #### func (*PairsService) AllDetailed
   786  
   787  ```go
   788  func (p *PairsService) AllDetailed() ([]Pair, error)
   789  ```
   790  Return a list of detailed pairs
   791  
   792  #### type PastTrade
   793  
   794  ```go
   795  type PastTrade struct {
   796  	Price       string
   797  	Amount      string
   798  	Timestamp   string
   799  	Exchange    string
   800  	Type        string
   801  	FeeCurrency string `json:"fee_currency"`
   802  	FeeAmount   string `json:"fee_amount"`
   803  	TID         int64
   804  	OrderId     int64 `json:"order_id,int"`
   805  }
   806  ```
   807  
   808  
   809  #### type Permissions
   810  
   811  ```go
   812  type Permissions struct {
   813  	Account   KeyPerm
   814  	History   KeyPerm
   815  	Orders    KeyPerm
   816  	Positions KeyPerm
   817  	Funding   KeyPerm
   818  	Wallets   KeyPerm
   819  	Withdraw  KeyPerm
   820  }
   821  ```
   822  
   823  
   824  #### type Position
   825  
   826  ```go
   827  type Position struct {
   828  	ID        int
   829  	Symbol    string
   830  	Amount    string
   831  	Status    string
   832  	Base      string
   833  	Timestamp string
   834  	Swap      string
   835  	Pl        string
   836  }
   837  ```
   838  
   839  Position structure
   840  
   841  #### func (*Position) ParseTime
   842  
   843  ```go
   844  func (p *Position) ParseTime() (*time.Time, error)
   845  ```
   846  
   847  #### type PositionsService
   848  
   849  ```go
   850  type PositionsService struct {
   851  }
   852  ```
   853  
   854  PositionsService structure
   855  
   856  #### func (*PositionsService) All
   857  
   858  ```go
   859  func (b *PositionsService) All() ([]Position, error)
   860  ```
   861  All - gets all positions
   862  
   863  #### func (*PositionsService) Claim
   864  
   865  ```go
   866  func (b *PositionsService) Claim(positionId int, amount string) (Position, error)
   867  ```
   868  Claim a position
   869  
   870  #### type Response
   871  
   872  ```go
   873  type Response struct {
   874  	Response *http.Response
   875  	Body     []byte
   876  }
   877  ```
   878  
   879  Response is wrapper for standard http.Response and provides more methods.
   880  
   881  #### func (*Response) String
   882  
   883  ```go
   884  func (r *Response) String() string
   885  ```
   886  String converts response body to string. An empty string will be returned if
   887  error.
   888  
   889  #### type Stats
   890  
   891  ```go
   892  type Stats struct {
   893  	Period int64
   894  	Volume float64 `json:"volume,string"`
   895  }
   896  ```
   897  
   898  
   899  #### type StatsService
   900  
   901  ```go
   902  type StatsService struct {
   903  }
   904  ```
   905  
   906  
   907  #### func (*StatsService) All
   908  
   909  ```go
   910  func (s *StatsService) All(pair string, period, volume string) ([]Stats, error)
   911  ```
   912  All(pair) - Volume stats for specified pair
   913  
   914  #### type SubmitOrder
   915  
   916  ```go
   917  type SubmitOrder struct {
   918  	Symbol string
   919  	Amount float64
   920  	Price  float64
   921  	Type   string
   922  }
   923  ```
   924  
   925  SubmitOrder is an order to be created on the bitfinex platform.
   926  
   927  #### type Summary
   928  
   929  ```go
   930  type Summary struct {
   931  	TradeVolume   SummaryVolume `json:"trade_vol_30d"`
   932  	FundingProfit SummaryProfit `json:"funding_profit_30d"`
   933  	MakerFee      string        `json:"maker_fee"`
   934  	TakerFee      string        `json:"taker_fee"`
   935  }
   936  ```
   937  
   938  
   939  #### type SummaryProfit
   940  
   941  ```go
   942  type SummaryProfit struct {
   943  	Currency string `json:"curr"`
   944  	Volume   string `json:"amount"`
   945  }
   946  ```
   947  
   948  
   949  #### type SummaryVolume
   950  
   951  ```go
   952  type SummaryVolume struct {
   953  	Currency string `json:"curr"`
   954  	Volume   string `json:"vol"`
   955  }
   956  ```
   957  
   958  
   959  #### type TermData
   960  
   961  ```go
   962  type TermData struct {
   963  	// Data term. E.g: ps, ws, ou, etc... See official documentation for more details.
   964  	Term string
   965  	// Data will contain different number of elements for each term.
   966  	// Examples:
   967  	// Term: ws, Data: ["exchange","BTC",0.01410829,0]
   968  	// Term: oc, Data: [0,"BTCUSD",0,-0.01,"","CANCELED",270,0,"2015-10-15T11:26:13Z",0]
   969  	Data  []interface{}
   970  	Error string
   971  }
   972  ```
   973  
   974  
   975  #### func (*TermData) HasError
   976  
   977  ```go
   978  func (c *TermData) HasError() bool
   979  ```
   980  
   981  #### type Tick
   982  
   983  ```go
   984  type Tick struct {
   985  	Mid       string
   986  	Bid       string
   987  	Ask       string
   988  	LastPrice string `json:"last_price"`
   989  	Low       string
   990  	High      string
   991  	Volume    string
   992  	Timestamp string
   993  }
   994  ```
   995  
   996  
   997  #### func (*Tick) ParseTime
   998  
   999  ```go
  1000  func (el *Tick) ParseTime() (*time.Time, error)
  1001  ```
  1002  ParseTime - return Timestamp in time.Time format
  1003  
  1004  #### type TickerService
  1005  
  1006  ```go
  1007  type TickerService struct {
  1008  }
  1009  ```
  1010  
  1011  
  1012  #### func (*TickerService) Get
  1013  
  1014  ```go
  1015  func (s *TickerService) Get(pair string) (Tick, error)
  1016  ```
  1017  Get(pair) - return last Tick for specified pair
  1018  
  1019  #### type Trade
  1020  
  1021  ```go
  1022  type Trade struct {
  1023  	Price     string
  1024  	Amount    string
  1025  	Exchange  string
  1026  	Type      string
  1027  	Timestamp int64
  1028  	TradeId   int64 `json:"tid,int"`
  1029  }
  1030  ```
  1031  
  1032  
  1033  #### func (*Trade) Time
  1034  
  1035  ```go
  1036  func (el *Trade) Time() *time.Time
  1037  ```
  1038  
  1039  #### type TradesService
  1040  
  1041  ```go
  1042  type TradesService struct {
  1043  }
  1044  ```
  1045  
  1046  
  1047  #### func (*TradesService) All
  1048  
  1049  ```go
  1050  func (s *TradesService) All(pair string, timestamp time.Time, limitTrades int) ([]Trade, error)
  1051  ```
  1052  
  1053  #### type TransferStatus
  1054  
  1055  ```go
  1056  type TransferStatus struct {
  1057  	Status  string
  1058  	Message string
  1059  }
  1060  ```
  1061  
  1062  
  1063  #### type WalletBalance
  1064  
  1065  ```go
  1066  type WalletBalance struct {
  1067  	Type      string
  1068  	Currency  string
  1069  	Amount    string
  1070  	Available string
  1071  }
  1072  ```
  1073  
  1074  
  1075  #### type WalletService
  1076  
  1077  ```go
  1078  type WalletService struct {
  1079  }
  1080  ```
  1081  
  1082  
  1083  #### func (*WalletService) Transfer
  1084  
  1085  ```go
  1086  func (c *WalletService) Transfer(amount float64, currency, from, to string) ([]TransferStatus, error)
  1087  ```
  1088  Transfer funds between wallets
  1089  
  1090  #### func (*WalletService) WithdrawCrypto
  1091  
  1092  ```go
  1093  func (c *WalletService) WithdrawCrypto(amount float64, currency, wallet, destinationAddress string) ([]WithdrawStatus, error)
  1094  ```
  1095  Withdraw a cryptocurrency to a digital wallet
  1096  
  1097  #### func (*WalletService) WithdrawWire
  1098  
  1099  ```go
  1100  func (c *WalletService) WithdrawWire(amount float64, expressWire bool, wallet string, beneficiaryBank, intermediaryBank BankAccount, message string) ([]WithdrawStatus, error)
  1101  ```
  1102  
  1103  #### type WebSocketService
  1104  
  1105  ```go
  1106  type WebSocketService struct {
  1107  }
  1108  ```
  1109  
  1110  WebSocketService allow to connect and receive stream data from bitfinex.com ws
  1111  service. nolint:megacheck,structcheck
  1112  
  1113  #### func  NewWebSocketService
  1114  
  1115  ```go
  1116  func NewWebSocketService(c *Client) *WebSocketService
  1117  ```
  1118  NewWebSocketService returns a WebSocketService using the given client.
  1119  
  1120  #### func (*WebSocketService) AddSubscribe
  1121  
  1122  ```go
  1123  func (w *WebSocketService) AddSubscribe(channel string, pair string, c chan []float64)
  1124  ```
  1125  
  1126  #### func (*WebSocketService) ClearSubscriptions
  1127  
  1128  ```go
  1129  func (w *WebSocketService) ClearSubscriptions()
  1130  ```
  1131  
  1132  #### func (*WebSocketService) Close
  1133  
  1134  ```go
  1135  func (w *WebSocketService) Close()
  1136  ```
  1137  Close web socket connection
  1138  
  1139  #### func (*WebSocketService) Connect
  1140  
  1141  ```go
  1142  func (w *WebSocketService) Connect() error
  1143  ```
  1144  Connect create new bitfinex websocket connection
  1145  
  1146  #### func (*WebSocketService) ConnectPrivate
  1147  
  1148  ```go
  1149  func (w *WebSocketService) ConnectPrivate(ch chan TermData)
  1150  ```
  1151  
  1152  #### func (*WebSocketService) Subscribe
  1153  
  1154  ```go
  1155  func (w *WebSocketService) Subscribe() error
  1156  ```
  1157  Subscribe allows to subsribe to channels and watch for new updates. This method
  1158  supports next channels: book, trade, ticker.
  1159  
  1160  #### type WithdrawStatus
  1161  
  1162  ```go
  1163  type WithdrawStatus struct {
  1164  	Status       string
  1165  	Message      string
  1166  	WithdrawalID int `json:"withdrawal_id"`
  1167  }
  1168  ```