binance

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2017 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const EPSILON float64 = 0.0000000001 // 10e-10

Variables

This section is empty.

Functions

This section is empty.

Types

type BinanceEndpoint

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

func NewBinanceEndpoint

func NewBinanceEndpoint(signer Signer, interf Interface) *BinanceEndpoint

func NewDevBinanceEndpoint

func NewDevBinanceEndpoint(signer Signer) *BinanceEndpoint

func NewKovanBinanceEndpoint

func NewKovanBinanceEndpoint(signer Signer) *BinanceEndpoint

func NewRealBinanceEndpoint

func NewRealBinanceEndpoint(signer Signer) *BinanceEndpoint

func NewSimulatedBinanceEndpoint

func NewSimulatedBinanceEndpoint(signer Signer) *BinanceEndpoint

func (*BinanceEndpoint) CancelOrder

func (self *BinanceEndpoint) CancelOrder(symbol string, id uint64) (exchange.Binacancel, error)

func (*BinanceEndpoint) DepositHistory

func (self *BinanceEndpoint) DepositHistory(startTime, endTime uint64) (exchange.Binadeposits, error)

func (*BinanceEndpoint) FetchOnePairData

func (self *BinanceEndpoint) FetchOnePairData(
	wg *sync.WaitGroup,
	pair common.TokenPair,
	data *sync.Map,
	timepoint uint64)

func (*BinanceEndpoint) GetDepositAddress

func (self *BinanceEndpoint) GetDepositAddress(asset string) (exchange.Binadepositaddress, error)

func (*BinanceEndpoint) GetInfo

func (self *BinanceEndpoint) GetInfo(timepoint uint64) (exchange.Binainfo, error)

func (*BinanceEndpoint) GetResponse

func (self *BinanceEndpoint) GetResponse(
	method string, url string,
	params map[string]string, signNeeded bool, timepoint uint64) ([]byte, error)

func (*BinanceEndpoint) OpenOrdersForOnePair

func (self *BinanceEndpoint) OpenOrdersForOnePair(
	wg *sync.WaitGroup,
	pair common.TokenPair,
	data *sync.Map,
	timepoint uint64)

func (*BinanceEndpoint) OrderStatus

func (self *BinanceEndpoint) OrderStatus(symbol string, id uint64, timepoint uint64) (exchange.Binaorder, error)

func (*BinanceEndpoint) QueryOrder

func (self *BinanceEndpoint) QueryOrder(symbol string, id uint64, timepoint uint64) (done float64, remaining float64, finished bool, err error)

func (*BinanceEndpoint) Trade

func (self *BinanceEndpoint) Trade(tradeType string, base, quote common.Token, rate, amount float64, timepoint uint64) (string, float64, float64, bool, error)

Relevant params: symbol ("%s%s", base, quote) side (BUY/SELL) type (LIMIT/MARKET) timeInForce (GTC/IOC) quantity price

In this version, we only support LIMIT order which means only buy/sell with acceptable price, and GTC time in force which means that the order will be active until it's implicitly canceled

func (*BinanceEndpoint) Withdraw

func (self *BinanceEndpoint) Withdraw(token common.Token, amount *big.Int, address ethereum.Address, timepoint uint64) (string, error)

func (*BinanceEndpoint) WithdrawHistory

func (self *BinanceEndpoint) WithdrawHistory(startTime, endTime uint64) (exchange.Binawithdrawals, error)

type DevInterface

type DevInterface struct{}

func NewDevInterface

func NewDevInterface() *DevInterface

func (*DevInterface) AuthenticatedEndpoint

func (self *DevInterface) AuthenticatedEndpoint() string

func (*DevInterface) PublicEndpoint

func (self *DevInterface) PublicEndpoint() string

type Interface

type Interface interface {
	PublicEndpoint() string
	AuthenticatedEndpoint() string
}

type KovanInterface

type KovanInterface struct{}

func NewKovanInterface

func NewKovanInterface() *KovanInterface

func (*KovanInterface) AuthenticatedEndpoint

func (self *KovanInterface) AuthenticatedEndpoint() string

func (*KovanInterface) PublicEndpoint

func (self *KovanInterface) PublicEndpoint() string

type RealInterface

type RealInterface struct{}

func NewRealInterface

func NewRealInterface() *RealInterface

func (*RealInterface) AuthenticatedEndpoint

func (self *RealInterface) AuthenticatedEndpoint() string

func (*RealInterface) PublicEndpoint

func (self *RealInterface) PublicEndpoint() string

type Signer

type Signer interface {
	GetBinanceKey() string
	BinanceSign(msg string) string
}

type SimulatedInterface

type SimulatedInterface struct{}

func NewSimulatedInterface

func NewSimulatedInterface() *SimulatedInterface

func (*SimulatedInterface) AuthenticatedEndpoint

func (self *SimulatedInterface) AuthenticatedEndpoint() string

func (*SimulatedInterface) PublicEndpoint

func (self *SimulatedInterface) PublicEndpoint() string

Jump to

Keyboard shortcuts

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