Versions in this module Expand all Collapse all v0 v0.0.2 Jul 26, 2020 Changes in this version type Binance + TickerPrice func(sym string) (*Ticker, error) type Service + TickerPrice func(sym string) (*Ticker, error) + type Ticker struct + Price string + Symbol string v0.0.1 May 25, 2020 Changes in this version + var Day = Interval("1d") + var EightHours = Interval("8h") + var FifteenMinutes = Interval("15m") + var FiveMinutes = Interval("5m") + var FourHours = Interval("4h") + var GTC = TimeInForce("GTC") + var Hour = Interval("1h") + var IOC = TimeInForce("IOC") + var Minute = Interval("1m") + var Month = Interval("1M") + var SideBuy = OrderSide("BUY") + var SideSell = OrderSide("SELL") + var SixHours = Interval("6h") + var StatusCancelled = OrderStatus("CANCELED") + var StatusExpired = OrderStatus("EXPIRED") + var StatusFilled = OrderStatus("FILLED") + var StatusNew = OrderStatus("NEW") + var StatusPartiallyFilled = OrderStatus("PARTIALLY_FILLED") + var StatusPendingCancel = OrderStatus("PENDING_CANCEL") + var StatusRejected = OrderStatus("REJECTED") + var ThirtyMinutes = Interval("30m") + var ThreeDays = Interval("3d") + var ThreeMinutes = Interval("3m") + var TwelveHours = Interval("12h") + var TwoHours = Interval("2h") + var TypeLimit = OrderType("LIMIT") + var TypeMarket = OrderType("MARKET") + var Week = Interval("1w") + type Account struct + Balances []*Balance + BuyerCommision int64 + CanDeposit bool + CanTrade bool + CanWithdraw bool + MakerCommision int64 + SellerCommision int64 + TakerCommision int64 + type AccountEvent struct + type AccountRequest struct + RecvWindow time.Duration + Timestamp time.Time + type AggTrade struct + BestPriceMatch bool + BuyerMaker bool + FirstTradeID int + ID int + LastTradeID int + Price float64 + Quantity float64 + Timestamp time.Time + type AggTradeEvent struct + type AggTradesRequest struct + EndTime int64 + FromID int64 + Limit int + StartTime int64 + Symbol string + type AllOrdersRequest struct + Limit int + OrderID int64 + RecvWindow time.Duration + Symbol string + Timestamp time.Time + type Balance struct + Asset string + Free float64 + Locked float64 + type Binance interface + Account func(ar AccountRequest) (*Account, error) + AggTrades func(atr AggTradesRequest) ([]*AggTrade, error) + AllOrders func(aor AllOrdersRequest) ([]*ExecutedOrder, error) + CancelOrder func(cor CancelOrderRequest) (*CanceledOrder, error) + CloseUserDataStream func(s *Stream) error + DepositHistory func(hr HistoryRequest) ([]*Deposit, error) + DepthWebsocket func(dwr DepthWebsocketRequest) (chan *DepthEvent, chan struct{}, error) + KeepAliveUserDataStream func(s *Stream) error + KlineWebsocket func(kwr KlineWebsocketRequest) (chan *KlineEvent, chan struct{}, error) + Klines func(kr KlinesRequest) ([]*Kline, error) + MyTrades func(mtr MyTradesRequest) ([]*Trade, error) + NewOrder func(nor NewOrderRequest) (*ProcessedOrder, error) + NewOrderTest func(nor NewOrderRequest) error + OpenOrders func(oor OpenOrdersRequest) ([]*ExecutedOrder, error) + OrderBook func(obr OrderBookRequest) (*OrderBook, error) + Ping func() error + QueryOrder func(qor QueryOrderRequest) (*ExecutedOrder, error) + StartUserDataStream func() (*Stream, error) + Ticker24 func(tr TickerRequest) (*Ticker24, error) + TickerAllBooks func() ([]*BookTicker, error) + TickerAllPrices func() ([]*PriceTicker, error) + Time func() (time.Time, error) + TradeWebsocket func(twr TradeWebsocketRequest) (chan *AggTradeEvent, chan struct{}, error) + UserDataWebsocket func(udwr UserDataWebsocketRequest) (chan *AccountEvent, chan struct{}, error) + Withdraw func(wr WithdrawRequest) (*WithdrawResult, error) + WithdrawHistory func(hr HistoryRequest) ([]*Withdrawal, error) + func NewBinance(service Service) Binance + type BookTicker struct + AskPrice float64 + AskQty float64 + BidPrice float64 + BidQty float64 + Symbol string + type CancelOrderRequest struct + NewClientOrderID string + OrderID int64 + OrigClientOrderID string + RecvWindow time.Duration + Symbol string + Timestamp time.Time + type CanceledOrder struct + ClientOrderID string + OrderID int64 + OrigClientOrderID string + Symbol string + type Deposit struct + Amount float64 + Asset string + InsertTime time.Time + Status int + type DepthEvent struct + UpdateID int + type DepthWebsocketRequest struct + Symbol string + type Error struct + Code int + Message string + func (e Error) Error() string + type ExecutedOrder struct + ClientOrderID string + ExecutedQty float64 + IcebergQty float64 + OrderID int + OrigQty float64 + Price float64 + Side OrderSide + Status OrderStatus + StopPrice float64 + Symbol string + Time time.Time + TimeInForce TimeInForce + Type OrderType + type HistoryRequest struct + Asset string + EndTime time.Time + RecvWindow time.Duration + StartTime time.Time + Status *int + Timestamp time.Time + type HmacSigner struct + Key []byte + func (hs *HmacSigner) Sign(payload []byte) string + type Interval string + type Kline struct + Close float64 + CloseTime time.Time + High float64 + Low float64 + NumberOfTrades int + Open float64 + OpenTime time.Time + QuoteAssetVolume float64 + TakerBuyBaseAssetVolume float64 + TakerBuyQuoteAssetVolume float64 + Volume float64 + type KlineEvent struct + Final bool + FirstTradeID int64 + Interval Interval + LastTradeID int64 + type KlineWebsocketRequest struct + Interval Interval + Symbol string + type KlinesRequest struct + EndTime int64 + Interval Interval + Limit int + StartTime int64 + Symbol string + type MyTradesRequest struct + FromID int64 + Limit int + RecvWindow time.Duration + Symbol string + Timestamp time.Time + type NewOrderRequest struct + IcebergQty float64 + NewClientOrderID string + Price float64 + Quantity float64 + Side OrderSide + StopPrice float64 + Symbol string + TimeInForce TimeInForce + Timestamp time.Time + Type OrderType + type OpenOrdersRequest struct + RecvWindow time.Duration + Symbol string + Timestamp time.Time + type Order struct + Price float64 + Quantity float64 + type OrderBook struct + Asks []*Order + Bids []*Order + LastUpdateID int + type OrderBookRequest struct + Limit int + Symbol string + type OrderSide string + type OrderStatus string + type OrderType string + type PriceTicker struct + Price float64 + Symbol string + type ProcessedOrder struct + ClientOrderID string + OrderID int64 + Symbol string + TransactTime time.Time + type QueryOrderRequest struct + OrderID int64 + OrigClientOrderID string + RecvWindow time.Duration + Symbol string + Timestamp time.Time + type Service interface + Account func(ar AccountRequest) (*Account, error) + AggTrades func(atr AggTradesRequest) ([]*AggTrade, error) + AllOrders func(aor AllOrdersRequest) ([]*ExecutedOrder, error) + CancelOrder func(cor CancelOrderRequest) (*CanceledOrder, error) + CloseUserDataStream func(s *Stream) error + DepositHistory func(hr HistoryRequest) ([]*Deposit, error) + DepthWebsocket func(dwr DepthWebsocketRequest) (chan *DepthEvent, chan struct{}, error) + KeepAliveUserDataStream func(s *Stream) error + KlineWebsocket func(kwr KlineWebsocketRequest) (chan *KlineEvent, chan struct{}, error) + Klines func(kr KlinesRequest) ([]*Kline, error) + MyTrades func(mtr MyTradesRequest) ([]*Trade, error) + NewOrder func(or NewOrderRequest) (*ProcessedOrder, error) + NewOrderTest func(or NewOrderRequest) error + OpenOrders func(oor OpenOrdersRequest) ([]*ExecutedOrder, error) + OrderBook func(obr OrderBookRequest) (*OrderBook, error) + Ping func() error + QueryOrder func(qor QueryOrderRequest) (*ExecutedOrder, error) + StartUserDataStream func() (*Stream, error) + Ticker24 func(tr TickerRequest) (*Ticker24, error) + TickerAllBooks func() ([]*BookTicker, error) + TickerAllPrices func() ([]*PriceTicker, error) + Time func() (time.Time, error) + TradeWebsocket func(twr TradeWebsocketRequest) (chan *AggTradeEvent, chan struct{}, error) + UserDataWebsocket func(udwr UserDataWebsocketRequest) (chan *AccountEvent, chan struct{}, error) + Withdraw func(wr WithdrawRequest) (*WithdrawResult, error) + WithdrawHistory func(hr HistoryRequest) ([]*Withdrawal, error) + func NewAPIService(url, apiKey string, signer Signer, logger log.Logger, ctx context.Context) Service + type Signer interface + Sign func(payload []byte) string + type Stream struct + ListenKey string + type Ticker24 struct + AskPrice float64 + BidPrice float64 + CloseTime time.Time + Count int + FirstID int + HighPrice float64 + LastID int + LastPrice float64 + LowPrice float64 + OpenPrice float64 + OpenTime time.Time + PrevClosePrice float64 + PriceChange float64 + PriceChangePercent float64 + Volume float64 + WeightedAvgPrice float64 + type TickerRequest struct + Symbol string + type TimeInForce string + type Trade struct + Commission float64 + CommissionAsset string + ID int64 + IsBestMatch bool + IsBuyer bool + IsMaker bool + Price float64 + Qty float64 + Time time.Time + type TradeWebsocketRequest struct + Symbol string + type UserDataWebsocketRequest struct + ListenKey string + type WSEvent struct + Symbol string + Time time.Time + Type string + type WithdrawRequest struct + Address string + Amount float64 + Asset string + Name string + RecvWindow time.Duration + Timestamp time.Time + type WithdrawResult struct + Msg string + Success bool + type Withdrawal struct + Address string + Amount float64 + ApplyTime time.Time + Asset string + Status int + TxID string