Versions in this module Expand all Collapse all v0 v0.2.0 Jan 13, 2025 Changes in this version + const AccountUri + const ApiV3 + const DepthUri + const ExWithdrawUrl + const FeeUrl + const FutureCoinWsBaseUrl + const FutureUsdWsBaseUrl + const GlobalApiBaseUrl + const JeApiBaseUrl + const KlineUri + const MaxChannelSymbols + const MaxSymbolChannels + const NetworkWithdrawUrl + const OrderUri + const ServerTimeUrl + const TestnetFutureCoinWsBaseUrl + const TestnetFutureUsdBaseUrl + const TestnetFutureUsdWsBaseUrl + const TestnetSpotApiBaseUrl + const TestnetSpotStreamBaseUrl + const TestnetSpotWsBaseUrl + const TickerUri + const TickersUri + const UnfinishedOrdersInfo + const UsApiBaseUrl + type AccountResponse struct + Assets []struct{ ... } + CanTrade bool + FeeTier int + type AssetDetail struct + Coin string + DepositAllEnable bool + Free string + Freeze string + Ipoable string + Ipoing string + IsLegalMoney bool + Locked string + Name string + NetworkList []NetworkWithdraw + type BaseResponse struct + Code int + Msg string + type Binance struct + func New(client *http.Client, apiKey, secretKey string) *Binance + func NewWithConfig(config *APIConfig) *Binance + func (bn *Binance) AllTicker(SymPair map[string]q.D) (*sync.Map, error) + func (bn *Binance) AssetDetail() (sf map[string]AssetDetail, err error) + func (bn *Binance) Balances() (available, frozen *sync.Map, err error) + func (bn *Binance) CancelOrder(orderId string, currencyPair CurrencyPair) (bool, error) + func (bn *Binance) ExWithdrawFee() (sf map[string]ExWithdraw, err error) + func (bn *Binance) Fee() float64 + func (bn *Binance) GetAccount() (*Account, error) + func (bn *Binance) GetAttr() (a q.Attr) + func (bn *Binance) GetDepth(size int, currencyPair CurrencyPair) (*Depth, error) + func (bn *Binance) GetExchangeInfo() (*ExchangeInfo, error) + func (bn *Binance) GetKlineRecords(currency CurrencyPair, period KlinePeriod, size int, ...) ([]Kline, error) + func (bn *Binance) GetOneOrder(orderId string, currencyPair CurrencyPair) (*q.Order, error) + func (bn *Binance) GetOrderHistorys(currency CurrencyPair, optional ...OptionalParameter) ([]q.Order, error) + func (bn *Binance) GetTicker(currency CurrencyPair) (*Ticker, error) + func (bn *Binance) GetTradeSymbol(currencyPair CurrencyPair) (*TradeSymbol, error) + func (bn *Binance) GetTrades(currencyPair CurrencyPair, since int64) ([]q.Trade, error) + func (bn *Binance) GetUnfinishedOrders(currencyPair CurrencyPair) ([]q.Order, error) + func (bn *Binance) LimitBuy(amount, price string, currencyPair CurrencyPair, ...) (*q.Order, error) + func (bn *Binance) LimitSell(amount, price string, currencyPair CurrencyPair, ...) (*q.Order, error) + func (bn *Binance) MarketBuy(amount, price string, currencyPair CurrencyPair) (*q.Order, error) + func (bn *Binance) MarketSell(amount, price string, currencyPair CurrencyPair) (*q.Order, error) + func (bn *Binance) OneTicker(d q.D) (ticker q.Bbo, err error) + func (bn *Binance) PairArray() (map[string]q.D, map[q.D]q.P, error) + func (bn *Binance) Ping() bool + func (bn *Binance) PlaceOrders(places [3]q.Order) (orders [3]q.Order, err error) + func (bn *Binance) String() string + func (bn *Binance) Test() bool + func (bn *Binance) TradeFee() (map[string]TradeFee, error) + func (bn *Binance) WithdrawFee() (sf []NetworkWithdraw, err error) + type BookTicker struct + AskPrice float64 + AskQty float64 + BidPrice float64 + BidQty float64 + Symbol string + type ExWithdraw struct + DepositStatus bool + DepositTip string + MinWithdrawAmount float64 + WithdrawFee float64 + WithdrawStatus bool + type ExchangeInfo struct + ExchangeFilters []any + RateLimits []RateLimit + ServerTime int + Symbols []TradeSymbol + Timezone string + type Filter struct + ApplyToMarket bool + AvgPriceMins int + FilterType string + Limit int + MaxNumAlgoOrders int + MaxNumIcebergOrders int + MaxNumOrders int + MaxPrice float64 + MaxQty float64 + MinNotional float64 + MinPrice float64 + MinQty float64 + MultiplierDown float64 + MultiplierUp float64 + StepSize float64 + TickSize float64 + type Futures struct + func NewBinanceFutures(config *APIConfig) *Futures + func (bs *Futures) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, error) + func (bs *Futures) GetContractValue(currencyPair CurrencyPair) (float64, error) + func (bs *Futures) GetDeliveryTime() (int, int, int, int) + func (bs *Futures) GetExchangeInfo() + func (bs *Futures) GetFee() (float64, error) + func (bs *Futures) GetFutureDepth(currencyPair CurrencyPair, contractType string, size int) (*Depth, error) + func (bs *Futures) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error) + func (bs *Futures) GetFutureIndex(currencyPair CurrencyPair) (float64, error) + func (bs *Futures) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error) + func (bs *Futures) GetFutureOrderHistory(pair CurrencyPair, contractType string, optional ...OptionalParameter) ([]FutureOrder, error) + func (bs *Futures) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (bs *Futures) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error) + func (bs *Futures) GetFutureTicker(currencyPair CurrencyPair, contractType string) (*Ticker, error) + func (bs *Futures) GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error) + func (bs *Futures) GetKlineRecords(contractType string, currency CurrencyPair, period KlinePeriod, size int, ...) ([]FutureKline, error) + func (bs *Futures) GetTrades(contractType string, currencyPair CurrencyPair, since int64) ([]Trade, error) + func (bs *Futures) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (bs *Futures) LimitFuturesOrder(currencyPair CurrencyPair, contractType, price, amount string, openType int, ...) (*FutureOrder, error) + func (bs *Futures) MarketFuturesOrder(currencyPair CurrencyPair, contractType, amount string, openType int) (*FutureOrder, error) + func (bs *Futures) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error) + func (bs *Futures) PlaceFutureOrder2(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error) + func (bs *Futures) SetBaseUri(uri string) + func (bs *Futures) String() string + type FuturesWs struct + func NewFuturesWs() *FuturesWs + func (s *FuturesWs) DepthCallback(f func(depth *exws.Depth)) + func (s *FuturesWs) SubscribeDepth(pair cons.CurrencyPair, contractType string) error + func (s *FuturesWs) SubscribeTicker(pair cons.CurrencyPair, contractType string) error + func (s *FuturesWs) SubscribeTrade(pair cons.CurrencyPair, contractType string) error + func (s *FuturesWs) TickerCallback(f func(ticker *exws.FutureTicker)) + func (s *FuturesWs) TradeCallback(f func(trade *q.Trade, contract string)) + type OrderInfoResponse struct + AvgPrice float64 + ClientOrderId string + ExecutedQty float64 + OrderId int64 + OrigQty float64 + Pair string + PositionSide string + Price float64 + Side string + Status string + Symbol string + Time int64 + Type string + UpdateTime int64 + type PositionRiskResponse struct + EntryPrice float64 + Leverage float64 + LiquidationPrice float64 + MarginType string + PositionAmt float64 + PositionSide string + Symbol string + UnRealizedProfit float64 + type RateLimit struct + Interval string + IntervalNum int64 + Limit int64 + RateLimitType string + type SpotWs struct + func NewSpotWs() *SpotWs + func (s *SpotWs) BBOCallback(f func(ticker *q.Bbo)) + func (s *SpotWs) DepthCallback(f func(depth *exws.Depth)) + func (s *SpotWs) SubscribeBBO(sm []string) (err error) + func (s *SpotWs) SubscribeDepth(pair cons.CurrencyPair) error + func (s *SpotWs) SubscribeTicker(pair cons.CurrencyPair) error + func (s *SpotWs) SubscribeTrade(pair cons.CurrencyPair) error + func (s *SpotWs) TickerCallback(f func(ticker *exws.Ticker)) + func (s *SpotWs) TradeCallback(f func(trade *q.Trade)) + type Swap struct + func NewBinanceSwap(config *APIConfig) *Swap + func (bs *Swap) FutureCancelAllOrders(currencyPair CurrencyPair, contractType string) (bool, error) + func (bs *Swap) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, error) + func (bs *Swap) FutureCancelOrders(currencyPair CurrencyPair, contractType string, orderIdList []string) (bool, error) + func (bs *Swap) GetContractValue(currencyPair CurrencyPair) (float64, error) + func (bs *Swap) GetDeliveryTime() (int, int, int, int) + func (bs *Swap) GetFee() (float64, error) + func (bs *Swap) GetFutureDepth(currency CurrencyPair, contractType string, size int) (*Depth, error) + func (bs *Swap) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error) + func (bs *Swap) GetFutureIndex(currencyPair CurrencyPair) (float64, error) + func (bs *Swap) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error) + func (bs *Swap) GetFutureOrderHistory(pair CurrencyPair, contractType string, optional ...OptionalParameter) ([]FutureOrder, error) + func (bs *Swap) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (bs *Swap) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error) + func (bs *Swap) GetFutureTicker(currency CurrencyPair, contractType string) (*Ticker, error) + func (bs *Swap) GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error) + func (bs *Swap) GetKlineRecords(contractType string, currency CurrencyPair, period KlinePeriod, size int, ...) ([]FutureKline, error) + func (bs *Swap) GetServerTime() (int64, error) + func (bs *Swap) GetTrades(contractType string, currencyPair CurrencyPair, since int64) ([]Trade, error) + func (bs *Swap) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (bs *Swap) LimitFuturesOrder(currencyPair CurrencyPair, contractType, price, amount string, openType int, ...) (*FutureOrder, error) + func (bs *Swap) MarketFuturesOrder(currencyPair CurrencyPair, contractType, amount string, openType int) (*FutureOrder, error) + func (bs *Swap) Ping() bool + func (bs *Swap) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error) + func (bs *Swap) PlaceFutureOrder2(currencyPair CurrencyPair, contractType, price, amount string, ...) (*FutureOrder, error) + func (bs *Swap) SetBaseUri(uri string) + func (bs *Swap) String() string + func (bs *Swap) Transfer(currency Currency, transferType int, amount float64) (int64, error) + type SymbolInfo struct + ContractSize int + ContractStatus string + ContractType string + DeliveryDate int64 + Pair string + PricePrecision int + Symbol string + type TradeSymbol struct + BaseAsset string + BaseAssetPrecision int + BaseCommissionPrecision int + Filters []Filter + IcebergAllowed bool + IsMarginTradingAllowed bool + IsSpotTradingAllowed bool + OcoAllowed bool + OrderTypes []string + QuoteAsset string + QuoteAssetPrecision int + QuoteCommissionPrecision int + QuoteOrderQtyMarketAllowed bool + QuotePrecision int + Status string + Symbol string + func (ts TradeSymbol) GetBaseStep() float64 + func (ts TradeSymbol) GetBaseStepN() int + func (ts TradeSymbol) GetMinBase() float64 + func (ts TradeSymbol) GetMinPrice() float64 + func (ts TradeSymbol) GetMinQuote() float64 + func (ts TradeSymbol) GetPriceStep() float64 + type Wallet struct + func NewWallet(c *APIConfig) *Wallet + func (w *Wallet) GetAccount() (*Account, error) + func (w *Wallet) GetDepositHistory(currency *Currency) ([]DepositWithdrawHistory, error) + func (w *Wallet) GetWithDrawHistory(currency *Currency) ([]DepositWithdrawHistory, error) + func (w *Wallet) Transfer(param TransferParameter) error + func (w *Wallet) Withdrawal(param WithdrawParameter) (withdrawId string, err error)