bitfinex

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BASE_URL = "https://api.bitfinex.com/v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitfinex

type Bitfinex struct {
	// contains filtered or unexported fields
}

func New

func New(client *http.Client, accessKey, secretKey string) *Bitfinex

func (*Bitfinex) ActiveCredits

func (bfx *Bitfinex) ActiveCredits() (error, []LendOrder)

func (*Bitfinex) ActiveLendOrders

func (bfx *Bitfinex) ActiveLendOrders() (error, []LendOrder)

func (*Bitfinex) CancelLendOrder

func (bfx *Bitfinex) CancelLendOrder(id int) (error, *LendOrder)

func (*Bitfinex) CancelOrder

func (bfx *Bitfinex) CancelOrder(orderId string, currencyPair CurrencyPair) (bool, error)

func (*Bitfinex) GetAccount

func (bfx *Bitfinex) GetAccount() (*Account, error)

defalut only return exchange wallet balance

func (*Bitfinex) GetDepositWalletBalance

func (bfx *Bitfinex) GetDepositWalletBalance() (*Account, error)

func (*Bitfinex) GetDepth

func (bfx *Bitfinex) GetDepth(size int, currencyPair CurrencyPair) (*Depth, error)

func (*Bitfinex) GetExchangeName

func (bfx *Bitfinex) GetExchangeName() string

func (*Bitfinex) GetKlineRecords

func (bfx *Bitfinex) GetKlineRecords(currencyPair CurrencyPair, period, size, since int) ([]Kline, error)

func (*Bitfinex) GetLendBook

func (bfx *Bitfinex) GetLendBook(currency Currency) (error, *LendBook)

func (*Bitfinex) GetLendOrderStatus

func (bfx *Bitfinex) GetLendOrderStatus(id int) (error, *LendOrder)

func (*Bitfinex) GetLendTickers

func (bfx *Bitfinex) GetLendTickers() ([]LendTicker, error)

func (*Bitfinex) GetMarginInfos

func (bfx *Bitfinex) GetMarginInfos() ([]MarginInfo, error)

func (*Bitfinex) GetMarginTradingWalletBalance

func (bfx *Bitfinex) GetMarginTradingWalletBalance() (*Account, error)

func (*Bitfinex) GetOneOrder

func (bfx *Bitfinex) GetOneOrder(orderId string, currencyPair CurrencyPair) (*Order, error)

func (*Bitfinex) GetOrderHistorys

func (bfx *Bitfinex) GetOrderHistorys(currencyPair CurrencyPair, currentPage, pageSize int) ([]Order, error)

func (*Bitfinex) GetTicker

func (bfx *Bitfinex) GetTicker(currencyPair CurrencyPair) (*Ticker, error)

func (*Bitfinex) GetTrades

func (bfx *Bitfinex) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)

func (*Bitfinex) GetUnfinishOrders

func (bfx *Bitfinex) GetUnfinishOrders(currencyPair CurrencyPair) ([]Order, error)

func (*Bitfinex) GetWalletBalances

func (bfx *Bitfinex) GetWalletBalances() (map[string]*Account, error)

func (*Bitfinex) LimitBuy

func (bfx *Bitfinex) LimitBuy(amount, price string, currencyPair CurrencyPair) (*Order, error)

func (*Bitfinex) LimitSell

func (bfx *Bitfinex) LimitSell(amount, price string, currencyPair CurrencyPair) (*Order, error)

func (*Bitfinex) MarginLimitBuy

func (bfx *Bitfinex) MarginLimitBuy(amount, price string, currencyPair CurrencyPair) (*Order, error)

func (*Bitfinex) MarginLimitSell

func (bfx *Bitfinex) MarginLimitSell(amount, price string, currencyPair CurrencyPair) (*Order, error)

func (*Bitfinex) MarginMarketBuy

func (bfx *Bitfinex) MarginMarketBuy(amount, price string, currencyPair CurrencyPair) (*Order, error)

func (*Bitfinex) MarginMarketSell

func (bfx *Bitfinex) MarginMarketSell(amount, price string, currencyPair CurrencyPair) (*Order, error)

func (*Bitfinex) MarketBuy

func (bfx *Bitfinex) MarketBuy(amount, price string, currencyPair CurrencyPair) (*Order, error)

func (*Bitfinex) MarketSell

func (bfx *Bitfinex) MarketSell(amount, price string, currencyPair CurrencyPair) (*Order, error)

func (*Bitfinex) MytradesFunding

func (bfx *Bitfinex) MytradesFunding(currency Currency, limit int) (error, []TradeFunding)

func (*Bitfinex) NewLendOrder

func (bfx *Bitfinex) NewLendOrder(currency Currency, amount, rate string, period int) (error, *LendOrder)

func (*Bitfinex) NewLoanOrder

func (bfx *Bitfinex) NewLoanOrder(currency Currency, amount, rate string, period int) (error, *LendOrder)

func (*Bitfinex) OffersHistory

func (bfx *Bitfinex) OffersHistory(limit int) (error, []LendOrder)

func (*Bitfinex) Transfer

func (bfx *Bitfinex) Transfer(amount float64, currency Currency, fromWallet, toWallet string) error

type LendBook

type LendBook struct {
	Bids []LendBookItem `json:"bids"`
	Asks []LendBookItem `json:"asks"`
}

type LendBookItem

type LendBookItem struct {
	Rate      float64 `json:",string"`
	Amount    float64 `json:",string"`
	Period    int     `json:"period"`
	Timestamp string  `json:"timestamp"`
	Frr       string  `json:"frr"`
}

type LendOrder

type LendOrder struct {
	Id              int     `json:"id"`
	Currency        string  `json:"currency"`
	Rate            float64 `json:"rate,string"`
	Period          int     `json:"period"`
	Direction       string  `json:"direction"`
	IsLive          bool    `json:"is_live"`
	IsCancelled     bool    `json:"is_cancelled"`
	Amount          float64 `json:"amount,string"`
	ExecutedAmount  float64 `json:"executed_amount,string"`
	RemainingAmount float64 `json:"remaining_amount,string"`
	OriginalAmount  float64 `json:"original_amount,string"`
	Timestamp       string  `json:"timestamp"`
}

type LendTicker

type LendTicker struct {
	Ticker
	Coin            Currency
	DailyChangePerc float64
}

type MarginInfo

type MarginInfo struct {
	MarginBalance     float64        `json:"margin_balance,string"`
	TradableBalance   float64        `json:"tradable_balance,string"`
	UnrealizedPl      float64        `json:"unrealized_pl,string"`
	UnrealizedSwap    float64        `json:"unrealized_swap,string"`
	NetValue          float64        `json:"net_value,string"`
	RequiredMargin    float64        `json:"required_margin,string"`
	Leverage          float64        `json:"leverage,string"`
	MarginRequirement float64        `json:"margin_requirement,string"`
	MarginLimits      []MarginLimits `json:"margin_limits"`
}

type MarginLimits

type MarginLimits struct {
	Pair              string  `json:"on_pair"`
	InitialMargin     float64 `json:"initial_margin,string"`
	MarginRequirement float64 `json:"margin_requirement,string"`
	TradableBalance   float64 `json:"tradable_balance,string"`
}

type TradeFunding

type TradeFunding struct {
	Rate      string `json:"rate"`
	Period    string `json:"period"`
	Amount    string `json:"amount"`
	Timestamp string `json:"timestamp"`
	Type      string `json:"type"`
	Tid       int64  `json:"tid"`
	OfferId   int64  `json:"offer_id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL