binance

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IntervalSecond = "s"
	IntervalMinute = "m"
	IntervalHour   = "h"
	IntervalDay    = "d"
)

Variables

View Source
var ErrClosed = fmt.Errorf("connection closed")

Functions

func IntervalFromLetter added in v0.1.3

func IntervalFromLetter(period int, letter IntervalLetter) (interval int64)

Types

type Binance

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

func New

func New(testnet bool, apiKey, secretKey string) (*Binance, error)

func (*Binance) Cancel added in v0.2.0

func (b *Binance) Cancel(ctx context.Context, symbol string, orderID string) (status string, err error)

func (*Binance) CancelAll added in v0.2.0

func (b *Binance) CancelAll(ctx context.Context, symbol string) (err error)

func (*Binance) Close added in v0.1.3

func (b *Binance) Close() error

func (*Binance) ListOrders added in v0.2.0

func (b *Binance) ListOrders(ctx context.Context, symbol string) (orders []platform.Order, err error)

func (*Binance) OrderMarket added in v0.1.3

func (b *Binance) OrderMarket(ctx context.Context, symbol string, side platform.OrderSide, quantity platform.Fixed) (orderID string, err error)

func (*Binance) OrderOCO added in v0.1.3

func (b *Binance) OrderOCO(ctx context.Context, symbol string, side platform.OrderSide, opt platform.OptionsOCO) (orderID string, err error)

func (*Binance) QueryOrder added in v0.2.0

func (b *Binance) QueryOrder(ctx context.Context, symbol string, orderID string) (err error)

func (*Binance) Subscribe

func (b *Binance) Subscribe(ctx context.Context, symbol string) <-chan platform.EventContainer

func (*Binance) Wallet added in v0.1.3

func (b *Binance) Wallet(ctx context.Context) (wallet map[string]platform.Fixed, err error)

type BinanceHistory

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

func NewHistory

func NewHistory(testnet bool, inteval int, letter IntervalLetter) *BinanceHistory

func (*BinanceHistory) Subscribe

func (bh *BinanceHistory) Subscribe(ctx context.Context, symbol string) <-chan platform.EventContainer

type IntervalLetter

type IntervalLetter string

Jump to

Keyboard shortcuts

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