Documentation
¶
Index ¶
- type DevInterface
- type Endpoint
- func (ep *Endpoint) CancelOrder(symbol string, id uint64) (exchange.Binacancel, error)
- func (ep *Endpoint) DepositHistory(startTime, endTime uint64) (exchange.Binadeposits, error)
- func (ep *Endpoint) GetAccountTradeHistory(base, quote common.Token, fromID string) (exchange.BinaAccountTradeHistory, error)
- func (ep *Endpoint) GetDepositAddress(asset string) (exchange.Binadepositaddress, error)
- func (ep *Endpoint) GetDepthOnePair(baseID, quoteID string) (exchange.Binaresp, error)
- func (ep *Endpoint) GetExchangeInfo() (exchange.BinanceExchangeInfo, error)
- func (ep *Endpoint) GetInfo() (exchange.Binainfo, error)
- func (ep *Endpoint) GetResponse(method string, url string, params map[string]string, signNeeded bool, ...) ([]byte, error)
- func (ep *Endpoint) GetTradeHistory(symbol string) (exchange.BinanceTradeHistory, error)
- func (ep *Endpoint) OpenOrdersForOnePair(pair common.TokenPair) (exchange.Binaorders, error)
- func (ep *Endpoint) OrderStatus(symbol string, id uint64) (exchange.Binaorder, error)
- func (ep *Endpoint) Trade(tradeType string, base, quote common.Token, rate, amount float64) (exchange.Binatrade, error)
- func (ep *Endpoint) UpdateTimeDelta() error
- func (ep *Endpoint) Withdraw(token common.Token, amount *big.Int, address ethereum.Address) (string, error)
- func (ep *Endpoint) WithdrawHistory(startTime, endTime uint64) (exchange.Binawithdrawals, error)
- type Interface
- type KovanInterface
- type RealInterface
- type RopstenInterface
- type Signer
- type SimulatedInterface
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DevInterface ¶
type DevInterface struct{}
func NewDevInterface ¶
func NewDevInterface() *DevInterface
func (*DevInterface) AuthenticatedEndpoint ¶
func (di *DevInterface) AuthenticatedEndpoint() string
func (*DevInterface) PublicEndpoint ¶
func (di *DevInterface) PublicEndpoint() string
type Endpoint ¶ added in v0.1.1
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint object stand for Binance endpoint including signer for api call authentication, interf for calling api in different env timedelta to make sure calling api in time
func NewBinanceEndpoint ¶
NewBinanceEndpoint return new endpoint instance for using binance
func (*Endpoint) CancelOrder ¶ added in v0.1.1
func (*Endpoint) DepositHistory ¶ added in v0.1.1
func (ep *Endpoint) DepositHistory(startTime, endTime uint64) (exchange.Binadeposits, error)
func (*Endpoint) GetAccountTradeHistory ¶ added in v0.1.1
func (*Endpoint) GetDepositAddress ¶ added in v0.1.1
func (ep *Endpoint) GetDepositAddress(asset string) (exchange.Binadepositaddress, error)
func (*Endpoint) GetDepthOnePair ¶ added in v0.1.1
func (*Endpoint) GetExchangeInfo ¶ added in v0.1.1
func (ep *Endpoint) GetExchangeInfo() (exchange.BinanceExchangeInfo, error)
func (*Endpoint) GetResponse ¶ added in v0.1.1
func (*Endpoint) GetTradeHistory ¶ added in v0.1.1
func (ep *Endpoint) GetTradeHistory(symbol string) (exchange.BinanceTradeHistory, error)
func (*Endpoint) OpenOrdersForOnePair ¶ added in v0.1.1
func (*Endpoint) OrderStatus ¶ added in v0.1.1
func (*Endpoint) Trade ¶ added in v0.1.1
func (ep *Endpoint) Trade(tradeType string, base, quote common.Token, rate, amount float64) (exchange.Binatrade, error)
Trade 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 (*Endpoint) UpdateTimeDelta ¶ added in v0.1.1
func (*Endpoint) WithdrawHistory ¶ added in v0.1.1
func (ep *Endpoint) WithdrawHistory(startTime, endTime uint64) (exchange.Binawithdrawals, error)
type Interface ¶
type Interface interface {
// PublicEndpoint returns the endpoint that does not requires authentication.
PublicEndpoint() string
// AuthenticatedEndpoint returns the endpoint that requires authentication.
// In simulation mode, authenticated endpoint is the Binance mock server.
AuthenticatedEndpoint() string
}
Interface is Binance exchange API endpoints interface.
type KovanInterface ¶
type KovanInterface struct {
// contains filtered or unexported fields
}
func NewKovanInterface ¶
func NewKovanInterface(flagVariable string) *KovanInterface
func (*KovanInterface) AuthenticatedEndpoint ¶
func (ki *KovanInterface) AuthenticatedEndpoint() string
func (*KovanInterface) PublicEndpoint ¶
func (ki *KovanInterface) PublicEndpoint() string
type RealInterface ¶
type RealInterface struct{}
func NewRealInterface ¶
func NewRealInterface() *RealInterface
func (*RealInterface) AuthenticatedEndpoint ¶
func (r *RealInterface) AuthenticatedEndpoint() string
func (*RealInterface) PublicEndpoint ¶
func (r *RealInterface) PublicEndpoint() string
type RopstenInterface ¶ added in v0.1.1
type RopstenInterface struct {
// contains filtered or unexported fields
}
func NewRopstenInterface ¶ added in v0.1.1
func NewRopstenInterface(flagVariable string) *RopstenInterface
func (*RopstenInterface) AuthenticatedEndpoint ¶ added in v0.1.1
func (ri *RopstenInterface) AuthenticatedEndpoint() string
func (*RopstenInterface) PublicEndpoint ¶ added in v0.1.1
func (ri *RopstenInterface) PublicEndpoint() string
type Signer ¶
func NewSignerFromFile ¶ added in v0.1.1
type SimulatedInterface ¶
type SimulatedInterface struct {
// contains filtered or unexported fields
}
func NewSimulatedInterface ¶
func NewSimulatedInterface(flagVariable string) *SimulatedInterface
func (*SimulatedInterface) AuthenticatedEndpoint ¶
func (si *SimulatedInterface) AuthenticatedEndpoint() string
func (*SimulatedInterface) PublicEndpoint ¶
func (si *SimulatedInterface) PublicEndpoint() string
type Storage ¶ added in v0.1.1
type Storage struct {
// contains filtered or unexported fields
}
Storage storage binance information including trade history
func NewBoltStorage ¶ added in v0.1.1
NewBoltStorage create database and related bucket for binance storage
func (*Storage) GetLastIDTradeHistory ¶ added in v0.1.1
GetLastIDTradeHistory return last id of trade history of a token using for query trade history from binance
func (*Storage) GetTradeHistory ¶ added in v0.1.1
func (bs *Storage) GetTradeHistory(fromTime, toTime uint64) (common.ExchangeTradeHistory, error)
GetTradeHistory return trade history from binance from time to time
func (*Storage) StoreTradeHistory ¶ added in v0.1.1
func (bs *Storage) StoreTradeHistory(data common.ExchangeTradeHistory) error
StoreTradeHistory store binance trade history