bitmex

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptCurrencyPairToSymbol

func AdaptCurrencyPairToSymbol(pair CurrencyPair, contract string) string

func AdaptWsSymbol

func AdaptWsSymbol(symbol string) (pair CurrencyPair, contract string)

func Sym2duo

func Sym2duo(pair string) q.D

Types

type Bitmex

type Bitmex struct {
	*APIConfig
}

func New

func New(config *APIConfig) *Bitmex

func (*Bitmex) AllTicker

func (bm *Bitmex) AllTicker(SymPair map[string]q.D) (mdt *sync.Map, err error)

func (*Bitmex) Balances

func (bm *Bitmex) Balances() (availables, frozens *sync.Map, err error)

func (*Bitmex) Fee

func (bm *Bitmex) Fee() float64

func (*Bitmex) FeeMap

func (bm *Bitmex) FeeMap() (map[string]q.TradeFee, error)

func (*Bitmex) FutureCancelOrder

func (bm *Bitmex) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, error)

func (*Bitmex) GetAttr

func (bm *Bitmex) GetAttr() (a q.Attr)

func (*Bitmex) GetContractValue

func (bm *Bitmex) GetContractValue(currencyPair CurrencyPair) (float64, error)

func (*Bitmex) GetDeliveryTime

func (bm *Bitmex) GetDeliveryTime() (int, int, int, int)

func (*Bitmex) GetFee

func (bm *Bitmex) GetFee() (float64, error)

func (*Bitmex) GetFutureDepth

func (bm *Bitmex) GetFutureDepth(currencyPair CurrencyPair, contractType string, size int) (*Depth, error)

func (*Bitmex) GetFutureEstimatedPrice

func (bm *Bitmex) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error)

func (*Bitmex) GetFutureIndex

func (bm *Bitmex) GetFutureIndex(currencyPair CurrencyPair) (float64, error)

func (*Bitmex) GetFutureOrder

func (bm *Bitmex) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error)

func (*Bitmex) GetFutureOrderHistory

func (bm *Bitmex) GetFutureOrderHistory(pair CurrencyPair, contractType string, optional ...OptionalParameter) ([]FutureOrder, error)

func (*Bitmex) GetFutureOrders

func (bm *Bitmex) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)

func (*Bitmex) GetFuturePosition

func (bm *Bitmex) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error)

func (*Bitmex) GetFutureTicker

func (bm *Bitmex) GetFutureTicker(currencyPair CurrencyPair, contractType string) (*Ticker, error)

func (*Bitmex) GetFutureUserinfo

func (bm *Bitmex) GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error)

func (*Bitmex) GetIndicativeFundingRate

func (bm *Bitmex) GetIndicativeFundingRate(symbol string) (float64, *time.Time, error)

func (*Bitmex) GetKlineRecords

func (bm *Bitmex) GetKlineRecords(contract_type string, currency CurrencyPair, period KlinePeriod, size int, optional ...OptionalParameter) ([]FutureKline, error)

func (*Bitmex) GetTrades

func (bm *Bitmex) GetTrades(contract_type string, currency CurrencyPair, since int64) ([]Trade, error)

func (*Bitmex) GetUnfinishFutureOrders

func (bm *Bitmex) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)

func (*Bitmex) LimitFuturesOrder

func (bm *Bitmex) LimitFuturesOrder(currencyPair CurrencyPair, contractType, price, amount string, openType int, opt ...LimitOrderOptionalParameter) (*FutureOrder, error)

func (*Bitmex) MarketFuturesOrder

func (bm *Bitmex) MarketFuturesOrder(currencyPair CurrencyPair, contractType, amount string, openType int) (*FutureOrder, error)

func (*Bitmex) OneTicker

func (bm *Bitmex) OneTicker(d q.D) (ticker q.Bbo, err error)

func (*Bitmex) PairArray

func (bm *Bitmex) PairArray() (map[string]q.D, map[q.D]q.P, error)

func (*Bitmex) PlaceFutureOrder

func (bm *Bitmex) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, openType, matchPrice int, leverRate float64) (string, error)

func (*Bitmex) PlaceFutureOrder2

func (bm *Bitmex) PlaceFutureOrder2(currencyPair CurrencyPair, contractType, price, amount string, openType, matchPrice int, leverRate float64) (*FutureOrder, error)

func (*Bitmex) PlaceOrders

func (bm *Bitmex) PlaceOrders(places [3]q.Order) (orders [3]q.Order, err error)

func (*Bitmex) String

func (bm *Bitmex) String() string

func (*Bitmex) Test

func (bm *Bitmex) Test() bool

func (*Bitmex) WithdrawFee

func (bm *Bitmex) WithdrawFee() (sf []q.NetworkWithdraw, err error)

type BitmexOrder

type BitmexOrder struct {
	Symbol      string    `json:"symbol"`
	OrderID     string    `json:"OrderID"`
	ClOrdID     string    `json:"clOrdID"`
	Price       float64   `json:"price,omitempty"`
	OrderQty    int       `json:"orderQty"`
	CumQty      int       `json:"cumQty"`
	AvgPx       float64   `json:"avgPx"`
	OrdType     string    `json:"ordType"`
	Text        string    `json:"text"`
	TimeInForce string    `json:"timeInForce,omitempty"`
	Side        string    `json:"side"`
	OrdStatus   string    `json:"ordStatus"`
	Timestamp   time.Time `json:"timestamp"`
}

type SubscribeOp

type SubscribeOp struct {
	Op   string   `json:"op"`
	Args []string `json:"args"`
}

type SwapWs

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

func NewSwapWs

func NewSwapWs() *SwapWs

func (*SwapWs) DepthCallback

func (s *SwapWs) DepthCallback(f func(depth *Depth))

func (*SwapWs) SubscribeDepth

func (s *SwapWs) SubscribeDepth(pair CurrencyPair, contractType string) error

func (*SwapWs) SubscribeTicker

func (s *SwapWs) SubscribeTicker(pair CurrencyPair, contractType string) error

func (*SwapWs) SubscribeTrade

func (s *SwapWs) SubscribeTrade(pair CurrencyPair, contractType string) error

func (*SwapWs) TickerCallback

func (s *SwapWs) TickerCallback(f func(ticker *FutureTicker))

func (*SwapWs) TradeCallback

func (s *SwapWs) TradeCallback(f func(trade *Trade, contract string))

Jump to

Keyboard shortcuts

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