futures

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptKlinePeriod

func AdaptKlinePeriod(period KlinePeriod) string

func AdaptOffsetDirectionToOrderSide

func AdaptOffsetDirectionToOrderSide(offset, direction string) OrderSide

func AdaptSideToDirectionAndOffset

func AdaptSideToDirectionAndOffset(side OrderSide) (direction, offset string)

func AdaptStatus

func AdaptStatus(s int) OrderStatus

func UnmarshalCancelOrderResponse

func UnmarshalCancelOrderResponse(data []byte) error

func UnmarshalCreateOrderResponse

func UnmarshalCreateOrderResponse(data []byte) (*Order, error)

func UnmarshalGetHistoryOrdersResponse

func UnmarshalGetHistoryOrdersResponse(data []byte) ([]Order, error)

func UnmarshalGetOrderInfoResponse

func UnmarshalGetOrderInfoResponse(data []byte) (*Order, error)

func UnmarshalGetPendingOrdersResponse

func UnmarshalGetPendingOrdersResponse(data []byte) ([]Order, error)

func UnmarshalKline

func UnmarshalKline(data []byte) ([]Kline, error)

func UnmarshalResponse

func UnmarshalResponse(data []byte, i interface{}) error

func UnmarshalTicker

func UnmarshalTicker(data []byte) (*Ticker, error)

Types

type BaseResponse

type BaseResponse struct {
	Code    int    `json:"code"`
	Status  string `json:"status"`
	Ts      int64  `json:"ts"`
	ErrCode int    `json:"err_code"`
	ErrMsg  string `json:"err_msg"`
}

type Futures

type Futures struct {
	USDTSwapFutures *USDTSwap
}

func New

func New() *Futures

type TradeBaseResponse

type TradeBaseResponse struct {
	*BaseResponse
	Data json.RawMessage `json:"data"`
}

type USDTSwap

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

func NewUSDTSwap

func NewUSDTSwap() *USDTSwap

func (*USDTSwap) DoNoAuthRequest

func (f *USDTSwap) DoNoAuthRequest(method, reqUrl string, params *url.Values) ([]byte, error)

func (*USDTSwap) GetDepth

func (f *USDTSwap) GetDepth(pair CurrencyPair, limit int, opt ...OptionParameter) (*Depth, []byte, error)

func (*USDTSwap) GetKline

func (f *USDTSwap) GetKline(pair CurrencyPair, period KlinePeriod, opts ...OptionParameter) ([]Kline, []byte, error)

func (*USDTSwap) GetName

func (f *USDTSwap) GetName() string

func (*USDTSwap) GetTicker

func (f *USDTSwap) GetTicker(pair CurrencyPair, opts ...OptionParameter) (*Ticker, []byte, error)

func (*USDTSwap) NewUSDTSwapPrvApi

func (f *USDTSwap) NewUSDTSwapPrvApi(apiOpts ...ApiOption) *USDTSwapPrvApi

func (*USDTSwap) WithUnmarshalerOptions

func (f *USDTSwap) WithUnmarshalerOptions(opts ...UnmarshalerOption) *USDTSwap

func (*USDTSwap) WithUriOptions

func (f *USDTSwap) WithUriOptions(uriOpts ...UriOption) *USDTSwap

type USDTSwapPrvApi

type USDTSwapPrvApi struct {
	*USDTSwap
	// contains filtered or unexported fields
}

func NewUSDTSwapPrvApi

func NewUSDTSwapPrvApi(apiOpts ...options.ApiOption) *USDTSwapPrvApi

func (*USDTSwapPrvApi) CancelOrder

func (f *USDTSwapPrvApi) CancelOrder(pair CurrencyPair, id string, opt ...OptionParameter) ([]byte, error)

func (*USDTSwapPrvApi) CancelOrders

func (f *USDTSwapPrvApi) CancelOrders(pair *CurrencyPair, id []string, opt ...OptionParameter) error

func (*USDTSwapPrvApi) CreateOrder

func (f *USDTSwapPrvApi) CreateOrder(pair CurrencyPair, qty, price float64, side OrderSide, orderTy OrderType, opts ...OptionParameter) (*Order, []byte, error)

func (*USDTSwapPrvApi) DoAuthRequest

func (f *USDTSwapPrvApi) DoAuthRequest(method, reqUrl string, params *url.Values, header map[string]string) ([]byte, error)

func (*USDTSwapPrvApi) GetFuturesAccount

func (f *USDTSwapPrvApi) GetFuturesAccount(coin string) (acc map[string]FuturesAccount, responseBody []byte, err error)

func (*USDTSwapPrvApi) GetHistoryOrders

func (f *USDTSwapPrvApi) GetHistoryOrders(pair CurrencyPair, opts ...OptionParameter) ([]Order, []byte, error)

func (*USDTSwapPrvApi) GetOrderInfo

func (f *USDTSwapPrvApi) GetOrderInfo(pair CurrencyPair, id string, opts ...OptionParameter) (*Order, []byte, error)

func (*USDTSwapPrvApi) GetPendingOrders

func (f *USDTSwapPrvApi) GetPendingOrders(pair CurrencyPair, opt ...OptionParameter) ([]Order, []byte, error)

func (*USDTSwapPrvApi) GetPositions

func (f *USDTSwapPrvApi) GetPositions(pair CurrencyPair, opts ...OptionParameter) (positions []FuturesPosition, responseBody []byte, err error)

Jump to

Keyboard shortcuts

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