fcoin

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FCoinWSTicker        = "ticker.%s"
	FCoinWSOrderBook     = "depth.L%d.%s"
	FCoinWSOrderBookL20  = "depth.L20.%s"
	FCoinWSOrderBookL150 = "depth.L150.%s"
	FCoinWSOrderBookFull = "depth.full.%s"
	FCoinWSTrades        = "trade.%s"
	FCoinWSKLines        = "candle.%s.%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Currency  Currency
	Avaliable float64
	Frozen    float64
	Finances  float64
	Lock      float64
	Total     float64
}

type FCoin

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

func NewFCoin

func NewFCoin(client *http.Client, apikey, secretkey string) *FCoin

func (*FCoin) AssetTransfer

func (fc *FCoin) AssetTransfer(currency Currency, amount, from, to string) (bool, error)

from, to: assets, spot

func (*FCoin) CancelOrder

func (fc *FCoin) CancelOrder(orderId string, currency CurrencyPair) (bool, error)

func (*FCoin) GetAccount

func (fc *FCoin) GetAccount() (*Account, error)

func (*FCoin) GetAssets

func (fc *FCoin) GetAssets() ([]Asset, error)

func (*FCoin) GetDaysOrderHistorys

func (fc *FCoin) GetDaysOrderHistorys(currency CurrencyPair, start time.Time, days int64) ([]Order, error)

func (*FCoin) GetDepth

func (fc *FCoin) GetDepth(size int, currency CurrencyPair) (*Depth, error)

func (*FCoin) GetExchangeName

func (fc *FCoin) GetExchangeName() string

func (*FCoin) GetHoursOrderHistorys

func (fc *FCoin) GetHoursOrderHistorys(currency CurrencyPair, start time.Time, hours int64) ([]Order, error)

func (*FCoin) GetKlineRecords

func (fc *FCoin) GetKlineRecords(currency CurrencyPair, period, size, since int) ([]Kline, error)

func (*FCoin) GetOneOrder

func (fc *FCoin) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)

func (*FCoin) GetOrderHistorys

func (fc *FCoin) GetOrderHistorys(currency CurrencyPair, currentPage, pageSize int) ([]Order, error)

func (*FCoin) GetServerTime

func (fc *FCoin) GetServerTime() (int64, error)

func (*FCoin) GetTicker

func (fc *FCoin) GetTicker(currencyPair CurrencyPair) (*Ticker, error)

func (*FCoin) GetTradeSymbols

func (fc *FCoin) GetTradeSymbols(currencyPair CurrencyPair) (*TradeSymbol, error)

func (*FCoin) GetTradeSymbols2

func (fc *FCoin) GetTradeSymbols2(currencyPair CurrencyPair) (*TradeSymbol2, error)

func (*FCoin) GetTrades

func (fc *FCoin) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)

非个人,整个交易所的交易记录

func (*FCoin) GetUnfinishOrders

func (fc *FCoin) GetUnfinishOrders(currency CurrencyPair) ([]Order, error)

func (*FCoin) LimitBuy

func (fc *FCoin) LimitBuy(amount, price string, currency CurrencyPair) (*Order, error)

func (*FCoin) LimitSell

func (fc *FCoin) LimitSell(amount, price string, currency CurrencyPair) (*Order, error)

func (*FCoin) MarketBuy

func (fc *FCoin) MarketBuy(amount, price string, currency CurrencyPair) (*Order, error)

func (*FCoin) MarketSell

func (fc *FCoin) MarketSell(amount, price string, currency CurrencyPair) (*Order, error)

type FCoinTicker

type FCoinTicker struct {
	Ticker
	SellAmount,
	BuyAmount float64
}

type FCoinWs

type FCoinWs struct {
	*WsBuilder
	sync.Once
	// contains filtered or unexported fields
}

func NewFCoinWs

func NewFCoinWs(client *http.Client) *FCoinWs

func (*FCoinWs) SetCallbacks

func (fcWs *FCoinWs) SetCallbacks(
	tickerCallback func(*Ticker),
	depthCallback func(*Depth),
	tradeCallback func(*Trade),
	klineCallback func(*Kline, int),
)

func (*FCoinWs) SubscribeDepth

func (fcWs *FCoinWs) SubscribeDepth(pair CurrencyPair, size int) error

func (*FCoinWs) SubscribeKline

func (fcWs *FCoinWs) SubscribeKline(pair CurrencyPair, period int) error

func (*FCoinWs) SubscribeTicker

func (fcWs *FCoinWs) SubscribeTicker(pair CurrencyPair) error

func (*FCoinWs) SubscribeTrade

func (fcWs *FCoinWs) SubscribeTrade(pair CurrencyPair) error

type TradeSymbol

type TradeSymbol struct {
	Name          string `json:"name"`
	BaseCurrency  string `json:"base_currency"`
	QuoteCurrency string `json:"quote_currency"`
	PriceDecimal  int    `json:"price_decimal"`
	AmountDecimal int    `json:"amount_decimal"`
	Tradeable     bool   `json:"tradable"`
}

type TradeSymbol2

type TradeSymbol2 struct {
	TradeSymbol
	Category           string  `json:"category"`
	LeveragedMultiple  int     `json:"leveraged_multiple"`
	MarketOrderEnabled bool    `json:"market_order_enabled"`
	LimitAmountMin     float64 `json:"limit_amount_min"`
	LimitAmountMax     float64 `json:"limit_amount_max"`
	MainTag            string  `json:"main_tag"`
	DailyOpenAt        string  `json:"daily_open_at"`
	DailyCloseAt       string  `json:"daily_close_at"`
}

Jump to

Keyboard shortcuts

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