lib

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryUtils

type BinaryUtils struct{}

func (*BinaryUtils) DeserializeNumber

func (*BinaryUtils) DeserializeNumber(data []byte, value interface{}) error

Deserializes any number into binary format Accepts any type (int, uint, float) and any size (8, 16, 32, 64)

func (*BinaryUtils) DeserializeString

func (*BinaryUtils) DeserializeString(data []byte) (string, error)

Deserialize a string from binary to string format

func (*BinaryUtils) SerializeNumber

func (*BinaryUtils) SerializeNumber(value interface{}) ([]byte, error)

Serializes any number into binary format Accepts any type (int, uint, float) and any size (8, 16, 32, 64)

func (*BinaryUtils) SerializeString

func (*BinaryUtils) SerializeString(value string) ([]byte, error)

Serialize a string from string to binary format

type CustomInterval

type CustomInterval struct {
	Rune          rune
	IntervalValue int64
}

type Error

type Error struct {
	// false => Error originating from binance's side
	// true => Originating from the Binance-Go library
	IsLocalError bool

	StatusCode int

	Code int

	Message string
}

func BinanceError

func BinanceError(statusCode int, body []byte) (BinanceError *Error, UnmarshallError error)

Processes an erroneous 4XX HTTP Response Returns the library Error type In the case of an error parsing the error body, it returns a secondaly unmarshall error

func LocalError

func LocalError(code int, msg string) *Error

func (*Error) Error

func (e *Error) Error() string

Implement the `Error` method to satisfy the `error` interface

type KlineInterval

type KlineInterval struct {
	Name       string
	Rune       rune
	BaseValue  int64
	Multiplier int64
	Value      int64
}

type Utils

type Utils struct{}

func (*Utils) CreateQueryString

func (*Utils) CreateQueryString(params map[string]interface{}, sorted bool) string

CreateQueryString transforms a map[string]interface{} into a query string

func (*Utils) DetectDotNumIndexes

func (*Utils) DetectDotNumIndexes(numStr string) (dotIndex int, numIndex int)

func (*Utils) Format_TickSize_str

func (*Utils) Format_TickSize_str(priceStr string, tickSize string) string

func (*Utils) GetIntervalFromString

func (*Utils) GetIntervalFromString(intervalStr string, customIntervals ...CustomInterval) (interval *KlineInterval, isComplex bool, err error)

func (*Utils) GetOpenCloseTimes

func (*Utils) GetOpenCloseTimes(currentTime int64, interval string, customIntervals ...CustomInterval) (openTime int64, closeTime int64, err error)

func (*Utils) GetStringNumberPrecision

func (*Utils) GetStringNumberPrecision(numStr string) int

func (*Utils) ParseFloat

func (*Utils) ParseFloat(floatStr string) (float64, error)

func (*Utils) ParseInt

func (*Utils) ParseInt(intStr string) (int64, error)

func (*Utils) RemoveDuplicates

func (*Utils) RemoveDuplicates(input []string) []string

func (*Utils) Round_priceStr

func (*Utils) Round_priceStr(priceStr string, precision int) string

func (*Utils) ToFixed_Ceil

func (*Utils) ToFixed_Ceil(price float64, precision int) float64

func (*Utils) ToFixed_Floor

func (*Utils) ToFixed_Floor(price float64, precision int) float64

func (*Utils) ToFixed_Round

func (*Utils) ToFixed_Round(price float64, precision int) float64

Jump to

Keyboard shortcuts

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