Documentation ¶
Index ¶
- Constants
- type API
- func (api *API) ActiveCredits() (credits Credits, err error)
- func (api *API) ActiveOffers() (offers Offers, err error)
- func (api *API) CancelActiveOffers() (err error)
- func (api *API) CancelActiveOffersByCurrency(currency string) (err error)
- func (api *API) CancelOffer(id int) (err error)
- func (api *API) Lendbook(currency string, limitBids, limitAsks int) (lendbook Lendbook, err error)
- func (api *API) MyTrades(symbol string, timestamp string, limitTrades int) (mytrades MyTrades, err error)
- func (api *API) NewOffer(currency string, amount, rate float64, period int, direction string) (offer Offer, err error)
- func (api *API) Orderbook(symbol string, limitBids, limitAsks, group int) (orderbook Orderbook, err error)
- func (api *API) Stats(symbol string) (stats Stats, err error)
- func (api *API) Ticker(symbol string) (ticker Ticker, err error)
- func (api *API) WalletBalances() (wallet WalletBalances, err error)
- type Credit
- type Credits
- type ErrorMessage
- type Lendbook
- type LendbookOffer
- type MyTrade
- type MyTrades
- type Offer
- type Offers
- type Orderbook
- type OrderbookOffer
- type Stat
- type Stats
- type Ticker
- type WalletBalance
- type WalletBalances
- type WalletKey
Constants ¶
const ( // APIURL points to Bitfinex API URL, found at https://www.bitfinex.com/pages/API APIURL = "https://api.bitfinex.com" // LEND ... LEND = "lend" // BORROW ... BORROW = "borrow" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API structure stores Bitfinex API credentials
func (*API) ActiveCredits ¶
ActiveCredits return a list of currently lent funds (active credits).
func (*API) ActiveOffers ¶
ActiveOffers return an array of all your live offers (lending or borrowing).
func (*API) CancelActiveOffers ¶
CancelActiveOffers ...
func (*API) CancelActiveOffersByCurrency ¶
CancelActiveOffersByCurrency ...
func (*API) CancelOffer ¶
CancelOffer cancel an offer give its id.
func (*API) MyTrades ¶
func (api *API) MyTrades(symbol string, timestamp string, limitTrades int) (mytrades MyTrades, err error)
MyTrades returns an array of your past trades for the given symbol.
func (*API) NewOffer ¶
func (api *API) NewOffer(currency string, amount, rate float64, period int, direction string) (offer Offer, err error)
NewOffer submits a new offer. currency (string): The name of the currency. amount (decimal): Offer size: how much to lend or borrow. rate (decimal): Rate to lend or borrow at. In percentage per 365 days. period (integer): Number of days of the loan (in days) direction (string): Either "lend" or "loan".
func (*API) Orderbook ¶
func (api *API) Orderbook(symbol string, limitBids, limitAsks, group int) (orderbook Orderbook, err error)
Orderbook returns the full order book.
func (*API) Ticker ¶
Ticker returns innermost bid and asks and information on the most recent trade,
as well as high, low and volume of the last 24 hours.
func (*API) WalletBalances ¶
func (api *API) WalletBalances() (wallet WalletBalances, err error)
WalletBalances return your balances.
type Credit ¶
type Credit struct { ID int `json:"id"` Currency string `json:"currency"` // The currency name of the offer. Rate float64 `json:"rate,string"` // The rate the offer was issued at (in % per 365 days). Period int `json:"period"` // The number of days of the offer. Amount float64 `json:"amount,string"` // How much is the credit for Status string `json:"status"` // "Active" Timestamp float64 `json:"timestamp,string"` // The timestamp the offer was submitted. }
Credit ...
type ErrorMessage ¶
type ErrorMessage struct {
Message string `json:"message"` // Returned only on error
}
ErrorMessage ...
type Lendbook ¶
type Lendbook struct { Bids []LendbookOffer // bids (array of loan demands) Asks []LendbookOffer // asks (array of loan offers) }
Lendbook ...
type LendbookOffer ¶
type LendbookOffer struct { Rate float64 `json:"rate,string"` // rate (rate in % per 365 days) Amount float64 `json:"amount,string"` // amount (decimal) Period int `json:"period"` // period (days): minimum period for the loan Timestamp float64 `json:"timestamp,string"` // timestamp (time) FRRString string `json:"frr"` // frr (yes/no): "Yes" if the offer is at Flash Return Rate, "No" if the offer is at fixed rate FRR bool Hidden int `json:"hidden"` // 0 if false, 1 if true }
LendbookOffer ...
type MyTrade ¶
type MyTrade struct { Price float64 `json:"price,string"` // price Amount float64 `json:"amount,string"` // amount (decimal) Timestamp float64 `json:"timestamp,string"` // time Until float64 `json:"until,string"` // until (time): return only trades before or a the time specified here Exchange string `json:"exchange"` // exchange Type string `json:"type"` // type - "Sell" or "Buy" FeeCurrency string `json:"fee_currency"` // fee_currency (string) Currency you paid this trade's fee in FeeAmount float64 `json:"fee_amount,string"` // fee_amount (decimal) Amount of fees you paid for this trade TID int `json:"tid"` // tid (integer): unique identification number of the trade OrderId int `json:"order_id"` // order_id (integer) unique identification number of the parent order of the trade }
MyTrade ... (NEW)
type Offer ¶
type Offer struct { ID int `json:"id"` Currency string `json:"currency"` // The currency name of the offer. Rate float64 `json:"rate,string"` // The rate the offer was issued at (in % per 365 days). Period int `json:"period"` // The number of days of the offer. Direction string `json:"direction"` // Either "lend" or "loan".Either "lend" or "loan". Type string `json:"type"` // Either "market" / "limit" / "stop" / "trailing-stop". Timestamp float64 `json:"timestamp,string"` // The timestamp the offer was submitted. Live bool `json:"is_live,bool"` // Could the offer still be filled? Cancelled bool `json:"is_cancelled,bool"` // Has the offer been cancelled? ExecutedAmount float64 `json:"executed_amount,string"` // How much of the offer has been executed so far in its history? RemainingAmount float64 `json:"remaining_amount,string"` // How much is still remaining to be submitted? OriginalAmount float64 `json:"original_amount,string"` // What was the offer originally submitted for? }
Offer ...
type Orderbook ¶
type Orderbook struct { Bids []OrderbookOffer // bids (array of bid offers) Asks []OrderbookOffer // asks (array of ask offers) }
Orderbook ... Public (NEW)
type OrderbookOffer ¶
type OrderbookOffer struct { Price float64 `json:"price,string"` // price Amount float64 `json:"amount,string"` // amount (decimal) Timestamp float64 `json:"timestamp,string"` // time }
OrderbookOffer ... (NEW)
type Stat ¶
type Stat struct { Period int `json:"period"` // period (integer), period covered in days Volume float64 `json:"volume,string"` // volume (price) }
Stat ...
type Ticker ¶
type Ticker struct { Mid float64 `json:"mid,string"` // mid (price): (bid + ask) / 2 Bid float64 `json:"bid,string"` // bid (price): Innermost bid. Ask float64 `json:"ask,string"` // ask (price): Innermost ask. LastPrice float64 `json:"last_price,string"` // last_price (price) The price at which the last order executed. Low float64 `json:"low,string"` // low (price): Lowest trade price of the last 24 hours High float64 `json:"high,string"` // high (price): Highest trade price of the last 24 hours Volume float64 `json:"volume,string"` // volume (price): Trading volume of the last 24 hours Timestamp float64 `json:"timestamp,string"` // timestamp (time) The timestamp at which this information was valid. }
Ticker ...
type WalletBalance ¶
type WalletBalance struct { Type string `json:"type"` // "trading", "deposit" or "exchange". Currency string `json:"currency"` // Currency Amount float64 `json:"amount,string"` // How much balance of this currency in this wallet Available float64 `json:"available,string"` // How much X there is in this wallet that is available to trade. }
WalletBalance ...