cmutils

package
v0.0.0-...-795c9cd Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 12 Imported by: 0

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 HTTPRequest) ([]byte, error)

type CoinMarginedClientCfg

type CoinMarginedClientCfg struct {
	Debug bool
	// Logger
	Logger *log.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 HTTPRequest

type HTTPRequest struct {
	// SecurityType each endpoint has a security type that determines how you will interact with it
	// docs: https://binance-docs.github.io/apidocs/delivery/en/#endpoint-security-type
	SecurityType usdmutils.SecurityType

	BaseURL string
	Path    string
	Method  string
	Headers map[string]string
	Query   any
	Body    any
}

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