Binance Connector Go SDK

repository·main·Indexed 43 days ago

https://github.com/binance/binance-connector-go

A collection of auto-generated Go SDKs for Binance API services, including Derivatives Trading (COIN-M Futures and Options). It provides programmatic interaction via REST APIs, WebSocket APIs, and WebSocket Streams for trading, lending, and financial products.

Tokens
960.5K
Snippets
2.1K
Records
2.7K
Agent score
55%

What's inside Binance Connector Go

  1. Overview of MarketDataAPI in COIN-M Futures

    main

    The MarketDataAPI provides access to various market-related data points for Binance COIN-M Futures. All URIs are relative to https://dapi.binance.com. Available endpoints include:

    • Basis: Get basis information.
    • CheckServerTime: Check the server time.
    • CompressedAggregateTradesList: Get a list of compressed/aggregate trades.
    • ContinuousContractKlineCandlestickData: Get continuous contract kline/candlestick data.
    • ExchangeInformation: Get exchange information.
    • GetFundingRateHistoryOfPerpetualFutures: Get funding rate history for perpetual futures.
    • GetFundingRateInfo: Get funding rate information.
    • IndexPriceAndMarkPrice: Get index price and mark price.
    • IndexPriceKlineCandlestickData: Get index price kline/candlestick data.
    • KlineCandlestickData: Get kline/candlestick data.
    • LongShortRatio: Get long/short ratio.
    • MarkPriceKlineCandlestickData: Get mark price kline/candlestick data.
    • OldTradesLookup: Lookup old trades.
    • OpenInterest: Get open interest.
    • OpenInterestStatistics: Get open interest statistics.
    • OrderBook: Get the order book.
    • PremiumIndexKlineData: Get premium index kline data.
    • QueryIndexPriceConstituents: Query index price constituents.
    • RecentTradesList: Get recent trades list.
    • SymbolOrderBookTicker: Get symbol order book ticker.
    • SymbolPriceTicker: Get symbol price ticker.
    • TakerBuySellVolume: Get taker buy/sell volume.
    • TestConnectivity: Test connectivity (ping).
    • Ticker24hrPriceChangeStatistics: Get 24hr ticker price change statistics.
    • TopTraderLongShortRatioAccounts: Get top trader long/short account ratio.
    • TopTraderLongShortRatioPositions: Get top trader long/short position ratio.
  2. Overview of OtcAPI

    main

    The OtcAPI provides endpoints for managing OTC (Over-the-Counter) Blocktrades within the PREDICTION_TRADE context. All URIs are relative to https://api.binance.com.

    Available Methods

    MethodHTTP RequestDescription
    CreateOtcBlocktradePost /sapi/v1/w3w/wallet/prediction/otc/blocktrade/createCreate OTC Blocktrade
    FulfilOtcBlocktradePost /sapi/v1/w3w/wallet/prediction/otc/blocktrade/fulfilFulfil OTC Blocktrade
    GetOtcBlocktradeDetailPost /sapi/v1/w3w/wallet/prediction/otc/blocktrade/detailGet OTC Blocktrade Detail
    GetOtcBlocktradeEventsPost /sapi/v1/w3w/wallet/prediction/otc/blocktrade/eventsGet OTC Blocktrade Events
    GetOtcReservedBalancesPost /sapi/v1/w3w/wallet/prediction/otc/blocktrade/reserved-balancesGet OTC Reserved Balances
    ListOtcBlocktradesPost /sapi/v1/w3w/wallet/prediction/otc/blocktrade/listList OTC Blocktrades
    PreviewOtcBlocktradePost /sapi/v1/w3w/wallet/prediction/otc/blocktrade/previewPreview OTC Blocktrade
    RemoveOtcBlocktradesPost /sapi/v1/w3w/wallet/prediction/otc/blocktrade/removeRemove OTC Blocktrades
  3. Overview of Spot WebSocket AccountAPI

    main

    The AccountAPI provides several endpoints via WebSocket for accessing user-specific account data. These endpoints require USER_DATA authorization (API Key and Secret) and are used to query information such as commission rates, unfilled order counts, account status, and order histories.

    Available methods include:

    • AccountCommission: Account Commission Rates
    • AccountRateLimitsOrders: Unfilled Order Count
    • AccountStatus: Account information
    • AllOrderLists: Account order list history
    • AllOrders: Account order history
    • MyAllocations: Account allocations
    • MyFilters: Query Relevant Filters
    • MyPreventedMatches: Account prevented matches
    • MyTrades: Account trade history
    • OpenOrderListsStatus: Current open Order lists
    • OpenOrdersStatus: Current open orders
    • OrderAmendments: Query Order Amendments
    • OrderListStatus: Query Order list
    • OrderStatus: Query order
  4. Overview of COIN-M Futures Trade API

    main
    The TradeAPI provides access to various endpoints for Binance Derivatives Trading (COIN-M Futures). All URIs are relative to https://dapi.binance.com. The API includes methods for managing orders (creating, canceling, modifying), retrieving trade history, and managing position margins. Endpoints are categorized by their required permission level: USER_DATA (read-only/account info) and TRADE (executing trades/modifying orders).
  5. Overview of MarketMakerBlockTradeAPI

    main

    The MarketMakerBlockTradeAPI provides endpoints for managing block trade orders within the Binance Derivatives Trading (Options) SDK. All URIs are relative to https://eapi.binance.com.

    Available methods include:

    • AcceptBlockTradeOrder: Accept a block trade order.
    • AccountBlockTradeList: Retrieve a list of block trades for an account.
    • CancelBlockTradeOrder: Cancel an existing block trade order.
    • ExtendBlockTradeOrder: Extend a block trade order.
    • NewBlockTradeOrder: Create a new block trade order.
    • QueryBlockTradeDetails: Query details of a block trade.
    • QueryBlockTradeOrder: Query a specific block trade order.
  6. Overview of the Portfolio Margin TradeAPI

    main

    The TradeAPI within the derivativestradingportfoliomargin client provides access to various trading operations including order management (creating, canceling, and modifying orders), account trade lists, and margin-specific actions.

    All URIs are relative to https://papi.binance.com.

    Endpoints are categorized by their access requirements:

    • TRADE: Requires authorization.
    • USER_DATA: Requires authorization.
    • MARGIN: Requires authorization.

    Common operations include managing CM (Coin-Margined), UM (Usd-Margined), and Margin account orders.

  7. Overview of Binance Derivatives Trading (Options) SDK

    main

    This SDK is a client library for the Binance Derivatives Trading Options API. It allows developers to interact programmatically with Binance's options trading features through two primary communication methods:

    1. REST API: For request-response interactions using the /eapi/* endpoints.
    2. Websocket Stream: For real-time data streaming.

    The library includes test cases and examples to assist with onboarding.

  8. Overview of binance-common utilities

    main

    The binance-common package is a utility library designed for Binance modular connectors. It provides reusable and optimized helpers to streamline development when interacting with Binance APIs.

    Key features include:

    • Common Utility Functions: Helpers for managing API requests, timestamps, and cryptographic signatures.
    • Optimized Integration: Specifically designed to work seamlessly with other Binance Go connectors.
    • Lightweight: The package is designed to be tree-shakeable, allowing you to import only the specific utilities you need.
  9. Overview of FlexibleRateAPI methods

    main

    The FlexibleRateAPI provides endpoints for managing flexible crypto loans. Methods are categorized by their access level: USER_DATA (read-only/informational) and TRADE (executing loan actions).

    TRADE Methods:

    • FlexibleLoanAdjustLtv: Adjust the Loan-to-Value ratio.
    • FlexibleLoanBorrow: Borrow funds against collateral.
    • FlexibleLoanRepay: Repay a loan.

    USER_DATA Methods:

    • CheckCollateralRepayRate: Check the collateral flexible repay rate.
    • GetFlexibleLoanAssetsData: Get flexible loan assets data.
    • GetFlexibleLoanBorrowHistory: Get flexible loan borrow history.
    • GetFlexibleLoanCollateralAssetsData: Get flexible loan collateral assets data.
    • GetFlexibleLoanInterestRateHistory: Get flexible loan interest rate history.
    • GetFlexibleLoanLiquidationHistory: Get flexible loan liquidation history.
    • GetFlexibleLoanLtvAdjustmentHistory: Get flexible loan LTV adjustment history.
    • GetFlexibleLoanOngoingOrders: Get flexible loan ongoing orders.
    • GetFlexibleLoanRepaymentHistory: Get flexible loan repayment history.
  10. Overview of Margin Trading Market Data API

    main

    The MarketDataAPI provides access to various market-related data for Margin Trading. Most endpoints are categorized as MARKET_DATA and do not require authorization, though they are accessed via the BinanceMarginTradingClient.

    Available endpoints include:

    • CrossMarginCollateralRatio: Get cross margin collateral ratio.
    • GetAllCrossMarginPairs: Get all cross margin pairs.
    • GetAllIsolatedMarginSymbol: Get all isolated margin symbols.
    • GetAllMarginAssets: Get all margin assets.
    • GetDelistSchedule: Get the delisting schedule.
    • GetLimitPricePairs: Get limit price pairs.
    • GetListSchedule: Get list schedule.
    • GetMarginAssetRiskBasedLiquidationRatio: Get margin asset risk-based liquidation ratio.
    • GetMarginRestrictedAssets: Get margin restricted assets.
    • QueryIsolatedMarginTierData: Query isolated margin tier data (USER_DATA).
    • QueryLiabilityCoinLeverageBracketInCrossMarginProMode: Query liability coin leverage bracket in cross margin pro mode.
    • QueryMarginAvailableInventory: Query margin available inventory (USER_DATA).
    • QueryMarginPriceindex: Query margin price index.
  11. Overview of Spot WebSocket TradeAPI

    main

    The TradeAPI provides a suite of trading operations available via WebSocket. These methods allow for high-frequency trading actions such as placing, canceling, and amending orders.

    Available methods include:

    • OpenOrdersCancelAll: Cancel all open orders for a symbol.
    • OrderAmendKeepPriority: Amend an existing order while maintaining its priority.
    • OrderCancel: Cancel a specific order.
    • OrderCancelReplace: Cancel and replace an order.
    • OrderListCancel: Cancel an order list.
    • OrderListPlaceOco: Place a new OCO (One-Cancels-the-Other) order list.
    • OrderListPlaceOto: Place a new OTO (One-Triggers-the-Other) order list.
    • OrderPlace: Place a new order.
    • SorOrderPlace: Place a new order using Smart Order Routing (SOR).
    • (And other specialized order list and SOR methods)