binance

package
v0.0.0-...-2a0cda8 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	API_BASE_URL = "https://api.binance.com/"
	API_V1       = API_BASE_URL + "api/v1/"
	API_V3       = API_BASE_URL + "api/v3/"

	TICKER_URI             = "ticker/24hr?symbol=%s"
	TICKERS_URI            = "ticker/allBookTickers"
	DEPTH_URI              = "depth?symbol=%s&limit=%d"
	ACCOUNT_URI            = "account?"
	ORDER_URI              = "order?"
	UNFINISHED_ORDERS_INFO = "openOrders?"
	KLINE_URI              = "klines"
	SERVER_TIME_URL        = "api/v1/time"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Binance

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

func New

func New(client *http.Client, api_key, secret_key string) *Binance

func (*Binance) CancelOrder

func (bn *Binance) CancelOrder(orderId string, currencyPair CurrencyPair) (bool, error)

func (*Binance) GetAccount

func (bn *Binance) GetAccount() (*Account, error)

func (*Binance) GetDepth

func (bn *Binance) GetDepth(size int, currencyPair CurrencyPair) (*Depth, error)

func (*Binance) GetExchangeName

func (bn *Binance) GetExchangeName() string

func (*Binance) GetKlineRecords

func (bn *Binance) GetKlineRecords(currency CurrencyPair, period, size, since int) ([]Kline, error)

func (*Binance) GetOneOrder

func (bn *Binance) GetOneOrder(orderId string, currencyPair CurrencyPair) (*Order, error)

func (*Binance) GetOrderHistorys

func (bn *Binance) GetOrderHistorys(currency CurrencyPair, currentPage, pageSize int) ([]Order, error)

func (*Binance) GetTicker

func (bn *Binance) GetTicker(currency CurrencyPair) (*Ticker, error)

func (*Binance) GetTrades

func (bn *Binance) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)

非个人,整个交易所的交易记录

func (*Binance) GetUnfinishOrders

func (bn *Binance) GetUnfinishOrders(currencyPair CurrencyPair) ([]Order, error)

func (*Binance) LimitBuy

func (bn *Binance) LimitBuy(amount, price string, currencyPair CurrencyPair) (*Order, error)

func (*Binance) LimitSell

func (bn *Binance) LimitSell(amount, price string, currencyPair CurrencyPair) (*Order, error)

func (*Binance) MarketBuy

func (bn *Binance) MarketBuy(amount, price string, currencyPair CurrencyPair) (*Order, error)

func (*Binance) MarketSell

func (bn *Binance) MarketSell(amount, price string, currencyPair CurrencyPair) (*Order, error)

Jump to

Keyboard shortcuts

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