Binance Web3 Connector JS
    Preparing search index...

    TradingApi - object-oriented interface TradingApi

    Implements

    Index
    • Solana-only counterpart to /swap. Shares the full quote → route → vendor buildSwapTx → priceImpact → minReceive → instruction-assembly pipeline; the only difference is the response: instead of returning a signed-and-serialized base64 transaction, this endpoint returns the uncompiled instruction list plus the address-lookup-table (ALT) address list, leaving v0-transaction compilation, signing, and submission to the caller.

      Use this when the caller needs to:

      • prepend / append their own instructions (e.g. fee splitting, custom logging) before signing;

      • reuse the platform-curated route, slippage, PS-variant rewriting, ALT injection, ComputeBudget overwrite, and ATA batching while still controlling the final wire format.

      Only supports binanceChainId=CT_501 (Solana). Other chains return CHAIN_NOT_SUPPORTED (40411). Parameters mirror the Solana subset of /swap (no EVM-only approveTransaction / approveAmount / gasLimit). Supports the custom-fee (Add Fee / referral fee) parameters (feePercent + fromTokenReferrerWalletAddress / toTokenReferrerWalletAddress), with the same semantics as /swap — the fee instructions are injected into the returned uncompiled instruction list.

      Parameters

      Returns Promise<RestApiResponse<BuildSolanaSwapInstructionsResponse>>

      TradingApi