binance

package
v0.3.0-pre2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPair = errors.New("symbol pair not support")
)

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code    int    `json:"code"`
	Message string `json:"msg"`
}

APIError error message

func (*APIError) Error

func (ae *APIError) Error() string

func (*APIError) Is

func (ae *APIError) Is(target interface{}) bool

type ExchangeInfo

type ExchangeInfo struct {
	Symbols []Symbol `json:"symbols"`
}

type RestClient

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

Binance Rest client instance

func NewRestClient

func NewRestClient(key, secret, host string) *RestClient

func (*RestClient) FeeRate

func (rc *RestClient) FeeRate(ctx context.Context, syms ...exchange.Symbol) ([]exchange.TradeFee, error)

func (*RestClient) Init

func (rc *RestClient) Init(ctx context.Context) error

func (*RestClient) NewSpotSymbol

func (c *RestClient) NewSpotSymbol(base, quote string) exchange.SpotSymbol

func (*RestClient) ParseSpotSymbol

func (c *RestClient) ParseSpotSymbol(sym string) (exchange.SpotSymbol, error)

func (*RestClient) Request

func (rc *RestClient) Request(ctx context.Context, method, endPoint string, param url.Values, data io.Reader, signed bool, dst interface{}) error

type SpotSymbol

type SpotSymbol struct {
	*exchange.BaseSpotSymbol
}

func (*SpotSymbol) String

func (ss *SpotSymbol) String() string

type Symbol

type Symbol struct {
	Symbol     string `json:"symbol"`
	BaseAsset  string `json:"baseAsset"`
	QuoteAsset string `json:"quoteAsset"`
}

Symbol info TODO: refactor Symbol add more info pricePrecison ...?

type TradeFee

type TradeFee struct {
	Symbol string  `json:"symbol"`
	Maker  float64 `json:"maker"`
	Taker  float64 `json:"taker"`
}

type TradeFeeResp

type TradeFeeResp struct {
	Success  bool       `json:"success"`
	TradeFee []TradeFee `json:"tradeFee"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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