futures

package
v2.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

* @Author: robert@xxx@xxx.com.com * @Date: 2024-09-23 02:03:56 * @LastEditors: robert@xxx@xxx.com.com * @LastEditTime: 2025-02-11 12:23:56 * @FilePath: \v2\v2\okx\futures\swap.go * @Description: * * Copyright (c) 2022 by robert@xxx@xxx.com.com, All Rights Reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrossPrvApi

type CrossPrvApi struct {
	*PrvApi
}

添加全仓位的API结构体

func (*CrossPrvApi) CreateOrder

func (prv *CrossPrvApi) CreateOrder(pair model.CurrencyPair, amount, price float64, side model.OrderSide, orderType model.OrderType, opt ...model.OptionParameter) (*model.Order, []byte, error)

为 CrossPrvApi 添加创建订单方法

func (*CrossPrvApi) SetLeverage added in v2.0.8

func (prv *CrossPrvApi) SetLeverage(pair model.CurrencyPair, leverage int, opt ...model.OptionParameter) error

为 CrossPrvApi 添加设置杠杆倍数方法

type Futures

type Futures struct {
	*common.OKxV5
	// contains filtered or unexported fields
}

func New

func New() *Futures

func (*Futures) GetExchangeInfo

func (f *Futures) GetExchangeInfo() (map[string]model.CurrencyPair, []byte, error)

func (*Futures) NewCurrencyPair

func (f *Futures) NewCurrencyPair(baseSym, quoteSym string, opts ...model.OptionParameter) (model.CurrencyPair, error)

func (*Futures) NewPrvApi

func (f *Futures) NewPrvApi(apiOpts ...options.ApiOption) *PrvApi

type FuturesError added in v2.0.8

type FuturesError struct {
	Symbol  string
	Action  string
	Details string
	Cause   error
}

添加错误类型

func (*FuturesError) Error added in v2.0.8

func (e *FuturesError) Error() string

type IsolatedPrvApi

type IsolatedPrvApi struct {
	*PrvApi
}

添加隔离仓位的API结构体

func (*IsolatedPrvApi) CreateOrder

func (prv *IsolatedPrvApi) CreateOrder(pair model.CurrencyPair, amount, price float64, side model.OrderSide, orderType model.OrderType, opt ...model.OptionParameter) (*model.Order, []byte, error)

为 IsolatedPrvApi 添加创建订单方法

func (*IsolatedPrvApi) SetLeverage added in v2.0.8

func (prv *IsolatedPrvApi) SetLeverage(pair model.CurrencyPair, leverage int, opt ...model.OptionParameter) error

为 IsolatedPrvApi 添加设置杠杆倍数方法

type PrvApi

type PrvApi struct {
	*common.Prv
	Isolated *IsolatedPrvApi
	Cross    *CrossPrvApi
}

func NewPrvApi

func NewPrvApi(v5 *common.OKxV5, apiOpts ...options.ApiOption) *PrvApi

func (*PrvApi) CreateOrder added in v2.0.4

func (prv *PrvApi) CreateOrder(pair model.CurrencyPair, amount, price float64, side model.OrderSide, orderType model.OrderType, opt ...model.OptionParameter) (*model.Order, []byte, error)

修改 CreateOrder 方法

func (*PrvApi) GetFuturesAccount

func (prv *PrvApi) GetFuturesAccount(coin string) (map[string]model.FuturesAccount, []byte, error)

func (*PrvApi) GetHistoryOrders

func (prv *PrvApi) GetHistoryOrders(pair model.CurrencyPair, opt ...model.OptionParameter) ([]model.Order, []byte, error)

func (*PrvApi) GetOrderInfo added in v2.0.8

func (prv *PrvApi) GetOrderInfo(pair model.CurrencyPair, orderId string, opt ...model.OptionParameter) (*model.Order, []byte, error)

添加 GetOrderInfo 方法

func (*PrvApi) GetPositions

func (prv *PrvApi) GetPositions(pair model.CurrencyPair, opts ...model.OptionParameter) ([]model.FuturesPosition, []byte, error)

func (*PrvApi) SetLeverage added in v2.0.8

func (prv *PrvApi) SetLeverage(pair model.CurrencyPair, leverage int, opt ...model.OptionParameter) error

修改 SetLeverage 方法

type Swap

type Swap struct {
	*common.OKxV5
	// contains filtered or unexported fields
}

func NewSwap

func NewSwap() *Swap

func (*Swap) GetExchangeInfo

func (f *Swap) GetExchangeInfo() (map[string]model.CurrencyPair, []byte, error)

func (*Swap) NewCurrencyPair

func (f *Swap) NewCurrencyPair(baseSym, quoteSym string, opts ...model.OptionParameter) (model.CurrencyPair, error)

func (*Swap) NewPrvApi

func (f *Swap) NewPrvApi(apiOpts ...options.ApiOption) *PrvApi

Jump to

Keyboard shortcuts

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