Versions in this module Expand all Collapse all v0 v0.29.6 Nov 20, 2022 v0.29.5 Nov 20, 2022 v0.29.4 Nov 20, 2022 v0.29.3 Nov 20, 2022 Changes in this version + type OrderBookHandler func(OrderBook) v0.29.2 Nov 12, 2022 Changes in this version + const Cancelled + const Closed + const DAY1 + const Filled + const HOUR1 + const HOUR4 + const MIN1 + const MIN15 + const MIN30 + const MIN5 + const MON1 + const Open + const WEEK1 + const YEAR1 + type AccountBalance struct + Currencies []Balance + Type string + type Balance struct + Available decimal.Decimal + Currency string + Locked decimal.Decimal + type Contract struct + ConfigChangeTime float64 + FundingInterval int32 + FundingNextApply float64 + FundingRate string + InDelisting bool + IndexPrice string + LastPrice string + LeverageMax string + LeverageMin string + MaintenanceRate string + MakerFeeRate string + MarkPrice string + MarkPriceRound string + MarkType string + Name string + OrderPriceDeviate string + OrderPriceRound string + OrderSizeMax int64 + OrderSizeMin int64 + OrderbookId int64 + OrdersLimit int32 + PositionSize int64 + QuoteMultiplier string + RefDiscountRate string + RefRebateRate string + RiskLimitBase string + RiskLimitMax string + RiskLimitStep string + TakerFeeRate string + TradeId int64 + TradeSize int64 + Type string + type Direction = string + const TradeDirectionBuy + const TradeDirectionSell + type Exchange interface + type Fee struct + ActualMaker decimal.Decimal + ActualTaker decimal.Decimal + BaseMaker decimal.Decimal + BaseTaker decimal.Decimal + Symbol string + type FuturesBalance struct + Available decimal.Decimal + Currency string + Dual bool + OrderMargin decimal.Decimal + PositionMargin decimal.Decimal + Total decimal.Decimal + UnrealisedPnl decimal.Decimal + type FuturesLiquidation struct + Contract string + EntryPrice decimal.Decimal + FillPrice decimal.Decimal + Left int64 + Leverage int + LiqPrice decimal.Decimal + Margin decimal.Decimal + MarkPrice decimal.Decimal + OrderId uint64 + OrderPrice decimal.Decimal + Size int64 + Time time.Time + type FuturesOrder struct + Close bool + Contract string + CreateTime time.Time + FillPrice decimal.Decimal + FinishAs string + FinishTime time.Time + Iceberg int64 + Id uint64 + IsClose bool + IsLiq bool + IsReduceOnly bool + Left int64 + MakerFee float64 + Price decimal.Decimal + ReduceOnly bool + Reference uint64 + Size int64 + Status string + TakerFee float64 + Text string + Tif string + User uint64 + type FuturesOrderbook struct + Asks []FuturesQuote + Bids []FuturesQuote + func (o FuturesOrderbook) String() string + type FuturesQuote struct + Amount int64 + Price float64 + type FuturesTrade struct + Contract string + CreateTime time.Time + Id uint64 + OrderId uint64 + Price decimal.Decimal + Role string + Size int64 + type Order struct + Amount decimal.Decimal + ClientOrderId string + FilledAmount decimal.Decimal + FilledPrice decimal.Decimal + Id uint64 + Price decimal.Decimal + Status string + Symbol string + Time time.Time + Trades []Trade + Type string + type OrderBook struct + Asks []Quote + Bids []Quote + Id int + type OrderStatus = int + type OrderType = int + const Buy + const Sell + type Position struct + AdlRanking int32 + CloseOrder *PositionCloseOrder + Contract string + EntryPrice decimal.Decimal + HistoryPnl decimal.Decimal + LastClosePnl decimal.Decimal + Leverage int + LiqPrice decimal.Decimal + MaintenanceRate float64 + Margin decimal.Decimal + MarkPrice decimal.Decimal + MaxLeverage int + Mode string + PendingOrders int32 + RealisedPnl decimal.Decimal + RiskLimit int + Size int64 + UnrealisedPnl decimal.Decimal + User int64 + Value decimal.Decimal + type PositionCloseOrder struct + Id int64 + IsLiq bool + Price decimal.Decimal + type Quote [2]float64 + type ResponseHandler func(response interface{}) + type RestAPIExchange interface + AllSymbols func(ctx context.Context) (s []Symbol, err error) + BuyLimit func(symbol, clientOrderId string, price, amount decimal.Decimal) (orderId uint64, err error) + BuyMarket func(symbol Symbol, clientOrderId string, total decimal.Decimal) (orderId uint64, err error) + BuyStopLimit func(symbol, clientOrderId string, price, amount, stopPrice decimal.Decimal) (orderId uint64, err error) + CancelOrder func(symbol string, orderId uint64) error + CandleBySize func(symbol string, period time.Duration, size int) (hs.Candle, error) + CandleFrom func(symbol, clientId string, period time.Duration, from, to time.Time) (hs.Candle, error) + FormatSymbol func(base, quote string) string + GetFee func(symbol string) (fee Fee, err error) + GetOrderById func(orderId uint64, symbol string) (Order, error) + GetSymbol func(ctx context.Context, symbol string) (Symbol, error) + IsFullFilled func(symbol string, orderId uint64) (Order, bool, error) + Last24hVolume func(symbol string) (decimal.Decimal, error) + LastPrice func(symbol string) (decimal.Decimal, error) + SellLimit func(symbol, clientOrderId string, price, amount decimal.Decimal) (orderId uint64, err error) + SellMarket func(symbol Symbol, clientOrderId string, amount decimal.Decimal) (orderId uint64, err error) + SellStopLimit func(symbol, clientOrderId string, price, amount, stopPrice decimal.Decimal) (orderId uint64, err error) + SpotAvailableBalance func() (map[string]decimal.Decimal, error) + SpotBalance func() (map[string]decimal.Decimal, error) + type Symbol struct + AmountPrecision int32 + BaseCurrency string + Disabled bool + LimitOrderMinAmount decimal.Decimal + MinTotal decimal.Decimal + PricePrecision int32 + QuoteCurrency string + Symbol string + type Ticker struct + BaseVolume decimal.Decimal + High24hr decimal.Decimal + HighestBid decimal.Decimal + Id int64 + Last decimal.Decimal + Low24hr decimal.Decimal + LowestAsk decimal.Decimal + PercentChange decimal.Decimal + QuoteVolume decimal.Decimal + type Trade struct + Amount decimal.Decimal + FeeAmount decimal.Decimal + FeeCurrency string + Id uint64 + OrderId uint64 + Price decimal.Decimal + Role string + Side string + Symbol string + Time time.Time + Type string + type TradeDetail struct + Amount decimal.Decimal + Direction Direction + Id int64 + Price decimal.Decimal + Timestamp int64 + type TradeHandler func([]TradeDetail) + type WsAPIExchange interface + SubscribeCandlestick func(symbol, clientId string, period time.Duration, responseHandler ResponseHandler) + SubscribeCandlestickWithReq func(symbol, clientId string, period time.Duration, responseHandler ResponseHandler) + SubscribeOrder func(symbol, clientId string, responseHandler ResponseHandler) + UnsubscribeCandlestick func(symbol, clientId string, period time.Duration) + UnsubscribeCandlestickWithReq func(symbol, clientId string, period time.Duration) + UnsubscribeOrder func(symbol, clientId string)