binance

package
v0.0.0-...-a4de9da Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// https://api.binance.com
	// https://api-gcp.binance.com
	// https://api1.binance.com
	// https://api2.binance.com
	// https://api3.binance.com
	// https://api4.binance.com
	MainnetSpotAPI SpotAPIURL = "https://api.binance.com"
	TestnetSpotAPI SpotAPIURL = "https://testnet.binance.vision"
	MainnetSpotWSS SpotWSURL  = "wss://stream.binance.com:9443/ws"
	TestnetSpotWSS SpotWSURL  = "wss://testnet.binance.vision/ws"
)

Variables

This section is empty.

Functions

func InitAccount

func InitAccount(apiKey, secretKey string, env Environment) *account

func InitKLines

func InitKLines(env Environment) *klines

func InitMonitor

func InitMonitor(env Environment) (*monitor, error)

func NewBinance

func NewBinance(env Environment, path SpotPATH) *binance

Types

type Environment

type Environment string
const (
	Mainnet Environment = "mainnet"
	Testnet Environment = "testnet"
)

type Interval

type Interval string
const (
	OneDay         Interval = "1d"
	OneHours       Interval = "1h"
	FourHours      Interval = "4h"
	OneMinutes     Interval = "1m"
	FifteenMinutes Interval = "15m"
	OneSecond      Interval = "1s"
)

type KLineMonitor

type KLineMonitor struct {
	S Symbol
	I Interval
}

func (KLineMonitor) Symbol

func (M KLineMonitor) Symbol() Symbol

func (KLineMonitor) Value

func (M KLineMonitor) Value() string

type KlinesReq

type KlinesReq struct {
	Symbol    Symbol    `json:"symbol"`
	Interval  Interval  `json:"interval"`
	StartTime time.Time `json:"startTime"`
	EndTime   time.Time `json:"endTime"`
	Limit     uint64    `json:"limit"`
}

type Method

type Method string
const (
	SUBSCRIBE Method = "SUBSCRIBE"
)

type MiniTickerMonitor

type MiniTickerMonitor struct {
	S Symbol
}

func (MiniTickerMonitor) Symbol

func (M MiniTickerMonitor) Symbol() Symbol

func (MiniTickerMonitor) Value

func (M MiniTickerMonitor) Value() string

type MonitorParam

type MonitorParam interface {
	Symbol() Symbol
	Value() string
}

type Processing

type Processing interface {
	Successful([]byte)
}

type SpotAPIURL

type SpotAPIURL string

type SpotPATH

type SpotPATH string

type SpotWSURL

type SpotWSURL string

type Stream

type Stream struct {
	Method Method
	Params MonitorParam
}

type Symbol

type Symbol string
const (
	BTCUSDT Symbol = "BTCUSDT"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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