Documentation ¶
Index ¶
- Constants
- Variables
- type ADLEstimateData
- type Account
- type AggregatedTrade
- type AggregatedTradeRequestParams
- type AllLiquidationOrders
- type AutoCancelAllOrdersData
- type AveragePrice
- type Balance
- type BatchCancelOrderData
- type BestPrice
- type Binance
- func (b *Binance) AllOrders(ctx context.Context, symbol currency.Pair, orderID, limit string) ([]QueryOrderData, error)
- func (b *Binance) AutoCancelAllOpenOrders(ctx context.Context, symbol currency.Pair, countdownTime int64) (AutoCancelAllOrdersData, error)
- func (b *Binance) CancelAllOrders(ctx context.Context, req *order.Cancel) (order.CancelAllResponse, error)
- func (b *Binance) CancelBatchOrders(ctx context.Context, os []order.Cancel) (*order.CancelBatchResponse, error)
- func (b *Binance) CancelExistingOrder(ctx context.Context, symbol currency.Pair, orderID int64, ...) (CancelOrderResponse, error)
- func (b *Binance) CancelOrder(ctx context.Context, o *order.Cancel) error
- func (b *Binance) ChangePositionMargin(ctx context.Context, req *margin.PositionChangeRequest) (*margin.PositionChangeResponse, error)
- func (b *Binance) CheckLimit(limit int) error
- func (b *Binance) CryptoLoanAdjustLTV(ctx context.Context, orderID int64, reduce bool, amount float64) (*CryptoLoanAdjustLTV, error)
- func (b *Binance) CryptoLoanAssetsData(ctx context.Context, loanCoin currency.Code, vipLevel int64) (*LoanableAssetsData, error)
- func (b *Binance) CryptoLoanBorrow(ctx context.Context, loanCoin currency.Code, loanAmount float64, ...) ([]CryptoLoanBorrow, error)
- func (b *Binance) CryptoLoanBorrowHistory(ctx context.Context, orderID int64, loanCoin, collateralCoin currency.Code, ...) (*LoanBorrowHistory, error)
- func (b *Binance) CryptoLoanCheckCollateralRepayRate(ctx context.Context, loanCoin, collateralCoin currency.Code, amount float64) (*CollateralRepayRate, error)
- func (b *Binance) CryptoLoanCollateralAssetsData(ctx context.Context, collateralCoin currency.Code, vipLevel int64) (*CollateralAssetData, error)
- func (b *Binance) CryptoLoanCustomiseMarginCall(ctx context.Context, orderID int64, collateralCoin currency.Code, ...) (*CustomiseMarginCall, error)
- func (b *Binance) CryptoLoanIncomeHistory(ctx context.Context, curr currency.Code, loanType string, ...) ([]CryptoLoansIncomeHistory, error)
- func (b *Binance) CryptoLoanLTVAdjustmentHistory(ctx context.Context, orderID int64, loanCoin, collateralCoin currency.Code, ...) (*CryptoLoanLTVAdjustmentHistory, error)
- func (b *Binance) CryptoLoanOngoingOrders(ctx context.Context, orderID int64, loanCoin, collateralCoin currency.Code, ...) (*CryptoLoanOngoingOrder, error)
- func (b *Binance) CryptoLoanRepay(ctx context.Context, orderID int64, amount float64, repayType int64, ...) ([]CryptoLoanRepay, error)
- func (b *Binance) CryptoLoanRepaymentHistory(ctx context.Context, orderID int64, loanCoin, collateralCoin currency.Code, ...) (*CryptoLoanRepayHistory, error)
- func (b *Binance) DepositHistory(ctx context.Context, c currency.Code, status string, ...) ([]DepositHistory, error)
- func (b *Binance) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (b *Binance) FetchCoinMarginExchangeLimits(ctx context.Context) ([]order.MinMaxLevel, error)
- func (b *Binance) FetchExchangeLimits(ctx context.Context, a asset.Item) ([]order.MinMaxLevel, error)
- func (b *Binance) FetchOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (b *Binance) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (b *Binance) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error)
- func (b *Binance) FetchUSDTMarginExchangeLimits(ctx context.Context) ([]order.MinMaxLevel, error)
- func (b *Binance) FlexibleCollateralAssetsData(ctx context.Context, collateralCoin currency.Code) (*FlexibleCollateralAssetsData, error)
- func (b *Binance) FlexibleLoanAdjustLTV(ctx context.Context, loanCoin, collateralCoin currency.Code, amount float64, ...) (*FlexibleLoanAdjustLTV, error)
- func (b *Binance) FlexibleLoanAssetsData(ctx context.Context, loanCoin currency.Code) (*FlexibleLoanAssetsData, error)
- func (b *Binance) FlexibleLoanBorrow(ctx context.Context, loanCoin, collateralCoin currency.Code, ...) (*FlexibleLoanBorrow, error)
- func (b *Binance) FlexibleLoanBorrowHistory(ctx context.Context, loanCoin, collateralCoin currency.Code, ...) (*FlexibleLoanBorrowHistory, error)
- func (b *Binance) FlexibleLoanLTVAdjustmentHistory(ctx context.Context, loanCoin, collateralCoin currency.Code, ...) (*FlexibleLoanLTVAdjustmentHistory, error)
- func (b *Binance) FlexibleLoanOngoingOrders(ctx context.Context, loanCoin, collateralCoin currency.Code, ...) (*FlexibleLoanOngoingOrder, error)
- func (b *Binance) FlexibleLoanRepay(ctx context.Context, loanCoin, collateralCoin currency.Code, amount float64, ...) (*FlexibleLoanRepay, error)
- func (b *Binance) FlexibleLoanRepayHistory(ctx context.Context, loanCoin, collateralCoin currency.Code, ...) (*FlexibleLoanRepayHistory, error)
- func (b *Binance) FormatExchangeCurrency(p currency.Pair, a asset.Item) (currency.Pair, error)
- func (b *Binance) FormatExchangeKlineInterval(interval kline.Interval) string
- func (b *Binance) FormatSymbol(p currency.Pair, a asset.Item) (string, error)
- func (b *Binance) FuturesBatchCancelOrders(ctx context.Context, symbol currency.Pair, ...) ([]BatchCancelOrderData, error)
- func (b *Binance) FuturesBatchOrder(ctx context.Context, data []PlaceBatchOrderData) ([]FuturesOrderPlaceData, error)
- func (b *Binance) FuturesCancelAllOpenOrders(ctx context.Context, symbol currency.Pair) (GenericAuthResponse, error)
- func (b *Binance) FuturesCancelOrder(ctx context.Context, symbol currency.Pair, orderID, origClientOrderID string) (FuturesOrderGetData, error)
- func (b *Binance) FuturesChangeInitialLeverage(ctx context.Context, symbol currency.Pair, leverage float64) (FuturesLeverageData, error)
- func (b *Binance) FuturesChangeMarginType(ctx context.Context, symbol currency.Pair, marginType string) (GenericAuthResponse, error)
- func (b *Binance) FuturesExchangeInfo(ctx context.Context) (CExchangeInfo, error)
- func (b *Binance) FuturesForceOrders(ctx context.Context, symbol currency.Pair, autoCloseType string, ...) ([]ForcedOrdersData, error)
- func (b *Binance) FuturesGetFundingHistory(ctx context.Context, symbol currency.Pair, limit int64, ...) ([]FundingRateHistory, error)
- func (b *Binance) FuturesGetOrderData(ctx context.Context, symbol currency.Pair, orderID, origClientOrderID string) (FuturesOrderGetData, error)
- func (b *Binance) FuturesIncomeHistory(ctx context.Context, symbol currency.Pair, incomeType string, ...) ([]FuturesIncomeHistoryData, error)
- func (b *Binance) FuturesMarginChangeHistory(ctx context.Context, symbol currency.Pair, changeType string, ...) ([]GetPositionMarginChangeHistoryData, error)
- func (b *Binance) FuturesNewOrder(ctx context.Context, x *FuturesNewOrderRequest) (FuturesOrderPlaceData, error)
- func (b *Binance) FuturesNotionalBracket(ctx context.Context, pair string) ([]NotionalBracketData, error)
- func (b *Binance) FuturesOpenOrderData(ctx context.Context, symbol currency.Pair, orderID, origClientOrderID string) (FuturesOrderGetData, error)
- func (b *Binance) FuturesPositionsADLEstimate(ctx context.Context, symbol currency.Pair) ([]ADLEstimateData, error)
- func (b *Binance) FuturesPositionsInfo(ctx context.Context, marginAsset, pair string) ([]FuturesPositionInformation, error)
- func (b *Binance) FuturesTradeHistory(ctx context.Context, symbol currency.Pair, pair string, ...) ([]FuturesAccountTradeList, error)
- func (b *Binance) GenerateSubscriptions() ([]subscription.Subscription, error)
- func (b *Binance) GetAccount(ctx context.Context) (*Account, error)
- func (b *Binance) GetAccountFundingHistory(_ context.Context) ([]exchange.FundingHistory, error)
- func (b *Binance) GetActiveOrders(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
- func (b *Binance) GetAggregatedTrades(ctx context.Context, arg *AggregatedTradeRequestParams) ([]AggregatedTrade, error)
- func (b *Binance) GetAllCoinsInfo(ctx context.Context) ([]CoinInfo, error)
- func (b *Binance) GetAllFuturesOrders(ctx context.Context, symbol, pair currency.Pair, startTime, endTime time.Time, ...) ([]FuturesOrderData, error)
- func (b *Binance) GetAssetsMode(ctx context.Context) (bool, error)
- func (b *Binance) GetAvailableTransferChains(ctx context.Context, cryptocurrency currency.Code) ([]string, error)
- func (b *Binance) GetAveragePrice(ctx context.Context, symbol currency.Pair) (AveragePrice, error)
- func (b *Binance) GetBestPrice(ctx context.Context, symbol currency.Pair) (BestPrice, error)
- func (b *Binance) GetCollateralMode(ctx context.Context, a asset.Item) (collateral.Mode, error)
- func (b *Binance) GetContinuousKlineData(ctx context.Context, pair, contractType, interval string, limit int64, ...) ([]FuturesCandleStick, error)
- func (b *Binance) GetCurrencyTradeURL(ctx context.Context, a asset.Item, cp currency.Pair) (string, error)
- func (b *Binance) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, _, chain string) (*deposit.Address, error)
- func (b *Binance) GetDepositAddressForCurrency(ctx context.Context, currency, chain string) (*DepositAddress, error)
- func (b *Binance) GetExchangeInfo(ctx context.Context) (ExchangeInfo, error)
- func (b *Binance) GetFee(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
- func (b *Binance) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
- func (b *Binance) GetFundingRateInfo(ctx context.Context) ([]FundingRateInfoResponse, error)
- func (b *Binance) GetFuturesAccountBalance(ctx context.Context) ([]FuturesAccountBalanceData, error)
- func (b *Binance) GetFuturesAccountInfo(ctx context.Context) (FuturesAccountInformation, error)
- func (b *Binance) GetFuturesAggregatedTradesList(ctx context.Context, symbol currency.Pair, fromID, limit int64, ...) ([]AggregatedTrade, error)
- func (b *Binance) GetFuturesAllOpenOrders(ctx context.Context, symbol currency.Pair, pair string) ([]FuturesOrderData, error)
- func (b *Binance) GetFuturesBasisData(ctx context.Context, pair, contractType, period string, limit int64, ...) ([]FuturesBasisData, error)
- func (b *Binance) GetFuturesContractDetails(ctx context.Context, item asset.Item) ([]futures.Contract, error)
- func (b *Binance) GetFuturesHistoricalTrades(ctx context.Context, symbol currency.Pair, fromID string, limit int64) ([]UPublicTradesData, error)
- func (b *Binance) GetFuturesKlineData(ctx context.Context, symbol currency.Pair, interval string, limit int64, ...) ([]FuturesCandleStick, error)
- func (b *Binance) GetFuturesOrderbook(ctx context.Context, symbol currency.Pair, limit int64) (*OrderBook, error)
- func (b *Binance) GetFuturesOrderbookTicker(ctx context.Context, symbol currency.Pair, pair string) ([]SymbolOrderBookTicker, error)
- func (b *Binance) GetFuturesPositionOrders(ctx context.Context, req *futures.PositionsRequest) ([]futures.PositionResponse, error)
- func (b *Binance) GetFuturesPositionSummary(ctx context.Context, req *futures.PositionSummaryRequest) (*futures.PositionSummary, error)
- func (b *Binance) GetFuturesPublicTrades(ctx context.Context, symbol currency.Pair, limit int64) ([]FuturesPublicTradesData, error)
- func (b *Binance) GetFuturesSwapTickerChangeStats(ctx context.Context, symbol currency.Pair, pair string) ([]PriceChangeStats, error)
- func (b *Binance) GetFuturesSymbolPriceTicker(ctx context.Context, symbol currency.Pair, pair string) ([]SymbolPriceTicker, error)
- func (b *Binance) GetFuturesTakerVolume(ctx context.Context, pair, contractType, period string, limit int64, ...) ([]TakerBuySellVolume, error)
- func (b *Binance) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, ...) (*kline.Item, error)
- func (b *Binance) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, ...) (*kline.Item, error)
- func (b *Binance) GetHistoricTrades(ctx context.Context, p currency.Pair, a asset.Item, from, to time.Time) ([]trade.Data, error)
- func (b *Binance) GetHistoricalFundingRates(ctx context.Context, r *fundingrate.HistoricalRatesRequest) (*fundingrate.HistoricalRates, error)
- func (b *Binance) GetHistoricalTrades(ctx context.Context, symbol string, limit int, fromID int64) ([]HistoricalTrade, error)
- func (b *Binance) GetIndexAndMarkPrice(ctx context.Context, symbol, pair string) ([]IndexMarkPrice, error)
- func (b *Binance) GetIndexPriceKlines(ctx context.Context, pair, interval string, limit int64, ...) ([]FuturesCandleStick, error)
- func (b *Binance) GetLatestFundingRates(ctx context.Context, r *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error)
- func (b *Binance) GetLatestSpotPrice(ctx context.Context, symbol currency.Pair) (SymbolPrice, error)
- func (b *Binance) GetLeverage(ctx context.Context, item asset.Item, pair currency.Pair, _ margin.Type, ...) (float64, error)
- func (b *Binance) GetMarginAccount(ctx context.Context) (*MarginAccount, error)
- func (b *Binance) GetMarkPriceKline(ctx context.Context, symbol currency.Pair, interval string, limit int64, ...) ([]FuturesCandleStick, error)
- func (b *Binance) GetMarketRatio(ctx context.Context, pair, period string, limit int64, ...) ([]TopTraderPositionRatio, error)
- func (b *Binance) GetMostRecentTrades(ctx context.Context, rtr RecentTradeRequestParams) ([]RecentTrade, error)
- func (b *Binance) GetOpenInterest(ctx context.Context, k ...key.PairAsset) ([]futures.OpenInterest, error)
- func (b *Binance) GetOpenInterestStats(ctx context.Context, pair, contractType, period string, limit int64, ...) ([]OpenInterestStats, error)
- func (b *Binance) GetOrderBook(ctx context.Context, obd OrderBookDataRequestParams) (*OrderBook, error)
- func (b *Binance) GetOrderHistory(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
- func (b *Binance) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (*order.Detail, error)
- func (b *Binance) GetPastPublicTrades(ctx context.Context, symbol currency.Pair, limit, fromID int64) ([]FuturesPublicTradesData, error)
- func (b *Binance) GetPerpMarkets(ctx context.Context) (PerpsExchangeInfo, error)
- func (b *Binance) GetPriceChangeStats(ctx context.Context, symbol currency.Pair) (PriceChangeStats, error)
- func (b *Binance) GetRecentTrades(ctx context.Context, p currency.Pair, a asset.Item) ([]trade.Data, error)
- func (b *Binance) GetServerTime(ctx context.Context, ai asset.Item) (time.Time, error)
- func (b *Binance) GetSpotKline(ctx context.Context, arg *KlinesRequestParams) ([]CandleStick, error)
- func (b *Binance) GetTickers(ctx context.Context) ([]PriceChangeStats, error)
- func (b *Binance) GetTraderFuturesAccountRatio(ctx context.Context, pair, period string, limit int64, ...) ([]TopTraderAccountRatio, error)
- func (b *Binance) GetTraderFuturesPositionsRatio(ctx context.Context, pair, period string, limit int64, ...) ([]TopTraderPositionRatio, error)
- func (b *Binance) GetUserMarginInterestHistory(ctx context.Context, assetCurrency currency.Code, isolatedSymbol currency.Pair, ...) (*UserMarginInterestHistoryResponse, error)
- func (b *Binance) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) ([]exchange.WithdrawalHistory, error)
- func (b *Binance) GetWsAuthStreamKey(ctx context.Context) (string, error)
- func (b *Binance) IsPerpetualFutureCurrency(a asset.Item, cp currency.Pair) (bool, error)
- func (b *Binance) KeepAuthKeyAlive()
- func (b *Binance) MaintainWsAuthStreamKey(ctx context.Context) error
- func (b *Binance) ModifyIsolatedPositionMargin(ctx context.Context, symbol currency.Pair, positionSide, changeType string, ...) (FuturesMarginUpdatedResponse, error)
- func (b *Binance) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error)
- func (b *Binance) NewOrder(ctx context.Context, o *NewOrderRequest) (NewOrderResponse, error)
- func (b *Binance) NewOrderTest(ctx context.Context, o *NewOrderRequest) error
- func (b *Binance) OpenInterest(ctx context.Context, symbol currency.Pair) (OpenInterestData, error)
- func (b *Binance) OpenOrders(ctx context.Context, pair currency.Pair) ([]QueryOrderData, error)
- func (b *Binance) ProcessUpdate(cp currency.Pair, a asset.Item, ws *WebsocketDepthStream) error
- func (b *Binance) QueryOrder(ctx context.Context, symbol currency.Pair, origClientOrderID string, ...) (QueryOrderData, error)
- func (b *Binance) SeedLocalCache(ctx context.Context, p currency.Pair) error
- func (b *Binance) SeedLocalCacheWithBook(p currency.Pair, orderbookNew *OrderBook) error
- func (b *Binance) SendAPIKeyHTTPRequest(ctx context.Context, ePath exchange.URL, path string, f request.EndpointLimit, ...) error
- func (b *Binance) SendAuthHTTPRequest(ctx context.Context, ePath exchange.URL, method, path string, ...) error
- func (b *Binance) SendHTTPRequest(ctx context.Context, ePath exchange.URL, path string, f request.EndpointLimit, ...) error
- func (b *Binance) SetAssetsMode(ctx context.Context, multiMargin bool) error
- func (b *Binance) SetCollateralMode(ctx context.Context, a asset.Item, collateralMode collateral.Mode) error
- func (b *Binance) SetDefaults()
- func (b *Binance) SetLeverage(ctx context.Context, item asset.Item, pair currency.Pair, _ margin.Type, ...) error
- func (b *Binance) SetMarginType(ctx context.Context, item asset.Item, pair currency.Pair, tp margin.Type) error
- func (b *Binance) SetValues()
- func (b *Binance) Setup(exch *config.Exchange) error
- func (b *Binance) SubmitOrder(ctx context.Context, s *order.Submit) (*order.SubmitResponse, error)
- func (b *Binance) SubmitOrders(ctx context.Context, ss ...*order.Submit) ([]*order.SubmitResponse, error)
- func (b *Binance) Subscribe(channels []subscription.Subscription) error
- func (b *Binance) SynchroniseWebsocketOrderbook()
- func (b *Binance) U24HTickerPriceChangeStats(ctx context.Context, symbol currency.Pair) ([]U24HrPriceChangeStats, error)
- func (b *Binance) UAccountBalanceV2(ctx context.Context) ([]UAccountBalanceV2Data, error)
- func (b *Binance) UAccountForcedOrders(ctx context.Context, symbol currency.Pair, autoCloseType string, limit int64, ...) ([]UForceOrdersData, error)
- func (b *Binance) UAccountIncomeHistory(ctx context.Context, symbol currency.Pair, incomeType string, limit int64, ...) ([]UAccountIncomeHistory, error)
- func (b *Binance) UAccountInformationV2(ctx context.Context) (UAccountInformationV2Data, error)
- func (b *Binance) UAccountTradesHistory(ctx context.Context, symbol currency.Pair, fromID string, limit int64, ...) ([]UAccountTradeHistory, error)
- func (b *Binance) UAllAccountOpenOrders(ctx context.Context, symbol currency.Pair) ([]UOrderData, error)
- func (b *Binance) UAllAccountOrders(ctx context.Context, symbol currency.Pair, orderID, limit int64, ...) ([]UFuturesOrderData, error)
- func (b *Binance) UAutoCancelAllOpenOrders(ctx context.Context, symbol currency.Pair, countdownTime int64) (AutoCancelAllOrdersData, error)
- func (b *Binance) UCancelAllOpenOrders(ctx context.Context, symbol currency.Pair) (GenericAuthResponse, error)
- func (b *Binance) UCancelBatchOrders(ctx context.Context, symbol currency.Pair, ...) ([]UOrderData, error)
- func (b *Binance) UCancelOrder(ctx context.Context, symbol currency.Pair, orderID, cliOrderID string) (UOrderData, error)
- func (b *Binance) UChangeInitialLeverageRequest(ctx context.Context, symbol currency.Pair, leverage float64) (UChangeInitialLeverage, error)
- func (b *Binance) UChangeInitialMarginType(ctx context.Context, symbol currency.Pair, marginType string) error
- func (b *Binance) UCompositeIndexInfo(ctx context.Context, symbol currency.Pair) ([]UCompositeIndexInfoData, error)
- func (b *Binance) UCompressedTrades(ctx context.Context, symbol currency.Pair, fromID string, limit int64, ...) ([]UCompressedTradeData, error)
- func (b *Binance) UExchangeInfo(ctx context.Context) (UFuturesExchangeInfo, error)
- func (b *Binance) UFetchOpenOrder(ctx context.Context, symbol currency.Pair, orderID, origClientOrderID string) (UOrderData, error)
- func (b *Binance) UFuturesHistoricalTrades(ctx context.Context, symbol currency.Pair, fromID string, limit int64) ([]interface{}, error)
- func (b *Binance) UFuturesNewOrder(ctx context.Context, data *UFuturesNewOrderRequest) (UOrderData, error)
- func (b *Binance) UFuturesOrderbook(ctx context.Context, symbol currency.Pair, limit int64) (*OrderBook, error)
- func (b *Binance) UGetCommissionRates(ctx context.Context, symbol currency.Pair) ([]UPositionInformationV2, error)
- func (b *Binance) UGetFundingHistory(ctx context.Context, symbol currency.Pair, limit int64, ...) ([]FundingRateHistory, error)
- func (b *Binance) UGetFundingRateInfo(ctx context.Context) ([]FundingRateInfoResponse, error)
- func (b *Binance) UGetMarkPrice(ctx context.Context, symbol currency.Pair) ([]UMarkPrice, error)
- func (b *Binance) UGetNotionalAndLeverageBrackets(ctx context.Context, symbol currency.Pair) ([]UNotionalLeverageAndBrakcetsData, error)
- func (b *Binance) UGetOrderData(ctx context.Context, symbol currency.Pair, orderID, cliOrderID string) (UOrderData, error)
- func (b *Binance) UGlobalLongShortRatio(ctx context.Context, symbol currency.Pair, period string, limit int64, ...) ([]ULongShortRatio, error)
- func (b *Binance) UKlineData(ctx context.Context, symbol currency.Pair, interval string, limit int64, ...) ([]FuturesCandleStick, error)
- func (b *Binance) UModifyIsolatedPositionMarginReq(ctx context.Context, symbol currency.Pair, positionSide, changeType string, ...) (UModifyIsolatedPosMargin, error)
- func (b *Binance) UOpenInterest(ctx context.Context, symbol currency.Pair) (UOpenInterestData, error)
- func (b *Binance) UOpenInterestStats(ctx context.Context, symbol currency.Pair, period string, limit int64, ...) ([]UOpenInterestStats, error)
- func (b *Binance) UPlaceBatchOrders(ctx context.Context, data []PlaceBatchOrderData) ([]UOrderData, error)
- func (b *Binance) UPositionMarginChangeHistory(ctx context.Context, symbol currency.Pair, changeType string, limit int64, ...) ([]UPositionMarginChangeHistoryData, error)
- func (b *Binance) UPositionsADLEstimate(ctx context.Context, symbol currency.Pair) (UPositionADLEstimationData, error)
- func (b *Binance) UPositionsInfoV2(ctx context.Context, symbol currency.Pair) ([]UPositionInformationV2, error)
- func (b *Binance) URecentTrades(ctx context.Context, symbol currency.Pair, fromID string, limit int64) ([]UPublicTradesData, error)
- func (b *Binance) UServerTime(ctx context.Context) (time.Time, error)
- func (b *Binance) USymbolOrderbookTicker(ctx context.Context, symbol currency.Pair) ([]USymbolOrderbookTicker, error)
- func (b *Binance) USymbolPriceTicker(ctx context.Context, symbol currency.Pair) ([]USymbolPriceTicker, error)
- func (b *Binance) UTakerBuySellVol(ctx context.Context, symbol currency.Pair, period string, limit int64, ...) ([]UTakerVolumeData, error)
- func (b *Binance) UTopAcccountsLongShortRatio(ctx context.Context, symbol currency.Pair, period string, limit int64, ...) ([]ULongShortRatio, error)
- func (b *Binance) UTopPostionsLongShortRatio(ctx context.Context, symbol currency.Pair, period string, limit int64, ...) ([]ULongShortRatio, error)
- func (b *Binance) Unsubscribe(channels []subscription.Subscription) error
- func (b *Binance) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (b *Binance) UpdateLocalBuffer(wsdp *WebsocketDepthStream) (bool, error)
- func (b *Binance) UpdateOrderExecutionLimits(ctx context.Context, a asset.Item) error
- func (b *Binance) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (b *Binance) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)
- func (b *Binance) UpdateTickers(ctx context.Context, a asset.Item) error
- func (b *Binance) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error
- func (b *Binance) ValidateAPICredentials(ctx context.Context, assetType asset.Item) error
- func (b *Binance) WithdrawCrypto(ctx context.Context, ...) (string, error)
- func (b *Binance) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *Binance) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *Binance) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *Binance) WithdrawHistory(ctx context.Context, c currency.Code, status string, ...) ([]WithdrawStatusResponse, error)
- func (b *Binance) WsConnect() error
- type CExchangeInfo
- type CancelOrderResponse
- type CandleStick
- type CoinInfo
- type CollateralAssetData
- type CollateralAssetItem
- type CollateralRepayRate
- type CompressedTradesData
- type CrossMarginInterestData
- type CryptoLoanAdjustLTV
- type CryptoLoanBorrow
- type CryptoLoanLTVAdjustmentHistory
- type CryptoLoanLTVAdjustmentItem
- type CryptoLoanOngoingOrder
- type CryptoLoanOngoingOrderItem
- type CryptoLoanRepay
- type CryptoLoanRepayHistory
- type CryptoLoanRepayHistoryItem
- type CryptoLoansIncomeHistory
- type CustomiseMarginCall
- type CustomiseMarginCallItem
- type DepositAddress
- type DepositHistory
- type DepthUpdateParams
- type ExchangeInfo
- type FlexibleCollateralAssetsData
- type FlexibleCollateralAssetsDataItem
- type FlexibleLoanAdjustLTV
- type FlexibleLoanAssetsData
- type FlexibleLoanAssetsDataItem
- type FlexibleLoanBorrow
- type FlexibleLoanBorrowHistory
- type FlexibleLoanBorrowHistoryItem
- type FlexibleLoanLTVAdjustmentHistory
- type FlexibleLoanLTVAdjustmentHistoryItem
- type FlexibleLoanOngoingOrder
- type FlexibleLoanOngoingOrderItem
- type FlexibleLoanRepay
- type FlexibleLoanRepayHistory
- type FlexibleLoanRepayHistoryItem
- type ForcedOrdersData
- type FundingRateData
- type FundingRateHistory
- type FundingRateInfoResponse
- type FuturesAccountAsset
- type FuturesAccountBalanceData
- type FuturesAccountInformation
- type FuturesAccountInformationPosition
- type FuturesAccountTradeList
- type FuturesBasisData
- type FuturesCandleStick
- type FuturesIncomeHistoryData
- type FuturesLeverageData
- type FuturesMarginUpdatedResponse
- type FuturesNewOrderRequest
- type FuturesOrderData
- type FuturesOrderGetData
- type FuturesOrderPlaceData
- type FuturesPositionInformation
- type FuturesPublicTradesData
- type GenericAuthResponse
- type GetPositionMarginChangeHistoryData
- type GlobalLongShortRatio
- type HistoricalTrade
- type IndexMarkPrice
- type InterestHistoryData
- type KlineStream
- type KlineStreamData
- type KlinesRequestParams
- type LevelDetail
- type LoanBorrowHistory
- type LoanBorrowHistoryItem
- type LoanableAssetItem
- type LoanableAssetsData
- type MarginAccount
- type MarginAccountAsset
- type MarginInfoData
- type MarkPriceData
- type ModifyIsolatedMarginData
- type NewOrderRequest
- type NewOrderResponse
- type NotionalBracketData
- type OpenInterestData
- type OpenInterestStats
- type OrderBook
- type OrderBookData
- type OrderBookDataRequestParams
- type OrderVars
- type OrderbookData
- type OrderbookItem
- type PerpsExchangeInfo
- type PlaceBatchOrderData
- type PriceChangeStats
- type QueryOrderData
- type RateLimit
- type RecentTrade
- type RecentTradeRequestParams
- type RequestParamsOrderType
- type RequestParamsTimeForceType
- type Response
- type SymbolOrderBookTicker
- type SymbolPrice
- type SymbolPriceTicker
- type SymbolsData
- type TakerBuySellVolume
- type TickerStream
- type TopTraderAccountRatio
- type TopTraderPositionRatio
- type TradeStream
- type U24HrPriceChangeStats
- type UAccountBalanceV2Data
- type UAccountIncomeHistory
- type UAccountInformationV2Data
- type UAccountTradeHistory
- type UAsset
- type UChangeInitialLeverage
- type UCompositeIndexInfoData
- type UCompressedTradeData
- type UForceOrdersData
- type UFuturesExchangeInfo
- type UFuturesNewOrderRequest
- type UFuturesOrderData
- type UFuturesSymbolInfo
- type ULiquidationOrdersData
- type ULongShortRatio
- type UMarkPrice
- type UModifyIsolatedPosMargin
- type UNotionalLeverageAndBrakcetsData
- type UOpenInterestData
- type UOpenInterestStats
- type UOrderData
- type UPosition
- type UPositionADLEstimationData
- type UPositionInformationV2
- type UPositionMarginChangeHistoryData
- type UPublicTradesData
- type USymbolOrderbookTicker
- type USymbolPriceTicker
- type UTakerVolumeData
- type UserAccountStream
- type UserMarginInterestHistory
- type UserMarginInterestHistoryResponse
- type WebsocketDepthStream
- type WithdrawResponse
- type WithdrawStatusResponse
- type WsAccountInfoData
- type WsAccountPositionData
- type WsBalanceUpdateData
- type WsListStatusData
- type WsOrderUpdateData
- type WsPayload
Constants ¶
const ( EmailSent = iota Cancelled AwaitingApproval Rejected Processing Failure Completed )
withdrawals status codes description
Variables ¶
var ( // BinanceRequestParamsTimeGTC GTC BinanceRequestParamsTimeGTC = RequestParamsTimeForceType("GTC") // BinanceRequestParamsTimeIOC IOC BinanceRequestParamsTimeIOC = RequestParamsTimeForceType("IOC") // BinanceRequestParamsTimeFOK FOK BinanceRequestParamsTimeFOK = RequestParamsTimeForceType("FOK") )
var ( // BinanceRequestParamsOrderLimit Limit order BinanceRequestParamsOrderLimit = RequestParamsOrderType("LIMIT") // BinanceRequestParamsOrderMarket Market order BinanceRequestParamsOrderMarket = RequestParamsOrderType("MARKET") // BinanceRequestParamsOrderStopLoss STOP_LOSS BinanceRequestParamsOrderStopLoss = RequestParamsOrderType("STOP_LOSS") // BinanceRequestParamsOrderStopLossLimit STOP_LOSS_LIMIT BinanceRequestParamsOrderStopLossLimit = RequestParamsOrderType("STOP_LOSS_LIMIT") // BinanceRequestParamsOrderTakeProfit TAKE_PROFIT BinanceRequestParamsOrderTakeProfit = RequestParamsOrderType("TAKE_PROFIT") // BinanceRequestParamsOrderTakeProfitLimit TAKE_PROFIT_LIMIT BinanceRequestParamsOrderTakeProfitLimit = RequestParamsOrderType("TAKE_PROFIT_LIMIT") // BinanceRequestParamsOrderLimitMarker LIMIT_MAKER BinanceRequestParamsOrderLimitMarker = RequestParamsOrderType("LIMIT_MAKER") )
var WithdrawalFees = map[currency.Code]float64{}/* 164 elements not displayed */
WithdrawalFees the large list of predefined withdrawal fees Prone to change
Functions ¶
This section is empty.
Types ¶
type ADLEstimateData ¶
type ADLEstimateData struct { Symbol string `json:"symbol"` ADLQuantile struct { Long float64 `json:"LONG"` Short float64 `json:"SHORT"` Hedge float64 `json:"HEDGE"` } `json:"adlQuantile"` }
ADLEstimateData stores data for ADL estimates
type Account ¶
type Account struct { MakerCommission int `json:"makerCommission"` TakerCommission int `json:"takerCommission"` BuyerCommission int `json:"buyerCommission"` SellerCommission int `json:"sellerCommission"` CanTrade bool `json:"canTrade"` CanWithdraw bool `json:"canWithdraw"` CanDeposit bool `json:"canDeposit"` UpdateTime time.Time `json:"updateTime"` Balances []Balance `json:"balances"` }
Account holds the account data
func (*Account) UnmarshalJSON ¶
UnmarshalJSON deserialises the JSON info, including the timestamp
type AggregatedTrade ¶
type AggregatedTrade struct { ATradeID int64 `json:"a"` Price float64 `json:"p,string"` Quantity float64 `json:"q,string"` FirstTradeID int64 `json:"f"` LastTradeID int64 `json:"l"` TimeStamp time.Time `json:"T"` Maker bool `json:"m"` BestMatchPrice bool `json:"M"` }
AggregatedTrade holds aggregated trade information
func (*AggregatedTrade) UnmarshalJSON ¶
func (a *AggregatedTrade) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type AggregatedTradeRequestParams ¶
type AggregatedTradeRequestParams struct { Symbol currency.Pair // Required field; example LTCBTC, BTCUSDT // The first trade to retrieve FromID int64 // The API seems to accept (start and end time) or FromID and no other combinations StartTime time.Time EndTime time.Time // Default 500; max 1000. Limit int }
AggregatedTradeRequestParams holds request params
type AllLiquidationOrders ¶
type AllLiquidationOrders struct { Symbol string `json:"symbol"` Price float64 `json:"price,string"` OrigQty float64 `json:"origQty,string"` ExecutedQty float64 `json:"executedQty,string"` AveragePrice float64 `json:"averagePrice,string"` Status string `json:"status"` TimeInForce string `json:"timeInForce"` OrderType string `json:"type"` Side string `json:"side"` Time int64 `json:"time"` }
AllLiquidationOrders gets all liquidation orders
type AutoCancelAllOrdersData ¶
type AutoCancelAllOrdersData struct { Symbol string `json:"symbol"` CountdownTime int64 `json:"countdownTime,string"` }
AutoCancelAllOrdersData gives data of auto cancelling all open orders
type AveragePrice ¶
AveragePrice holds current average symbol price
type Balance ¶
type Balance struct { Asset string `json:"asset"` Free decimal.Decimal `json:"free"` Locked decimal.Decimal `json:"locked"` }
Balance holds query order data
type BatchCancelOrderData ¶
type BatchCancelOrderData struct { ClientOrderID string `json:"clientOrderID"` CumQty float64 `json:"cumQty,string"` CumBase float64 `json:"cumBase,string"` ExecuteQty float64 `json:"executeQty,string"` OrderID int64 `json:"orderID,string"` AvgPrice float64 `json:"avgPrice,string"` OrigQty float64 `json:"origQty,string"` Price float64 `json:"price,string"` ReduceOnly bool `json:"reduceOnly"` Side string `json:"side"` PositionSide string `json:"positionSide"` Status string `json:"status"` StopPrice int64 `json:"stopPrice"` ClosePosition bool `json:"closePosition"` Symbol string `json:"symbol"` Pair string `json:"pair"` TimeInForce string `json:"TimeInForce"` OrderType string `json:"type"` OrigType string `json:"origType"` ActivatePrice float64 `json:"activatePrice,string"` PriceRate float64 `json:"priceRate,string"` UpdateTime int64 `json:"updateTime"` WorkingType string `json:"workingType"` PriceProtect bool `json:"priceProtect"` Code int64 `json:"code"` Msg string `json:"msg"` }
BatchCancelOrderData stores batch cancel order data
type BestPrice ¶
type BestPrice struct { Symbol string `json:"symbol"` BidPrice float64 `json:"bidPrice,string"` BidQty float64 `json:"bidQty,string"` AskPrice float64 `json:"askPrice,string"` AskQty float64 `json:"askQty,string"` }
BestPrice holds best price data
type Binance ¶
Binance is the overarching type across the Binance package
func (*Binance) AllOrders ¶
func (b *Binance) AllOrders(ctx context.Context, symbol currency.Pair, orderID, limit string) ([]QueryOrderData, error)
AllOrders Get all account orders; active, canceled, or filled. orderId optional param limit optional param, default 500; max 500
func (*Binance) AutoCancelAllOpenOrders ¶
func (b *Binance) AutoCancelAllOpenOrders(ctx context.Context, symbol currency.Pair, countdownTime int64) (AutoCancelAllOrdersData, error)
AutoCancelAllOpenOrders cancels all open futures orders countdownTime 1000 = 1s, example - to cancel all orders after 30s (countdownTime: 30000)
func (*Binance) CancelAllOrders ¶
func (b *Binance) CancelAllOrders(ctx context.Context, req *order.Cancel) (order.CancelAllResponse, error)
CancelAllOrders cancels all orders associated with a currency pair
func (*Binance) CancelBatchOrders ¶
func (b *Binance) CancelBatchOrders(ctx context.Context, os []order.Cancel) (*order.CancelBatchResponse, error)
CancelBatchOrders cancels an orders by their corresponding ID numbers
func (*Binance) CancelExistingOrder ¶
func (b *Binance) CancelExistingOrder(ctx context.Context, symbol currency.Pair, orderID int64, origClientOrderID string) (CancelOrderResponse, error)
CancelExistingOrder sends a cancel order to Binance
func (*Binance) CancelOrder ¶
CancelOrder cancels an order by its corresponding ID number
func (*Binance) ChangePositionMargin ¶
func (b *Binance) ChangePositionMargin(ctx context.Context, req *margin.PositionChangeRequest) (*margin.PositionChangeResponse, error)
ChangePositionMargin will modify a position/currencies margin parameters
func (*Binance) CheckLimit ¶
CheckLimit checks value against a variable list
func (*Binance) CryptoLoanAdjustLTV ¶
func (b *Binance) CryptoLoanAdjustLTV(ctx context.Context, orderID int64, reduce bool, amount float64) (*CryptoLoanAdjustLTV, error)
CryptoLoanAdjustLTV adjusts the LTV of a crypto loan
func (*Binance) CryptoLoanAssetsData ¶
func (b *Binance) CryptoLoanAssetsData(ctx context.Context, loanCoin currency.Code, vipLevel int64) (*LoanableAssetsData, error)
CryptoLoanAssetsData gets the loanable assets data
func (*Binance) CryptoLoanBorrow ¶
func (b *Binance) CryptoLoanBorrow(ctx context.Context, loanCoin currency.Code, loanAmount float64, collateralCoin currency.Code, collateralAmount float64, loanTerm int64) ([]CryptoLoanBorrow, error)
CryptoLoanBorrow borrows crypto
func (*Binance) CryptoLoanBorrowHistory ¶
func (b *Binance) CryptoLoanBorrowHistory(ctx context.Context, orderID int64, loanCoin, collateralCoin currency.Code, startTime, endTime time.Time, current, limit int64) (*LoanBorrowHistory, error)
CryptoLoanBorrowHistory gets loan borrow history
func (*Binance) CryptoLoanCheckCollateralRepayRate ¶
func (b *Binance) CryptoLoanCheckCollateralRepayRate(ctx context.Context, loanCoin, collateralCoin currency.Code, amount float64) (*CollateralRepayRate, error)
CryptoLoanCheckCollateralRepayRate checks the collateral repay rate
func (*Binance) CryptoLoanCollateralAssetsData ¶
func (b *Binance) CryptoLoanCollateralAssetsData(ctx context.Context, collateralCoin currency.Code, vipLevel int64) (*CollateralAssetData, error)
CryptoLoanCollateralAssetsData gets the collateral assets data
func (*Binance) CryptoLoanCustomiseMarginCall ¶
func (b *Binance) CryptoLoanCustomiseMarginCall(ctx context.Context, orderID int64, collateralCoin currency.Code, marginCallValue float64) (*CustomiseMarginCall, error)
CryptoLoanCustomiseMarginCall customises a loan's margin call
func (*Binance) CryptoLoanIncomeHistory ¶
func (b *Binance) CryptoLoanIncomeHistory(ctx context.Context, curr currency.Code, loanType string, startTime, endTime time.Time, limit int64) ([]CryptoLoansIncomeHistory, error)
CryptoLoanIncomeHistory returns crypto loan income history
func (*Binance) CryptoLoanLTVAdjustmentHistory ¶
func (b *Binance) CryptoLoanLTVAdjustmentHistory(ctx context.Context, orderID int64, loanCoin, collateralCoin currency.Code, startTime, endTime time.Time, current, limit int64) (*CryptoLoanLTVAdjustmentHistory, error)
CryptoLoanLTVAdjustmentHistory gets the crypto loan LTV adjustment history
func (*Binance) CryptoLoanOngoingOrders ¶
func (b *Binance) CryptoLoanOngoingOrders(ctx context.Context, orderID int64, loanCoin, collateralCoin currency.Code, current, limit int64) (*CryptoLoanOngoingOrder, error)
CryptoLoanOngoingOrders obtains ongoing loan orders
func (*Binance) CryptoLoanRepay ¶
func (b *Binance) CryptoLoanRepay(ctx context.Context, orderID int64, amount float64, repayType int64, collateralReturn bool) ([]CryptoLoanRepay, error)
CryptoLoanRepay repays a crypto loan
func (*Binance) CryptoLoanRepaymentHistory ¶
func (b *Binance) CryptoLoanRepaymentHistory(ctx context.Context, orderID int64, loanCoin, collateralCoin currency.Code, startTime, endTime time.Time, current, limit int64) (*CryptoLoanRepayHistory, error)
CryptoLoanRepaymentHistory gets the crypto loan repayment history
func (*Binance) DepositHistory ¶
func (b *Binance) DepositHistory(ctx context.Context, c currency.Code, status string, startTime, endTime time.Time, offset, limit int) ([]DepositHistory, error)
DepositHistory returns the deposit history based on the supplied params status `param` used as string to prevent default value 0 (for int) interpreting as EmailSent status
func (*Binance) FetchAccountInfo ¶
func (b *Binance) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
FetchAccountInfo retrieves balances for all enabled currencies
func (*Binance) FetchCoinMarginExchangeLimits ¶
FetchCoinMarginExchangeLimits fetches coin margined order execution limits
func (*Binance) FetchExchangeLimits ¶
func (b *Binance) FetchExchangeLimits(ctx context.Context, a asset.Item) ([]order.MinMaxLevel, error)
FetchExchangeLimits fetches order execution limits filtered by asset
func (*Binance) FetchOrderbook ¶
func (b *Binance) FetchOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
FetchOrderbook returns orderbook base on the currency pair
func (*Binance) FetchTicker ¶
func (b *Binance) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
FetchTicker returns the ticker for a currency pair
func (*Binance) FetchTradablePairs ¶
FetchTradablePairs returns a list of the exchanges tradable pairs
func (*Binance) FetchUSDTMarginExchangeLimits ¶
FetchUSDTMarginExchangeLimits fetches USDT margined order execution limits
func (*Binance) FlexibleCollateralAssetsData ¶
func (b *Binance) FlexibleCollateralAssetsData(ctx context.Context, collateralCoin currency.Code) (*FlexibleCollateralAssetsData, error)
FlexibleCollateralAssetsData gets the flexible loan collateral assets data
func (*Binance) FlexibleLoanAdjustLTV ¶
func (b *Binance) FlexibleLoanAdjustLTV(ctx context.Context, loanCoin, collateralCoin currency.Code, amount float64, reduce bool) (*FlexibleLoanAdjustLTV, error)
FlexibleLoanAdjustLTV adjusts the LTV of a flexible loan
func (*Binance) FlexibleLoanAssetsData ¶
func (b *Binance) FlexibleLoanAssetsData(ctx context.Context, loanCoin currency.Code) (*FlexibleLoanAssetsData, error)
FlexibleLoanAssetsData gets the flexible loan assets data
func (*Binance) FlexibleLoanBorrow ¶
func (b *Binance) FlexibleLoanBorrow(ctx context.Context, loanCoin, collateralCoin currency.Code, loanAmount, collateralAmount float64) (*FlexibleLoanBorrow, error)
FlexibleLoanBorrow creates a flexible loan
func (*Binance) FlexibleLoanBorrowHistory ¶
func (b *Binance) FlexibleLoanBorrowHistory(ctx context.Context, loanCoin, collateralCoin currency.Code, startTime, endTime time.Time, current, limit int64) (*FlexibleLoanBorrowHistory, error)
FlexibleLoanBorrowHistory gets the flexible loan borrow history
func (*Binance) FlexibleLoanLTVAdjustmentHistory ¶
func (b *Binance) FlexibleLoanLTVAdjustmentHistory(ctx context.Context, loanCoin, collateralCoin currency.Code, startTime, endTime time.Time, current, limit int64) (*FlexibleLoanLTVAdjustmentHistory, error)
FlexibleLoanLTVAdjustmentHistory gets the flexible loan LTV adjustment history
func (*Binance) FlexibleLoanOngoingOrders ¶
func (b *Binance) FlexibleLoanOngoingOrders(ctx context.Context, loanCoin, collateralCoin currency.Code, current, limit int64) (*FlexibleLoanOngoingOrder, error)
FlexibleLoanOngoingOrders gets the flexible loan ongoing orders
func (*Binance) FlexibleLoanRepay ¶
func (b *Binance) FlexibleLoanRepay(ctx context.Context, loanCoin, collateralCoin currency.Code, amount float64, collateralReturn, fullRepayment bool) (*FlexibleLoanRepay, error)
FlexibleLoanRepay repays a flexible loan
func (*Binance) FlexibleLoanRepayHistory ¶
func (b *Binance) FlexibleLoanRepayHistory(ctx context.Context, loanCoin, collateralCoin currency.Code, startTime, endTime time.Time, current, limit int64) (*FlexibleLoanRepayHistory, error)
FlexibleLoanRepayHistory gets the flexible loan repayment history
func (*Binance) FormatExchangeCurrency ¶
FormatExchangeCurrency is a method that formats and returns a currency pair based on the user currency display preferences overrides default implementation to use optional delimiter
func (*Binance) FormatExchangeKlineInterval ¶
FormatExchangeKlineInterval returns Interval to exchange formatted string
func (*Binance) FormatSymbol ¶
FormatSymbol formats the given pair to a string suitable for exchange API requests overrides default implementation to use optional delimiter
func (*Binance) FuturesBatchCancelOrders ¶
func (b *Binance) FuturesBatchCancelOrders(ctx context.Context, symbol currency.Pair, orderList, origClientOrderIDList []string) ([]BatchCancelOrderData, error)
FuturesBatchCancelOrders sends a batch request to cancel orders
func (*Binance) FuturesBatchOrder ¶
func (b *Binance) FuturesBatchOrder(ctx context.Context, data []PlaceBatchOrderData) ([]FuturesOrderPlaceData, error)
FuturesBatchOrder sends a batch order request
func (*Binance) FuturesCancelAllOpenOrders ¶
func (b *Binance) FuturesCancelAllOpenOrders(ctx context.Context, symbol currency.Pair) (GenericAuthResponse, error)
FuturesCancelAllOpenOrders cancels a futures order
func (*Binance) FuturesCancelOrder ¶
func (b *Binance) FuturesCancelOrder(ctx context.Context, symbol currency.Pair, orderID, origClientOrderID string) (FuturesOrderGetData, error)
FuturesCancelOrder cancels a futures order
func (*Binance) FuturesChangeInitialLeverage ¶
func (b *Binance) FuturesChangeInitialLeverage(ctx context.Context, symbol currency.Pair, leverage float64) (FuturesLeverageData, error)
FuturesChangeInitialLeverage changes initial leverage for the account
func (*Binance) FuturesChangeMarginType ¶
func (b *Binance) FuturesChangeMarginType(ctx context.Context, symbol currency.Pair, marginType string) (GenericAuthResponse, error)
FuturesChangeMarginType changes margin type
func (*Binance) FuturesExchangeInfo ¶
func (b *Binance) FuturesExchangeInfo(ctx context.Context) (CExchangeInfo, error)
FuturesExchangeInfo stores CoinMarginedFutures, data
func (*Binance) FuturesForceOrders ¶
func (b *Binance) FuturesForceOrders(ctx context.Context, symbol currency.Pair, autoCloseType string, startTime, endTime time.Time) ([]ForcedOrdersData, error)
FuturesForceOrders gets futures forced orders
func (*Binance) FuturesGetFundingHistory ¶
func (b *Binance) FuturesGetFundingHistory(ctx context.Context, symbol currency.Pair, limit int64, startTime, endTime time.Time) ([]FundingRateHistory, error)
FuturesGetFundingHistory gets funding history for CoinMarginedFutures,
func (*Binance) FuturesGetOrderData ¶
func (b *Binance) FuturesGetOrderData(ctx context.Context, symbol currency.Pair, orderID, origClientOrderID string) (FuturesOrderGetData, error)
FuturesGetOrderData gets futures order data
func (*Binance) FuturesIncomeHistory ¶
func (b *Binance) FuturesIncomeHistory(ctx context.Context, symbol currency.Pair, incomeType string, startTime, endTime time.Time, limit int64) ([]FuturesIncomeHistoryData, error)
FuturesIncomeHistory gets income history for CoinMarginedFutures,
func (*Binance) FuturesMarginChangeHistory ¶
func (b *Binance) FuturesMarginChangeHistory(ctx context.Context, symbol currency.Pair, changeType string, startTime, endTime time.Time, limit int64) ([]GetPositionMarginChangeHistoryData, error)
FuturesMarginChangeHistory gets past margin changes for positions
func (*Binance) FuturesNewOrder ¶
func (b *Binance) FuturesNewOrder(ctx context.Context, x *FuturesNewOrderRequest) ( FuturesOrderPlaceData, error, )
FuturesNewOrder sends a new futures order to the exchange
func (*Binance) FuturesNotionalBracket ¶
func (b *Binance) FuturesNotionalBracket(ctx context.Context, pair string) ([]NotionalBracketData, error)
FuturesNotionalBracket gets futures notional bracket
func (*Binance) FuturesOpenOrderData ¶
func (b *Binance) FuturesOpenOrderData(ctx context.Context, symbol currency.Pair, orderID, origClientOrderID string) (FuturesOrderGetData, error)
FuturesOpenOrderData gets open order data for CoinMarginedFutures,
func (*Binance) FuturesPositionsADLEstimate ¶
func (b *Binance) FuturesPositionsADLEstimate(ctx context.Context, symbol currency.Pair) ([]ADLEstimateData, error)
FuturesPositionsADLEstimate estimates ADL on positions
func (*Binance) FuturesPositionsInfo ¶
func (b *Binance) FuturesPositionsInfo(ctx context.Context, marginAsset, pair string) ([]FuturesPositionInformation, error)
FuturesPositionsInfo gets futures positions info "pair" for coinmarginedfutures in GCT terms is the pair base eg ADAUSD_PERP the "pair" parameter is ADAUSD
func (*Binance) FuturesTradeHistory ¶
func (b *Binance) FuturesTradeHistory(ctx context.Context, symbol currency.Pair, pair string, startTime, endTime time.Time, limit, fromID int64) ([]FuturesAccountTradeList, error)
FuturesTradeHistory gets trade history for CoinMarginedFutures, account
func (*Binance) GenerateSubscriptions ¶
func (b *Binance) GenerateSubscriptions() ([]subscription.Subscription, error)
GenerateSubscriptions generates the default subscription set
func (*Binance) GetAccount ¶
GetAccount returns binance user accounts
func (*Binance) GetAccountFundingHistory ¶
GetAccountFundingHistory returns funding history, deposits and withdrawals
func (*Binance) GetActiveOrders ¶
func (b *Binance) GetActiveOrders(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
GetActiveOrders retrieves any orders that are active/open
func (*Binance) GetAggregatedTrades ¶
func (b *Binance) GetAggregatedTrades(ctx context.Context, arg *AggregatedTradeRequestParams) ([]AggregatedTrade, error)
GetAggregatedTrades returns aggregated trade activity. If more than one hour of data is requested or asked limit is not supported by exchange then the trades are collected with multiple backend requests. https://binance-docs.github.io/apidocs/spot/en/#compressed-aggregate-trades-list
func (*Binance) GetAllCoinsInfo ¶
GetAllCoinsInfo returns details about all supported coins
func (*Binance) GetAllFuturesOrders ¶
func (b *Binance) GetAllFuturesOrders(ctx context.Context, symbol, pair currency.Pair, startTime, endTime time.Time, orderID, limit int64) ([]FuturesOrderData, error)
GetAllFuturesOrders gets all orders active cancelled or filled
func (*Binance) GetAssetsMode ¶
GetAssetsMode returns the current asset margin type, true for multi, false for single
func (*Binance) GetAvailableTransferChains ¶
func (b *Binance) GetAvailableTransferChains(ctx context.Context, cryptocurrency currency.Code) ([]string, error)
GetAvailableTransferChains returns the available transfer blockchains for the specific cryptocurrency
func (*Binance) GetAveragePrice ¶
GetAveragePrice returns current average price for a symbol.
symbol: string of currency pair
func (*Binance) GetBestPrice ¶
GetBestPrice returns the latest best price for symbol
symbol: string of currency pair
func (*Binance) GetCollateralMode ¶
GetCollateralMode returns the account's collateral mode for the asset type
func (*Binance) GetContinuousKlineData ¶
func (b *Binance) GetContinuousKlineData(ctx context.Context, pair, contractType, interval string, limit int64, startTime, endTime time.Time) ([]FuturesCandleStick, error)
GetContinuousKlineData gets continuous kline data
func (*Binance) GetCurrencyTradeURL ¶
func (b *Binance) GetCurrencyTradeURL(ctx context.Context, a asset.Item, cp currency.Pair) (string, error)
GetCurrencyTradeURL returns the URL to the exchange's trade page for the given asset and currency pair
func (*Binance) GetDepositAddress ¶
func (b *Binance) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, _, chain string) (*deposit.Address, error)
GetDepositAddress returns a deposit address for a specified currency
func (*Binance) GetDepositAddressForCurrency ¶
func (b *Binance) GetDepositAddressForCurrency(ctx context.Context, currency, chain string) (*DepositAddress, error)
GetDepositAddressForCurrency retrieves the wallet address for a given currency
func (*Binance) GetExchangeInfo ¶
func (b *Binance) GetExchangeInfo(ctx context.Context) (ExchangeInfo, error)
GetExchangeInfo returns exchange information. Check binance_types for more information
func (*Binance) GetFeeByType ¶
func (b *Binance) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
GetFeeByType returns an estimate of fee based on type of transaction
func (*Binance) GetFundingRateInfo ¶
func (b *Binance) GetFundingRateInfo(ctx context.Context) ([]FundingRateInfoResponse, error)
GetFundingRateInfo returns extra details about funding rates
func (*Binance) GetFuturesAccountBalance ¶
func (b *Binance) GetFuturesAccountBalance(ctx context.Context) ([]FuturesAccountBalanceData, error)
GetFuturesAccountBalance gets account balance data for CoinMarginedFutures, account
func (*Binance) GetFuturesAccountInfo ¶
func (b *Binance) GetFuturesAccountInfo(ctx context.Context) (FuturesAccountInformation, error)
GetFuturesAccountInfo gets account info data for CoinMarginedFutures, account
func (*Binance) GetFuturesAggregatedTradesList ¶
func (b *Binance) GetFuturesAggregatedTradesList(ctx context.Context, symbol currency.Pair, fromID, limit int64, startTime, endTime time.Time) ([]AggregatedTrade, error)
GetFuturesAggregatedTradesList gets aggregated trades list for CoinMarginedFutures,
func (*Binance) GetFuturesAllOpenOrders ¶
func (b *Binance) GetFuturesAllOpenOrders(ctx context.Context, symbol currency.Pair, pair string) ([]FuturesOrderData, error)
GetFuturesAllOpenOrders gets all open orders data for CoinMarginedFutures,
func (*Binance) GetFuturesBasisData ¶
func (b *Binance) GetFuturesBasisData(ctx context.Context, pair, contractType, period string, limit int64, startTime, endTime time.Time) ([]FuturesBasisData, error)
GetFuturesBasisData gets futures basis data
func (*Binance) GetFuturesContractDetails ¶
func (b *Binance) GetFuturesContractDetails(ctx context.Context, item asset.Item) ([]futures.Contract, error)
GetFuturesContractDetails returns details about futures contracts
func (*Binance) GetFuturesHistoricalTrades ¶
func (b *Binance) GetFuturesHistoricalTrades(ctx context.Context, symbol currency.Pair, fromID string, limit int64) ([]UPublicTradesData, error)
GetFuturesHistoricalTrades gets historical public trades for CoinMarginedFutures,
func (*Binance) GetFuturesKlineData ¶
func (b *Binance) GetFuturesKlineData(ctx context.Context, symbol currency.Pair, interval string, limit int64, startTime, endTime time.Time) ([]FuturesCandleStick, error)
GetFuturesKlineData gets futures kline data for CoinMarginedFutures,
func (*Binance) GetFuturesOrderbook ¶
func (b *Binance) GetFuturesOrderbook(ctx context.Context, symbol currency.Pair, limit int64) (*OrderBook, error)
GetFuturesOrderbook gets orderbook data for CoinMarginedFutures,
func (*Binance) GetFuturesOrderbookTicker ¶
func (b *Binance) GetFuturesOrderbookTicker(ctx context.Context, symbol currency.Pair, pair string) ([]SymbolOrderBookTicker, error)
GetFuturesOrderbookTicker gets orderbook ticker for symbol
func (*Binance) GetFuturesPositionOrders ¶
func (b *Binance) GetFuturesPositionOrders(ctx context.Context, req *futures.PositionsRequest) ([]futures.PositionResponse, error)
GetFuturesPositionOrders returns the orders for futures positions
func (*Binance) GetFuturesPositionSummary ¶
func (b *Binance) GetFuturesPositionSummary(ctx context.Context, req *futures.PositionSummaryRequest) (*futures.PositionSummary, error)
GetFuturesPositionSummary returns the account's position summary for the asset type and pair it can be used to calculate potential positions
func (*Binance) GetFuturesPublicTrades ¶
func (b *Binance) GetFuturesPublicTrades(ctx context.Context, symbol currency.Pair, limit int64) ([]FuturesPublicTradesData, error)
GetFuturesPublicTrades gets recent public trades for CoinMarginedFutures,
func (*Binance) GetFuturesSwapTickerChangeStats ¶
func (b *Binance) GetFuturesSwapTickerChangeStats(ctx context.Context, symbol currency.Pair, pair string) ([]PriceChangeStats, error)
GetFuturesSwapTickerChangeStats gets 24hr ticker change stats for CoinMarginedFutures,
func (*Binance) GetFuturesSymbolPriceTicker ¶
func (b *Binance) GetFuturesSymbolPriceTicker(ctx context.Context, symbol currency.Pair, pair string) ([]SymbolPriceTicker, error)
GetFuturesSymbolPriceTicker gets price ticker for symbol
func (*Binance) GetFuturesTakerVolume ¶
func (b *Binance) GetFuturesTakerVolume(ctx context.Context, pair, contractType, period string, limit int64, startTime, endTime time.Time) ([]TakerBuySellVolume, error)
GetFuturesTakerVolume gets futures taker buy/sell volumes
func (*Binance) GetHistoricCandles ¶
func (b *Binance) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error)
GetHistoricCandles returns candles between a time period for a set time interval
func (*Binance) GetHistoricCandlesExtended ¶
func (b *Binance) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error)
GetHistoricCandlesExtended returns candles between a time period for a set time interval
func (*Binance) GetHistoricTrades ¶
func (b *Binance) GetHistoricTrades(ctx context.Context, p currency.Pair, a asset.Item, from, to time.Time) ([]trade.Data, error)
GetHistoricTrades returns historic trade data within the timeframe provided
func (*Binance) GetHistoricalFundingRates ¶
func (b *Binance) GetHistoricalFundingRates(ctx context.Context, r *fundingrate.HistoricalRatesRequest) (*fundingrate.HistoricalRates, error)
GetHistoricalFundingRates returns funding rates for a given asset and currency for a time period
func (*Binance) GetHistoricalTrades ¶
func (b *Binance) GetHistoricalTrades(ctx context.Context, symbol string, limit int, fromID int64) ([]HistoricalTrade, error)
GetHistoricalTrades returns historical trade activity
symbol: string of currency pair limit: Optional. Default 500; max 1000. fromID:
func (*Binance) GetIndexAndMarkPrice ¶
func (b *Binance) GetIndexAndMarkPrice(ctx context.Context, symbol, pair string) ([]IndexMarkPrice, error)
GetIndexAndMarkPrice gets index and mark prices for CoinMarginedFutures,
func (*Binance) GetIndexPriceKlines ¶
func (b *Binance) GetIndexPriceKlines(ctx context.Context, pair, interval string, limit int64, startTime, endTime time.Time) ([]FuturesCandleStick, error)
GetIndexPriceKlines gets continuous kline data
func (*Binance) GetLatestFundingRates ¶
func (b *Binance) GetLatestFundingRates(ctx context.Context, r *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error)
GetLatestFundingRates returns the latest funding rates data
func (*Binance) GetLatestSpotPrice ¶
func (b *Binance) GetLatestSpotPrice(ctx context.Context, symbol currency.Pair) (SymbolPrice, error)
GetLatestSpotPrice returns latest spot price of symbol
symbol: string of currency pair
func (*Binance) GetLeverage ¶
func (b *Binance) GetLeverage(ctx context.Context, item asset.Item, pair currency.Pair, _ margin.Type, _ order.Side) (float64, error)
GetLeverage gets the account's initial leverage for the asset type and pair
func (*Binance) GetMarginAccount ¶
func (b *Binance) GetMarginAccount(ctx context.Context) (*MarginAccount, error)
GetMarginAccount returns account information for margin accounts
func (*Binance) GetMarkPriceKline ¶
func (b *Binance) GetMarkPriceKline(ctx context.Context, symbol currency.Pair, interval string, limit int64, startTime, endTime time.Time) ([]FuturesCandleStick, error)
GetMarkPriceKline gets mark price kline data
func (*Binance) GetMarketRatio ¶
func (b *Binance) GetMarketRatio(ctx context.Context, pair, period string, limit int64, startTime, endTime time.Time) ([]TopTraderPositionRatio, error)
GetMarketRatio gets global long/short ratio
func (*Binance) GetMostRecentTrades ¶
func (b *Binance) GetMostRecentTrades(ctx context.Context, rtr RecentTradeRequestParams) ([]RecentTrade, error)
GetMostRecentTrades returns recent trade activity limit: Up to 500 results returned
func (*Binance) GetOpenInterest ¶
func (b *Binance) GetOpenInterest(ctx context.Context, k ...key.PairAsset) ([]futures.OpenInterest, error)
GetOpenInterest returns the open interest rate for a given asset pair
func (*Binance) GetOpenInterestStats ¶
func (b *Binance) GetOpenInterestStats(ctx context.Context, pair, contractType, period string, limit int64, startTime, endTime time.Time) ([]OpenInterestStats, error)
GetOpenInterestStats gets open interest stats for a symbol
func (*Binance) GetOrderBook ¶
func (b *Binance) GetOrderBook(ctx context.Context, obd OrderBookDataRequestParams) (*OrderBook, error)
GetOrderBook returns full orderbook information
OrderBookDataRequestParams contains the following members symbol: string of currency pair limit: returned limit amount
func (*Binance) GetOrderHistory ¶
func (b *Binance) GetOrderHistory(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*Binance) GetOrderInfo ¶
func (b *Binance) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (*order.Detail, error)
GetOrderInfo returns information on a current open order
func (*Binance) GetPastPublicTrades ¶
func (b *Binance) GetPastPublicTrades(ctx context.Context, symbol currency.Pair, limit, fromID int64) ([]FuturesPublicTradesData, error)
GetPastPublicTrades gets past public trades for CoinMarginedFutures,
func (*Binance) GetPerpMarkets ¶
func (b *Binance) GetPerpMarkets(ctx context.Context) (PerpsExchangeInfo, error)
GetPerpMarkets returns exchange information. Check binance_types for more information
func (*Binance) GetPriceChangeStats ¶
func (b *Binance) GetPriceChangeStats(ctx context.Context, symbol currency.Pair) (PriceChangeStats, error)
GetPriceChangeStats returns price change statistics for the last 24 hours
symbol: string of currency pair
func (*Binance) GetRecentTrades ¶
func (b *Binance) GetRecentTrades(ctx context.Context, p currency.Pair, a asset.Item) ([]trade.Data, error)
GetRecentTrades returns the most recent trades for a currency and asset
func (*Binance) GetServerTime ¶
GetServerTime returns the current exchange server time.
func (*Binance) GetSpotKline ¶
func (b *Binance) GetSpotKline(ctx context.Context, arg *KlinesRequestParams) ([]CandleStick, error)
GetSpotKline returns kline data
KlinesRequestParams supports 5 parameters symbol: the symbol to get the kline data for limit: optional interval: the interval time for the data startTime: startTime filter for kline data endTime: endTime filter for the kline data
func (*Binance) GetTickers ¶
func (b *Binance) GetTickers(ctx context.Context) ([]PriceChangeStats, error)
GetTickers returns the ticker data for the last 24 hrs
func (*Binance) GetTraderFuturesAccountRatio ¶
func (b *Binance) GetTraderFuturesAccountRatio(ctx context.Context, pair, period string, limit int64, startTime, endTime time.Time) ([]TopTraderAccountRatio, error)
GetTraderFuturesAccountRatio gets a traders futures account long/short ratio
func (*Binance) GetTraderFuturesPositionsRatio ¶
func (b *Binance) GetTraderFuturesPositionsRatio(ctx context.Context, pair, period string, limit int64, startTime, endTime time.Time) ([]TopTraderPositionRatio, error)
GetTraderFuturesPositionsRatio gets a traders futures positions' long/short ratio
func (*Binance) GetUserMarginInterestHistory ¶
func (b *Binance) GetUserMarginInterestHistory(ctx context.Context, assetCurrency currency.Code, isolatedSymbol currency.Pair, startTime, endTime time.Time, currentPage, size int64, archived bool) (*UserMarginInterestHistoryResponse, error)
GetUserMarginInterestHistory returns margin interest history for the user
func (*Binance) GetWithdrawalsHistory ¶
func (b *Binance) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) ([]exchange.WithdrawalHistory, error)
GetWithdrawalsHistory returns previous withdrawals data
func (*Binance) GetWsAuthStreamKey ¶
GetWsAuthStreamKey will retrieve a key to use for authorised WS streaming
func (*Binance) IsPerpetualFutureCurrency ¶
IsPerpetualFutureCurrency ensures a given asset and currency is a perpetual future
func (*Binance) KeepAuthKeyAlive ¶
func (b *Binance) KeepAuthKeyAlive()
KeepAuthKeyAlive will continuously send messages to keep the WS auth key active
func (*Binance) MaintainWsAuthStreamKey ¶
MaintainWsAuthStreamKey will keep the key alive
func (*Binance) ModifyIsolatedPositionMargin ¶
func (b *Binance) ModifyIsolatedPositionMargin(ctx context.Context, symbol currency.Pair, positionSide, changeType string, amount float64) (FuturesMarginUpdatedResponse, error)
ModifyIsolatedPositionMargin changes margin for an isolated position
func (*Binance) ModifyOrder ¶
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*Binance) NewOrder ¶
func (b *Binance) NewOrder(ctx context.Context, o *NewOrderRequest) (NewOrderResponse, error)
NewOrder sends a new order to Binance
func (*Binance) NewOrderTest ¶
func (b *Binance) NewOrderTest(ctx context.Context, o *NewOrderRequest) error
NewOrderTest sends a new test order to Binance
func (*Binance) OpenInterest ¶
OpenInterest gets open interest data for a symbol
func (*Binance) OpenOrders ¶
OpenOrders Current open orders. Get all open orders on a symbol. Careful when accessing this with no symbol: The number of requests counted against the rate limiter is significantly higher
func (*Binance) ProcessUpdate ¶
ProcessUpdate processes the websocket orderbook update
func (*Binance) QueryOrder ¶
func (b *Binance) QueryOrder(ctx context.Context, symbol currency.Pair, origClientOrderID string, orderID int64) (QueryOrderData, error)
QueryOrder returns information on a past order
func (*Binance) SeedLocalCache ¶
SeedLocalCache seeds depth data
func (*Binance) SeedLocalCacheWithBook ¶
SeedLocalCacheWithBook seeds the local orderbook cache
func (*Binance) SendAPIKeyHTTPRequest ¶
func (b *Binance) SendAPIKeyHTTPRequest(ctx context.Context, ePath exchange.URL, path string, f request.EndpointLimit, result interface{}) error
SendAPIKeyHTTPRequest is a special API request where the api key is appended to the headers without a secret
func (*Binance) SendAuthHTTPRequest ¶
func (b *Binance) SendAuthHTTPRequest(ctx context.Context, ePath exchange.URL, method, path string, params url.Values, f request.EndpointLimit, result interface{}) error
SendAuthHTTPRequest sends an authenticated HTTP request
func (*Binance) SendHTTPRequest ¶
func (b *Binance) SendHTTPRequest(ctx context.Context, ePath exchange.URL, path string, f request.EndpointLimit, result interface{}) error
SendHTTPRequest sends an unauthenticated request
func (*Binance) SetAssetsMode ¶
SetAssetsMode sets the current asset margin type, true for multi, false for single
func (*Binance) SetCollateralMode ¶
func (b *Binance) SetCollateralMode(ctx context.Context, a asset.Item, collateralMode collateral.Mode) error
SetCollateralMode sets the account's collateral mode for the asset type
func (*Binance) SetDefaults ¶
func (b *Binance) SetDefaults()
SetDefaults sets the basic defaults for Binance
func (*Binance) SetLeverage ¶
func (b *Binance) SetLeverage(ctx context.Context, item asset.Item, pair currency.Pair, _ margin.Type, amount float64, _ order.Side) error
SetLeverage sets the account's initial leverage for the asset type and pair
func (*Binance) SetMarginType ¶
func (b *Binance) SetMarginType(ctx context.Context, item asset.Item, pair currency.Pair, tp margin.Type) error
SetMarginType sets the default margin type for when opening a new position
func (*Binance) SubmitOrder ¶
SubmitOrder submits a new order
func (*Binance) SubmitOrders ¶ added in v1.0.2
func (*Binance) Subscribe ¶
func (b *Binance) Subscribe(channels []subscription.Subscription) error
Subscribe subscribes to a set of channels
func (*Binance) SynchroniseWebsocketOrderbook ¶
func (b *Binance) SynchroniseWebsocketOrderbook()
SynchroniseWebsocketOrderbook synchronises full orderbook for currency pair asset
func (*Binance) U24HTickerPriceChangeStats ¶
func (b *Binance) U24HTickerPriceChangeStats(ctx context.Context, symbol currency.Pair) ([]U24HrPriceChangeStats, error)
U24HTickerPriceChangeStats gets 24hr ticker price change stats for USDTMarginedFutures
func (*Binance) UAccountBalanceV2 ¶
func (b *Binance) UAccountBalanceV2(ctx context.Context) ([]UAccountBalanceV2Data, error)
UAccountBalanceV2 gets V2 account balance data
func (*Binance) UAccountForcedOrders ¶
func (b *Binance) UAccountForcedOrders(ctx context.Context, symbol currency.Pair, autoCloseType string, limit int64, startTime, endTime time.Time) ([]UForceOrdersData, error)
UAccountForcedOrders gets account's forced (liquidation) orders for USDTMarginedFutures
func (*Binance) UAccountIncomeHistory ¶
func (b *Binance) UAccountIncomeHistory(ctx context.Context, symbol currency.Pair, incomeType string, limit int64, startTime, endTime time.Time) ([]UAccountIncomeHistory, error)
UAccountIncomeHistory gets account's income history data for USDTMarginedFutures
func (*Binance) UAccountInformationV2 ¶
func (b *Binance) UAccountInformationV2(ctx context.Context) (UAccountInformationV2Data, error)
UAccountInformationV2 gets V2 account balance data
func (*Binance) UAccountTradesHistory ¶
func (b *Binance) UAccountTradesHistory(ctx context.Context, symbol currency.Pair, fromID string, limit int64, startTime, endTime time.Time) ([]UAccountTradeHistory, error)
UAccountTradesHistory gets account's trade history data for USDTMarginedFutures
func (*Binance) UAllAccountOpenOrders ¶
func (b *Binance) UAllAccountOpenOrders(ctx context.Context, symbol currency.Pair) ([]UOrderData, error)
UAllAccountOpenOrders gets all account's orders for USDTMarginedFutures
func (*Binance) UAllAccountOrders ¶
func (b *Binance) UAllAccountOrders(ctx context.Context, symbol currency.Pair, orderID, limit int64, startTime, endTime time.Time) ([]UFuturesOrderData, error)
UAllAccountOrders gets all account's orders for USDTMarginedFutures
func (*Binance) UAutoCancelAllOpenOrders ¶
func (b *Binance) UAutoCancelAllOpenOrders(ctx context.Context, symbol currency.Pair, countdownTime int64) (AutoCancelAllOrdersData, error)
UAutoCancelAllOpenOrders auto cancels all ufutures open orders for a symbol after the set countdown time
func (*Binance) UCancelAllOpenOrders ¶
func (b *Binance) UCancelAllOpenOrders(ctx context.Context, symbol currency.Pair) (GenericAuthResponse, error)
UCancelAllOpenOrders cancels all open orders for a symbol ufutures
func (*Binance) UCancelBatchOrders ¶
func (b *Binance) UCancelBatchOrders(ctx context.Context, symbol currency.Pair, orderIDList, origCliOrdIDList []string) ([]UOrderData, error)
UCancelBatchOrders cancel batch order for USDTMarginedFutures
func (*Binance) UCancelOrder ¶
func (b *Binance) UCancelOrder(ctx context.Context, symbol currency.Pair, orderID, cliOrderID string) (UOrderData, error)
UCancelOrder cancel an order for USDTMarginedFutures
func (*Binance) UChangeInitialLeverageRequest ¶
func (b *Binance) UChangeInitialLeverageRequest(ctx context.Context, symbol currency.Pair, leverage float64) (UChangeInitialLeverage, error)
UChangeInitialLeverageRequest sends a request to change account's initial leverage
func (*Binance) UChangeInitialMarginType ¶
func (b *Binance) UChangeInitialMarginType(ctx context.Context, symbol currency.Pair, marginType string) error
UChangeInitialMarginType sends a request to change account's initial margin type
func (*Binance) UCompositeIndexInfo ¶
func (b *Binance) UCompositeIndexInfo(ctx context.Context, symbol currency.Pair) ([]UCompositeIndexInfoData, error)
UCompositeIndexInfo stores composite indexs' info for usdt margined futures
func (*Binance) UCompressedTrades ¶
func (b *Binance) UCompressedTrades(ctx context.Context, symbol currency.Pair, fromID string, limit int64, startTime, endTime time.Time) ([]UCompressedTradeData, error)
UCompressedTrades gets compressed public trades for usdt margined futures
func (*Binance) UExchangeInfo ¶
func (b *Binance) UExchangeInfo(ctx context.Context) (UFuturesExchangeInfo, error)
UExchangeInfo stores usdt margined futures data
func (*Binance) UFetchOpenOrder ¶
func (b *Binance) UFetchOpenOrder(ctx context.Context, symbol currency.Pair, orderID, origClientOrderID string) (UOrderData, error)
UFetchOpenOrder sends a request to fetch open order data for USDTMarginedFutures
func (*Binance) UFuturesHistoricalTrades ¶
func (b *Binance) UFuturesHistoricalTrades(ctx context.Context, symbol currency.Pair, fromID string, limit int64) ([]interface{}, error)
UFuturesHistoricalTrades gets historical public trades for USDTMarginedFutures
func (*Binance) UFuturesNewOrder ¶
func (b *Binance) UFuturesNewOrder(ctx context.Context, data *UFuturesNewOrderRequest) (UOrderData, error)
UFuturesNewOrder sends a new order for USDTMarginedFutures
func (*Binance) UFuturesOrderbook ¶
func (b *Binance) UFuturesOrderbook(ctx context.Context, symbol currency.Pair, limit int64) (*OrderBook, error)
UFuturesOrderbook gets orderbook data for usdt margined futures
func (*Binance) UGetCommissionRates ¶
func (b *Binance) UGetCommissionRates(ctx context.Context, symbol currency.Pair) ([]UPositionInformationV2, error)
UGetCommissionRates returns the commission rates for USDTMarginedFutures
func (*Binance) UGetFundingHistory ¶
func (b *Binance) UGetFundingHistory(ctx context.Context, symbol currency.Pair, limit int64, startTime, endTime time.Time) ([]FundingRateHistory, error)
UGetFundingHistory gets funding history for USDTMarginedFutures
func (*Binance) UGetFundingRateInfo ¶
func (b *Binance) UGetFundingRateInfo(ctx context.Context) ([]FundingRateInfoResponse, error)
UGetFundingRateInfo returns extra details about funding rates
func (*Binance) UGetMarkPrice ¶
UGetMarkPrice gets mark price data for USDTMarginedFutures
func (*Binance) UGetNotionalAndLeverageBrackets ¶
func (b *Binance) UGetNotionalAndLeverageBrackets(ctx context.Context, symbol currency.Pair) ([]UNotionalLeverageAndBrakcetsData, error)
UGetNotionalAndLeverageBrackets gets account's notional and leverage brackets for USDTMarginedFutures
func (*Binance) UGetOrderData ¶
func (b *Binance) UGetOrderData(ctx context.Context, symbol currency.Pair, orderID, cliOrderID string) (UOrderData, error)
UGetOrderData gets order data for USDTMarginedFutures
func (*Binance) UGlobalLongShortRatio ¶
func (b *Binance) UGlobalLongShortRatio(ctx context.Context, symbol currency.Pair, period string, limit int64, startTime, endTime time.Time) ([]ULongShortRatio, error)
UGlobalLongShortRatio gets the global long/short ratio data for USDTMarginedFutures
func (*Binance) UKlineData ¶
func (b *Binance) UKlineData(ctx context.Context, symbol currency.Pair, interval string, limit int64, startTime, endTime time.Time) ([]FuturesCandleStick, error)
UKlineData gets kline data for usdt margined futures
func (*Binance) UModifyIsolatedPositionMarginReq ¶
func (b *Binance) UModifyIsolatedPositionMarginReq(ctx context.Context, symbol currency.Pair, positionSide, changeType string, amount float64) (UModifyIsolatedPosMargin, error)
UModifyIsolatedPositionMarginReq sends a request to modify isolated margin for USDTMarginedFutures
func (*Binance) UOpenInterest ¶
func (b *Binance) UOpenInterest(ctx context.Context, symbol currency.Pair) (UOpenInterestData, error)
UOpenInterest gets open interest data for USDTMarginedFutures
func (*Binance) UOpenInterestStats ¶
func (b *Binance) UOpenInterestStats(ctx context.Context, symbol currency.Pair, period string, limit int64, startTime, endTime time.Time) ([]UOpenInterestStats, error)
UOpenInterestStats gets open interest stats for USDTMarginedFutures
func (*Binance) UPlaceBatchOrders ¶
func (b *Binance) UPlaceBatchOrders(ctx context.Context, data []PlaceBatchOrderData) ([]UOrderData, error)
UPlaceBatchOrders places batch orders
func (*Binance) UPositionMarginChangeHistory ¶
func (b *Binance) UPositionMarginChangeHistory(ctx context.Context, symbol currency.Pair, changeType string, limit int64, startTime, endTime time.Time) ([]UPositionMarginChangeHistoryData, error)
UPositionMarginChangeHistory gets margin change history for USDTMarginedFutures
func (*Binance) UPositionsADLEstimate ¶
func (b *Binance) UPositionsADLEstimate(ctx context.Context, symbol currency.Pair) (UPositionADLEstimationData, error)
UPositionsADLEstimate gets estimated ADL data for USDTMarginedFutures positions
func (*Binance) UPositionsInfoV2 ¶
func (b *Binance) UPositionsInfoV2(ctx context.Context, symbol currency.Pair) ([]UPositionInformationV2, error)
UPositionsInfoV2 gets positions' info for USDTMarginedFutures
func (*Binance) URecentTrades ¶
func (b *Binance) URecentTrades(ctx context.Context, symbol currency.Pair, fromID string, limit int64) ([]UPublicTradesData, error)
URecentTrades gets recent trades for usdt margined futures
func (*Binance) UServerTime ¶
UServerTime gets the server time
func (*Binance) USymbolOrderbookTicker ¶
func (b *Binance) USymbolOrderbookTicker(ctx context.Context, symbol currency.Pair) ([]USymbolOrderbookTicker, error)
USymbolOrderbookTicker gets symbol orderbook ticker
func (*Binance) USymbolPriceTicker ¶
func (b *Binance) USymbolPriceTicker(ctx context.Context, symbol currency.Pair) ([]USymbolPriceTicker, error)
USymbolPriceTicker gets symbol price ticker for USDTMarginedFutures
func (*Binance) UTakerBuySellVol ¶
func (b *Binance) UTakerBuySellVol(ctx context.Context, symbol currency.Pair, period string, limit int64, startTime, endTime time.Time) ([]UTakerVolumeData, error)
UTakerBuySellVol gets takers' buy/sell ratio for USDTMarginedFutures
func (*Binance) UTopAcccountsLongShortRatio ¶
func (b *Binance) UTopAcccountsLongShortRatio(ctx context.Context, symbol currency.Pair, period string, limit int64, startTime, endTime time.Time) ([]ULongShortRatio, error)
UTopAcccountsLongShortRatio gets long/short ratio data for top trader accounts in ufutures
func (*Binance) UTopPostionsLongShortRatio ¶
func (b *Binance) UTopPostionsLongShortRatio(ctx context.Context, symbol currency.Pair, period string, limit int64, startTime, endTime time.Time) ([]ULongShortRatio, error)
UTopPostionsLongShortRatio gets long/short ratio data for top positions' in ufutures
func (*Binance) Unsubscribe ¶
func (b *Binance) Unsubscribe(channels []subscription.Subscription) error
Unsubscribe unsubscribes from a set of channels
func (*Binance) UpdateAccountInfo ¶
func (b *Binance) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
UpdateAccountInfo retrieves balances for all enabled currencies for the Binance exchange
func (*Binance) UpdateLocalBuffer ¶
func (b *Binance) UpdateLocalBuffer(wsdp *WebsocketDepthStream) (bool, error)
UpdateLocalBuffer updates and returns the most recent iteration of the orderbook
func (*Binance) UpdateOrderExecutionLimits ¶
UpdateOrderExecutionLimits sets exchange executions for a required asset type
func (*Binance) UpdateOrderbook ¶
func (b *Binance) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*Binance) UpdateTicker ¶
func (b *Binance) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)
UpdateTicker updates and returns the ticker for a currency pair
func (*Binance) UpdateTickers ¶
UpdateTickers updates the ticker for all currency pairs of a given asset type
func (*Binance) UpdateTradablePairs ¶
UpdateTradablePairs updates the exchanges available pairs and stores them in the exchanges config
func (*Binance) ValidateAPICredentials ¶
ValidateAPICredentials validates current credentials used for wrapper functionality
func (*Binance) WithdrawCrypto ¶
func (b *Binance) WithdrawCrypto(ctx context.Context, cryptoAsset, withdrawOrderID, network, address, addressTag, name, amount string, transactionFeeFlag bool) (string, error)
WithdrawCrypto sends cryptocurrency to the address of your choosing
func (*Binance) WithdrawCryptocurrencyFunds ¶
func (b *Binance) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*Binance) WithdrawFiatFunds ¶
func (b *Binance) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*Binance) WithdrawFiatFundsToInternationalBank ¶
func (b *Binance) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
func (*Binance) WithdrawHistory ¶
func (b *Binance) WithdrawHistory(ctx context.Context, c currency.Code, status string, startTime, endTime time.Time, offset, limit int) ([]WithdrawStatusResponse, error)
WithdrawHistory gets the status of recent withdrawals status `param` used as string to prevent default value 0 (for int) interpreting as EmailSent status
type CExchangeInfo ¶
type CExchangeInfo struct { ExchangeFilters []interface{} `json:"exchangeFilters"` RateLimits []struct { Interval string `json:"interval"` IntervalNum int64 `json:"intervalNul"` Limit int64 `json:"limit"` RateLimitType string `json:"rateLimitType"` } `json:"rateLimits"` ServerTime int64 `json:"serverTime"` Symbols []struct { Filters []struct { FilterType string `json:"filterType"` MinPrice float64 `json:"minPrice,string"` MaxPrice float64 `json:"maxPrice,string"` StepSize float64 `json:"stepSize,string"` TickSize float64 `json:"tickSize,string"` MaxQty float64 `json:"maxQty,string"` MinQty float64 `json:"minQty,string"` Limit int64 `json:"limit"` MultiplierDown float64 `json:"multiplierDown,string"` MultiplierUp float64 `json:"multiplierUp,string"` MultiplierDecimal float64 `json:"multiplierDecimal,string"` } `json:"filters"` OrderTypes []string `json:"orderType"` TimeInForce []string `json:"timeInForce"` Symbol string `json:"symbol"` Pair string `json:"pair"` ContractType string `json:"contractType"` DeliveryDate binanceTime `json:"deliveryDate"` OnboardDate binanceTime `json:"onboardDate"` ContractStatus string `json:"contractStatus"` ContractSize int64 `json:"contractSize"` QuoteAsset string `json:"quoteAsset"` BaseAsset string `json:"baseAsset"` MarginAsset string `json:"marginAsset"` PricePrecision int64 `json:"pricePrecision"` QuantityPrecision int64 `json:"quantityPrecision"` BaseAssetPrecision int64 `json:"baseAssetPrecision"` QuotePrecision int64 `json:"quotePrecision"` MaintMarginPercent float64 `json:"maintMarginPercent,string"` RequiredMarginPercent float64 `json:"requiredMarginPercent,string"` } `json:"symbols"` Timezone string `json:"timezone"` }
CExchangeInfo stores exchange info for cfutures
type CancelOrderResponse ¶
type CancelOrderResponse struct { Symbol string `json:"symbol"` OrigClientOrderID string `json:"origClientOrderId"` OrderID int64 `json:"orderId"` ClientOrderID string `json:"clientOrderId"` }
CancelOrderResponse is the return structured response from the exchange
type CandleStick ¶
type CandleStick struct { OpenTime time.Time Open float64 High float64 Low float64 Close float64 Volume float64 CloseTime time.Time QuoteAssetVolume float64 TradeCount float64 TakerBuyAssetVolume float64 TakerBuyQuoteAssetVolume float64 }
CandleStick holds kline data
type CoinInfo ¶
type CoinInfo struct { Coin string `json:"coin"` DepositAllEnable bool `json:"depositAllEnable"` WithdrawAllEnable bool `json:"withdrawAllEnable"` Free float64 `json:"free,string"` Freeze float64 `json:"freeze,string"` IPOAble float64 `json:"ipoable,string"` IPOing float64 `json:"ipoing,string"` IsLegalMoney bool `json:"isLegalMoney"` Locked float64 `json:"locked,string"` Name string `json:"name"` NetworkList []struct { AddressRegex string `json:"addressRegex"` Coin string `json:"coin"` DepositDescription string `json:"depositDesc"` // shown only when "depositEnable" is false DepositEnable bool `json:"depositEnable"` IsDefault bool `json:"isDefault"` MemoRegex string `json:"memoRegex"` MinimumConfirmation uint16 `json:"minConfirm"` Name string `json:"name"` Network string `json:"network"` ResetAddressStatus bool `json:"resetAddressStatus"` SpecialTips string `json:"specialTips"` UnlockConfirm uint16 `json:"unLockConfirm"` WithdrawDescription string `json:"withdrawDesc"` // shown only when "withdrawEnable" is false WithdrawEnable bool `json:"withdrawEnable"` WithdrawFee float64 `json:"withdrawFee,string"` WithdrawMinimum float64 `json:"withdrawMin,string"` WithdrawMaximum float64 `json:"withdrawMax,string"` } `json:"networkList"` Storage float64 `json:"storage,string"` Trading bool `json:"trading"` Withdrawing float64 `json:"withdrawing,string"` }
CoinInfo stores information about all supported coins
type CollateralAssetData ¶
type CollateralAssetData struct { Rows []CollateralAssetItem `json:"rows"` Total int64 `json:"total"` }
CollateralAssetData stores collateral asset data
type CollateralAssetItem ¶
type CollateralAssetItem struct { CollateralCoin currency.Code `json:"collateralCoin"` InitialLTV float64 `json:"initialLTV,string"` MarginCallLTV float64 `json:"marginCallLTV,string"` LiquidationLTV float64 `json:"liquidationLTV,string"` MaxLimit float64 `json:"maxLimit,string"` VIPLevel int64 `json:"vipLevel"` }
CollateralAssetItem stores collateral asset item data
type CollateralRepayRate ¶
type CollateralRepayRate struct { LoanCoin currency.Code `json:"loanCoin"` CollateralCoin currency.Code `json:"collateralCoin"` RepayAmount float64 `json:"repayAmount,string"` Rate float64 `json:"rate,string"` }
CollateralRepayRate stores collateral repayment rate data
type CompressedTradesData ¶
type CompressedTradesData struct { TradeID int64 `json:"a"` Price float64 `json:"p"` Quantity float64 `json:"q"` FirstTradeID int64 `json:"f"` LastTradeID int64 `json:"l"` Timestamp binanceTime `json:"t"` BuyerMaker bool `json:"b"` }
CompressedTradesData stores futures trades data in a compressed format
type CrossMarginInterestData ¶
type CrossMarginInterestData struct { Code int64 `json:"code,string"` Message string `json:"message"` MessageDetail string `json:"messageDetail"` Data []struct { AssetName string `json:"assetName"` Specs []struct { VipLevel string `json:"vipLevel"` DailyInterestRate string `json:"dailyInterestRate"` BorrowLimit string `json:"borrowLimit"` } `json:"specs"` } `json:"data"` Success bool `json:"success"` }
CrossMarginInterestData stores cross margin data for borrowing
type CryptoLoanAdjustLTV ¶
type CryptoLoanAdjustLTV struct { LoanCoin currency.Code `json:"loanCoin"` CollateralCoin currency.Code `json:"collateralCoin"` Direction string `json:"direction"` Amount float64 `json:"amount,string"` CurrentLTV float64 `json:"currentLTV,string"` }
CryptoLoanAdjustLTV stores crypto loan LTV adjustment data
type CryptoLoanBorrow ¶
type CryptoLoanBorrow struct { LoanCoin currency.Code `json:"loanCoin"` Amount float64 `json:"amount,string"` CollateralCoin currency.Code `json:"collateralCoin"` CollateralAmount float64 `json:"collateralAmount,string"` HourlyInterestRate float64 `json:"hourlyInterestRate,string"` OrderID int64 `json:"orderId,string"` }
CryptoLoanBorrow stores crypto loan borrow data
type CryptoLoanLTVAdjustmentHistory ¶
type CryptoLoanLTVAdjustmentHistory struct { Rows []CryptoLoanLTVAdjustmentItem `json:"rows"` Total int64 `json:"total"` }
CryptoLoanLTVAdjustmentHistory stores crypto loan LTV adjustment history data
type CryptoLoanLTVAdjustmentItem ¶
type CryptoLoanLTVAdjustmentItem struct { LoanCoin currency.Code `json:"loanCoin"` CollateralCoin currency.Code `json:"collateralCoin"` Direction string `json:"direction"` Amount float64 `json:"amount,string"` PreviousLTV float64 `json:"preLTV,string"` AfterLTV float64 `json:"afterLTV,string"` AdjustTime binanceTime `json:"adjustTime"` OrderID int64 `json:"orderId"` }
CryptoLoanLTVAdjustmentItem stores crypto loan LTV adjustment item data
type CryptoLoanOngoingOrder ¶
type CryptoLoanOngoingOrder struct { Rows []CryptoLoanOngoingOrderItem `json:"rows"` Total int64 `json:"total"` }
CryptoLoanOngoingOrder stores crypto loan ongoing order data
type CryptoLoanOngoingOrderItem ¶
type CryptoLoanOngoingOrderItem struct { OrderID int64 `json:"orderId"` LoanCoin currency.Code `json:"loanCoin"` TotalDebt float64 `json:"totalDebt,string"` ResidualInterest float64 `json:"residualInterest,string"` CollateralCoin currency.Code `json:"collateralCoin"` CollateralAmount float64 `json:"collateralAmount,string"` CurrentLTV float64 `json:"currentLTV,string"` ExpirationTime binanceTime `json:"expirationTime"` }
CryptoLoanOngoingOrderItem stores crypto loan ongoing order item data
type CryptoLoanRepay ¶
type CryptoLoanRepay struct { LoanCoin currency.Code `json:"loanCoin"` RemainingPrincipal float64 `json:"remainingPrincipal,string"` RemainingInterest float64 `json:"remainingInterest,string"` CollateralCoin currency.Code `json:"collateralCoin"` RemainingCollateral float64 `json:"remainingCollateral,string"` CurrentLTV float64 `json:"currentLTV,string"` RepayStatus string `json:"repayStatus"` }
CryptoLoanRepay stores crypto loan repayment data
type CryptoLoanRepayHistory ¶
type CryptoLoanRepayHistory struct { Rows []CryptoLoanRepayHistoryItem `json:"rows"` Total int64 `json:"total"` }
CryptoLoanRepayHistory stores crypto loan repayment history data
type CryptoLoanRepayHistoryItem ¶
type CryptoLoanRepayHistoryItem struct { LoanCoin currency.Code `json:"loanCoin"` RepayAmount float64 `json:"repayAmount,string"` CollateralCoin currency.Code `json:"collateralCoin"` CollateralUsed float64 `json:"collateralUsed,string"` CollateralReturn float64 `json:"collateralReturn,string"` RepayType string `json:"repayType"` RepayTime binanceTime `json:"repayTime"` OrderID int64 `json:"orderId"` }
CryptoLoanRepayHistoryItem stores crypto loan repayment history item data
type CryptoLoansIncomeHistory ¶
type CryptoLoansIncomeHistory struct { Asset currency.Code `json:"asset"` Type string `json:"type"` Amount float64 `json:"amount,string"` TransactionID int64 `json:"tranId"` }
CryptoLoansIncomeHistory stores crypto loan income history data
type CustomiseMarginCall ¶
type CustomiseMarginCall struct { Rows []CustomiseMarginCallItem `json:"rows"` Total int64 `json:"total"` }
CustomiseMarginCall stores customise margin call data
type CustomiseMarginCallItem ¶
type CustomiseMarginCallItem struct { OrderID int64 `json:"orderId"` CollateralCoin currency.Code `json:"collateralCoin"` PreMarginCall float64 `json:"preMarginCall,string"` AfterMarginCall float64 `json:"afterMarginCall,string"` CustomiseTime binanceTime `json:"customizeTime"` }
CustomiseMarginCallItem stores customise margin call item data
type DepositAddress ¶
type DepositAddress struct { Address string `json:"address"` Coin string `json:"coin"` Tag string `json:"tag"` URL string `json:"url"` }
DepositAddress stores the deposit address info
type DepositHistory ¶
type DepositHistory struct { Amount float64 `json:"amount,string"` Coin string `json:"coin"` Network string `json:"network"` Status uint8 `json:"status"` Address string `json:"address"` AddressTag string `json:"adressTag"` TransactionID string `json:"txId"` InsertTime float64 `json:"insertTime"` TransferType uint8 `json:"transferType"` ConfirmTimes string `json:"confirmTimes"` }
DepositHistory stores deposit history info
type DepthUpdateParams ¶
type DepthUpdateParams []struct { PriceLevel float64 Quantity float64 // contains filtered or unexported fields }
DepthUpdateParams is used as an embedded type for WebsocketDepthStream
type ExchangeInfo ¶
type ExchangeInfo struct { Code int `json:"code"` Msg string `json:"msg"` Timezone string `json:"timezone"` ServerTime time.Time `json:"serverTime"` RateLimits []*struct { RateLimitType string `json:"rateLimitType"` Interval string `json:"interval"` Limit int `json:"limit"` } `json:"rateLimits"` ExchangeFilters interface{} `json:"exchangeFilters"` Symbols []*struct { Symbol string `json:"symbol"` Status string `json:"status"` BaseAsset string `json:"baseAsset"` BaseAssetPrecision int `json:"baseAssetPrecision"` QuoteAsset string `json:"quoteAsset"` QuotePrecision int `json:"quotePrecision"` OrderTypes []string `json:"orderTypes"` IcebergAllowed bool `json:"icebergAllowed"` OCOAllowed bool `json:"ocoAllowed"` QuoteOrderQtyMarketAllowed bool `json:"quoteOrderQtyMarketAllowed"` IsSpotTradingAllowed bool `json:"isSpotTradingAllowed"` IsMarginTradingAllowed bool `json:"isMarginTradingAllowed"` Filters []*filterData `json:"filters"` Permissions []string `json:"permissions"` PermissionSets [][]string `json:"permissionSets"` } `json:"symbols"` }
ExchangeInfo holds the full exchange information type
func (*ExchangeInfo) UnmarshalJSON ¶
func (a *ExchangeInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type FlexibleCollateralAssetsData ¶
type FlexibleCollateralAssetsData struct { Rows []FlexibleCollateralAssetsDataItem `json:"rows"` Total int64 `json:"total"` }
FlexibleCollateralAssetsData stores flexible collateral asset data
type FlexibleCollateralAssetsDataItem ¶
type FlexibleCollateralAssetsDataItem struct { CollateralCoin currency.Code `json:"collateralCoin"` InitialLTV float64 `json:"initialLTV,string"` MarginCallLTV float64 `json:"marginCallLTV,string"` LiquidationLTV float64 `json:"liquidationLTV,string"` MaxLimit float64 `json:"maxLimit,string"` }
FlexibleCollateralAssetsDataItem stores a flexible collateral asset data item
type FlexibleLoanAdjustLTV ¶
type FlexibleLoanAdjustLTV struct { LoanCoin currency.Code `json:"loanCoin"` CollateralCoin currency.Code `json:"collateralCoin"` Direction string `json:"direction"` Amount float64 `json:"amount,string"` // docs error: API actually returns "amount" instead of "adjustedAmount" CurrentLTV float64 `json:"currentLTV,string"` Status string `json:"status"` }
FlexibleLoanAdjustLTV stores a flexible loan LTV adjustment
type FlexibleLoanAssetsData ¶
type FlexibleLoanAssetsData struct { Rows []FlexibleLoanAssetsDataItem `json:"rows"` Total int64 `json:"total"` }
FlexibleLoanAssetsData stores flexible loan asset data
type FlexibleLoanAssetsDataItem ¶
type FlexibleLoanAssetsDataItem struct { LoanCoin currency.Code `json:"loanCoin"` FlexibleInterestRate float64 `json:"flexibleInterestRate,string"` FlexibleMinLimit float64 `json:"flexibleMinLimit,string"` FlexibleMaxLimit float64 `json:"flexibleMaxLimit,string"` }
FlexibleLoanAssetsDataItem stores a flexible loan asset data item
type FlexibleLoanBorrow ¶
type FlexibleLoanBorrow struct { LoanCoin currency.Code `json:"loanCoin"` LoanAmount float64 `json:"loanAmount,string"` CollateralCoin currency.Code `json:"collateralCoin"` CollateralAmount float64 `json:"collateralAmount,string"` Status string `json:"status"` }
FlexibleLoanBorrow stores a flexible loan borrow
type FlexibleLoanBorrowHistory ¶
type FlexibleLoanBorrowHistory struct { Rows []FlexibleLoanBorrowHistoryItem `json:"rows"` Total int64 `json:"total"` }
FlexibleLoanBorrowHistory stores flexible loan borrow history
type FlexibleLoanBorrowHistoryItem ¶
type FlexibleLoanBorrowHistoryItem struct { LoanCoin currency.Code `json:"loanCoin"` InitialLoanAmount float64 `json:"initialLoanAmount,string"` CollateralCoin currency.Code `json:"collateralCoin"` InitialCollateralAmount float64 `json:"initialCollateralAmount,string"` BorrowTime binanceTime `json:"borrowTime"` Status string `json:"status"` }
FlexibleLoanBorrowHistoryItem stores a flexible loan borrow history item
type FlexibleLoanLTVAdjustmentHistory ¶
type FlexibleLoanLTVAdjustmentHistory struct { Rows []FlexibleLoanLTVAdjustmentHistoryItem `json:"rows"` Total int64 `json:"total"` }
FlexibleLoanLTVAdjustmentHistory stores flexible loan LTV adjustment history
type FlexibleLoanLTVAdjustmentHistoryItem ¶
type FlexibleLoanLTVAdjustmentHistoryItem struct { LoanCoin currency.Code `json:"loanCoin"` CollateralCoin currency.Code `json:"collateralCoin"` Direction string `json:"direction"` CollateralAmount float64 `json:"collateralAmount,string"` PreviousLTV float64 `json:"preLTV,string"` AfterLTV float64 `json:"afterLTV,string"` AdjustTime binanceTime `json:"adjustTime"` }
FlexibleLoanLTVAdjustmentHistoryItem stores a flexible loan LTV adjustment history item
type FlexibleLoanOngoingOrder ¶
type FlexibleLoanOngoingOrder struct { Rows []FlexibleLoanOngoingOrderItem `json:"rows"` Total int64 `json:"total"` }
FlexibleLoanOngoingOrder stores flexible loan ongoing orders
type FlexibleLoanOngoingOrderItem ¶
type FlexibleLoanOngoingOrderItem struct { LoanCoin currency.Code `json:"loanCoin"` TotalDebt float64 `json:"totalDebt,string"` CollateralCoin currency.Code `json:"collateralCoin"` CollateralAmount float64 `json:"collateralAmount,string"` CurrentLTV float64 `json:"currentLTV,string"` }
FlexibleLoanOngoingOrderItem stores a flexible loan ongoing order item
type FlexibleLoanRepay ¶
type FlexibleLoanRepay struct { LoanCoin currency.Code `json:"loanCoin"` CollateralCoin currency.Code `json:"collateralCoin"` RemainingDebt float64 `json:"remainingDebt,string"` RemainingCollateral float64 `json:"remainingCollateral,string"` FullRepayment bool `json:"fullRepayment"` CurrentLTV float64 `json:"currentLTV,string"` RepayStatus string `json:"repayStatus"` }
FlexibleLoanRepay stores a flexible loan repayment
type FlexibleLoanRepayHistory ¶
type FlexibleLoanRepayHistory struct { Rows []FlexibleLoanRepayHistoryItem `json:"rows"` Total int64 `json:"total"` }
FlexibleLoanRepayHistory stores flexible loan repayment history
type FlexibleLoanRepayHistoryItem ¶
type FlexibleLoanRepayHistoryItem struct { LoanCoin currency.Code `json:"loanCoin"` RepayAmount float64 `json:"repayAmount,string"` CollateralCoin currency.Code `json:"collateralCoin"` CollateralReturn float64 `json:"collateralReturn,string"` RepayStatus string `json:"repayStatus"` RepayTime binanceTime `json:"repayTime"` }
FlexibleLoanRepayHistoryItem stores a flexible loan repayment history item
type ForcedOrdersData ¶
type ForcedOrdersData struct { OrderID int64 `json:"orderId"` Symbol string `json:"symbol"` Status string `json:"status"` ClientOrderID string `json:"clientOrderId"` Price float64 `json:"price,string"` AvgPrice float64 `json:"avgPrice,string"` OrigQty float64 `json:"origQty,string"` ExecutedQty float64 `json:"executedQty,string"` CumQuote float64 `json:"cumQuote,string"` TimeInForce string `json:"timeInForce"` OrderType string `json:"orderType"` ReduceOnly bool `json:"reduceOnly"` ClosePosition bool `json:"closePosition"` Side string `json:"side"` PositionSide string `json:"positionSide"` StopPrice float64 `json:"stopPrice,string"` WorkingType string `json:"workingType"` PriceProtect float64 `json:"priceProtect,string"` OrigType string `json:"origType"` Time int64 `json:"time"` UpdateTime int64 `json:"updateTime"` }
ForcedOrdersData stores forced orders data
type FundingRateData ¶
type FundingRateData struct { Symbol string `json:"symbol"` FundingRate float64 `json:"fundingRate,string"` FundingTime int64 `json:"fundingTime"` }
FundingRateData stores funding rates data
type FundingRateHistory ¶
type FundingRateHistory struct { Symbol string `json:"symbol"` FundingRate float64 `json:"fundingRate,string"` FundingTime int64 `json:"fundingTime"` }
FundingRateHistory stores funding rate history
type FundingRateInfoResponse ¶
type FundingRateInfoResponse struct { Symbol string `json:"symbol"` AdjustedFundingRateCap types.Number `json:"adjustedFundingRateCap"` AdjustedFundingRateFloor types.Number `json:"adjustedFundingRateFloor"` FundingIntervalHours int64 `json:"fundingIntervalHours"` Disclaimer bool `json:"disclaimer"` }
FundingRateInfoResponse stores funding rate info
type FuturesAccountAsset ¶
type FuturesAccountAsset struct { Asset string `json:"asset"` WalletBalance float64 `json:"walletBalance,string"` UnrealizedProfit float64 `json:"unrealizedProfit,string"` MarginBalance float64 `json:"marginBalance,string"` MaintenanceMargin float64 `json:"maintMargin,string"` InitialMargin float64 `json:"initialMargin,string"` PositionInitialMargin float64 `json:"positionInitialMargin,string"` OpenOrderInitialMargin float64 `json:"openOrderInitialMargin,string"` MaxWithdrawAmount float64 `json:"maxWithdrawAmount,string"` CrossWalletBalance float64 `json:"crossWalletBalance,string"` CrossUnPNL float64 `json:"crossUnPnl,string"` AvailableBalance float64 `json:"availableBalance,string"` }
FuturesAccountAsset holds account asset information
type FuturesAccountBalanceData ¶
type FuturesAccountBalanceData struct { AccountAlias string `json:"accountAlias"` Asset string `json:"asset"` Balance float64 `json:"balance,string"` WithdrawAvailable float64 `json:"withdrawAvailable,string"` CrossWalletBalance float64 `json:"crossWalletBalance,string"` CrossUnPNL float64 `json:"crossUnPNL,string"` AvailableBalance float64 `json:"availableBalance,string"` UpdateTime int64 `json:"updateTime"` }
FuturesAccountBalanceData stores account balance data for futures
type FuturesAccountInformation ¶
type FuturesAccountInformation struct { Assets []FuturesAccountAsset `json:"assets"` Positions []FuturesAccountInformationPosition `json:"positions"` CanDeposit bool `json:"canDeposit"` CanTrade bool `json:"canTrade"` CanWithdraw bool `json:"canWithdraw"` FeeTier int64 `json:"feeTier"` UpdateTime time.Time `json:"updateTime"` }
FuturesAccountInformation stores account information for futures account
func (*FuturesAccountInformation) UnmarshalJSON ¶
func (a *FuturesAccountInformation) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type FuturesAccountInformationPosition ¶
type FuturesAccountInformationPosition struct { Symbol string `json:"symbol"` Amount float64 `json:"positionAmt,string"` InitialMargin float64 `json:"initialMargin,string"` MaintenanceMargin float64 `json:"maintMargin,string"` UnrealizedProfit float64 `json:"unrealizedProfit,string"` PositionInitialMargin float64 `json:"positionInitialMargin,string"` OpenOrderInitialMargin float64 `json:"openOrderInitialMargin,string"` Leverage float64 `json:"leverage,string"` Isolated bool `json:"isolated"` PositionSide string `json:"positionSide"` EntryPrice float64 `json:"entryPrice,string"` MaxQty float64 `json:"maxQty,string"` UpdateTime time.Time `json:"updateTime"` NotionalValue float64 `json:"notionalValue,string"` IsolatedWallet float64 `json:"isolatedWallet,string"` }
FuturesAccountInformationPosition holds account position data
func (*FuturesAccountInformationPosition) UnmarshalJSON ¶
func (a *FuturesAccountInformationPosition) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type FuturesAccountTradeList ¶
type FuturesAccountTradeList struct { Symbol string `json:"symbol"` ID int64 `json:"id"` OrderID int64 `json:"orderID"` Pair string `json:"pair"` Side string `json:"side"` Price string `json:"price"` Qty float64 `json:"qty"` RealizedPNL float64 `json:"realizedPNL"` MarginAsset string `json:"marginAsset"` BaseQty float64 `json:"baseQty"` Commission float64 `json:"commission"` CommissionAsset string `json:"commissionAsset"` Timestamp int64 `json:"timestamp"` PositionSide string `json:"positionSide"` Buyer bool `json:"buyer"` Maker bool `json:"maker"` }
FuturesAccountTradeList stores account trade list data
type FuturesBasisData ¶
type FuturesBasisData struct { Pair string `json:"pair"` ContractType string `json:"contractType"` FuturesPrice float64 `json:"futuresPrice,string"` IndexPrice float64 `json:"indexPrice,string"` Basis float64 `json:"basis,string"` BasisRate float64 `json:"basisRate,string"` Timestamp int64 `json:"timestamp"` }
FuturesBasisData gets futures basis data
type FuturesCandleStick ¶
type FuturesCandleStick struct { OpenTime time.Time Open float64 High float64 Low float64 Close float64 Volume float64 CloseTime time.Time BaseAssetVolume float64 NumberOfTrades int64 TakerBuyVolume float64 TakerBuyBaseAssetVolume float64 }
FuturesCandleStick holds kline data
type FuturesIncomeHistoryData ¶
type FuturesIncomeHistoryData struct { Symbol string `json:"symbol"` IncomeType string `json:"incomeType"` Income float64 `json:"income,string"` Asset string `json:"asset"` Info string `json:"info"` Timestamp int64 `json:"time"` }
FuturesIncomeHistoryData stores futures income history data
type FuturesLeverageData ¶
type FuturesLeverageData struct { Leverage int64 `json:"leverage"` MaxQty float64 `json:"maxQty,string"` Symbol string `json:"symbol"` }
FuturesLeverageData stores leverage data for futures
type FuturesMarginUpdatedResponse ¶
type FuturesMarginUpdatedResponse struct { Amount float64 `json:"amount"` Type int `json:"type"` GenericAuthResponse }
FuturesMarginUpdatedResponse stores margin update response data
type FuturesNewOrderRequest ¶
type FuturesNewOrderRequest struct { Symbol currency.Pair Side string PositionSide string OrderType string TimeInForce RequestParamsTimeForceType NewClientOrderID string ClosePosition string WorkingType string NewOrderRespType string Quantity float64 Price float64 StopPrice float64 ActivationPrice float64 CallbackRate float64 ReduceOnly bool PriceProtect bool }
FuturesNewOrderRequest stores all the data needed to submit a delivery/coin-margined-futures order.
type FuturesOrderData ¶
type FuturesOrderData struct { AvgPrice float64 `json:"avgPrice,string"` ClientOrderID string `json:"clientOrderId"` CumBase string `json:"cumBase"` ExecutedQty float64 `json:"executedQty,string"` OrderID int64 `json:"orderId"` OrigQty float64 `json:"origQty,string"` OrigType string `json:"origType"` Price float64 `json:"price,string"` ReduceOnly bool `json:"reduceOnly"` Side string `json:"side"` PositionSide string `json:"positionSide"` Status string `json:"status"` StopPrice float64 `json:"stopPrice,string"` ClosePosition bool `json:"closePosition"` Symbol string `json:"symbol"` Pair string `json:"pair"` Time time.Time `json:"time"` TimeInForce string `json:"timeInForce"` OrderType string `json:"type"` ActivatePrice float64 `json:"activatePrice,string"` PriceRate float64 `json:"priceRate,string"` UpdateTime time.Time `json:"updateTime"` WorkingType string `json:"workingType"` PriceProtect bool `json:"priceProtect"` }
FuturesOrderData stores order data for futures
func (*FuturesOrderData) UnmarshalJSON ¶
func (a *FuturesOrderData) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type FuturesOrderGetData ¶
type FuturesOrderGetData struct { AveragePrice float64 `json:"avgPrice,string"` ClientOrderID string `json:"clientOrderID"` CumulativeQuantity float64 `json:"cumQty,string"` CumulativeBase float64 `json:"cumBase,string"` ExecutedQuantity float64 `json:"executedQty,string"` OrderID int64 `json:"orderId"` OriginalQuantity float64 `json:"origQty,string"` OriginalType string `json:"origType"` Price float64 `json:"price,string"` ReduceOnly bool `json:"reduceOnly"` Side string `json:"buy"` PositionSide string `json:"positionSide"` Status string `json:"status"` StopPrice float64 `json:"stopPrice,string"` ClosePosition bool `json:"closePosition"` Symbol string `json:"symbol"` Pair string `json:"pair"` TimeInForce string `json:"timeInForce"` OrderType string `json:"type"` ActivatePrice float64 `json:"activatePrice,string"` PriceRate float64 `json:"priceRate,string"` Time time.Time `json:"time"` UpdateTime time.Time `json:"updateTime"` WorkingType string `json:"workingType"` PriceProtect bool `json:"priceProtect"` }
FuturesOrderGetData stores futures order data for get requests
func (*FuturesOrderGetData) UnmarshalJSON ¶
func (a *FuturesOrderGetData) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type FuturesOrderPlaceData ¶
type FuturesOrderPlaceData struct { ClientOrderID string `json:"clientOrderId"` CumQty float64 `json:"cumQty,string"` CumBase float64 `json:"cumBase,string"` ExecuteQty float64 `json:"executedQty,string"` OrderID int64 `json:"orderId"` AvgPrice float64 `json:"avgPrice,string"` OrigQty float64 `json:"origQty,string"` Price float64 `json:"price,string"` ReduceOnly bool `json:"reduceOnly"` Side string `json:"side"` PositionSide string `json:"positionSide"` Status string `json:"status"` StopPrice float64 `json:"stopPrice,string"` ClosePosition bool `json:"closePosition"` Symbol string `json:"symbol"` Pair string `json:"pair"` TimeInForce string `json:"TimeInForce"` OrderType string `json:"type"` OrigType string `json:"origType"` ActivatePrice float64 `json:"activatePrice,string"` PriceRate float64 `json:"priceRate,string"` UpdateTime int64 `json:"updateTime"` WorkingType string `json:"workingType"` PriceProtect bool `json:"priceProtect"` }
FuturesOrderPlaceData stores futures order data
type FuturesPositionInformation ¶
type FuturesPositionInformation struct { Symbol string `json:"symbol"` PositionAmount float64 `json:"positionAmt,string"` EntryPrice float64 `json:"entryPrice,string"` MarkPrice float64 `json:"markPrice,string"` UnRealizedProfit float64 `json:"unRealizedProfit,string"` LiquidationPrice float64 `json:"liquidationPrice,string"` Leverage float64 `json:"leverage,string"` MaxQty float64 `json:"maxQty,string"` MarginType string `json:"marginType"` IsolatedMargin float64 `json:"isolatedMargin,string"` IsAutoAddMargin bool `json:"isAutoAddMargin,string"` PositionSide string `json:"positionSide"` NotionalValue float64 `json:"notionalValue,string"` IsolatedWallet float64 `json:"isolatedWallet,string"` UpdateTime binanceTime `json:"updateTime"` }
FuturesPositionInformation stores futures position info
type FuturesPublicTradesData ¶
type FuturesPublicTradesData struct { ID int64 `json:"id"` Price float64 `json:"price,string"` Qty float64 `json:"qty,string"` QuoteQty float64 `json:"quoteQty,string"` Time binanceTime `json:"time"` IsBuyerMaker bool `json:"isBuyerMaker"` }
FuturesPublicTradesData stores recent public trades for futures
type GenericAuthResponse ¶
GenericAuthResponse is a general data response for a post auth request
type GetPositionMarginChangeHistoryData ¶
type GetPositionMarginChangeHistoryData struct { Amount float64 `json:"amount"` Asset string `json:"asset"` Symbol string `json:"symbol"` Timestamp int64 `json:"time"` MarginChangeType int64 `json:"type"` PositionSide string `json:"positionSide"` }
GetPositionMarginChangeHistoryData gets margin change history for positions
type GlobalLongShortRatio ¶
type GlobalLongShortRatio struct { Symbol string `json:"symbol"` LongShortRatio float64 `json:"longShortRatio"` LongAccount float64 `json:"longAccount"` ShortAccount float64 `json:"shortAccount"` Timestamp string `json:"timestamp"` }
GlobalLongShortRatio stores ratio data of all longs vs shorts
type HistoricalTrade ¶
type HistoricalTrade struct { ID int64 `json:"id"` Price float64 `json:"price,string"` Quantity float64 `json:"qty,string"` QuoteQuantity float64 `json:"quoteQty,string"` Time time.Time `json:"time"` IsBuyerMaker bool `json:"isBuyerMaker"` IsBestMatch bool `json:"isBestMatch"` }
HistoricalTrade holds recent trade data
func (*HistoricalTrade) UnmarshalJSON ¶
func (a *HistoricalTrade) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type IndexMarkPrice ¶
type IndexMarkPrice struct { Symbol string `json:"symbol"` Pair string `json:"pair"` MarkPrice types.Number `json:"markPrice"` IndexPrice types.Number `json:"indexPrice"` EstimatedSettlePrice types.Number `json:"estimatedSettlePrice"` LastFundingRate types.Number `json:"lastFundingRate"` NextFundingTime int64 `json:"nextFundingTime"` Time int64 `json:"time"` }
IndexMarkPrice stores data for index and mark prices
type InterestHistoryData ¶
type InterestHistoryData struct { Asset string `json:"asset"` Interest float64 `json:"interest"` LendingType string `json:"lendingType"` ProductName string `json:"productName"` Time string `json:"time"` }
InterestHistoryData gets interest history data
type KlineStream ¶
type KlineStream struct { EventType string `json:"e"` EventTime time.Time `json:"E"` Symbol string `json:"s"` Kline KlineStreamData `json:"k"` }
KlineStream holds the kline stream data
func (*KlineStream) UnmarshalJSON ¶
func (a *KlineStream) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type KlineStreamData ¶
type KlineStreamData struct { StartTime time.Time `json:"t"` CloseTime time.Time `json:"T"` Symbol string `json:"s"` Interval string `json:"i"` FirstTradeID int64 `json:"f"` LastTradeID int64 `json:"L"` OpenPrice types.Number `json:"o"` ClosePrice types.Number `json:"c"` HighPrice types.Number `json:"h"` LowPrice types.Number `json:"l"` Volume types.Number `json:"v"` NumberOfTrades int64 `json:"n"` KlineClosed bool `json:"x"` Quote types.Number `json:"q"` TakerBuyBaseAssetVolume types.Number `json:"V"` TakerBuyQuoteAssetVolume types.Number `json:"Q"` }
KlineStreamData defines kline streaming data
type KlinesRequestParams ¶
type KlinesRequestParams struct { Symbol currency.Pair // Required field; example LTCBTC, BTCUSDT Interval string // Time interval period Limit int // Default 500; max 500. StartTime time.Time EndTime time.Time }
KlinesRequestParams represents Klines request data.
type LevelDetail ¶
type LevelDetail struct { Level string `json:"level"` MaxBorrowable float64 `json:"maxBorrowable,string"` InterestRate float64 `json:"interestRate,string"` }
LevelDetail stores level detail data
type LoanBorrowHistory ¶
type LoanBorrowHistory struct { Rows []LoanBorrowHistoryItem `json:"rows"` Total int64 `json:"total"` }
LoanBorrowHistory stores loan borrow history data
type LoanBorrowHistoryItem ¶
type LoanBorrowHistoryItem struct { OrderID int64 `json:"orderId"` LoanCoin currency.Code `json:"loanCoin"` InitialLoanAmount float64 `json:"initialLoanAmount,string"` HourlyInterestRate float64 `json:"hourlyInterestRate,string"` LoanTerm int64 `json:"loanTerm,string"` CollateralCoin currency.Code `json:"collateralCoin"` InitialCollateralAmount float64 `json:"initialCollateralAmount,string"` BorrowTime binanceTime `json:"borrowTime"` Status string `json:"status"` }
LoanBorrowHistoryItem stores loan borrow history item data
type LoanableAssetItem ¶
type LoanableAssetItem struct { LoanCoin currency.Code `json:"loanCoin"` SevenDayHourlyInterestRate float64 `json:"_7dHourlyInterestRate,string"` SevenDayDailyInterestRate float64 `json:"_7dDailyInterestRate,string"` FourteenDayHourlyInterest float64 `json:"_14dHourlyInterestRate,string"` FourteenDayDailyInterest float64 `json:"_14dDailyInterestRate,string"` ThirtyDayHourlyInterest float64 `json:"_30dHourlyInterestRate,string"` ThirtyDayDailyInterest float64 `json:"_30dDailyInterestRate,string"` NinetyDayHourlyInterest float64 `json:"_90dHourlyInterestRate,string"` NinetyDayDailyInterest float64 `json:"_90dDailyInterestRate,string"` OneHundredAndEightyDayHourlyInterest float64 `json:"_180dHourlyInterestRate,string"` OneHundredAndEightyDayDailyInterest float64 `json:"_180dDailyInterestRate,string"` MinimumLimit float64 `json:"minLimit,string"` MaximumLimit float64 `json:"maxLimit,string"` VIPLevel int64 `json:"vipLevel"` }
LoanableAssetItem stores loanable asset item data
type LoanableAssetsData ¶
type LoanableAssetsData struct { Rows []LoanableAssetItem `json:"rows"` Total int64 `json:"total"` }
LoanableAssetsData stores loanable assets data
type MarginAccount ¶
type MarginAccount struct { BorrowEnabled bool `json:"borrowEnabled"` MarginLevel float64 `json:"marginLevel,string"` TotalAssetOfBtc float64 `json:"totalAssetOfBtc,string"` TotalLiabilityOfBtc float64 `json:"totalLiabilityOfBtc,string"` TotalNetAssetOfBtc float64 `json:"totalNetAssetOfBtc,string"` TradeEnabled bool `json:"tradeEnabled"` TransferEnabled bool `json:"transferEnabled"` UserAssets []MarginAccountAsset `json:"userAssets"` }
MarginAccount holds the margin account data
type MarginAccountAsset ¶
type MarginAccountAsset struct { Asset string `json:"asset"` Borrowed float64 `json:"borrowed,string"` Free float64 `json:"free,string"` Interest float64 `json:"interest,string"` Locked float64 `json:"locked,string"` NetAsset float64 `json:"netAsset,string"` }
MarginAccountAsset holds each individual margin account asset
type MarginInfoData ¶
type MarginInfoData struct { Data []struct { MarginRatio string `json:"marginRatio"` Base struct { AssetName string `json:"assetName"` LevelDetails []LevelDetail `json:"levelDetails"` } `json:"base"` Quote struct { AssetName string `json:"assetName"` LevelDetails []LevelDetail `json:"levelDetails"` } `json:"quote"` } `json:"data"` }
MarginInfoData stores margin info data
type MarkPriceData ¶
type MarkPriceData struct { Symbol string `json:"symbol"` MarkPrice float64 `json:"markPrice"` LastFundingRate float64 `json:"lastFundingRate"` NextFundingTime int64 `json:"nextFundingTime"` Time binanceTime `json:"time"` }
MarkPriceData stores mark price data for futures
type ModifyIsolatedMarginData ¶
type ModifyIsolatedMarginData struct { Amount float64 `json:"amount"` Code int64 `json:"code"` Msg string `json:"msg"` ModType string `json:"modType"` }
ModifyIsolatedMarginData stores margin modification data
type NewOrderRequest ¶
type NewOrderRequest struct { // Symbol (currency pair to trade) Symbol currency.Pair // Side Buy or Sell Side string // TradeType (market or limit order) TradeType RequestParamsOrderType // TimeInForce specifies how long the order remains in effect. // Examples are (Good Till Cancel (GTC), Immediate or Cancel (IOC) and Fill Or Kill (FOK)) TimeInForce RequestParamsTimeForceType // Quantity is the total base qty spent or received in an order. Quantity float64 // QuoteOrderQty is the total quote qty spent or received in a MARKET order. QuoteOrderQty float64 Price float64 NewClientOrderID string StopPrice float64 // Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders. IcebergQty float64 // Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order. NewOrderRespType string }
NewOrderRequest request type
type NewOrderResponse ¶
type NewOrderResponse struct { Code int `json:"code"` Msg string `json:"msg"` Symbol string `json:"symbol"` OrderID int64 `json:"orderId"` ClientOrderID string `json:"clientOrderId"` TransactionTime time.Time `json:"transactTime"` Price float64 `json:"price,string"` OrigQty float64 `json:"origQty,string"` ExecutedQty float64 `json:"executedQty,string"` // The cumulative amount of the quote that has been spent (with a BUY order) or received (with a SELL order). CumulativeQuoteQty float64 `json:"cummulativeQuoteQty,string"` Status string `json:"status"` TimeInForce string `json:"timeInForce"` Type string `json:"type"` Side string `json:"side"` Fills []struct { Price float64 `json:"price,string"` Qty float64 `json:"qty,string"` Commission float64 `json:"commission,string"` CommissionAsset string `json:"commissionAsset"` } `json:"fills"` }
NewOrderResponse is the return structured response from the exchange
func (*NewOrderResponse) UnmarshalJSON ¶
func (a *NewOrderResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type NotionalBracketData ¶
type NotionalBracketData struct { Pair string `json:"pair"` Brackets []struct { Bracket int64 `json:"bracket"` InitialLeverage float64 `json:"initialLeverage"` QtyCap float64 `json:"qtyCap"` QtylFloor float64 `json:"qtyFloor"` MaintMarginRatio float64 `json:"maintMarginRatio"` } }
NotionalBracketData stores notional bracket data
type OpenInterestData ¶
type OpenInterestData struct { Symbol string `json:"symbol"` Pair string `json:"pair"` OpenInterest float64 `json:"openInterest,string"` ContractType string `json:"contractType"` Time int64 `json:"time"` }
OpenInterestData stores open interest data
type OpenInterestStats ¶
type OpenInterestStats struct { Pair string `json:"pair"` ContractType string `json:"contractType"` SumOpenInterest float64 `json:"sumOpenInterest,string"` SumOpenInterestValue float64 `json:"sumOpenInterestValue,string"` Timestamp int64 `json:"timestamp"` }
OpenInterestStats stores stats for open interest data
type OrderBook ¶
type OrderBook struct { Symbol string LastUpdateID int64 Code int Msg string Bids []OrderbookItem Asks []OrderbookItem }
OrderBook actual structured data that can be used for orderbook
type OrderBookData ¶
type OrderBookData struct { Code int `json:"code"` Msg string `json:"msg"` LastUpdateID int64 `json:"lastUpdateId"` Bids [][2]string `json:"bids"` Asks [][2]string `json:"asks"` }
OrderBookData is resp data from orderbook endpoint
type OrderBookDataRequestParams ¶
type OrderBookDataRequestParams struct { Symbol currency.Pair `json:"symbol"` // Required field; example LTCBTC,BTCUSDT Limit int `json:"limit"` // Default 100; max 1000. Valid limits:[5, 10, 20, 50, 100, 500, 1000] }
OrderBookDataRequestParams represents Klines request data.
type OrderbookData ¶
type OrderbookData struct { LastUpdateID int64 `json:"lastUpdateID"` Timestamp int64 `json:"T"` Bids [][2]string `json:"bids"` Asks [][2]string `json:"asks"` }
OrderbookData stores ob data for umargined and cmargined futures
type OrderbookItem ¶
OrderbookItem stores an individual orderbook item
type PerpsExchangeInfo ¶
type PerpsExchangeInfo struct {
Symbols []SymbolsData `json:"symbols"`
}
PerpsExchangeInfo stores data for perps
type PlaceBatchOrderData ¶
type PlaceBatchOrderData struct { Symbol string `json:"symbol"` Side string `json:"side"` PositionSide string `json:"positionSide,omitempty"` OrderType string `json:"type"` TimeInForce string `json:"timeInForce,omitempty"` Quantity float64 `json:"quantity"` ReduceOnly string `json:"reduceOnly,omitempty"` Price float64 `json:"price"` NewClientOrderID string `json:"newClientOrderId,omitempty"` StopPrice float64 `json:"stopPrice,omitempty"` ActivationPrice float64 `json:"activationPrice,omitempty"` CallbackRate float64 `json:"callbackRate,omitempty"` WorkingType string `json:"workingType,omitempty"` PriceProtect string `json:"priceProtect,omitempty"` NewOrderRespType string `json:"newOrderRespType,omitempty"` }
PlaceBatchOrderData stores batch order data for placing
type PriceChangeStats ¶
type PriceChangeStats struct { Symbol string `json:"symbol"` PriceChange float64 `json:"priceChange,string"` PriceChangePercent float64 `json:"priceChangePercent,string"` WeightedAvgPrice float64 `json:"weightedAvgPrice,string"` PrevClosePrice float64 `json:"prevClosePrice,string"` LastPrice float64 `json:"lastPrice,string"` LastQty float64 `json:"lastQty,string"` BidPrice float64 `json:"bidPrice,string"` AskPrice float64 `json:"askPrice,string"` OpenPrice float64 `json:"openPrice,string"` HighPrice float64 `json:"highPrice,string"` LowPrice float64 `json:"lowPrice,string"` Volume float64 `json:"volume,string"` QuoteVolume float64 `json:"quoteVolume,string"` OpenTime time.Time `json:"openTime"` CloseTime time.Time `json:"closeTime"` FirstID int64 `json:"firstId"` LastID int64 `json:"lastId"` Count int64 `json:"count"` }
PriceChangeStats contains statistics for the last 24 hours trade
func (*PriceChangeStats) UnmarshalJSON ¶
func (a *PriceChangeStats) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type QueryOrderData ¶
type QueryOrderData struct { Code int `json:"code"` Msg string `json:"msg"` Symbol string `json:"symbol"` OrderID int64 `json:"orderId"` ClientOrderID string `json:"clientOrderId"` Price float64 `json:"price,string"` OrigQty float64 `json:"origQty,string"` ExecutedQty float64 `json:"executedQty,string"` Status string `json:"status"` TimeInForce string `json:"timeInForce"` Type string `json:"type"` Side string `json:"side"` StopPrice float64 `json:"stopPrice,string"` IcebergQty float64 `json:"icebergQty,string"` Time time.Time `json:"time"` IsWorking bool `json:"isWorking"` CummulativeQuoteQty float64 `json:"cummulativeQuoteQty,string"` OrderListID int64 `json:"orderListId"` OrigQuoteOrderQty float64 `json:"origQuoteOrderQty,string"` UpdateTime time.Time `json:"updateTime"` }
QueryOrderData holds query order data
func (*QueryOrderData) UnmarshalJSON ¶
func (a *QueryOrderData) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type RateLimit ¶
type RateLimit struct { SpotRate *rate.Limiter SpotOrdersRate *rate.Limiter UFuturesRate *rate.Limiter UFuturesOrdersRate *rate.Limiter CFuturesRate *rate.Limiter CFuturesOrdersRate *rate.Limiter }
RateLimit implements the request.Limiter interface
func SetRateLimit ¶
func SetRateLimit() *RateLimit
SetRateLimit returns the rate limit for the exchange
type RecentTrade ¶
type RecentTrade struct { ID int64 `json:"id"` Price float64 `json:"price,string"` Quantity float64 `json:"qty,string"` Time time.Time `json:"time"` IsBuyerMaker bool `json:"isBuyerMaker"` IsBestMatch bool `json:"isBestMatch"` }
RecentTrade holds recent trade data
func (*RecentTrade) UnmarshalJSON ¶
func (a *RecentTrade) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type RecentTradeRequestParams ¶
type RecentTradeRequestParams struct { Symbol currency.Pair `json:"symbol"` // Required field. example LTCBTC, BTCUSDT Limit int `json:"limit"` // Default 500; max 500. }
RecentTradeRequestParams represents Klines request data.
type RequestParamsOrderType ¶
type RequestParamsOrderType string
RequestParamsOrderType trade order type
type RequestParamsTimeForceType ¶
type RequestParamsTimeForceType string
RequestParamsTimeForceType Time in force
type SymbolOrderBookTicker ¶
type SymbolOrderBookTicker struct { Symbol string `json:"symbol"` BidPrice float64 `json:"bidPrice,string"` AskPrice float64 `json:"askPrice,string"` BidQty float64 `json:"bidQty,string"` AskQty float64 `json:"askQty,string"` Time int64 `json:"time"` }
SymbolOrderBookTicker stores orderbook ticker data
type SymbolPrice ¶
SymbolPrice holds basic symbol price
type SymbolPriceTicker ¶
type SymbolPriceTicker struct { Symbol string `json:"symbol"` Price float64 `json:"price,string"` Time int64 `json:"time"` }
SymbolPriceTicker stores ticker price stats
type SymbolsData ¶
type SymbolsData struct {
Symbol string `json:"symbol"`
}
SymbolsData stores perp futures' symbols
type TakerBuySellVolume ¶
type TakerBuySellVolume struct { Pair string `json:"pair"` ContractType string `json:"contractType"` TakerBuyVolume float64 `json:"takerBuyVol,string"` BuySellRatio float64 `json:"takerSellVol,string"` BuyVol float64 `json:"takerBuyVolValue,string"` SellVol float64 `json:"takerSellVolValue,string"` Timestamp int64 `json:"timestamp"` }
TakerBuySellVolume stores taker buy sell volume
type TickerStream ¶
type TickerStream struct { EventType string `json:"e"` EventTime time.Time `json:"E"` Symbol string `json:"s"` PriceChange types.Number `json:"p"` PriceChangePercent types.Number `json:"P"` WeightedAvgPrice types.Number `json:"w"` ClosePrice types.Number `json:"x"` LastPrice types.Number `json:"c"` LastPriceQuantity types.Number `json:"Q"` BestBidPrice types.Number `json:"b"` BestBidQuantity types.Number `json:"B"` BestAskPrice types.Number `json:"a"` BestAskQuantity types.Number `json:"A"` OpenPrice types.Number `json:"o"` HighPrice types.Number `json:"h"` LowPrice types.Number `json:"l"` TotalTradedVolume types.Number `json:"v"` TotalTradedQuoteVolume types.Number `json:"q"` OpenTime time.Time `json:"O"` CloseTime time.Time `json:"C"` FirstTradeID int64 `json:"F"` LastTradeID int64 `json:"L"` NumberOfTrades int64 `json:"n"` }
TickerStream holds the ticker stream data
func (*TickerStream) UnmarshalJSON ¶
func (a *TickerStream) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type TopTraderAccountRatio ¶
type TopTraderAccountRatio struct { Pair string `json:"pair"` LongShortRatio float64 `json:"longShortRatio,string"` LongAccount float64 `json:"longAccount,string"` ShortAccount float64 `json:"shortAccount,string"` Timestamp int64 `json:"timestamp"` }
TopTraderAccountRatio stores account ratio data for top traders
type TopTraderPositionRatio ¶
type TopTraderPositionRatio struct { Pair string `json:"pair"` LongShortRatio float64 `json:"longShortRatio,string"` LongPosition float64 `json:"longPosition,string"` ShortPosition float64 `json:"shortPosition,string"` Timestamp int64 `json:"timestamp"` }
TopTraderPositionRatio stores position ratio for top trader accounts
type TradeStream ¶
type TradeStream struct { EventType string `json:"e"` EventTime time.Time `json:"E"` Symbol string `json:"s"` TradeID int64 `json:"t"` Price types.Number `json:"p"` Quantity types.Number `json:"q"` BuyerOrderID int64 `json:"b"` SellerOrderID int64 `json:"a"` TimeStamp time.Time `json:"T"` Maker bool `json:"m"` BestMatchPrice bool `json:"M"` }
TradeStream holds the trade stream data
func (*TradeStream) UnmarshalJSON ¶
func (a *TradeStream) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type U24HrPriceChangeStats ¶
type U24HrPriceChangeStats struct { Symbol string `json:"symbol"` PriceChange float64 `json:"priceChange,string"` PriceChangePercent float64 `json:"priceChangePercent,string"` WeightedAvgPrice float64 `json:"weightedAvgPrice,string"` PrevClosePrice float64 `json:"prevClosePrice,string"` LastPrice float64 `json:"lastPrice,string"` LastQty float64 `json:"lastQty,string"` OpenPrice float64 `json:"openPrice,string"` HighPrice float64 `json:"highPrice,string"` LowPrice float64 `json:"lowPrice,string"` Volume float64 `json:"volume,string"` QuoteVolume float64 `json:"quoteVolume,string"` OpenTime int64 `json:"openTime"` CloseTime int64 `json:"closeTime"` FirstID int64 `json:"firstId"` LastID int64 `json:"lastId"` Count int64 `json:"count"` }
U24HrPriceChangeStats stores price change stats data
type UAccountBalanceV2Data ¶
type UAccountBalanceV2Data struct { AccountAlias string `json:"accountAlias"` Asset string `json:"asset"` Balance float64 `json:"balance,string"` CrossWalletBalance float64 `json:"crossWalletBalance,string"` CrossUnrealizedPNL float64 `json:"crossUnPnl,string"` AvailableBalance float64 `json:"availableBalance,string"` MaxWithdrawAmount float64 `json:"maxWithdrawAmount,string"` }
UAccountBalanceV2Data stores account balance data for ufutures
type UAccountIncomeHistory ¶
type UAccountIncomeHistory struct { Symbol string `json:"symbol"` IncomeType string `json:"incomeType"` Income float64 `json:"income,string"` Asset string `json:"asset"` Info string `json:"info"` Time int64 `json:"time"` TranID int64 `json:"tranId"` TradeID string `json:"tradeId"` }
UAccountIncomeHistory stores income history data
type UAccountInformationV2Data ¶
type UAccountInformationV2Data struct { FeeTier int64 `json:"feeTier"` CanTrade bool `json:"canTrade"` CanDeposit bool `json:"canDeposit"` CanWithdraw bool `json:"canWithdraw"` UpdateTime int64 `json:"updateTime"` MultiAssetsMargin bool `json:"multiAssetsMargin"` TotalInitialMargin float64 `json:"totalInitialMargin,string"` TotalMaintenanceMargin float64 `json:"totalMaintMargin,string"` TotalWalletBalance float64 `json:"totalWalletBalance,string"` TotalUnrealizedProfit float64 `json:"totalUnrealizedProfit,string"` TotalMarginBalance float64 `json:"totalMarginBalance,string"` TotalPositionInitialMargin float64 `json:"totalPositionInitialMargin,string"` TotalOpenOrderInitialMargin float64 `json:"totalOpenOrderInitialMargin,string"` TotalCrossWalletBalance float64 `json:"totalCrossWalletBalance,string"` TotalCrossUnrealizedPNL float64 `json:"totalCrossUnPnl,string"` AvailableBalance float64 `json:"availableBalance,string"` MaxWithdrawAmount float64 `json:"maxWithdrawAmount,string"` Assets []UAsset `json:"assets"` Positions []UPosition `json:"positions"` }
UAccountInformationV2Data stores account info for ufutures
type UAccountTradeHistory ¶
type UAccountTradeHistory struct { Buyer bool `json:"buyer"` Commission float64 `json:"commission,string"` CommissionAsset string `json:"commissionAsset"` ID int64 `json:"id"` Maker bool `json:"maker"` OrderID int64 `json:"orderId"` Price float64 `json:"price,string"` Qty float64 `json:"qty,string"` QuoteQty float64 `json:"quoteQty"` RealizedPNL float64 `json:"realizedPnl,string"` Side string `json:"side"` PositionSide string `json:"positionSide"` Symbol string `json:"symbol"` Time int64 `json:"time"` }
UAccountTradeHistory stores trade data for the users account
type UAsset ¶
type UAsset struct { Asset string `json:"asset"` WalletBalance float64 `json:"walletBalance,string"` UnrealizedProfit float64 `json:"unrealizedProfit,string"` MarginBalance float64 `json:"marginBalance,string"` MaintenanceMargin float64 `json:"maintMargin,string"` InitialMargin float64 `json:"initialMargin,string"` PositionInitialMargin float64 `json:"positionInitialMargin,string"` OpenOrderInitialMargin float64 `json:"openOrderInitialMargin,string"` CrossWalletBalance float64 `json:"crossWalletBalance,string"` CrossUnPnl float64 `json:"crossUnPnl,string"` AvailableBalance float64 `json:"availableBalance,string"` MaxWithdrawAmount float64 `json:"maxWithdrawAmount,string"` }
UAsset holds account asset information
type UChangeInitialLeverage ¶
type UChangeInitialLeverage struct { Leverage int64 `json:"leverage"` MaxNotionalValue float64 `json:"maxNotionalValue,string"` Symbol string `json:"symbol"` }
UChangeInitialLeverage stores leverage change data
type UCompositeIndexInfoData ¶
type UCompositeIndexInfoData struct { Symbol string `json:"symbol"` Time int64 `json:"time"` BaseAssetList []struct { BaseAsset string `json:"baseAsset"` WeightInQuantity float64 `json:"weightInQuantity,string"` WeightInPercentage float64 `json:"weightInPercentage,string"` } `json:"baseAssetList"` }
UCompositeIndexInfoData stores composite index data for usdt margined futures
type UCompressedTradeData ¶
type UCompressedTradeData struct { AggregateTradeID int64 `json:"a"` Price float64 `json:"p,string"` Quantity float64 `json:"q,string"` FirstTradeID int64 `json:"f"` LastTradeID int64 `json:"l"` Timestamp int64 `json:"t"` IsBuyerMaker bool `json:"m"` }
UCompressedTradeData stores compressed trade data
type UForceOrdersData ¶
type UForceOrdersData struct { OrderID int64 `json:"orderId"` Symbol string `json:"symbol"` Status string `json:"status"` ClientOrderID string `json:"clientOrderId"` Price float64 `json:"price,string"` AvgPrice float64 `json:"avgPrice,string"` OrigQty float64 `json:"origQty,string"` ExecutedQty float64 `json:"executedQty,string"` CumQuote float64 `json:"cumQuote,string"` TimeInForce string `json:"timeInForce"` OrderType string `json:"type"` ReduceOnly bool `json:"reduceOnly"` ClosePosition bool `json:"closePosition"` Side string `json:"side"` PositionSide string `json:"positionSide"` StopPrice float64 `json:"stopPrice,string"` WorkingType string `json:"workingType"` PriceProtect bool `json:"priceProtect,string"` OrigType string `json:"origType"` Time int64 `json:"time"` UpdateTime int64 `json:"updateTime"` }
UForceOrdersData stores liquidation orders data for the account
type UFuturesExchangeInfo ¶
type UFuturesExchangeInfo struct { RateLimits []struct { Interval string `json:"interval"` IntervalNum int64 `json:"intervalNum"` Limit int64 `json:"limit"` RateLimitType string `json:"rateLimitType"` } `json:"rateLimits"` ServerTime int64 `json:"serverTime"` Symbols []UFuturesSymbolInfo `json:"symbols"` Timezone string `json:"timezone"` }
UFuturesExchangeInfo stores exchange info for ufutures
type UFuturesNewOrderRequest ¶
type UFuturesNewOrderRequest struct { Symbol currency.Pair `json:"symbol"` Side string `json:"side"` PositionSide string `json:"position_side"` OrderType string `json:"order_type"` TimeInForce string `json:"time_in_force"` NewClientOrderID string `json:"new_client_order_id"` ClosePosition string `json:"close_position"` WorkingType string `json:"working_type"` NewOrderRespType string `json:"new_order_resp_type"` Quantity float64 `json:"quantity"` Price float64 `json:"price"` StopPrice float64 `json:"stop_price"` ActivationPrice float64 `json:"activation_price"` CallbackRate float64 `json:"callback_rate"` ReduceOnly bool `json:"reduce_only"` }
UFuturesNewOrderRequest stores order data for placing
type UFuturesOrderData ¶
type UFuturesOrderData struct { AvgPrice float64 `json:"avgPrice,string"` ClientOrderID string `json:"clientOrderId"` CumQuote string `json:"cumQuote"` ExecutedQty float64 `json:"executedQty,string"` OrderID int64 `json:"orderId"` OrigQty float64 `json:"origQty,string"` OrigType string `json:"origType"` Price float64 `json:"price,string"` ReduceOnly bool `json:"reduceOnly"` Side string `json:"side"` PositionSide string `json:"positionSide"` Status string `json:"status"` StopPrice float64 `json:"stopPrice,string"` ClosePosition bool `json:"closePosition"` Symbol string `json:"symbol"` Time time.Time `json:"time"` TimeInForce string `json:"timeInForce"` OrderType string `json:"type"` ActivatePrice float64 `json:"activatePrice,string"` PriceRate float64 `json:"priceRate,string"` UpdateTime time.Time `json:"updateTime"` WorkingType string `json:"workingType"` }
UFuturesOrderData stores order data for ufutures
func (*UFuturesOrderData) UnmarshalJSON ¶
func (a *UFuturesOrderData) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type UFuturesSymbolInfo ¶
type UFuturesSymbolInfo struct { Symbol string `json:"symbol"` Pair string `json:"pair"` ContractType string `json:"contractType"` DeliveryDate binanceTime `json:"deliveryDate"` OnboardDate binanceTime `json:"onboardDate"` Status string `json:"status"` MaintenanceMarginPercent float64 `json:"maintMarginPercent,string"` RequiredMarginPercent float64 `json:"requiredMarginPercent,string"` BaseAsset string `json:"baseAsset"` QuoteAsset string `json:"quoteAsset"` MarginAsset string `json:"marginAsset"` PricePrecision int64 `json:"pricePrecision"` QuantityPrecision int64 `json:"quantityPrecision"` BaseAssetPrecision int64 `json:"baseAssetPrecision"` QuotePrecision int64 `json:"quotePrecision"` UnderlyingType string `json:"underlyingType"` UnderlyingSubType []string `json:"underlyingSubType"` SettlePlan float64 `json:"settlePlan"` TriggerProtect float64 `json:"triggerProtect,string"` Filters []struct { FilterType string `json:"filterType"` MinPrice float64 `json:"minPrice,string"` MaxPrice float64 `json:"maxPrice,string"` TickSize float64 `json:"tickSize,string"` StepSize float64 `json:"stepSize,string"` MaxQty float64 `json:"maxQty,string"` MinQty float64 `json:"minQty,string"` Limit int64 `json:"limit"` MultiplierDown float64 `json:"multiplierDown,string"` MultiplierUp float64 `json:"multiplierUp,string"` MultiplierDecimal float64 `json:"multiplierDecimal,string"` Notional float64 `json:"notional,string"` } `json:"filters"` OrderTypes []string `json:"OrderType"` TimeInForce []string `json:"timeInForce"` LiquidationFee float64 `json:"liquidationFee,string"` MarketTakeBound float64 `json:"marketTakeBound,string"` }
UFuturesSymbolInfo contains details of a currency symbol for a usdt margined future contract
type ULiquidationOrdersData ¶
type ULiquidationOrdersData struct { Symbol string `json:"symbol"` Price float64 `json:"price,string"` OrigQty float64 `json:"origQty,string"` ExecutedQty float64 `json:"executedQty,string"` AveragePrice float64 `json:"averagePrice,string"` Status string `json:"status"` TimeInForce string `json:"timeInForce"` OrderType string `json:"type"` Side string `json:"side"` Time int64 `json:"time"` }
ULiquidationOrdersData stores liquidation orders data
type ULongShortRatio ¶
type ULongShortRatio struct { Symbol string `json:"symbol"` LongShortRatio float64 `json:"longShortRatio,string"` LongAccount float64 `json:"longAccount,string"` ShortAccount float64 `json:"shortAccount,string"` Timestamp int64 `json:"timestamp"` }
ULongShortRatio stores top trader accounts' or positions' or global long/short ratio data
type UMarkPrice ¶
type UMarkPrice struct { Symbol string `json:"symbol"` MarkPrice float64 `json:"markPrice,string"` IndexPrice float64 `json:"indexPrice,string"` LastFundingRate float64 `json:"lastFundingRate,string"` EstimatedSettlePrice float64 `json:"estimatedSettlePrice,string"` NextFundingTime int64 `json:"nextFundingTime"` Time int64 `json:"time"` }
UMarkPrice stores mark price data
type UModifyIsolatedPosMargin ¶
type UModifyIsolatedPosMargin struct { Amount float64 `json:"amount,string"` MarginType int64 `json:"type"` }
UModifyIsolatedPosMargin stores modified isolated margin positions' data
type UNotionalLeverageAndBrakcetsData ¶
type UNotionalLeverageAndBrakcetsData struct { Symbol string `json:"symbol"` Brackets []struct { Bracket int64 `json:"bracket"` InitialLeverage float64 `json:"initialLeverage"` NotionalCap float64 `json:"notionalCap"` NotionalFloor float64 `json:"notionalFloor"` MaintenanceMarginRatio float64 `json:"maintMarginRatio"` Cumulative float64 `json:"cum"` } `json:"brackets"` }
UNotionalLeverageAndBrakcetsData stores notional and leverage brackets data for the account
type UOpenInterestData ¶
type UOpenInterestData struct { OpenInterest float64 `json:"openInterest,string"` Symbol string `json:"symbol"` Time int64 `json:"time"` }
UOpenInterestData stores open interest data
type UOpenInterestStats ¶
type UOpenInterestStats struct { Symbol string `json:"symbol"` SumOpenInterest float64 `json:"sumOpenInterest,string"` SumOpenInterestValue float64 `json:"sumOpenInterestValue,string"` Timestamp int64 `json:"timestamp"` }
UOpenInterestStats stores open interest stats data
type UOrderData ¶
type UOrderData struct { ClientOrderID string `json:"clientOrderId"` Time time.Time `json:"time"` CumulativeQuantity float64 `json:"cumQty,string"` CumulativeQuote float64 `json:"cumQuote,string"` ExecutedQuantity float64 `json:"executedQty,string"` OrderID int64 `json:"orderId"` AveragePrice float64 `json:"avgPrice,string"` OriginalQuantity float64 `json:"origQty,string"` Price float64 `json:"price,string"` ReduceOnly bool `json:"reduceOnly"` Side string `json:"side"` PositionSide string `json:"positionSide"` Status string `json:"status"` StopPrice float64 `json:"stopPrice,string"` ClosePosition bool `json:"closePosition"` Symbol string `json:"symbol"` TimeInForce string `json:"timeInForce"` OrderType string `json:"type"` OriginalType string `json:"origType"` ActivatePrice float64 `json:"activatePrice,string"` PriceRate float64 `json:"priceRate,string"` UpdateTime time.Time `json:"updateTime"` WorkingType string `json:"workingType"` Code int64 `json:"code"` Message string `json:"msg"` }
UOrderData stores order data
func (*UOrderData) UnmarshalJSON ¶
func (a *UOrderData) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type UPosition ¶
type UPosition struct { Symbol string `json:"symbol"` InitialMargin float64 `json:"initialMargin,string"` MaintenanceMargin float64 `json:"maintMargin,string"` UnrealisedProfit float64 `json:"unrealizedProfit,string"` PositionInitialMargin float64 `json:"positionInitialMargin,string"` OpenOrderInitialMargin float64 `json:"openOrderInitialMargin,string"` Leverage float64 `json:"leverage,string"` Isolated bool `json:"isolated"` IsolatedWallet float64 `json:"isolatedWallet,string"` EntryPrice float64 `json:"entryPrice,string"` MaxNotional float64 `json:"maxNotional,string"` BidNotional float64 `json:"bidNotional,string"` AskNotional float64 `json:"askNotional,string"` PositionSide string `json:"positionSide"` PositionAmount float64 `json:"positionAmt,string"` UpdateTime binanceTime `json:"updateTime"` }
UPosition holds account position information
type UPositionADLEstimationData ¶
type UPositionADLEstimationData struct { Symbol string `json:"symbol"` ADLQuantile struct { Long int64 `json:"LONG"` Short int64 `json:"SHORT"` Hedge int64 `json:"HEDGE"` } `json:"adlQuantile"` }
UPositionADLEstimationData stores ADL estimation data for a position
type UPositionInformationV2 ¶
type UPositionInformationV2 struct { Symbol string `json:"symbol"` PositionAmount float64 `json:"positionAmt,string"` EntryPrice float64 `json:"entryPrice,string"` MarkPrice float64 `json:"markPrice,string"` UnrealizedProfit float64 `json:"unrealizedProfit,string"` LiquidationPrice float64 `json:"liquidationPrice,string"` Leverage float64 `json:"leverage,string"` MaxNotionalValue float64 `json:"maxNotionalValue,string"` MarginType string `json:"marginType"` IsAutoAddMargin bool `json:"isAutoAddMargin,string"` PositionSide string `json:"positionSide"` Notional float64 `json:"notional,string"` IsolatedWallet float64 `json:"isolatedWallet,string"` IsolatedMargin float64 `json:"isolatedMargin,string"` UpdateTime binanceTime `json:"updateTime"` }
UPositionInformationV2 stores positions data
type UPositionMarginChangeHistoryData ¶
type UPositionMarginChangeHistoryData struct { Amount float64 `json:"amount,string"` Asset string `json:"asset"` Symbol string `json:"symbol"` Time int64 `json:"time"` MarginType int64 `json:"type"` PositionSide string `json:"positionSide"` }
UPositionMarginChangeHistoryData gets position margin change history data
type UPublicTradesData ¶
type UPublicTradesData struct { ID int64 `json:"id"` Price float64 `json:"price,string"` Qty float64 `json:"qty,string"` QuoteQty float64 `json:"quoteQty,string"` Time binanceTime `json:"time"` IsBuyerMaker bool `json:"isBuyerMaker"` }
UPublicTradesData stores trade data
type USymbolOrderbookTicker ¶
type USymbolOrderbookTicker struct { Symbol string `json:"symbol"` BidPrice float64 `json:"bidPrice,string"` BidQty float64 `json:"bidQty,string"` AskPrice float64 `json:"askPrice,string"` AskQty float64 `json:"askQty,string"` Time int64 `json:"time"` }
USymbolOrderbookTicker stores symbol orderbook ticker data
type USymbolPriceTicker ¶
type USymbolPriceTicker struct { Symbol string `json:"symbol"` Price float64 `json:"price,string"` Time int64 `json:"time"` }
USymbolPriceTicker stores symbol price ticker data
type UTakerVolumeData ¶
type UTakerVolumeData struct { BuySellRatio float64 `json:"buySellRatio,string"` BuyVol float64 `json:"buyVol,string"` SellVol float64 `json:"sellVol,string"` Timestamp int64 `json:"timestamp"` }
UTakerVolumeData stores volume data on buy/sell side from takers
type UserAccountStream ¶
type UserAccountStream struct {
ListenKey string `json:"listenKey"`
}
UserAccountStream contains a key to maintain an authorised websocket connection
type UserMarginInterestHistory ¶
type UserMarginInterestHistory struct { TxID int64 `json:"txId"` InterestAccruedTime binanceTime `json:"interestAccuredTime"` // typo in docs, cannot verify due to API restrictions Asset string `json:"asset"` RawAsset string `json:"rawAsset"` Principal float64 `json:"principal,string"` Interest float64 `json:"interest,string"` InterestRate float64 `json:"interestRate,string"` Type string `json:"type"` IsolatedSymbol string `json:"isolatedSymbol"` }
UserMarginInterestHistory user margin interest history row
type UserMarginInterestHistoryResponse ¶
type UserMarginInterestHistoryResponse struct { Rows []UserMarginInterestHistory `json:"rows"` Total int64 `json:"total"` }
UserMarginInterestHistoryResponse user margin interest history response
type WebsocketDepthStream ¶
type WebsocketDepthStream struct { Event string `json:"e"` Timestamp time.Time `json:"E"` Pair string `json:"s"` FirstUpdateID int64 `json:"U"` LastUpdateID int64 `json:"u"` UpdateBids [][2]types.Number `json:"b"` UpdateAsks [][2]types.Number `json:"a"` Symbol string `json:"symbol"` }
WebsocketDepthStream is the difference for the update depth stream
func (*WebsocketDepthStream) UnmarshalJSON ¶
func (a *WebsocketDepthStream) UnmarshalJSON(data []byte) error
UnmarshalJSON deserialises the JSON info, including the timestamp
type WithdrawResponse ¶
type WithdrawResponse struct {
ID string `json:"id"`
}
WithdrawResponse contains status of withdrawal request
type WithdrawStatusResponse ¶
type WithdrawStatusResponse struct { Address string `json:"address"` Amount float64 `json:"amount,string"` ApplyTime binanceTime `json:"applyTime"` Coin string `json:"coin"` ID string `json:"id"` WithdrawOrderID string `json:"withdrawOrderId"` Network string `json:"network"` TransferType uint8 `json:"transferType"` Status int64 `json:"status"` TransactionFee float64 `json:"transactionFee,string"` TransactionID string `json:"txId"` ConfirmNumber int64 `json:"confirmNo"` }
WithdrawStatusResponse defines a withdrawal status response
type WsAccountInfoData ¶
type WsAccountInfoData struct { CanDeposit bool `json:"D"` CanTrade bool `json:"T"` CanWithdraw bool `json:"W"` EventTime time.Time `json:"E"` LastUpdated time.Time `json:"u"` BuyerCommission float64 `json:"b"` MakerCommission float64 `json:"m"` SellerCommission float64 `json:"s"` TakerCommission float64 `json:"t"` EventType string `json:"e"` Currencies []struct { Asset string `json:"a"` Available float64 `json:"f,string"` Locked float64 `json:"l,string"` } `json:"B"` }
WsAccountInfoData defines websocket account info data
type WsAccountPositionData ¶
type WsAccountPositionData struct { Currencies []struct { Asset string `json:"a"` Available float64 `json:"f,string"` Locked float64 `json:"l,string"` } `json:"B"` EventTime time.Time `json:"E"` LastUpdated time.Time `json:"u"` EventType string `json:"e"` }
WsAccountPositionData defines websocket account position data
type WsBalanceUpdateData ¶
type WsBalanceUpdateData struct { EventTime time.Time `json:"E"` ClearTime time.Time `json:"T"` BalanceDelta float64 `json:"d,string"` Asset string `json:"a"` EventType string `json:"e"` }
WsBalanceUpdateData defines websocket account balance data
type WsListStatusData ¶
type WsListStatusData struct { ListClientOrderID string `json:"C"` EventTime time.Time `json:"E"` ListOrderStatus string `json:"L"` Orders []struct { ClientOrderID string `json:"c"` OrderID int64 `json:"i"` Symbol string `json:"s"` } `json:"O"` TransactionTime time.Time `json:"T"` ContingencyType string `json:"c"` EventType string `json:"e"` OrderListID int64 `json:"g"` ListStatusType string `json:"l"` RejectionReason string `json:"r"` Symbol string `json:"s"` }
WsListStatusData defines websocket account listing status data
type WsOrderUpdateData ¶
type WsOrderUpdateData struct { EventType string `json:"e"` EventTime time.Time `json:"E"` Symbol string `json:"s"` ClientOrderID string `json:"c"` Side string `json:"S"` OrderType string `json:"o"` TimeInForce string `json:"f"` Quantity float64 `json:"q,string"` Price float64 `json:"p,string"` StopPrice float64 `json:"P,string"` IcebergQuantity float64 `json:"F,string"` OrderListID int64 `json:"g"` CancelledClientOrderID string `json:"C"` CurrentExecutionType string `json:"x"` OrderStatus string `json:"X"` RejectionReason string `json:"r"` OrderID int64 `json:"i"` LastExecutedQuantity float64 `json:"l,string"` CumulativeFilledQuantity float64 `json:"z,string"` LastExecutedPrice float64 `json:"L,string"` Commission float64 `json:"n,string"` CommissionAsset string `json:"N"` TransactionTime time.Time `json:"T"` TradeID int64 `json:"t"` Ignored int64 `json:"I"` // Must be ignored explicitly, otherwise it overwrites 'i'. IsOnOrderBook bool `json:"w"` IsMaker bool `json:"m"` Ignored2 bool `json:"M"` // See the comment for "I". OrderCreationTime time.Time `json:"O"` WorkingTime time.Time `json:"W"` CumulativeQuoteTransactedQuantity float64 `json:"Z,string"` LastQuoteAssetTransactedQuantity float64 `json:"Y,string"` QuoteOrderQuantity float64 `json:"Q,string"` }
WsOrderUpdateData defines websocket account order update data