utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CoinMarginedBaseURL = "https://dapi.binance.com"
)

Functions

This section is empty.

Types

type CoinMarginedClient

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

func NewCoinMarginedClient

func NewCoinMarginedClient(cfg *CoinMarginedClientCfg) (*CoinMarginedClient, error)

func (*CoinMarginedClient) GenHeaders

func (u *CoinMarginedClient) GenHeaders(t usdmutils.SecurityType) (map[string]string, error)

func (*CoinMarginedClient) GetBaseURL

func (u *CoinMarginedClient) GetBaseURL() string

func (*CoinMarginedClient) GetDebug

func (u *CoinMarginedClient) GetDebug() bool

func (*CoinMarginedClient) GetKey

func (u *CoinMarginedClient) GetKey() string

func (*CoinMarginedClient) GetRecvWindow

func (u *CoinMarginedClient) GetRecvWindow() int

func (*CoinMarginedClient) GetSecret

func (u *CoinMarginedClient) GetSecret() string

func (*CoinMarginedClient) NeedSignature

func (u *CoinMarginedClient) NeedSignature(t usdmutils.SecurityType) bool

func (*CoinMarginedClient) SendHTTPRequest

func (u *CoinMarginedClient) SendHTTPRequest(ctx context.Context, req utils.HTTPRequest) (*utils.ApiResponse, error)

type CoinMarginedClientCfg

type CoinMarginedClientCfg struct {
	Debug bool
	// Logger
	Logger *slog.Logger

	BaseURL    string `validate:"required"`
	Key        string
	Secret     string
	RecvWindow int
}

type ContractType

type ContractType = string
var (
	All            ContractType = "ALL"
	Perpetual      ContractType = "PERPETUAL"
	CurrentQuarter ContractType = "CURRENT_QUARTER"
	NextQuarter    ContractType = "NEXT_QUARTER"
)

type OrderStatus

type OrderStatus = string
var (
	New             OrderStatus = "NEW"
	PartiallyFilled OrderStatus = "PARTIALLY_FILLED"
	Filled          OrderStatus = "FILLED"
	Canceled        OrderStatus = "CANCELED"
	Expired         OrderStatus = "EXPIRED"
)

Jump to

Keyboard shortcuts

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