# Binance Developer Docs > Complete documentation for Large Language Models --- ## Document: /introduction URL: /en/dev-docs/introduction # Binance Developer Documentation Welcome to the official Binance API documentation. This portal is the central reference for developers building applications, services, and trading systems that integrate with Binance. It covers the main programmatic interfaces available across Binance products, from market data access and account operations to advanced trading, streaming, and lower-latency integrations. Whether you are building a simple script, a production backend, or a professional trading system, these docs are designed to help you understand the available interfaces, choose the right integration path, and implement it reliably. --- ## How to use this documentation This documentation is organized into three main areas: - **Documentation** Conceptual guides, onboarding content, environment information, and operational guidance. - **API Reference** Endpoint definitions, request parameters, payload schemas, and API-specific details. - **SDKs & Tools** Official connectors, Postman collections, developer tools, and implementation resources. If you are new to Binance APIs, start with the documentation guides first. If you already know which product or endpoint you need, you can move directly into the relevant API reference. --- ## Choose a starting point A good starting point depends on what you are trying to do: - **New to Binance APIs** Start with the documentation guides, supported API types, environments, and authentication requirements. - **Need endpoint details** Go directly to the API Reference for request parameters, payloads, and endpoint-specific behavior. - **Looking for connectors or testing resources** Visit SDKs & Tools for official connectors, Postman collections, developer tools, and implementation resources. - **Working on product-specific integrations** Navigate to the relevant product family first, such as Spot, Futures, Wallet, or other supported areas. --- ## Start here A common onboarding path is: 1. Review the supported API types and product areas 2. Create an API key if your integration requires authenticated access 3. Understand authentication, signing, and environment support 4. Validate your implementation in a supported non-production environment where available 5. Move to production only after confirming product-specific requirements and limits --- ## What you can build with Binance APIs Using Binance APIs, you can: - Access real-time and historical market data - Place, manage, and cancel orders programmatically - Monitor account state, balances, and positions - Consume live updates through WebSocket-based interfaces - Build trading bots, automation, and internal services - Integrate Binance data into dashboards, analytics, and reporting systems - Support lower-latency or institutional workflows with specialized interfaces The platform supports both lightweight integrations and more advanced, performance-sensitive systems. --- ## API types Binance provides multiple API styles to support different integration patterns: - **REST APIs** Request/response HTTP APIs for market data, trading, account operations, and other product workflows. - **WebSocket APIs** Request/response APIs over persistent connections, useful for interactive and stateful workflows. - **WebSocket Streams** Push-based real-time streams for market data and user events. - **FIX APIs** Session-based APIs designed for advanced and institutional trading workflows. - **SBE (Simple Binary Encoding)** Binary-encoded payload formats intended for performance-sensitive environments. Each API type has different trade-offs in latency, throughput, operational complexity, and client design. Product documentation will indicate when a specific interface is recommended. --- ## Authentication and security Many private endpoints require authentication. Depending on the interface and product, Binance supports mechanisms such as: - HMAC-based request signing - Asymmetric key authentication, including RSA and Ed25519 - Session-based authentication for selected WebSocket and FIX workflows Authentication requirements are documented in the relevant product sections. During development, use dedicated testnet or demo environments where supported, protect credentials carefully, and review signing requirements before going live. --- ## Rate limits and reliability Binance APIs enforce rate limits and request weights. These limits vary by product and endpoint, and exceeding them may result in throttling or temporary restrictions. Production integrations should account for: - Request weights and endpoint-specific limits - Retry and backoff strategies - Connection health and reconnection handling - Monitoring for API errors and degraded conditions Always review the relevant product documentation before deploying systems at scale. --- ## Environments Binance provides different environments depending on the product and interface, including: - **Production** for live trading and real market data - **Testnet** for supported testing workflows without real funds - **Demo environments** for supported products and scenarios where simulated or non-production access is available Environment support is not identical across all products. Some products support testnet, some support demo environments, and others may have different non-production availability. Before implementation or rollout, verify which environments are supported for the specific API and product you intend to use. --- ## Agent Native Binance APIs are designed to be agent-friendly. Whether you are building autonomous trading bots, AI-powered assistants, or automated workflows, the following resources are available: - **llms.txt** — Machine-readable documentation index at [`/llms.txt`](/llms.txt) for LLM-based tools and agents - **Agent REST API** — Structured endpoints optimized for programmatic and agent-driven access - **MCP Server** — Model Context Protocol server for seamless integration with AI development tools For more details, see the [Agent Native overview](/agent-native/overview). --- ## SDKs, tools, and samples To help accelerate development, Binance provides supporting resources such as: - Official SDKs in supported languages - Developer tools and utilities - Postman collections for exploration and testing - Examples and sample applications for common workflows These resources can help shorten the path from initial exploration to a working integration. --- ## Official and supported interfaces Interfaces, endpoints, streams, parameters, and payloads documented in this portal are considered officially documented for developer use. Undocumented behaviors or unofficial interfaces should not be relied upon in production systems. They may change without notice and are outside the scope of supported documentation. --- ## Product-specific updates API changes, new features, and breaking updates are typically documented within the relevant product areas. Before deploying or upgrading an integration, review the documentation for the specific product you depend on. --- ## Getting help If you need help while integrating: - Review the relevant documentation and API reference first - Check available tools, examples, and sample applications - Join the [Binance Developer Community](https://dev.binance.vision) - Open issues in the relevant GitHub repositories when appropriate - Follow the official Telegram [Binance API announcements channel](https://t.me/binance_api_announcements) for service and API-related updates --- This documentation evolves as Binance products and APIs change. Check back regularly and review product-specific documentation before making production changes. --- ## Document: SDKs & Tools URL: /en/dev-docs/sdks-tools/overview # SDKs & Tools Build faster with official SDKs, tools, and reference implementations maintained by Binance. import { Link, Typography, LanguageIcon } from "zudoku/components"; import { Card, CardHeader, CardTitle, CardDescription, CardFooter, } from "zudoku/ui/Card"; import { ChevronRight, KeyRound, Terminal, Github, Bot } from "lucide-react"; export const IconTile = ({ children, label }) => ( {children} ); export const Badge = ({ children }) => ( {children} ); export const REGISTRY_ICONS = { npm: "https://cdn.simpleicons.org/npm", PyPI: "https://cdn.simpleicons.org/pypi", "crates.io": "https://cdn.simpleicons.org/rust", "pkg.go.dev": "https://cdn.simpleicons.org/go", NuGet: "https://cdn.simpleicons.org/nuget", Packagist: "https://cdn.simpleicons.org/packagist", RubyGems: "https://cdn.simpleicons.org/rubygems", Maven: "https://cdn.simpleicons.org/apachemaven", }; export const CardLink = ({ to, title, description, children, github, registry, }) => (
{children}
{title} {description ? ( {description} ) : null}
{(github || registry) && ( {github && ( Git )} {registry && ( {registry.label} )} )}
); --- ## Official API Connectors
Production-ready client libraries maintained by Binance for popular languages. Each connector includes request signing helpers, typed models, and runnable examples.
### REST API, WebSocket API & WebSocket Streams
Full-featured connectors covering REST endpoints, WebSocket API requests, and real-time WebSocket data streams.
### FIX
Low-latency connectors for Binance's FIX API, designed for high-performance order entry and execution reporting.
FIX
--- ## Developer Tools
Utilities that help you develop locally, validate signatures, and automate common workflows. Use these tools alongside the connectors to speed up testing and integration.
--- ## Sample Applications
End-to-end reference implementations you can run, modify, and use as a starting point. Ideal for learning message formats and recommended flows.
SBE SBE SBE
--- ## Postman Collections
Ready-made Postman collections to explore endpoints quickly and share reproducible requests. Great for debugging, onboarding, and testing against different environments.
Postman
--- ## Document: Agent Native URL: /en/dev-docs/agent-native/overview # Agent Native import { Link } from "zudoku/components"; import { Card, CardHeader, CardTitle, CardDescription } from "zudoku/ui/Card"; import { Bot, FileText, ChevronRight, Code2, Lightbulb, Users, } from "lucide-react"; export const IconTile = ({ children, label }) => ( {children} ); export const Badge = ({ children }) => ( {children} ); export const CardLink = ({ to, title, description, children, badge }) => (
{children} {badge && {badge}}
{title} {description} Learn more
); export const ScenarioCard = ({ icon: Icon, title, description }) => (

{title}

{description}

);

Agent Native

Lightweight, AI-friendly access to Binance API documentation. Discover and load full documentation programmatically — built for AI tools, coding assistants, and autonomous agents.

## Core Components
Choose the integration method that fits your use case.
--- ## Quick Start ### Fetch documentation with llms.txt ```bash # Summary — document titles, descriptions, and links curl -s https://developers.binance.com/en/dev-docs/llms.txt # Full content — complete documentation in a single file curl -s https://developers.binance.com/en/dev-docs/llms-full.txt ``` --- ## Who Is This For?
Whether you're building with AI IDEs or integrating documentation into agent pipelines, llms.txt fits a wide range of workflows.
--- ## Document: /agent-native/llms-txt URL: /en/dev-docs/agent-native/llms-txt # llms.txt [llms.txt](https://llmstxt.org/) is a proposed standard for making website content accessible to large language models. Similar to `robots.txt` for web crawlers, `llms.txt` tells AI tools what documentation is available and how to access it. ## Files Binance API Documentation provides two llms.txt files: | File | URL | Description | | --------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------ | | `llms.txt` | /dev-docs/llms.txt | Summary — document titles, descriptions, and links | | `llms-full.txt` | /dev-docs/llms-full.txt | Full content — complete documentation in a single file | ## Format ### llms.txt (Summary) The summary file contains a structured list of all documentation pages with titles, descriptions, and URLs: ``` # Binance API Documentation > Comprehensive API documentation for Binance trading platform. ## Spot Trading - [Changelog](/docs/spot-trading/1.changelog): Spot Trading API changelog - [README](/docs/spot-trading/2.readme): Getting started with Spot Trading API ... ## Derivatives Trading - [Change Log](/docs/derivatives/change-log): Derivatives API changelog ... ``` ### llms-full.txt (Full Content) The full file includes the complete markdown content of every documentation page, separated by headers. This is useful for loading the entire documentation into an LLM's context window. ## Usage Examples ### Feed into any LLM ```bash # Download and use as context curl -s https://developers.binance.com/en/dev-docs/llms.txt # Full documentation for comprehensive context curl -s https://developers.binance.com/en/dev-docs/llms-full.txt ``` ### Use with Claude ``` Please read https://developers.binance.com/en/dev-docs/llms.txt and help me understand how to place a futures order using the Binance API. ``` ### Use in a Python script ```python import requests # Fetch the documentation index response = requests.get("https://developers.binance.com/en/dev-docs/llms.txt") docs_index = response.text # Feed into your LLM as context messages = [ {"role": "system", "content": f"Binance API docs:\n{docs_index}"}, {"role": "user", "content": "How do I check my account balance?"} ] ``` ### Use with LangChain ```python from langchain_community.document_loaders import WebBaseLoader loader = WebBaseLoader("https://developers.binance.com/en/dev-docs/llms-full.txt") docs = loader.load() ``` ## When to Use llms.txt vs Other Options - **llms.txt** — You want to quickly give an LLM awareness of all available documentation, or load full docs into context - **Agent REST API** — You need structured JSON data, filtered queries, or programmatic access - **MCP Server** — You're using Claude Code, Cursor, or another MCP-compatible IDE --- ## Document: Binance Skills Hub URL: /en/dev-docs/sdks-tools/tools/skills-hub # Binance Skills Hub The Binance Skills Hub is an open marketplace of AI agent skills that give any LLM-powered agent native access to Binance crypto capabilities — token search, on-chain trading, wallet tracking, smart-money signals, and DeFi protocol interactions. Skills are framework-agnostic and work with Claude Code, LangChain, CrewAI, OpenClaw, and custom agent stacks. For the full skill catalogue, installation options, authentication setup, and contribution guidelines, see the [binance-skills-hub](https://github.com/binance/binance-skills-hub) repository on GitHub. ## How it works Each skill is a self-contained module that exposes a set of capabilities an AI agent can invoke through natural language. Skills follow the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) standard, so any MCP-compatible agent can discover and call them without custom integration code. Skills are split into two categories: - **Read-only skills** — query market data, wallet balances, token info, trending tokens, smart-money activity, DeFi protocol stats, and trading signals - **Read + Write skills** — execute on-chain operations such as token transfers, swaps, and limit orders via the Agentic Wallet The hub is open source and community-extensible — anyone can contribute new skills by following the repository's contribution guide. ## Supported environments - Node.js 22+ - Any MCP-compatible AI agent (Claude Code, OpenClaw, custom clients) - Python agents via LangChain / CrewAI adapters ## Getting started Install skills from the hub: ```bash npx skills add https://github.com/binance/binance-skills-hub ``` Refer to the repository README for authentication setup, available skills, and usage examples. ## Typical use cases - Adding crypto market data and trading capabilities to any AI agent - Building autonomous trading bots with natural-language interfaces - Monitoring wallet balances and smart-money flows from an agent - Integrating DeFi analytics into research or reporting workflows - Prototyping agent-driven strategies without writing API integration code --- ## Document: Binance CLI URL: /en/dev-docs/sdks-tools/tools/binance-cli # Binance CLI The Binance CLI is a command-line tool for interacting with Binance APIs directly from your terminal. It provides access to a subset of Binance REST APIs and WebSocket streams across multiple markets, making it useful for quick inspections, scripting, and lightweight operational tasks. For source code, issues, and updates, see the [binance-cli](https://github.com/binance/binance-cli) repository on GitHub. ## Status > ⚠️ **Maintenance status** > > The Binance CLI is **not actively maintained**, but it is **updated periodically**. It may not > include the latest endpoints, products, or features. > > For long-term integrations or production systems, we recommend using one of the official SDKs > (JavaScript, Python, Go, Java, PHP or Rust). ## Supported environments - Node.js (installed globally) - Unix-like environments (Linux, macOS) > This tool is intended for local or server-side usage via a terminal. ## Scope and capabilities The Binance CLI supports: - REST API interactions for multiple Binance markets - WebSocket streams for real-time market data - Order placement and account queries via CLI commands - Spot, USDⓈ-M Futures, and COIN-M Futures workflows (subset of APIs) The CLI is designed for **manual usage, debugging, and scripting**, not as a replacement for SDK-based integrations. ## Typical use cases - Quickly querying market data from the terminal - Inspecting exchange metadata and symbol information - Placing or canceling orders during testing - Listening to WebSocket streams for debugging or exploration - Simple automation via shell scripts ## Installation Install the CLI globally using `npm`: ```bash git clone https://github.com/binance/binance-cli.git cd binance-cli npm install -g ``` Verify installation: ```bash binance-cli --help ``` ## Usage overview The CLI exposes a large number of commands covering market data, trading, account information, and WebSocket streams. Examples: ```bash # Show help binance-cli --help # Get server time binance-cli time # Get order book binance-cli book BNBUSDT # Place a limit buy order binance-cli buy -s BNBUSDT -t LIMIT -q 0.05 -p 350 -f GTC # Listen to WebSocket streams binance-cli listen bnbusdt@depth bnbusdt@bookTicker ``` Refer to the repository README and `--help` output for the full list of supported commands. ## Notes and best practices - This CLI supports REST APIs and WebSocket streams - API and product coverage is limited and may lag behind current Binance APIs - Always review commands carefully before placing live orders - Use testnet endpoints when experimenting - For production systems or advanced workflows, use an official SDK instead of the CLI --- ## Document: Asymmetric Key Generator URL: /en/dev-docs/sdks-tools/tools/asymmetric-key-generator # Asymmetric Key Generator The Asymmetric Key Generator is a utility for generating **Ed25519** and **RSA** asymmetric key pairs (private and public keys) used for authenticating and signing requests to Binance APIs. It is commonly used when working with **asymmetric authentication**, such as FIX APIs or REST / WebSocket APIs that support `RSA` or `Ed25519` signatures. For source code, releases, and updates, see the [asymmetric-key-generator](https://github.com/binance/asymmetric-key-generator) repository on GitHub. ## Supported key types The tool can generate the following key types: - **Ed25519** (PKCS#8) - **RSA-2048** - **RSA-4096** > ⚠️ **Important** > > Some Binance APIs (for example FIX APIs) **require Ed25519 keys**. `RSA` keys are supported only > by APIs that explicitly allow `RSA` authentication. ## Supported environments - Desktop environments (macOS, Windows, Linux) via prebuilt apps - Node.js (for CLI and local builds) ## Installation options You can use the tool in **three different ways**, depending on your workflow. ### Option 1: Download prebuilt application (recommended) Prebuilt desktop applications are available on the [GitHub Releases page](https://github.com/binance/asymmetric-key-generator/releases). After downloading, verify the package integrity using the provided checksum: ```bash sha256sum -c AsymmetricKeyGenerator-.CHECKSUM ``` If successful, the output will indicate OK. ### Option 2: Build from source Clone the repository and build the application locally: ```bash npm install npm run start # run locally npm run dist # build distributables into the dist folder ``` ### Option 3: Command-line usage The generator can also be used as a CLI tool. Install dependencies: ```bash npm install ``` Generate key pairs: ```bash npm run generate -- -k -p -n -o ``` Examples Generate a single `RSA-2048` key pair: ```bash npm run generate -- -k rsa-2048 -o id_rsa.tar.gz ``` Generate two `Ed25519` key pairs with a passphrase: ```bash npm run generate -- -k ed25519 -p mySecretPassphrase -n 2 ``` ## UI usage The desktop application provides a simple graphical interface: 1. Open the application 2. Select the key type (`Ed25519` is recommended in most cases) 3. Click Generate Key Pair 4. Save the private key securely (never share it) 5. Save the public key to upload or distribute as required ## Typical use cases - Generating `Ed25519` keys for Binance FIX APIs - Generating `RSA` keys for REST or WebSocket APIs that support asymmetric authentication - Rotating API credentials securely - Local development and testing of signed API requests ## Security best practices - Never share your private key - Store private keys securely on disk or in a secrets manager - Use passphrases where supported - Upload only the public key to Binance - Rotate keys periodically and revoke unused credentials --- ## Document: SBE Sample App (Rust) URL: /en/dev-docs/sdks-tools/sample-apps/sbe-rust # SBE Sample App (Rust) The Rust SBE Sample Application is a reference implementation that demonstrates how to **decode Binance API responses encoded using Simple Binary Encoding (SBE)** in a Rust environment. It reads an SBE-encoded payload from **STDIN** and outputs a **human-readable YAML representation** to **STDOUT**, making it useful for inspecting, debugging, and validating SBE responses returned by Binance APIs. For source code, updates, and examples, see the [binance-sbe-rust-sample-app](https://github.com/binance/binance-sbe-rust-sample-app) repository on GitHub. ## Supported environments - Rust (toolchain defined in `rust-toolchain.toml`) - Linux - macOS > This is a sample application intended for local execution and inspection. > It is not a production-ready SDK. ## What this sample demonstrates This application focuses on **decoding SBE-encoded API responses**, not on sending or managing requests. It demonstrates how to: - Decode SBE responses in Rust - Convert binary SBE payloads into human-readable YAML - Pipe SBE responses from REST or WebSocket APIs into a Rust decoder - Reuse generated SBE decoder modules in Rust projects ## Typical use cases - Inspecting and validating SBE responses - Debugging integrations that use SBE - Learning how Binance SBE schemas are decoded in Rust - Building internal tooling around SBE-based APIs - Verifying authentication and request signing workflows with SBE output ## Getting started Clone the repository: ```bash git clone https://github.com/binance/binance-sbe-rust-sample-app.git cd binance-sbe-rust-sample-app ``` Build the sample application: ```bash cargo build ``` The resulting binary is located at: ```text ./target/debug/sbe-sample-app ``` ## Using the sample app The application reads SBE-encoded data from STDIN and prints decoded YAML to STDOUT. ### Example: decoding an SBE REST response ```bash curl -H "Accept: application/sbe" -H "X-MBX-SBE: 3:1" \ "" \ | ./target/debug/sbe-sample-app ``` ### Example: decoding an SBE WebSocket response You can pipe WebSocket responses into the app using a helper script or tool that forwards raw WebSocket messages: ```bash echo '' \ | ./tools/websocket_send.py '' \ | ./target/debug/sbe-sample-app ``` To run `websocket_send.py`, your Python environment must include the websocket-client package. ## Authentication When requesting SBE responses from authenticated endpoints, standard Binance authentication methods apply. Examples in the repository demonstrate usage with: - `HMAC`-based authentication - `RSA`-based authentication - `Ed25519`-based authentication The sample application itself does not perform signing—it only decodes SBE responses. ## SBE decoders The repository includes Rust decoder modules generated from Binance SBE schemas using [Simple Binary Encoding (SBE)](https://github.com/aeron-io/simple-binary-encoding). These decoders can be reused directly in your own Rust projects. If needed, the decoders can be regenerated from the latest schema files by following the instructions in the repository. ## Notes and best practices - This project is intended as a reference and debugging tool - Always validate decoded fields against the official API documentation - Prefer SBE only when binary efficiency or latency is required - For general-purpose integrations, REST or WebSocket APIs may be simpler to use - Use testnet environments when experimenting with authenticated endpoints --- ## Document: SBE Sample App (Java) URL: /en/dev-docs/sdks-tools/sample-apps/sbe-java # SBE Sample App (Java) The Java SBE Sample Application is a reference implementation that demonstrates how to **decode Binance API responses encoded using Simple Binary Encoding (SBE)** in a JVM environment. It reads an SBE-encoded payload from **STDIN** or fetches it directly from an API endpoint, and outputs a **human-readable YAML representation** to **STDOUT**. This makes it useful for inspecting, debugging, and validating SBE responses returned by Binance APIs. For source code, updates, and examples, see the [binance-sbe-java-sample-app](https://github.com/binance/binance-sbe-java-sample-app) repository on GitHub. ## Supported environments - Java 11 or newer - Linux - macOS > This is a sample application intended for local execution and inspection. > It is not a production-ready SDK. ## What this sample demonstrates This application focuses on **decoding SBE-encoded API responses**, not on sending or managing requests. It demonstrates how to: - Decode SBE-encoded API responses - Convert binary SBE payloads into human-readable YAML - Pipe SBE responses from REST or WebSocket APIs into a Java decoder - Reuse generated SBE decoder classes in JVM-based projects ## Typical use cases - Inspecting and validating SBE responses - Debugging integrations that use SBE - Learning how Binance SBE schemas are decoded in Java - Building internal tooling around SBE-based APIs - Verifying authentication and request signing workflows with SBE output ## Getting started Clone the repository: ```bash git clone https://github.com/binance/binance-sbe-java-sample-app.git cd binance-sbe-java-sample-app ``` Build the project using Maven: ```bash mvn clean install ``` This produces the runnable JAR: ```bash ./target/sbe-sample-app-1.0-SNAPSHOT.jar ``` ## Using the sample app The application decodes SBE payloads and writes the decoded output to STDOUT. ### Example: decoding an SBE REST response via STDIN ```bash curl -H "Accept: application/sbe" -H "X-MBX-SBE: 3:1" \ "" \ | java -jar ./target/sbe-sample-app-1.0-SNAPSHOT.jar - ``` ### Example: decoding an SBE WebSocket response You can pipe WebSocket responses into the app using a helper script or tool that forwards raw WebSocket messages: ```bash echo '' \ | ./tools/websocket_send.py '' \ | java -jar ./target/sbe-sample-app-1.0-SNAPSHOT.jar - ``` To run `websocket_send.py`, your Python environment must include the websocket-client package. ### Example: fetching and decoding within the app The sample app can also fetch an SBE-encoded response directly: ```bash java -jar ./target/sbe-sample-app-1.0-SNAPSHOT.jar '' ``` ## Authentication When requesting SBE responses from authenticated endpoints, standard Binance authentication methods apply. Examples in the repository demonstrate usage with: - `HMAC`-based authentication - `RSA`-based authentication - `Ed25519`-based authentication The sample application itself does not perform request signing—it only decodes SBE responses. ## SBE decoders The repository includes Java decoder classes generated from Binance SBE schemas using [Simple Binary Encoding (SBE)](https://github.com/aeron-io/simple-binary-encoding). These decoders can be reused directly in your own Java or JVM-based projects, or adapted for custom SBE pipelines. If needed, the decoders can be regenerated from the latest schema files by following the instructions in the repository. ## Notes and best practices - This project is intended as a reference and debugging tool - Always validate decoded fields against the official API documentation - Prefer SBE only when binary efficiency or latency is required - For general-purpose integrations, REST or WebSocket APIs may be simpler to use - Use testnet environments when experimenting with authenticated endpoints --- ## Document: SBE Sample App (C++) URL: /en/dev-docs/sdks-tools/sample-apps/sbe-cpp # SBE Sample App (C++) The C++ SBE Sample Application is a reference implementation that demonstrates how to **decode Binance API responses encoded using Simple Binary Encoding (SBE)**. It reads an SBE-encoded payload from **STDIN** and outputs a **JSON representation** to **STDOUT**, making it useful for debugging, testing, and validating SBE responses returned by Binance APIs. For source code, updates, and examples, see the [binance-sbe-cpp-sample-app](https://github.com/binance/binance-sbe-cpp-sample-app) repository on GitHub. ## Supported environments - Linux - macOS - C++20 compatible compiler > This is a sample application intended for local execution and inspection. > It is not a production-ready SDK. ## What this sample demonstrates This application focuses on **decoding SBE responses**, not on sending requests itself. It demonstrates how to: - Decode SBE-encoded API responses - Convert binary SBE payloads into human-readable JSON - Work with different authentication schemes when requesting SBE responses - Reuse generated SBE decoders in C++ projects ## Typical use cases - Inspecting and validating SBE responses - Debugging integrations using SBE - Learning how Binance SBE schemas are decoded in C++ - Building internal tooling around SBE-based APIs - Verifying authentication and signing workflows with SBE output ## Getting started Clone the repository: ```bash git clone https://github.com/binance/binance-sbe-cpp-sample-app.git cd binance-sbe-cpp-sample-app ``` Compile the sample application: ```bash c++ -std=c++20 -Wextra -Wall -o sbe-sample-app ./main.cpp ``` The resulting binary (`sbe-sample-app`) reads from STDIN and writes decoded JSON to STDOUT. ## Using the sample app The application is typically used by piping API responses into it. ### Example: decoding an SBE REST response ```bash curl -H "Accept: application/sbe" -H "X-MBX-SBE: 3:1" \ "" \ | ./sbe-sample-app ``` ### Example: decoding an SBE WebSocket response You can pipe WebSocket responses into the app using a helper script or tool that sends WebSocket requests and forwards the raw response: ```bash echo '' \ | ./tools/websocket_send.py '' \ | ./sbe-sample-app ``` To run `websocket_send.py`, your Python environment must include the websocket-client package. ## Authentication When requesting SBE responses from authenticated endpoints, standard Binance authentication methods apply. Examples in the repository demonstrate usage with: - `HMAC`-based authentication - `RSA`-based authentication - `Ed25519`-based authentication The sample app itself does not perform request signing—it only decodes SBE responses. ## SBE decoders The repository includes C++ decoder classes generated from Binance SBE schemas using [Simple Binary Encoding (SBE)](https://github.com/aeron-io/simple-binary-encoding). These decoders can be reused directly in your own C++ projects or adapted for custom SBE pipelines. If needed, the decoders can be regenerated from the latest schema files by following the instructions in the repository. ## Notes and best practices - This project is intended as a reference and debugging tool - Always validate decoded fields against the official API documentation - Prefer SBE only when binary efficiency or latency is required - For general-purpose integrations, REST or WebSocket APIs may be simpler to use - Use testnet environments when experimenting with authenticated endpoints --- ## Document: Postman Collections URL: /en/dev-docs/sdks-tools/postman/collections # Postman Collections Binance maintains an official set of **Postman collections and environments** to help you explore and test Binance **REST APIs** across products. For source code, collections, environments, and updates, see the [binance-api-postman](https://github.com/binance/binance-api-postman) repository on GitHub. ## What’s included - Postman **Collections** for Binance REST endpoints - Postman **Environments** (JSON) for configuring base URLs and credentials > These collections are focused on **REST** usage. WebSocket APIs and WebSocket Streams are > typically not covered by Postman collections. ## Quick start 1. Download (or clone) the `binance-api-postman` repository. 2. In Postman, click **Import** and select the repository’s **root folder**. 3. Choose which **collections** and **environments** you want to import. 4. In Postman → **Environments**, open the environment you’ll use and set your API credentials in the **Current Value** column. 5. Select that environment from the environment dropdown before sending requests. ## Authentication and environments Many endpoints require authentication and signing. The repository provides environment files so you can: - Switch between environments (for example, production vs testnet) by selecting a different Postman environment - Store your API key/secret in Postman environment variables (use **Current Value** so you don’t accidentally export secrets) ## Safety practices When using Postman collections with real credentials, Binance recommends these safety measures: - Only use collections from trusted sources (this repo is the official one) - Review the environment JSON before using it - Avoid enabling withdrawal permissions on API keys - Delete API keys when you finish testing --- ## Document: Rust URL: /en/dev-docs/sdks-tools/connectors/rust # Rust The official Rust connector for Binance APIs, designed for backend applications and services written in Rust. The connector is published as a single crate (`binance-sdk`). You enable the Binance products you need using Cargo features (for example `spot`). It supports REST APIs, WebSocket APIs and WebSocket Streams, and provides built-in request signing, connection management, and strongly typed request and response models. For source code, issues, and release notes, see the [binance-connector-rust](https://github.com/binance/binance-connector-rust) repository on GitHub. ## Supported environments - Rust 1.86 or newer (stable toolchain) - Backend Rust applications and services > This connector is intended for server-side usage only. ## Package structure The Rust connector is published as a single crate with product modules behind feature flags. Enable the products you want in `Cargo.toml` (for example `spot`, `derivatives_trading_usds_futures`, `wallet` etc.), then import the corresponding module in your code. This keeps dependencies minimal and avoids pulling in APIs you don’t use. ## Typical use cases - Low-latency trading and execution services - High-throughput market data ingestion - Backend services managing accounts, balances, and orders - Applications consuming WebSocket APIs or WebSocket Streams for real-time updates ## Key features - Support for Binance REST APIs, WebSocket APIs and WebSocket Streams - Built-in request signing for authenticated endpoints - WebSocket connection handling with automatic reconnection and session renewal - Strongly typed request and response models - Support for both production and testnet environments - Memory-safe and performant Rust API design ## Getting started Enable the product feature you want under `binance-sdk`: ```toml [dependencies] binance-sdk = { version = "", features = ["spot"] } ``` Create a client and send a request: ```rust use anyhow::{Context, Result}; use std::env; use binance_sdk::config::{ConfigurationRestApi, PrivateKey}; use binance_sdk::spot::{SpotRestApi, rest_api::GetAccountParams}; #[tokio::main] async fn main() -> Result<()> { let api_key = env::var("BINANCE_API_KEY").context("BINANCE_API_KEY must be set")?; let private_key = env::var("BINANCE_PRIVATE_KEY").context("BINANCE_PRIVATE_KEY must be set")?; let configuration = ConfigurationRestApi::builder() .api_key(api_key) .private_key(PrivateKey::File(private_key)) .build()?; let spot_client = SpotRestApi::production(configuration); let params = GetAccountParams::default(); let account_info = spot_client .get_account(params) .await .context("get_account request failed")?; Ok(()) } ``` The example above uses asymmetric key authentication. HMAC-based authentication using an API secret is also supported. Refer to the crate documentation for product-specific REST, WebSocket API and WebSocket Streams examples. ## Notes and best practices - Store API keys securely using environment variables or a secrets manager - Prefer WebSocket APIs or Streams for real-time data instead of polling REST endpoints - Monitor rate limits and endpoint weights when building high-throughput services - Use testnet environments when developing and validating integrations --- ## Document: Ruby URL: /en/dev-docs/sdks-tools/connectors/ruby # Ruby The Ruby connector for Binance APIs provides a client for interacting with a subset of Binance REST APIs and WebSocket streams from Ruby applications. This connector is considered **legacy** and is **not actively maintained**. It supports a limited set of Binance products and endpoints compared to newer SDKs available in other languages. For source code, issues, and release notes, see the [binance-connector-ruby](https://github.com/binance/binance-connector-ruby) repository on GitHub. ## Status > ⚠️ **Maintenance status** > > The Ruby connector is currently **not actively maintained**. It supports only a subset of Binance > products and APIs, and may not include newer endpoints or features. > > For full product coverage and ongoing updates, we recommend using one of the actively maintained > SDKs such as JavaScript, Python, Go, Java, PHP or Rust. ## Supported environments - Ruby 2.5 or newer - Backend Ruby applications and scripts > This connector is intended for server-side usage only. ## Package structure The Ruby connector is distributed as a single Ruby gem. It exposes a unified client interface for supported REST APIs and WebSocket streams, following a simple client-based design. Product coverage is limited and may vary depending on the API. ## Typical use cases - Simple scripts interacting with Binance REST APIs - Applications consuming WebSocket streams for market data - Lightweight automation or reporting tasks - Prototyping or existing Ruby-based systems ## Key features - Support for a subset of Binance REST APIs - Support for Binance WebSocket streams - Simple client-based API design - API key and secret authentication - Easy installation via RubyGems ## Getting started Install the connector using RubyGems: ```bash gem install binance-connector-ruby ``` Or add it to your Gemfile: ```ruby gem 'binance-connector-ruby' ``` Then install dependencies: ```bash bundle install ``` Create a client and send requests: ```ruby require 'binance' client = Binance::Spot.new( key: ENV['BINANCE_API_KEY'], secret: ENV['BINANCE_API_SECRET'] ) puts client.account ``` Refer to the repository documentation and the examples folder for additional REST and WebSocket usage examples. ## Notes and best practices - This connector supports REST APIs and WebSocket streams - Product and endpoint coverage is limited and may not reflect the latest Binance APIs - Monitor rate limits carefully, as older clients may not expose detailed weight information - For production systems or full API coverage, use an actively maintained SDK --- ## Document: Python URL: /en/dev-docs/sdks-tools/connectors/python # Python The official Python connector for Binance APIs, designed for backend applications running on Python. The connector is fully modular: each Binance product is published as a separate Python package (for example `binance-spot`), allowing you to install and use only the APIs you need. It supports REST APIs, WebSocket APIs and WebSocket Streams and provides built-in request signing, connection management, and typed request/response models for a consistent development experience. For source code, issues, and release notes, see the [binance-connector-python](https://github.com/binance/binance-connector-python) repository on GitHub. ## Supported environments - Python 3.9 or newer - Backend Python applications and services > This connector is intended for server-side usage only. Interactive or client-side Python > environments are not supported. ## Package structure Each Binance product is published as an independent Python package. Commonly used packages include: - `binance-sdk-spot` - `binance-sdk-derivatives-trading-usds-futures` - `binance-sdk-derivatives-trading-coin-futures` - `binance-sdk-wallet` - _(additional products follow the same structure)_ This modular approach keeps dependencies minimal and makes upgrades and integrations easier to manage. ## Typical use cases - Trading and execution services - Real-time and historical market data ingestion - Backend services managing accounts, balances, and orders - Applications consuming WebSocket APIs or WebSocket Streams for low-latency updates ## Key features - Support for Binance REST APIs, WebSocket APIs and WebSocket Streams - Built-in request signing for authenticated endpoints - WebSocket connection handling with automatic reconnection and session renewal - Typed request and response models - Support for both production and testnet environments - Consistent API design across products ## Getting started Install the package for the product you want to integrate with: ```bash pip install binance-sdk-spot ``` Create a client and send a request: ```python from binance_sdk_spot.spot import Spot, ConfigurationRestAPI configuration_rest_api = ConfigurationRestAPI( api_key=os.environ["BINANCE_API_KEY"], private_key=os.environ["BINANCE_PRIVATE_KEY"], ) spot_client = Spot(config_rest_api=configuration_rest_api) account_info = spot_client.rest_api.get_account() ``` The example above uses asymmetric key authentication. HMAC-based authentication using an API secret is also supported. Refer to each package’s documentation for product-specific REST, WebSocket API and WebSocket Streams examples. ## Notes and best practices - Store API keys securely using environment variables or a secrets manager - Prefer WebSocket APIs or Streams for real-time data instead of polling REST endpoints - Monitor rate limits and endpoint weights when building high-throughput services - Use testnet environments when developing and validating integrations --- ## Document: PHP URL: /en/dev-docs/sdks-tools/connectors/php # PHP The official PHP connector for Binance APIs, designed for backend applications and services written in PHP. The connector provides an idiomatic PHP interface to Binance REST APIs. It includes built-in request signing, configuration helpers, and typed request and response models to help you build reliable server-side integrations. For source code, issues, and release notes, see the [binance-connector-php](https://github.com/binance/binance-connector-php) repository on GitHub. ## Supported environments - PHP 8.4 or newer - Backend PHP applications and services > This connector is intended for server-side usage only. > Browser-based or client-side PHP environments are not supported. ## Package structure The PHP connector is published as a single Composer package. Product-specific REST APIs (such as `Spot`, `DerivativesTradingUsdsFutures`, `Wallet`, and others) are organized into namespaces within the library. This structure keeps APIs clearly separated while allowing shared configuration, authentication, and transport logic. ## Typical use cases - Trading and execution services using REST APIs - Backend services managing accounts, balances, and orders - Historical market data ingestion - Automation and reporting workflows ## Key features - Support for Binance REST APIs - Built-in request signing for authenticated endpoints - Typed request and response models - Support for both production and testnet environments - Consistent and idiomatic PHP API design ## Getting started Install the connector using Composer: ```bash composer require binance/binance-connector-php ``` Create a client and send a request: ```php apiKey(getenv('BINANCE_API_KEY')) ->privateKey(getenv('BINANCE_PRIVATE_KEY_FILE_PATH')); $spotClient = new SpotRestApi($configurationBuilder->build()); $accountInfo = $spotClient->getAccount(); ``` The example above uses asymmetric key authentication. HMAC-based authentication using an API secret is also supported. Refer to the repository documentation for additional REST API examples. ## Notes and best practices - Store API keys securely using environment variables or a secrets manager - Monitor rate limits and endpoint weights when building high-throughput services - Use testnet environments when developing and validating integrations --- ## Document: JavaScript URL: /en/dev-docs/sdks-tools/connectors/javascript # JavaScript The official JavaScript connector for Binance APIs, designed for backend applications running on Node.js. The connector is fully modular: each Binance product is published as a separate `npm` package (for example `@binance/spot`), allowing you to install and use only the APIs you need. It supports REST APIs, WebSocket APIs and WebSocket Streams and provides built-in request signing, connection management and TypeScript definitions. For source code, issues, and release notes, see the [binance-connector-js](https://github.com/binance/binance-connector-js) repository on GitHub. ## Supported environments - Node.js v22 or newer (LTS versions recommended) - JavaScript and TypeScript backend applications > This connector is intended for server-side usage only. > Browser environments are not supported at this time. ## Package structure Each Binance product is published as an independent `npm` package under the `@binance` scope. Commonly used packages include: - `@binance/spot` - `@binance/derivatives-trading-usds-futures` - `@binance/derivatives-trading-coin-futures` - `@binance/wallet` - _(additional products follow the same structure)_ This modular approach keeps dependencies minimal and makes upgrades and integrations easier to manage. ## Typical use cases - Trading and execution services - Real-time and historical market data ingestion - Backend services managing accounts, balances, and orders - Applications consuming WebSocket APIs or WebSocket Streams for low-latency updates ## Key features - Support for Binance REST APIs, WebSocket APIs and WebSocket Streams - Built-in request signing for authenticated endpoints - WebSocket connection handling with automatic reconnection and session renewal - First-class TypeScript definitions - Support for both production and testnet environments - Consistent API design across products ## Getting started Install the package for the product you want to integrate with: ```bash npm install @binance/spot ``` Create a client and send a request: ```ts import { Spot } from "@binance/spot"; const spotClient = new Spot({ apiKey: process.env.BINANCE_API_KEY, privateKey: process.env.BINANCE_PRIVATE_KEY, }); const accountInfo = await spotClient.restAPI.getAccount(); ``` The example above uses asymmetric key authentication. HMAC-based authentication using an API secret is also supported. Refer to each package’s documentation for product-specific REST, WebSocket API and WebSocket Streams examples. ## Notes and best practices - Store API keys securely using environment variables or a secrets manager - Prefer WebSocket APIs or Streams for real-time data instead of polling REST endpoints - Monitor rate limits and endpoint weights when building high-throughput services - Use testnet environments when developing and validating integrations --- ## Document: Java URL: /en/dev-docs/sdks-tools/connectors/java # Java The official Java connector for Binance APIs, designed for backend applications and services running on the JVM. The connector provides a modular and idiomatic Java interface to Binance APIs, supporting REST APIs, WebSocket APIs and WebSocket Streams. It includes built-in request signing, connection management, and strongly typed request and response models to help you build reliable and maintainable integrations. For source code, issues, and release notes, see the [binance-connector-java](https://github.com/binance/binance-connector-java) repository on GitHub. ## Supported environments - Java 11 or newer - Backend Java applications and JVM-based services > This connector is intended for server-side usage only. ## Package structure The Java connector is published as a set of product-specific artifacts. Each Binance product is distributed as an independent dependency (for example `binance-sdk-spot`), allowing you to include only the APIs you need. This modular structure keeps dependencies minimal and makes upgrades and integrations easier to manage. ## Typical use cases - Trading and execution services - Real-time and historical market data ingestion - Backend services managing accounts, balances, and orders - Applications consuming WebSocket APIs or WebSocket Streams for low-latency updates ## Key features - Support for Binance REST APIs, WebSocket APIs and WebSocket Streams - Built-in request signing for authenticated endpoints - WebSocket connection handling with automatic reconnection and session renewal - Strongly typed request and response models - Support for both production and testnet environments - Consistent and idiomatic Java API design ## Getting started Install the dependency for the product you want to integrate with: ```xml io.github.binance binance-spot ``` Create a client and send a request: ```java import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.spot.rest.api.SpotRestApi; import com.binance.connector.client.common.ApiResponse; import com.binance.connector.client.spot.rest.model.GetAccountResponse; public class Main { public static void main(String[] args) throws Exception { SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey(System.getenv("BINANCE_API_KEY")); signatureConfiguration.setPrivateKey(System.getenv("BINANCE_PRIVATE_KEY")); ClientConfiguration clientConfiguration = new ClientConfiguration(); clientConfiguration.setSignatureConfiguration(signatureConfiguration); SpotRestApi spotApi = new SpotRestApi(clientConfiguration); ApiResponse accountInfo = spotApi.getAccount(); } } ``` The example above uses asymmetric key authentication. HMAC-based authentication using an API secret is also supported. Refer to each package’s documentation for product-specific REST, WebSocket API and WebSocket Streams examples. ## Notes and best practices - Store API keys securely using environment variables or a secrets manager - Prefer WebSocket APIs or Streams for real-time data instead of polling REST endpoints - Monitor rate limits and endpoint weights when building high-throughput services - Use testnet environments when developing and validating integrations --- ## Document: Go URL: /en/dev-docs/sdks-tools/connectors/go # Go The official Go connector for Binance APIs, designed for backend applications and services written in Go. The connector provides a modular and idiomatic Go interface to Binance APIs, supporting REST APIs, WebSocket APIs and WebSocket Streams. It includes built-in request signing, connection management, and strongly typed request and response structures for building reliable and maintainable integrations. For source code, issues, and release notes, see the [binance-connector-go](https://github.com/binance/binance-connector-go) repository on GitHub. ## Supported environments - Go 1.24 or newer - Backend Go applications and services > This connector is intended for server-side usage only. Browser-based or WebAssembly environments > are not supported. ## Package structure The Go connector is published as a single module that exposes clients for different Binance products. Product-specific functionality is organized into dedicated packages within the repository, such as `spot`, `derivativestradingusdsfutures`, `wallet`, and others. This structure keeps APIs clearly separated while allowing you to share configuration, authentication, and transport logic across clients. ## Typical use cases - Trading and execution services - Real-time and historical market data ingestion - Backend services managing accounts, balances, and orders - Applications consuming WebSocket APIs or WebSocket Streams for low-latency updates ## Key features - Support for Binance REST APIs, WebSocket APIs and WebSocket Streams - Built-in request signing for authenticated endpoints - WebSocket connection handling with automatic reconnection and session renewal - Strongly typed request and response structures - Support for both production and testnet environments - Idiomatic Go API design ## Getting started Install the package for the product you want to integrate with: ```bash go get github.com/binance/binance-connector-go/clients/spot ``` Create a client and send a request: ```go package main import ( "context" "os" spotClient "github.com/binance/binance-connector-go/clients/spot" "github.com/binance/binance-connector-go/common/common" ) func main() { config := common.NewConfigurationRestAPI( common.WithApiKey(os.Getenv("BINANCE_API_KEY")), common.WithPrivateKey(os.Getenv("BINANCE_PRIVATE_KEY")), ) client := spotClient.NewBinanceSpotClient( spotClient.WithRestAPI(config), ) accountInfo, err := client .RestApi .AccountAPI .GetAccount(context.Background()) .Execute() } ``` The example above uses asymmetric key authentication. HMAC-based authentication using an API secret is also supported. Refer to the repository documentation for product-specific REST, WebSocket API and WebSocket Streams examples. ## Notes and best practices - Store API keys securely using environment variables or a secrets manager - Prefer WebSocket APIs or Streams for real-time data instead of polling REST endpoints - Monitor rate limits and endpoint weights when building high-throughput services - Use testnet environments when developing and validating integrations --- ## Document: FIX (Python) URL: /en/dev-docs/sdks-tools/connectors/fix-python # FIX (Python) The Python FIX connector provides access to Binance Financial Information eXchange (FIX) APIs using the FIX protocol. This connector is intended for **advanced and institutional use cases** that require low-latency order entry, execution, and session-based trading workflows. It exposes Binance Spot FIX message types and session flows and allows you to place orders, cancel orders, and track order status using FIX messages. For source code, issues, and release notes, see the [binance-fix-connector-python](https://github.com/binance/binance-fix-connector-python) repository on GitHub. ## Supported environments - Python 3.9 or newer - Backend services and trading systems > This connector is intended for server-side usage only and requires a persistent FIX session. ## Scope and capabilities The FIX Python connector supports: - Binance Spot FIX Order Entry - Order placement and cancellation - Execution reports and order state updates - Session-based FIX communication This connector **does not** replace REST or WebSocket APIs and is designed for specialized trading workflows. ## Authentication > ⚠️ **Important** > > Binance FIX APIs **only support Ed25519 keys**. Other authentication methods (such as HMAC or RSA) > are not supported. Before using the FIX connector, ensure that: - You have generated an `Ed25519` key pair - Your API key has FIX permissions enabled - You are using the correct FIX endpoint for production or testnet Refer to the following guides: - [How to generate an Ed25519 key pair (mainnet)](https://www.binance.com/en/support/faq/how-to-generate-an-ed25519-key-pair-to-send-api-requests-on-binance-6b9a63f1e3384cf48a2eedb82767a69a) - [Binance Spot FIX API documentation](/products/spot/fix-api) ## Installation Install the connector using `pip`: ```bash pip install binance-fix-connector ``` > The package is published on PyPI as `binance-fix-connector`. Source code is maintained in the > GitHub repository linked above. ## Getting started All FIX messages are created and managed through the `create_order_entry_session` helper, which establishes a FIX session and exposes utilities to create and send messages. The example below demonstrates how to establish a FIX Order Entry session and submit a simple limit order. ```python import time from binance_fix_connector.fix_connector import create_order_entry_session from binance_fix_connector.utils import get_private_key API_KEY = "" PRIVATE_KEY = get_private_key("/path/to/private.key") FIX_OE_URL = "tcp+tls://fix-oe.testnet.binance.vision:9000" client = create_order_entry_session( api_key=API_KEY, private_key=PRIVATE_KEY, endpoint=FIX_OE_URL, ) # Wait for logon client.retrieve_messages_until(message_type="A") # Create and send a NewOrderSingle (D) msg = client.create_fix_message_with_basic_header("D") msg.append_pair(11, str(time.time_ns())) # ClOrdID msg.append_pair(55, "BNBUSDT") # Symbol msg.append_pair(54, 1) # Side (BUY) msg.append_pair(38, 1) # OrderQty msg.append_pair(40, 2) # OrdType (LIMIT) msg.append_pair(44, 730) # Price msg.append_pair(59, 1) # TimeInForce (GTC) client.send_message(msg) # Receive execution reports responses = client.retrieve_messages_until(message_type="8") ``` Refer to the repository documentation for more examples. ## Typical use cases - Low-latency order entry and execution - Institutional or professional trading systems - FIX-based integrations requiring session control - Advanced trading infrastructure where REST or WebSocket APIs are not sufficient ## Notes and best practices - FIX APIs require a persistent TCP/TLS connection - Always handle session lifecycle events (logon, heartbeat, logout) - Use testnet endpoints for development and validation - Consider implementing reconnect/backoff logic and monitoring session health - This connector is intended for experienced FIX users - For general-purpose integrations, prefer REST or WebSocket APIs --- ## Document: .NET URL: /en/dev-docs/sdks-tools/connectors/dotnet # .NET The .NET connector for Binance APIs provides a client for interacting with a subset of Binance REST APIs, WebSocket APIs, and WebSocket streams from .NET applications. This connector is considered **legacy** and is **not actively maintained**. It supports a limited set of Binance products and endpoints compared to newer SDKs available in other languages. For source code, issues, and release notes, see the [binance-connector-dotnet](https://github.com/binance/binance-connector-dotnet) repository on GitHub. ## Status > ⚠️ **Maintenance status** > > The .NET connector is currently **not actively maintained**. It supports only a subset of Binance > products and APIs, and may not include newer endpoints or features. > > For full product coverage and ongoing updates, we recommend using one of the actively maintained > SDKs such as JavaScript, Python, Go, Java, PHP or Rust. ## Supported environments - .NET 6.0 or newer - Backend .NET applications and services > This connector is intended for server-side usage only. ## Package structure The .NET connector is distributed as one or more `NuGet` packages. It exposes client interfaces for supported REST APIs, WebSocket streams, and WebSocket APIs. Product coverage is limited and may vary depending on the API. ## Typical use cases - Backend services interacting with Binance REST APIs - Applications consuming WebSocket streams for real-time data - Applications using WebSocket APIs for request–response communication - Existing .NET systems requiring Binance integrations ## Key features - Support for a subset of Binance products and endpoints - HMAC and RSA-based request signing - Integration with the .NET logging ecosystem ## Getting started Install the connector using NuGet: ```bash dotnet add package Binance.Spot ``` Create a client and send a request: ```csharp using System; using System.Threading.Tasks; using Binance.Spot; class Program { static async Task Main(string[] args) { var market = new Market(); var serverTime = await market.CheckServerTime(); Console.WriteLine(serverTime); } } ``` Refer to the repository documentation and the examples folder for additional REST, WebSocket API, and WebSocket Stream usage examples. ## Notes and best practices - This connector supports REST APIs, WebSocket APIs, and WebSocket streams - Product and endpoint coverage is limited and may not reflect the latest Binance APIs - Monitor rate limits carefully, as older clients may not expose detailed weight information - For production systems or full API coverage, use an actively maintained SDK --- ## Document: Binance Web3 ON-Chain API Specification URL: /en/dev-docs/products/web3-task-verification/on-chain-verification # Binance Web3 ON-Chain API Specification ## Web3 API description - Binance's Partners need to follow the API specification in this doc in order to integrate with Binance. ## API Specification​ ### EVM Compatible Blockchains #### VerificationProvider ```solidity abstract contract VerificationProvider { // verify is to check if the user is verified in the partner's system function verify(address addr) external view virtual returns (bool pass, string memory message); } ``` You are required to implement the `VerificationProvider` contract in your smart contract. The `verify` function should return `true` if the verification is successful, otherwise `false`. The `message` should contain the reason for the failure. #### Example ```solidity contract Example is VerificationProvider { function verify(address user) external view override returns (bool pass, string memory message) { if (user == address(0)) { return (false, "Invalid address"); } return (true, "Verified"); } } ``` ### Non EVM Compatible Blockchains Currently, We do not support non EVM compatible blockchains. Please refer to [off-chain verfication.](/docs/products/web3-task-verification/apis) --- ## Document: Binance Web3 API Specification URL: /en/dev-docs/products/web3-task-verification/apis # Binance Web3 API Specification ## Web3 API description - Binance's Partners need to follow the API specification in this doc to provide Binance with a set of endpoints that Binance will call to check if a user has completed specific tasks (like a deposit, swap,etc.). ## General API Information - All endpoints return a common JSON object with "code", "message" and "data", no matter if it's a success or not. - Here "data" is either a customized JSON object or a simple type (int, string...). It may vary from endpoint to endpoint. ```json { "code": "XXXXXX", "message": "success", "data": { "abc": "efg", ... } } ``` - General codes in responses: | code | Description | | --- | --- | | 000000 | success | | 000001 | too many requests | | 000006 | invalid argument | | 000007 | other error | - All time and timestamp related fields are in milliseconds. - HTTP 5XX return codes are used for internal errors. The issue is on the partner's side. Binance will **NOT** treat this as a failure operation; the execution status is UNKNOWN. - For GET endpoints, parameters must be sent as a query string. - Parameters may be sent in any order. - Each request and response should be logged in both Binance and partner's sides for further investigation. - Every partner needs to define a url prefix so that Binance can invoke the partner's endpoint using prefix + endpoint_url. E.g. https://tasks-api.x.build/api/v1/task/completion?walletAddress=xx&task=["deposit"] * **Front all OpenAPI endpoints with a WAF** - Place every public endpoint behind a Web Application Firewall. - Enable core protections (SQLi, XSS, RCE) and basic rate/behavior policies. * **Rate limiting & overload protection** - Enforce global and per-key limits (per IP / user / token), plus per-endpoint limits on critical paths. - When capacity is exceeded, return **HTTP 429 (Too Many Requests)** and include a `Retry-After` header. - Consider circuit breakers and exponential backoff hints for clients. ## API Specification​ ### Task Completion ``` GET /v1/task/completion ``` **Parameters:** | Name | Type | Mandatory | Description | | ------------- | ----------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | walletAddress | String | YES | a user's unified id | | task | String json array | YES | Task ID used to identify the task. Try to use a Task ID that is relevant and descriptive of the task, not a random or arbitrary string. For example, task=["deposit","withdraw"]. If it's not empty, just return corresponding task completion status. Otherwise, return all tasks completion statuses. | **Response Body:** | Name | Type | Mandatory | | ------- | ----------- | --------- | | code | String | YES | | message | String | YES | | data | JSON Object | YES | **Examples:** ```json GET {prefix} + /v1/task/completion?walletAddress=0xabcdefg&task=["deposit", "withdrawal"] Response: { "code": "000000", "message": "success", "data": { "withdrawal": true, // complete "deposit": false, // incomplete } } { "code": "000006", "message": "invalid argument", "data": null } ``` - **Task verification (`verify` API)** - Flow: After a user completes a task and taps **Verify**, Binance backend calls your `verify` API to confirm completion. - **Latency SLO**: **P99 \< 1s**, **hard timeout ≤ 3s** (set a server-side timeout of 3 seconds). - **Observability**: Monitor latency (P50/P95/P99), error ratio, dependency timing; alert on timeouts and anomalies, and investigate immediately. - **Correctness over speed**: Do not return success/failure optimistically if data is inconclusive. - **Response shape**: - If incomplete, return a clear reason to reduce support load (e.g., a missing sub-step). Example: ```json { "completed": false, "reason": "Subtask 'bridge_tx_confirmed' not met (0/1 confirmations)", "evidence": null } ``` - Success example: ```json { "completed": true, "reason": null, "evidence": { "tx_hash": "0xabc...123", "chain_id": 56, "timestamp": 1732178452 } } ``` ## Web3 API Performance - Ensure your API can support >=**50 QPS.** - In special cases, Binance will review your campaign and contact you to increase the API QPS threshold. (E.g. Marketing plan is possible to attract extra traffic to your campaign, or special task design will cause high peak verification queries) - API performance is vital. So please conduct a performance test on the API. - Before developing the API, review the campaign mechanism. Avoid mechanisms requiring all users to verify tasks at the same time. (E.g. a task user can only verify on the last day of a campaign) - When API encounters performance issues, please return an error (error code:000002) to the caller. ## API Maintenance Periods: - Maintain the API till 3 days after the campaign end time. - E.g.: the campaign using your API ends on 1st Jan 2025 00:00(UTC), then the earliest time you can sunset the API is 4th Jan 2025 00:00(UTC) - Before you sunset the API, please ensure no traffic hits your API. If there is still traffic to your API, please contact the Binance team. ## Other Good Practise for API Developing: - Use 95% of the original criteria to verify user’s task status. - E.g. for a task that requires the user to stake more than 10 USDT, the API should return completed (True) if the user takes more than 9.5 USDT. - Avoid API changes before sunsetting the API. - Please update stakeholders if the API has to be updated due to logic change or issue fix. - Monitor the API performances especially the 1st 4 hours after the campaign launch time. * **Observability & slow-query management** - Enable slow-query logs for **DB** and **Redis** (or other caches) and wire up application/APM monitoring (latency percentiles, error codes, dependency timings). - Use distributed tracing (Trace/Span IDs) end-to-end so you can pinpoint bottlenecks quickly. - Define alert thresholds and on-call procedures for timeouts and rising error rates. * **SQL review & caching strategy** - Audit **all** SQL statements: - Ensure predicates use appropriate **indexes**; avoid full scans and implicit casts. - Review execution plans (`EXPLAIN`) and data distribution regularly. - Identify **hot keys** / high-QPS reads; use **Redis** (or similar) with proper TTLs and invalidation/backfill. - Protect against cache **penetration / breakdown / avalanche** (e.g., negative caching, jittered TTLs, bulkhead isolation). - Revisit schema/index health periodically; consider archival, read replicas, or sharding where needed. Provide feedback on this document: --- ## Document: DApp Self-Testing Manual URL: /en/dev-docs/products/web3-dapp/self-testing # DApp Self-Testing Manual _SDK integration, DApps listing are independent. Well-tested DApps will help to reduce partly campaign workload._ ## Summary For all parties interested in cooperating with Binance Web3 Wallet, this manual contains all relevant information, including [integrating the Binance Web3 Connect SDK](/products/web3-connect/introduction) and **joining the Binance Web3 Wallet Dapp Zone**. **Self-testing** by the project party is essential. The Binance Web3 Wallet team strongly recommends that all projects complete self-testing according to the provided instructions to maximize user experience. Binance reserves the right to reject applications from projects that demonstrate low testing quality. Please read the following information carefully. ## How to test dApp 1. Type your url in the latest Binance Web3 wallet browser. 2. Test all the features in DApps. You could refer to the following test case checklist for guidance. ![browser-entry](/img/web3-dapp/browser-entry.png) ## Frequent Problems ### Error Code : ‘Network not supported for this wallet’ Project website should detect and change to the corresponding chain when users connect. For BEVM, check the `window.ethereum` chainId to change to the correct chain. ### IOS/Android Login Problem Check SDK status and Internet/VPN connection. ### RPC problem When testing on chain actions, projects might find the gas fee abnormally high. In this situation, projects could try the test with Trust Wallet and other Wallets like Metamask. If it only happens in Trust Wallet and Binance Wallet, it would be Binance’s RPC issue. Please contact Jasmine G @P0kEjasmine if this happens. ### Mobile Login Issue Ensure that the Binance App version for both IOS and Android is updated to the **latest version**. ## Test Case Checklist ### SDK | Category | Feature (Web, IOS and Android) | | ---------------- | -------------------------------------------------------------------------------------------------------------------- | | Connect Wallet | Can get wallet address and chainID. | | Send Transaction | The whole transaction process should be successful and can be checked on the chain. | | Sign message | The signature value should be valid | | Logo exposure | E.g.
| ### dApps | Category | Feature (IOS and Android) | | ---------------- | ------------------------------------------------------------------------------------- | | Connect Wallet | Wallet connects successfully and stably. (Without page redirection) | | | Binance Logo Exposure Success (Web & App) | | Send Transaction | All send transaction cases are successful. (e.g. Swap, Approve, etc.) | | | The gas fee is in the normal range. | | User Experience | The font size and icons are displayed appropriately. | | | All the URLs in the dApp can be opened in Binance directly. | | | The project will automatically switch to the user's current chain if it is supported. | | | All cases should be checked in both IOS and Android | --- ## Document: DApp Self-Listing Manual URL: /en/dev-docs/products/web3-dapp/self-listing # DApp Self-Listing Manual ## Introduction This manual serves to guide any dApp team wishing to have their dApp listed within Binance Web3 Wallet. However, before the dApp can be listed officially, any team is required to go through a self testing process to ensure the dApp and Binance Web3 Wallet SDK integration functions as intended within Binance Web3 Wallet on Binance App. In order for the dApp team to conduct a self test before the dApp is officially released to the general public within Binance Web3 Wallet, the dApp URL will be whitelisted for the dApp team to conduct self testing within the Binance environment. Only dApps passing the quality control process will be shown and released to the general public within Binance Web3 Wallet with the following route: [Web3] - [Discover] - [dApps] [Web3] - [Discover] - [dApps] - dApp Main Page ![DApp](/img/web3-dapp/discover-dapps.jpg) **Please Notice:** 1. All submitted applications are expected to receive review results within **7** business days. 2. Test all the features in DApps. You could refer to the following test case checklist for guidance. 3. Having an 'Approved' status for a DApp application **does not guarantee** display unless the DApp passes Binance's quality control test, which aligns with the standards outlined in the [self-test checklist](/products/web3-dapp/self-testing#test-case-checklist). Therefore, we strongly recommend the dApp team to follow the test guide above and conduct sufficient self tests to facilitate the process of being listed. 4. Any application that fails to comply with the established rules may be rejected. ## How to apply? 1. Log in [Binance developer center](https://developers.binance.com/en/dapps) 2. Read the [rules](/products/web3-dapp/operation-rules) ![how-to-apply](/img/web3-dapp/how-to-apply.jpg) 3. Click [DApp],then click [Get started], and click [Apply] in the subpage. ![apply-DApp](/img/web3-dapp/apply-dapp.jpg) 4. Fill in the [application form](https://developers.binance.com/en/dapps/application-management/apply). ![DApp-application](/img/web3-dapp/dapp-application.jpg) 5. After completing the application form, the status in the Application Management page will change to 'under Review'. ![under-review](/img/web3-dapp/under-review.jpg) 6. Binance will conduct a quality control test following the [self-test checklist](self-testing#test-case-checklist) within 5 business days after application approval. A full self-test is a prerequisite for self-listing. Binance will only list the dApps that complete [Binance Web3 wallet integration](/products/web3-connect/introduction) (including Binance Logo exposure) and pass all items in the [self-test checklist](self-testing#test-case-checklist). --- ## Document: Web3 DApp Platform Operation Rules URL: /en/dev-docs/products/web3-dapp/operation-rules # Web3 DApp Platform Operation Rules ## 1. Operation Rules ### 1.1 Rules for Registration and Submission 1.1.1 The developer should provide true and valid contact information or entity certification information. It is necessary to ensure that the entity actually providing services through the DApp must be consistent with the entity information. 1.1.2 The DApp submitted by the developer shall be associated with websites, applications, products or services that have complete legal rights or complete authorization. 1.1.3 To ensure the security and stability of the platform that users can access safely, the platform may require that the developer upload appropriate documents or make certain additions or adjustments to the DApp when submitting or operating the DApp. Be sure to provide such assistance based on our requirements or the submission may be rejected. 1.1.4 The services provided by the DApp shall match the category and tags the developer chooses as well as the services that the Web3 DApp provides. ### 1.2 Rules for Basic Information 1.2.1 The name, logo, and brief description of a DAPP constitutes its account's basic information, which shall accurately describe its features and content, help users easily understand it, and be consistent with users' expectations of its features and services. 1.2.2 The basic information of DApp accounts shall not make unauthorized use of trademarks or brand logos to which third parties enjoy the legal rights to, or other content, information or special superscripts/subscripts similar to these trademarks or brand logos. Developers shall not infringe upon third parties' intellectual property rights or other legal rights. --- ## Document: Tron Provider URL: /en/dev-docs/products/web3-connect/tron-provider # Tron Provider # Tron Provider ## `@tronweb3/tronwallet-adapter-binance` This package provides an adapter to enable TRON DApps to connect to the [Binance Wallet](https://www.binance.com/en/binancewallet). ## Demo ```typescript import { BinanceWalletAdapter } from "@tronweb3/tronwallet-adapter-binance"; const adapter = new BinanceWalletAdapter(); // connect to BinanceWallet await adapter.connect(); // then you can get address console.log(adapter.address); const tronWeb = new TronWeb({ fullHost: "https://api.trongrid.io", }); // create a send TRX transaction const unSignedTransaction = await tronWeb.transactionBuilder.sendTrx(targetAddress, 100, adapter.address); // using adapter to sign the transaction const signedTransaction = await adapter.signTransaction(unSignedTransaction); // broadcast the transaction await tronWeb.trx.sendRawTransaction(signedTransaction); ``` ## Documentation ### API - `Constructor(config: BinanceWalletAdapterConfig)` ```typescript interface BinanceWalletAdapterConfig { /** * Set if open Wallet's website when wallet is not installed. * Default is true. */ openUrlWhenWalletNotFound?: boolean; /** * Timeout in millisecond for checking if TokenPocket wallet is supported. * Default is 2 * 1000ms */ checkTimeout?: number; /** * Set if open TokenPocket app using DeepLink on mobile device. * Default is true. */ openAppWithDeeplink?: boolean; } ``` - `network()` method is supported to get current network information. The type of returned value is `Network` as follows: ```typescript export enum NetworkType { Mainnet = "Mainnet", Shasta = "Shasta", Nile = "Nile", /** * When use custom node */ Unknown = "Unknown", } export type Network = { networkType: NetworkType; chainId: string; fullNode: string; solidityNode: string; eventServer: string; }; ``` ### Caveats - Binance Wallet doesn't implement `multiSign()` and `switchChain()`. - Binance Wallet App does not support any events. For more information about tronwallet adapters, please refer to [`@tronweb3/tronwallet-adapters`](https://github.com/tronweb3/tronwallet-adapter/tree/main/packages/adapters/adapters) --- ## Document: Ton Provider URL: /en/dev-docs/products/web3-connect/ton-provider # Ton Provider # Ton Provider ## Introduction[](https://developers.devfdg.net/docs/binance-w3w/ton-provider#ton-provider-api) Binance Web3 Wallet's TON API is fully compliant with the [Ton Connect protocol](https://docs.ton.org/develop/dapps/ton-connect/protocol/). By connecting to our TON API Provider, you can use the [TON Connect SDK](https://docs.ton.org/develop/dapps/ton-connect/developers) to integrate with Binance Web3 Wallet. There are 2 ways to integrate with Binance Web3 Wallet: JS Bridge API: for apps opened within the wallet; or when the wallet is a browser extension. HTTP Bridge API: for apps opened outside the wallet The last section, “Interactions”, provides detailed instructions on implementing specific Binance Web3 Wallet interactions. Especially for conducting airdrop campaigns, some interactions are more desirable than others. ## JS Bridge API[](https://developers.devfdg.net/docs/binance-w3w/ton-provider#js-bridge-api) When the dapp is opened in the Binance Web3 Wallet browser, the `window.binancew3w` object will be injected into the global scope. The object contains the `tonconnect` object, which is the bridge object for the TON Connect protocol. ### Provider Detection[](https://developers.devfdg.net/docs/binance-w3w/ton-provider#provider-detection) ```js window.binancew3w.tonconnect; ``` The data structure of the object it points to is as follows: ```js interface TonConnectBridge { deviceInfo: DeviceInfo walletInfo?: WalletInfo protocolVersion: number connect(protocolVersion: number, message: ConnectRequest): Promise restoreConnection(): Promise send(message: AppRequest): Promise listen(callback: (event: WalletEvent) => void): () => void } ``` The version of Ton Connect supported by Binance Web3 Wallet is currently 2. For more information, see [ton-connect bridge api](https://docs.ton.org/develop/dapps/ton-connect/protocol/bridge) and [ton-connect requests and responses](https://docs.ton.org/develop/dapps/ton-connect/protocol/requests-responses) ### Example[](https://developers.devfdg.net/docs/binance-w3w/ton-provider#example) To connect to our wallet to get the wallet address as an identifier and the necessary parameters used to sign the transaction: ```js const result = await window.binancew3w.tonconnect.connect(2, { manifestUrl: "https://example.com/manifest.json", items: [{ name: "ton_addr" }], }); if (result.event === "connect") { console.log(result.payload.items, result.payload.device); } if (result.event === "connect_error") { console.error(result.payload.error.code, result.payload.error.message); } ``` ## HTTP Bridge API[](https://developers.devfdg.net/docs/binance-w3w/ton-provider#http-bridge-api) If the dapp is not opened in the Binance Web3 Wallet browser, the `window.binancew3w` object will not be injected into the global scope. In this case, the dapp can use the [HTTP bridge API](https://github.com/ton-blockchain/ton-connect/blob/main/bridge.md) to interact with the wallet. ### Provider Detection[](https://developers.devfdg.net/docs/binance-w3w/ton-provider#provider-detection-1) Let say dapp with ID A connects to the bridge to listen to incoming requests from wallet with ID B. ```bash request GET https://bridge.tonapi.io/bridge/events?client_id= Accept: text/event-stream ``` Sending message from client A to client B. Bridge returns error if ttl is too high. ```bash request POST https://bridge.tonapi.io/bridge/message?client_id=?to=&ttl=300&topic=sendTransaction body: ``` Dapp need to encrypt the message before sending it to the bridge with id of client B as public key. And client B will decrypt the message with its private key. When the bridge receives a message base64_encoded_message from client A addressed to client B, it generates a message BridgeMessage: ```json { "from": , "message": } ``` Client B send a message to client A. Client A will receive a message from the bridge. Dapp need to decrypt the message with its private key(id of client A). ```json { "from": , "message": } ``` ## Interactions To offer clarity on certain Binance Web3 Wallet interactions which is most appropriate for your dApp. ### Directly Open Binance Web3 Wallet If you want to open Binance Web3 wallet directly without the user selecting a wallet, you can follow the steps below: 1. Add a button with the text `Binance Web3 Connect` 2. Add the following code. > Assume the id of the button above is binance-w3w-connect. ```js import TonConnectUI from "@tonconnect/ui"; // create an instance of TonConnectUI const tonConnectUI = new TonConnectUI({ manifestUrl: "https://ton-connect.github.io/demo-dapp-with-react-ui/tonconnect-manifest.json", buttonRootId: "your-button-root-id", }); // add event listener to the button document.querySelector("#binance-w3w-connect").addEventListener("click", async () => { await tonConnectUI.openSingleWalletModal("binanceWeb3TonWallet"); }); ``` After that, when the user clicks the `Binance Web3 Connect` button, the Binance wallet app will be opened directly. ### Call Specific Page or Action If you want to open a specific page like swap, bridge or earn, you can request from us for a Universal Link with relevant parameters. Use the Universal Link in a button to trigger the page connection. #### Available Page Here are some pages you can open: - **swap** #### Parameters Depending on the action, you may need to include additional parameters: For Swap, - pageName string: swap - fromNetwork string?: ETH or TON or SOL - toNetwork string?: ETH or TON or SOL - fromTokenAddress string?: Token contract address of asset to swap from (If unavailable, skip this parameter) - toTokenAddress string?: Token contract address of asset to swap to (If unavailable, skip this parameter) - tab string?: Specific tab within a page; swap or bridge #### Universal Link Construction Here is how to construct the link: ```bash https://app.binance.com/uni-qr/ww{pageName}?fromNetwork={string}&fromTokenAddress={string}&toNetwork={string}&toTokenAddress={string}&tab={string} ``` #### Implementation To implement these universal links in your application: 1. Construct the appropriate URL based on the desired action and parameters. 2. Use the URL to create a clickable link or button in your app's interface. 3. When the user interacts with the link, it will open the Binance Web3 Wallet app (if installed) or redirect to the Binance app download page. #### Example Code Open swap page for 1 USDT to Ton on Ton chain. ```bash https://app.binance.com/uni-qr/wwswap?fromNetwork=TON&fromTokenAddress=EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs&toNetwork=TON&toTokenAddress=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ``` ## Conclusion[](https://developers.devfdg.net/docs/binance-w3w/ton-provider#conclusion) The Binance Web3 Wallet browser provides both JS bridge API and HTTP bridge API for dapps to interact with the wallet. Dapps can use the JS bridge API when the dapp is opened in the Binance Web3 Wallet browser, and use the HTTP bridge API when the dapp is not opened in the Binance Web3 Wallet browser. We strongly recommend that dapps use [ton-connect](https://docs.ton.org/develop/dapps/ton-connect/developers) to integrate with Binance Web3 Wallet, as it provides a more secure and reliable way to interact with the wallet. You don't need to care about which bridge API to use, ton-connect will automatically choose the appropriate bridge API based on the environment. Also you don't need to care about the encryption and decryption of messages, ton-connect will handle it for you Refer to Interactions especially when discussing with our BD/PM to decide on a suitable UI/UX for users. --- ## Document: Sui Provider URL: /en/dev-docs/products/web3-connect/sui-provider # Sui Provider ## Sui Provider API Binance Web3 Wallet comes with built-in support for Wallet Standard on Sui. To get started, simply update the [Sui dApp Kit](https://www.npmjs.com/package/@mysten/dapp-kit) to the latest release. For a demo, check out [Sui dApp Kit](https://sdk.mystenlabs.com/dapp-kit). And if you are using Typescript, check out [Sui TypeScript SDK](https://docs.sui.io/guides/developer/first-app/client-tssdk) --- ## Document: Solana Provider URL: /en/dev-docs/products/web3-connect/solana-provider # Solana Provider ## Solana Provider API Binance Web3 Wallet comes with built-in support for Wallet Standard on Solana. To get started, simply update the [Solana Wallet Adapter](https://github.com/solana-labs/wallet-adapter) to the latest release. For a demo, check out the [Wallet Adapter Example](https://anza-xyz.github.io/wallet-adapter/example/). --- ## Document: Movement Network URL: /en/dev-docs/products/web3-connect/movement-network # Movement Network ## Movement Aptos Testnet Binance Web3 Wallet supports Movement Aptos Testnet, the API is the same as [Aptos Provider API](/products/web3-connect/aptos-provider) --- ## Document: Binance Wallet SDK URL: /en/dev-docs/products/web3-connect/introduction # Binance Wallet SDK ## Introduction Welcome to the Wallet Software Development Kit (SDK) documentation. This SDK is designed to empower third-party Decentralized Applications (dApps) by enabling seamless integration with the Binance Wallet. By leveraging the SDK, developers can enhance their dApp's user experience and provide seamless access to the advanced features of the Binance Wallet. The Binance Wallet is built on the latest multi-party computation (MPC) cryptographic standard, providing unmatched security. With this technique, private keys remain secure and confidential, as each party only has access to its own key fragment. In addition to exceptional security, the Binance Wallet offers a comprehensive suite of advanced features, including biometric authentication, Wallet Connect support, and SoulBound Tokens (SBT). The SDK supports standard functionality such as connecting and signing transactions. It also continuously expands its capabilities, offering unique features like fund transfers from the user's Binance account to a Web3 wallet when using a dApp, with more features to come in the future. ## Features - Secure and easy integration with Binance Wallet. - Support for standard functions such as connecting and signing transactions. - Continuously evolving capabilities, such as offering unique features like fund transfers between the user's Binance account and Web3 wallet. ## Support & Resources If you encounter any issues or have any questions, please reach out to our support team for assistance. Support appeal: Provide feedback on this document: --- ## Document: EVM-Compatible Provider URL: /en/dev-docs/products/web3-connect/evm-compatible-provider # EVM-Compatible Provider ## Binance Web3 Wallet Provider API The Provider API is a JavaScript API that connects wallets with dApps. The dApps you visit can access your wallet, read on-chain data, sign messages, and send transactions. Below are some common usage examples ```tsx // Wallet connection if (typeof window.binancew3w.ethereum !== "undefined") { try { const accounts = await window.binancew3w.ethereum.request({ method: "eth_requestAccounts", }); console.log("connected:", accounts[0]); } catch (error) { console.error("connection rejected:", error); } } else { alert("Please install wallet!"); } // Send transaction const transactionParameters = { from: accounts[0], // sender address to: "0xRecipientAddress", // recipient address value: "0xDE0B6B3A7640000", gasLimit: "0x5208", // 21000 gas }; try { const txHash = await window.binancew3w.ethereum.request({ method: "eth_sendTransaction", params: [transactionParameters], }); console.log("Transaction hash:", txHash); } catch (error) { console.error("Transaction failed:", error); } // Switch accounts window.binancew3w.ethereum.on("accountsChanged", (accounts) => { if (accounts.length === 0) { console.log("Wallet has been disconnected"); } else { console.log("Current account:", accounts[0]); } }); // Switch chains window.binancew3w.ethereum.on("chainChanged", (chainId) => { console.log("Current chain id:", chainId); }); ``` ## Installation The installation process may vary depending on the technology stack you are using. ## Integration ### Integration with RainbowKit 2.x Add Packages ```shell npm install @binance/w3w-rainbow-connector-v2 @rainbow-me/rainbowkit@2.1.2 wagmi@2.x viem@2.x @tanstack/react-query ``` Usage ```typescript import '@rainbow-me/rainbowkit/styles.css' import { connectorsForWallets, RainbowKitProvider, WalletList } from '@rainbow-me/rainbowkit' import { injectedWallet } from '@rainbow-me/rainbowkit/wallets' import { WagmiProvider, createConfig, http } from 'wagmi' import { bsc, mainnet, sepolia } from 'wagmi/chains' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import binanceWallet from '@binance/w3w-rainbow-connector-v2' const WALLET_CONNECT_PROJECT_ID = 'xxxxxxxxxx' const APP_NAME = 'xxx' const recommendedWalletList: WalletList = [ { groupName: 'Recommended', wallets: [ injectedWallet, binanceWallet, ], }, ] const connectors = connectorsForWallets( recommendedWalletList, { projectId: WALLET_CONNECT_PROJECT_ID, appName: APP_NAME } ) const config = createConfig({ ssr: true, connectors, chains: [mainnet, sepolia, bsc], transports: { [mainnet.id]: http(), [sepolia.id]: http(), [bsc.id]: http(), }, }) const queryClient = new QueryClient() export default function RainbowProvider({ children }) { return ( {children} ) } ``` ### Integration with BlockNative Add Packages ```shell npm install @web3-onboard/core @binance/w3w-blocknative-connector ``` Usage ```typescript import Onboard from "@web3-onboard/core"; import binanceModule from "@binance/w3w-blocknative-connector"; // initialize the module with options const binance = binanceModule({ options: { lng: "en" } }); // can also initialize with no options... // const binance = binanceModule() const onboard = Onboard({ // ... other Onboard options wallets: [ binance, //... other wallets ], }); const connectedWallets = await onboard.connectWallet(); console.log(connectedWallets); ``` ### Integration with wagmi v2 Add Packages ```shell npm install wagmi@2.x viem@2.x @tanstack/react-query @binance/w3w-wagmi-connector-v2 ``` Integrate with your projects ```tsx import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { http, createConfig, WagmiProvider } from "wagmi"; import { injected } from "wagmi/connectors"; import { getWagmiConnectorV2 } from "@binance/w3w-wagmi-connector-v2"; import { bsc, mainnet, sepolia } from "wagmi/chains"; const connector = getWagmiConnectorV2(); const config = createConfig({ chains: [mainnet, sepolia, bsc], connectors: [injected(), connector()], transports: { [mainnet.id]: http(), [sepolia.id]: http(), [bsc.id]: http(), }, }); const queryClient = new QueryClient(); export default function WagmiV2() { return ( ); } ``` Use wagmi v2 API [wagmi v2](https://wagmi.sh/) provides many useful API for you to use, here is a basic example. ```tsx import { Connector, useConnect, useDisconnect, useSignMessage } from "wagmi"; function WalletOption({ connector, onClick }: { connector: Connector; onClick: () => void }) { const [ready, setReady] = React.useState(false); React.useEffect(() => { (async () => { const provider = await connector.getProvider(); setReady(!!provider); })(); }, [connector]); return ( ); } function Home() { const { connectors, connect } = useConnect(); const { disconnect } = useDisconnect(); const { signMessage, data } = useSignMessage(); return (

wagmi v2 connector

{connectors.map((connector) => ( connect({ connector })} /> ))}
); } ``` #### Get connector by id from wagmi If you need to getConnector by id, you can use the following code ```tsx const connector = connectors.find((connector) => { return connector.id === "BinanceW3WSDK" || connector.id === "wallet.binance.com"; }); ``` ### Wagmi injected connector If you like to inject Binance web3 wallet, you can use the following code ```tsx import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { http, createConfig, WagmiProvider } from "wagmi"; // wagmi v2 API import { injected } from "wagmi/connectors"; import { bsc, mainnet, sepolia } from "wagmi/chains"; const config = createConfig({ ssr: true, chains: [mainnet, sepolia, bsc], connectors: [ injected({ target: { // Provide the injected target to avoid window.ethereum provider overwrite conflict id: "wallet.binance.com", name: "Binance Wallet Injected", provider: () => window.binancew3w.ethereum, }, }), ], transports: { [mainnet.id]: http(), [sepolia.id]: http(), [bsc.id]: http(), }, }); const queryClient = new QueryClient(); export default function WagmiV2Injected() { return ( ); } ``` ## Utility ### isInBinance Return `true` if the dApp is in the dApp browser of the Binance Web3 Wallet. ```ts import { isInBinance } from "@binance/w3w-utils"; isInBinance(); // return boolean // Or you can detect without install any packages window.ethereum.isBinance; // boolean ``` ### getDeeplink By this way, you can guide users to open your dapp in Binance dApp browser. ```ts import {getDeeplink} fom '@binance/w3w-utils' getDeeplink(url, defaultChainId) // return {bnc, http} ``` For the response, bnc is the deeplink and http is the universal link. ## Example code Here is the example project which integrating the SDK. ## Troubleshooting ### buffer is not defined While using wagmi or Rainbowkit, if you are using regular React(not SSR), you may encounter the error `buffer is not defined`. You can try to install `buffer` package. ```shell npm install buffer ``` ```tsx // src/index.ts import { Buffer } from "buffer"; window.Buffer = Buffer; ``` ```html // public/index.html ``` ### Non-React project For Non-React project, you can refer this example --- ## Document: Cosmos Provider URL: /en/dev-docs/products/web3-connect/cosmos-provider # Cosmos Provider ## Cosmos Provider API ### Provider Detection ```javascript // binancew3w.keplr if (window.binancew3w.keplr) { console.log("Cosmos Provider is detected!"); } ``` ## Connecting to Cosmos If Binance Web3 Wallet is locked, you can unlock the wallet by using window.binancew3w.keplr.enable(chainIds). You'll be required to grant the webpage permission to access Keplr if such permission wasn't previously granted. The enable method can receive one or more chain IDs as an array. When passing the chain ID array, you can simultaneously request the permissions of all chains that haven't been authorized. If you cancel the unlocking or are denied permission, an error will show. ```javascript const chainId = "cosmoshub-4"; // Enabling before using the Keplr is recommended. // This method will ask the user whether to allow access if they haven't visited this website. // Also, it will request that the user unlock the wallet if the wallet is locked. await window.binancew3w.keplr.enable(chainId); ``` ## Methods ### signArbitrary This request will sign any information, which is equivalent to the signMessage (any) of the previous chains. Connect the current account. #### Parameters - `chainId` - `string` - `signerAddress` - `string` - `data` - `string` #### Returns `Promise` returns `object` : - `signature` - `string` - `signDoc` - `object` #### Example ```javascript const res = await window.binancew3w.keplr.signArbitrary({ "osmosis-1", "osmo1sxqwesgp7253fdv985csvz95fwc0q53ulldggl", 'test cosmos' } ); ``` ### signAmino This request signs in a fixed format, similar to the signAmino method of OfflineSigner of cosmjs. Parameters are objects, and signDoc is a fixed format. #### Parameters - `chainId` - `string` - `signerAddress` - `string` - `signDoc` - `object` #### Returns `Promise` returns `object` : - `signature` - `string` - `signed` - `boolean` #### Example ```javascript const res = const res = await window.binancew3w.keplr.signAmino( "osmosis-1", "osmo1sxqwesgp7253fdv985csvz95fwc0q53ulldggl", { account_number: "707744", chain_id: "osmosis-1", fee: { gas: "500000", amount: [ { denom: "uosmo", amount: "12500" } ] }, memo: "", msgs: [ { type: "osmosis/gamm/swap-exact-amount-in", value: { routes: [ { pool_id: "795", token_out_denom: "uosmo" }, { pool_id: "1", token_out_denom: "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2" } ], sender: "osmo1sxqwesgp7253fdv985csvz95fwc0q53ulldggl", token_in: { amount: "10000", denom: "ibc/2DA9C149E9AD2BD27FEFA635458FB37093C256C1A940392634A16BEA45262604" }, token_out_min_amount: "553" } } ], sequence: "54" } ); ``` --- ## Document: Bitcoin Provider URL: /en/dev-docs/products/web3-connect/bitcoin-provider # Bitcoin Provider ## Bitcoin Provider API ### Provider Detection ```javascript // binancew3w.bitcoin if (window.binancew3w.bitcoin) { console.log("Bitcoin Provider is detected!"); } // we also proxy window.unisat, but some of the APIs are different if (window.unisat && window.unisat.isBinance) { console.log("Bitcoin Provider is detected!"); } ``` ## Connecting to Bitcoin Connecting" or "logging in" to Binance Web3 Wallet effectively means "to access the user's Bitcoin account(s)". We recommend that you provide a button to allow the user to connect Binance Web3 Wallet to your dapp. Clicking this button should call the following method: ```javascript binancew3w.bitcoin.requestAccounts(); ``` ## Methods ### requestAccounts ```javascript binancew3w.bitcoin.requestAccounts(); ``` Connect the current account. #### Parameters none #### Returns `Promise` returns `string[]` : Address of current account. #### Example ```javascript try { let accounts = await window.binancew3w.bitcoin.requestAccounts(); console.log('connect success', accounts); } catch (e) { console.log('connect failed'); } > connect success ['tb1qrn7tvhdf6wnh790384ahj56u0xaa0kqgautnnz'] ``` ### getAccounts ```javascript binancew3w.bitcoin.getAccounts(); ``` Get address of current account #### Parameters none #### Returns `Promise` returns `string` : Address of current account. #### Example ```javascript try { let accounts = await window.binancew3w.bitcoin.getAccounts(); console.log('connect success', accounts); } catch (e) { console.log('connect failed'); } > connect success ['tb1qrn7tvhdf6wnh790384ahj56u0xaa0kqgautnnz'] ``` ### getNetwork ```javascript binancew3w.bitcoin.getNetwork(); ``` Get network of current account #### Parameters none #### Returns `Promise` returns `string` : `livenet` `testnet` or `signet` #### Example ```javascript try { let accounts = await window.binancew3w.bitcoin.getNetwork(); console.log('connect network', accounts); } catch (e) { console.log('connect failed', e); } > 'livenet' ``` ### switchNetwork ```javascript binancew3w.bitcoin.switchNetwork(network); ``` Switch network #### Parameters - `network` - `string`: the network. `livenet` `testnet` or `signet` #### Returns none #### Example ```javascript try { let res = await window.binancew3w.bitcoin.switchNetwork("livenet"); console.log(res) } catch (e) { console.error(e) } > true ``` ### getPublicKey ```javascript binancew3w.bitcoin.getPublicKey(); ``` Get publicKey of current account #### Parameters none #### Returns `Promise` returns `string` : publicKey (no tweak for taproot) #### Example ```javascript try { let res = await window.binancew3w.bitcoin.getPublicKey(); console.log(res) } catch (e) { console.log(e); } > 03cbaedc26f03fd3ba02fc936f338e980c9e2172c5e23128877ed46827e935296f ``` ### getBalance ```javascript binancew3w.bitcoin.getBalance(); ``` Get BTC balance #### Parameters none #### Returns - `Promise` returns `Object` : - `confirmed` - `number`: the confirmed satoshis - `unconfirmed` - `number`: the unconfirmed satoshis - `total` - `number`: the total satoshis #### Example ```javascript try { let res = await window.binancew3w.bitcoin.getBalance(); console.log(res) } catch (e) { console.log(e); } > { "confirmed":0, "unconfirmed":100000, "total":100000 } ``` ### signMessage ```javascript binancew3w.signMessage(msg[, type]) ``` sign message #### Parameters - `msg` - `string`: a string to sign - `type` - `string`: (Optional) "ecdsa" | "bip322-simple". default is "ecdsa" #### Returns - `Promise` returns `string`: the signature #### Example ```javascript // sign by ecdsa try { let res = await window.binancew3w.bitcoin.signMessage("abcdefghijk123456789"); console.log(res) } catch (e) { console.log(e); } > G+LrYa7T5dUMDgQduAErw+i6ebK4GqTXYVWIDM+snYk7Yc6LdPitmaqM6j+iJOeID1CsMXOJFpVopvPiHBdulkE= // sign by bip322-simple try { let res = await window.binancew3w.bitcoin.signMessage("abcdefghijk123456789","bip322-simple"); console.log(res) } catch (e) { console.log(e); } > AkcwRAIgeHUcjr0jODaR7GMM8cenWnIj0MYdGmmrpGyMoryNSkgCICzVXWrLIKKp5cFtaCTErY7FGNXTFe6kuEofl4G+Vi5wASECaIeVi8xMtvjATqSSYPDRDjEsQbr0hSUpU7FHJNtVKqw= ``` ### signPsbt ```javascript binancew3w.signPsbt(psbtHex[, options]) ``` Sign PSBT This method will traverse all inputs that match the current address to sign. #### Parameters - `psbtHex` - `string`: the hex string of psbt to sign - `options` - `object`: - `autoFinalized` - `boolean`: whether finalize inputs signed by user's wallet after signing, default is `true` - `toSignInputs` - `array`: - `index` - `number`: which input to sign - `address` - `string`: (at least specify either an address or a publicKey) Which corresponding private key to use for signing - `publicKey` - `string`: (at least specify either an address or a publicKey) Which corresponding private key to use for signing - `sighashTypes` - `number[]`: (optionals) sighashTypes - `disableTweakSigner` - `boolean`: (optionals) When signing and unlocking Taproot addresses, the tweakSigner is used by default for signature generation. Enabling this allows for signing with the original private key. #### Returns - `Promise` returns `string`: the hex string of signed psbt #### Example ```javascript try { let res = await window.binancew3w.bitcoin.signPsbt("70736274ff01007d....", { autoFinalized: false, toSignInputs: [ { index: 0, address: "tb1q8h8....mjxzny", }, { index: 1, publicKey: "tb1q8h8....mjxzny", sighashTypes: [1], }, { index: 2, publicKey: "02062...8779693f", }, ], }); console.log(res); } catch (e) { console.log(e); } binancew3w.bitcoin.signPsbt("xxxxxxxx", { toSignInputs: [{ index: 0, publicKey: "xxxxxx", disableTweakSigner: true }], autoFinalized: false, }); ``` ## Events ### accountsChanged ```javascript binancew3w.bitcoin.on('accountsChanged', handler: (accounts: Array) => void); bitnancew3w.bitcoin.removeListener('accountsChanged', handler: (accounts: Array) => void); ``` The accountsChanged will be emitted whenever the user's exposed account address changes. ### networkChanged ```javascript binancew3w.bitcoin.on('networkChanged', handler: (network: string) => void); binancew3w.bitcoin.removeListener('networkChanged', handler: (network: string) => void); ``` The networkChanged will be emitted whenever the user's network changes. --- ## Document: Avail Provider URL: /en/dev-docs/products/web3-connect/avail-provider # Avail Provider ## Avail Provider API Binance Web3 Wallet's Avail API is fully compliant with the [polkadot extension](https://polkadot.js.org/docs/extension/). Dapps can use it to integrate with Binance Web3 Wallet. ### Provider Detection We will inject the `window.injectedWeb3` object into the global scope. The object contains the `binancew3w` object, which is the bridge object for the Avail protocol. ```js window.injectedWeb3 = { 'binancew3w': { // semver for the package version: '1.0.0', // this is called to enable the injection, and returns an injected // object containing the accounts, signer and provider interfaces // (or it will reject if not authorized) enable (originName: string): Promise } } ``` You can get the provider object by calling `window.injectedWeb3['binancew3w'].enable('my dapp')`. and then use the `accounts` and `signer` interfaces to interact with the injected account. ```js const provider = await window.injectedWeb3["subwallet-js"].enable("my dapp"); const allAccounts = provider.accounts.get(); const AVAIL_GENESIS_HASH = isTest ? "0xd3d2f3a3495dc597434a99d7d449ebad6616db45e4e4f178f31cc6fa14378b70" : "0xb91746b45e0346cc2f815a520b9c6cb4d5c0902af848db0a80f85932d2e8276a"; if (allAccounts.length > 0) { console.log("Injected accounts:", allAccounts); for (let i = 0; i < allAccounts.length; i++) { if (allAccounts[i].genesisHash === AVAIL_GENESIS_HASH) { console.log("Injected avail account:", allAccounts[i]); } } } ``` You can also use the `@polkadot/extension-dapp` package to detect the provider: ```js const AVAIL_GENESIS_HASH = isTest ? "0xd3d2f3a3495dc597434a99d7d449ebad6616db45e4e4f178f31cc6fa14378b70" : "0xb91746b45e0346cc2f815a520b9c6cb4d5c0902af848db0a80f85932d2e8276a"; const allAccounts = await web3Accounts(); if (allAccounts.length > 0) { console.log("Injected accounts:", allAccounts); for (let i = 0; i < allAccounts.length; i++) { if (allAccounts[i].genesisHash === AVAIL_GENESIS_HASH) { console.log("Injected avail account:", allAccounts[i]); } } } ``` ## Injection information And here is the related interfaces: ```ts interface Injected { // the interface for Accounts, as detailed below readonly accounts: Accounts; // the standard Signer interface for the API, as detailed below readonly signer: Signer; } interface Account = { // ss-58 encoded address readonly address: string; // the genesisHash for this account (empty if applicable to all) readonly genesisHash?: string; // (optional) name for display readonly name?: string; }; // exposes accounts interface Accounts { // retrieves the list of accounts for right now get: () => Promise; // (optional) subscribe to all accounts, updating as they change subscribe?: (cb: (accounts: Account[]) => any) => () => void } // a signer that communicates with the extension via sendMessage interface Signer { /** * @description signs an extrinsic payload from a serialized form */ signPayload?: (payload: SignerPayloadJSON) => Promise; /** * @description signs a raw payload, only the bytes data as supplied */ signRaw?: (raw: SignerPayloadRaw) => Promise; } ``` ## Provide metadata You may need to provide metadata for the wallet, such as the chain name, chain type, color, genesis hash, icon, and meta calls. ```js // the address we use to use for signing, as injected const SENDER = '5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFabHE'; // finds an injector for an address const injector = await web3FromAddress(SENDER); injector.metadata.provide({ chain: 'Avail DA Mainnet', chainType: 'substrate', color: '#1B1E26', genesisHash: '0xb91746b45e0346cc2f815a520b9c6cb4d5c0902af848db0a80f85932d2e8276a', icon: 'substrate', metaCalls: ... }) ``` ## signAndSend You can use the `signAndSend` method to sign and send a transaction. ```js import { web3Accounts, web3Enable, web3FromAddress } from '@polkadot/extension-dapp'; // returns an array of all the injected sources // (this needs to be called first, before other requests) const allInjected = await web3Enable('my cool dapp'); // returns an array of { address, meta: { name, source } } // meta.source contains the name of the extension that provides this account const allAccounts = await web3Accounts(); // the address we use to use for signing, as injected const SENDER = '5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFabHE'; // finds an injector for an address const injector = await web3FromAddress(SENDER); // sign and send our transaction - notice here that the address of the account // (as retrieved injected) is passed through as the param to the `signAndSend`, // the API then calls the extension to present to the user and get it signed. // Once complete, the api sends the tx + signature via the normal process api.tx.balances .transfer('5C5555yEXUcmEJ5kkcCMvdZjUo7NGJiQJMS7vZXEeoMhj3VQ', 123456) .signAndSend(SENDER, { signer: injector.signer }, (status) => { ... }); ``` --- ## Document: Aptos Provider URL: /en/dev-docs/products/web3-connect/aptos-provider # Aptos Provider ## Aptos Provider API Binance Web3 Wallet comes with built-in support for AIP-62 - Wallet Standard on Aptos. The interface of provider can be referenced in [AIP-62](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-62.md) To get started, simply update the [Aptos Wallet Adapter](https://github.com/aptos-labs/aptos-wallet-adapter) to the latest release, and follow [the usage](https://github.com/aptos-labs/aptos-wallet-adapter/tree/main/packages/wallet-adapter-reactA). --- ## Document: Supported Skills URL: /en/dev-docs/products/wallet-skills/supported-skills # Supported Skills Binance Wallet Skills are published on [binance-skills-hub](https://github.com/binance/binance-skills-hub/tree/main/skills/binance-web3), including 7 read-only **Wallet Skills** and the **Agentic Wallet Skill** for on-chain trading. ## Overview ### Published Wallet Skills | Skill | Type | Status | Wallet Required | | ------------------------------------- | ---- | ------- | --------------- | | **query-token-info** | Read | ✅ Live | No | | **query-token-audit** | Read | ✅ Live | No | | **query-address-info** | Read | ✅ Live | No | | **crypto-market-rank** | Read | ✅ Live | No | | **meme-rush** | Read | ✅ Live | No | | **trading-signal** | Read | ✅ Live | No | | **binance-tokenized-securities-info** | Read | ✅ Live | No | ### Agentic Wallet Skills | Skill | Type | Status | Wallet Required | | -------------------------- | ------------ | ------- | --------------- | | **binance-agentic-wallet** | Read + Write | ✅ Live | Yes (write ops) | --- ## Published Wallet Skills ### query-token-info Comprehensive token research — from discovery to deep analysis in one place. **Supported operations** | Operation | Description | | ------------------ | ---------------------------------------------------------------------------------- | | Token search | Search by name, symbol, or contract address — returns price, market cap, liquidity | | Metadata | Description, creator, audit status, social links | | Live market data | Price changes across timeframes (5m/1h/4h/24h), buy/sell volume, holder analytics | | Candlestick charts | OHLCV data from 1s to 1-month intervals | **Supported chains:** BSC, Base, Solana ``` What's the price of BNB? Show me the holder distribution for this token Give me SOL's 4-hour candlestick data ``` --- ### query-token-audit Pre-trade security audit to identify risky contracts and malicious tokens. **Supported operations** | Operation | Description | | --------------------- | ----------------------------------------------------------------- | | Risk scoring | Returns LOW / MEDIUM / HIGH risk level (scale 1–5) | | Honeypot detection | Identifies contracts that can be bought but not sold | | Tax analysis | Returns buy/sell tax rates — flags anything above 10% as critical | | Contract verification | Checks whether source code is publicly verified | **Supported chains:** Ethereum, BSC, Base, Solana > ⚠️ Audit results are for reference only. LOW risk is not a safety guarantee. Always do your own > research. ``` Is this contract address safe? Does this token have honeypot risk? ``` --- ### query-address-info Query all tokens held by a wallet address, with balances and valuations. **Supported operations** | Operation | Description | | -------------- | -------------------------------------------------------------- | | Holdings query | Returns all token balances, quantities, and contract addresses | | Price data | Current USD price and 24h change for each token | | Pagination | Use offset parameter to page through large portfolios | **Supported chains:** BSC, Base, Solana ``` What tokens does this address hold? What positions does 0xABC... have on BSC? ``` --- ### crypto-market-rank Multi-dimensional crypto market rankings covering social buzz, fund flows, Meme coins, and trader performance. **Supported operations** | Operation | Description | | ------------------- | ------------------------------------------------------------------------------------------ | | Social buzz ranking | Ranked by community discussion volume, with sentiment analysis (positive/negative/neutral) | | Unified rankings | Trending tokens, top searched, Binance Alpha picks, tokenized stocks | | Smart money inflow | Top tokens by net buying from tracked smart wallets | | Meme token rank | Top 100 Meme tokens from Pulse launchpad, scored by breakout potential | | Trader PnL ranking | Address-level realized P&L over 7d/30d/90d | **Supported chains:** BSC, Base, Solana ``` Which tokens have the highest social buzz right now? What are smart money wallets buying lately? Show me the Binance Alpha picks ranking ``` --- ### meme-rush Real-time Meme token tracking + AI hot topic discovery, built for fast-paced Meme trading. Includes two core features: **Meme Rush — Launchpad token lifecycle tracking** | Operation | Description | | --------------- | ---------------------------------------------------------------------------- | | New tokens | Tracks newly launched tokens on the bonding curve | | Migrating soon | Monitors tokens near the end of the bonding curve, about to migrate to DEX | | Migrated tokens | Tokens that just completed migration — capture early liquidity opportunities | **Topic Rush — AI hot topic discovery** | Operation | Description | | ------------- | -------------------------------------------------------- | | Latest topics | Discover newest market hot topics with associated tokens | | Rising topics | Topics gaining momentum (all-time high inflow $1k–$20k) | Each topic returns: topic name, AI summary, net inflow (total/1h), associated token list (with market cap, liquidity, net inflow, holder count, etc.). **Supported chains:** Solana (Pump.fun, Raydium, etc.), BSC (Four.meme, Flap, etc.) ``` What new Meme tokens launched on Solana recently? Which Meme tokens are about to migrate to DEX? What topics are trending right now? What are the rising hot topics? ``` --- ### trading-signal Monitors on-chain smart money trading activity and outputs structured buy/sell signals for reference. **Supported operations** | Operation | Description | | ---------------- | ---------------------------------------------------------------------------------------------------------- | | Signal feed | Buy/sell signals from smart money wallets on Solana and BSC | | Price comparison | Signal trigger price vs current price — gauge whether entry is still relevant | | Signal quality | Returns peak gain (maxGain) and smart money exit rate (exitRate) | | Token tags | Labels tokens with Social Events, Launch Platform (e.g., Pumpfun), Sensitive Events (e.g., whale buy/sell) | | Signal status | Classifies signals as `active` / `timeout` / `completed` | **Supported chains:** Solana, BSC ``` What are the latest smart money buy signals? Are there any new on-chain signals on BNB Chain? What was the peak gain after this signal triggered? ``` --- ### binance-tokenized-securities-info Query real-time on-chain data and status for Ondo Finance tokenized US stocks. **Supported operations** | Operation | Description | | ------------------ | ------------------------------------------------------------------------------------------------- | | Asset list | All supported tokenized stocks with contract addresses | | Company info | CEO, industry, concept tags, attestation report links | | Market status | Whether the Ondo market is open/paused, and next open/close times | | Corporate actions | Per-token halt status (splits, dividends, mergers, etc.) | | Live on-chain data | Token price, 24h change, holder count, supply, market cap, and fundamentals (P/E, dividend yield) | | Candlestick data | OHLC data from 1-minute to 1-day intervals | **Supported chains:** Ethereum, BSC > Note: Each token represents `multiplier` shares, not 1 share. To compare with the reference price: > `referencePrice = tokenPrice ÷ sharesMultiplier`. ``` Is the Ondo market open right now? What's the current price of the AAPL tokenized stock? Which tokenized stocks are halted due to corporate actions? ``` --- ## Agentic Wallet Skill `binance-agentic-wallet` provides wallet management, token transfers, market swaps, and limit orders. → See [Agentic Wallet Documentation](/products/agentic-wallet/welcome) for details. --- ## Related - [Binance Wallet Skills Overview](/products/wallet-skills/overview) --- ## Document: Binance Wallet Skills URL: /en/dev-docs/products/wallet-skills/overview # Binance Wallet Skills Binance Wallet Skills are composable AI modules for developers. They expose Binance Web3's on-chain capabilities in a form that any LLM Agent or application can call directly. ## What Are Skills Traditional APIs require developers to manually parse intent, call endpoints, and handle errors. Skills wrap all of that into modules an AI can understand and invoke directly: - Triggered by **natural language intent** — no API calls to write - Each Skill is a standalone module — integrate individually or combine - Compatible with Claude, ChatGPT, Copilot, and major AI Agent environments ## Published Wallet Skills (binance-web3) 8 Skills are currently published on [binance-skills-hub](https://github.com/binance/binance-skills-hub/tree/main/skills/binance-web3): | Skill | Type | Core Capability | | ------------------------------------- | ------------ | ------------------------------------------------------------------------------------ | | **binance-agentic-wallet** | Read + Write | Wallet management, token transfers, market swaps, limit orders (BSC/ETH/Base/Solana) | | **query-token-info** | Read | Token search, metadata, live market data, candlestick charts | | **query-token-audit** | Read | Token security audit: risk scoring, honeypot detection, contract verification | | **query-address-info** | Read | Wallet address token holdings with prices and balances | | **crypto-market-rank** | Read | Market rankings: social buzz, smart money inflow, Meme coins, trader PnL | | **meme-rush** | Read | Meme token tracking (new/migrating/migrated) + AI narrative discovery | | **trading-signal** | Read | On-chain smart money signals with signal status and peak gain data | | **binance-tokenized-securities-info** | Read | Tokenized securities (Ondo Finance) — live prices, market status, on-chain data | → [View full Skills list](/products/wallet-skills/supported-skills) --- ## Document: /products/wallet/quick-start URL: /en/dev-docs/products/wallet/quick-start # Quick Start ## API Key Setup - Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/articles/360002502072) regarding API key creation. - Once API key is created, it is recommended to set IP restrictions on the key for security reasons. - **Never share your API key/secret key to ANYONE.** ## API Key Restrictions - After creating the API key, the default restrictions is `Enable Reading`. - To **enable withdrawals via the API**, the API key restriction needs to be modified through the Binance UI. ## Enabling Accounts ### Spot Account A `SPOT` account is provided by default upon creation of a Binance Account. ### Margin Account To enable a `MARGIN` account for Margin Trading, please refer to the [Margin Trading Guide](https://www.binance.vision/tutorials/binance-margin-trading-guide) ## API Library ### Python connector This is a lightweight library that works as a connector to Binance public API, written in Python. [https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python) ### Javascript connector This is a lightweight library that works as a connector to Binance public API, written for JavaScript users. [https://github.com/binance/binance-connector-js](https://github.com/binance/binance-connector-js) ### Ruby connector This is a lightweight library that works as a connector to Binance public API, written for Ruby users. [https://github.com/binance/binance-connector-ruby](https://github.com/binance/binance-connector-ruby) ### DotNET connector This is a lightweight library that works as a connector to Binance public API, written for C# users. [https://github.com/binance/binance-connector-dotnet](https://github.com/binance/binance-connector-dotnet) ### Java connector This is a lightweight library that works as a connector to Binance public API, written for Java users. [https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java) ### Postman Collections There is now a Postman collection containing the API endpoints for quick and easy use. This is recommended for new users who want to get a quick-start into using the API. For more information please refer to this page: [Binance API Postman](https://github.com/binance/binance-api-postman) ### Swagger A YAML file with OpenAPI specification on the RESTful API is available to be used, as well as a Swagger UI page for the consulting. [https://github.com/binance/binance-api-swagger](https://github.com/binance/binance-api-swagger) --- ## Document: /products/wallet/general-info URL: /en/dev-docs/products/wallet/general-info # General Info ## General API Information - The following base endpoints are available: - **https://api.binance.com** - **https://api-gcp.binance.com** - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** - The last 4 endpoints in the point above (`api1`-`api4`) might give better performance but have less stability. Please use whichever works best for your setup. - All endpoints return either a JSON object or array. - Data is returned in **ascending** order. Oldest first, newest last. - All time and timestamp related fields are in **milliseconds**. ### HTTP Return Codes - HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. - HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP `409` return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.) - HTTP `429` return code is used when breaking a request rate limit. - HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. - HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. ### Error Codes and Messages - If there is an error, the API will return an error with a message of the reason. > The error payload on API and SAPI is as follows: ```json { "code": -1121, "msg": "Invalid symbol." } ``` - Specific error codes and messages defined in [Error Codes](./error-code). ### General Information on Endpoints - For `GET` endpoints, parameters must be sent as a `query string`. - For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. - Parameters may be sent in any order. - If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. --- ## LIMITS ### General Info on Limits - The following `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". - The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. - A 429 will be returned when either request rate limit or order rate limit is violated. ### IP Limits - Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. - When a 429 is received, it's your obligation as an API to back off and not spam the API. - **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** - IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. - A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - **The limits on the API are based on the IPs, not the API keys.** ### Order Rate Limits - Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. - When the order count exceeds the limit, you will receive a 429 error without the `Retry-After` header. Please check the Order Rate Limit rules using `GET api/v3/exchangeInfo` and wait for reactivation accordingly. - Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - **The order rate limit is counted against each account**. - To monitor order count usage, refer to GET `api/v3/rateLimit/order` ### Websocket Limits - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON controlled message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. - There is a limit of **300 connections per attempt every 5 minutes per IP**. ### /api/ and /sapi/ Limit Introduction The `/api/*` and `/sapi/*` endpoints adopt either of two access limiting rules, IP limits or UID (account) limits. - Endpoints related to `/api/*`: - According to the two modes of IP and UID (account) limit, each are independent. - Endpoints share the 6000 per minute limit based on IP. - Responses contain the header `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)`, defining the weight used by the current IP. - Successful order responses contain the header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`, defining the order limit used by the UID. - Endpoints related to `/sapi/*`: - Endpoints are marked according to IP or UID limit and their corresponding weight value. - Each endpoint with IP limits has an independent 12000 per minute limit. - Each endpoint with UID limits has an independent 180000 per minute limit. - Responses from endpoints with IP limits contain the header `X-SAPI-USED-IP-WEIGHT-1M`, defining the weight used by the current IP. - Responses from endpoints with UID limits contain the header `X-SAPI-USED-UID-WEIGHT-1M`, defining the weight used by the current UID. --- ## Data Sources - The API system is asynchronous, so some delay in the response is normal and expected. - Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates. - **Matching Engine** - the data is from the matching Engine - **Memory** - the data is from a server's local or external memory - **Database** - the data is taken directly from a database ## Request Security - Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](#place-new-order-trade)). - If unspecified, the security type is `NONE`. - Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](#user-data-stream-requests). - Secure endpoints require a valid API key to be specified and authenticated. - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. - API keys can be configured to allow access only to certain types of secure endpoints. - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. | Security Type | Description | | ------------- | -------------------------------------------------------- | | NONE | Endpoint can be accessed freely. | | TRADE | Endpoint requires sending a valid API-Key and signature. | | MARGIN | Endpoint requires sending a valid API-Key and signature. | | USER_DATA | Endpoint requires sending a valid API-Key and signature. | | USER_STREAM | Endpoint requires sending a valid API-Key. | | MARKET_DATA | Endpoint requires sending a valid API-Key. | - `TRADE`, `MARGIN` and `USER_DATA` endpoints are `SIGNED` endpoints. ### SIGNED Endpoint security - `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. #### Signature Case Sensitivity - **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. - **RSA:** Signatures generated using RSA are **case-sensitive**. - **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** Please consult [SIGNED request example (HMAC)](#hmac-keys), [SIGNED request example (RSA)](#rsa-keys), and [SIGNED request example (Ed25519)](#ed25519-keys) on how to compute signature, depending on which API key type you are using. ### Timing security - `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](#general-api-information)) - An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. - Maximum `recvWindow` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` **Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. **It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** ### SIGNED Endpoint Examples for POST /api/v3/order #### HMAC Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. Example API key and secret key: | Key | Value | | ----------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `secretKey` | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j | **WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | LTCBTC | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` **Step 2: Compute the signature** 1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. 2. Sign the signature payload constructed in Step 1. 3. Encode the HMAC-SHA-256 output as a hex string. Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. **Example commands** For the first set of example parameters (ASCII only): ```console $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" ``` For the second set of example parameters (some non-ASCII characters) ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" ``` Here is a sample Bash script performing all the steps above: ```bash apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" # Sign the request signature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey") signature=${signature#*= } # Keep only the part after the "= " # Send the request curl -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?$payload&signature=$signature" ``` #### RSA Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. Only `PKCS#8` keys are supported. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. These examples assume the private key is stored in the file `./test-prv-key.pem`. | Key | Value | | -------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | BTCUSDT | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` **Step 2: Compute the signature** 1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function. 2. Encode the output in base64. Note that the payload and the resulting `signature` are **case-sensitive**. For the first set of example parameters (ASCII only): ```console $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== ``` 3. Percent-encode the base64 string. For the first set of example parameters (ASCII only): ```console HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D ``` For the second set of example parameters (some non-ASCII characters): ```console qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' ``` For the second set of example parameters (some non-ASCII characters): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' ``` Here is a sample Bash script performing all the steps above: ```bash function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos The error JSON payload: ```javascript { "code":-1121, "msg":"Invalid symbol." } ``` Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. ## 10xx - General Server or Network issues ### -1000 UNKNOWN - An unknown error occurred while processing the request. - An unknown error occurred while processing the request.[%s] ### -1001 DISCONNECTED - Internal error; unable to process your request. Please try again. ### -1002 UNAUTHORIZED - You are not authorized to execute this request. ### -1003 TOO_MANY_REQUESTS - Too many requests queued. - Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. - Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. ### -1004 SERVER_BUSY - Server is busy, please wait and try again ### -1006 UNEXPECTED_RESP - An unexpected response was received from the message bus. Execution status unknown. ### -1007 TIMEOUT - Timeout waiting for response from backend server. Send status unknown; execution status unknown. ### -1008 SERVER_BUSY - Spot server is currently overloaded with other requests. Please try again in a few minutes. ### -1014 UNKNOWN_ORDER_COMPOSITION - Unsupported order combination. ### -1015 TOO_MANY_ORDERS - Too many new orders. - Too many new orders; current limit is %s orders per %s. ### -1016 SERVICE_SHUTTING_DOWN - This service is no longer available. ### -1020 UNSUPPORTED_OPERATION - This operation is not supported. ### -1021 INVALID_TIMESTAMP - Timestamp for this request is outside of the recvWindow. - Timestamp for this request was 1000ms ahead of the server's time. ### -1022 INVALID_SIGNATURE - Signature for this request is not valid. ### -1099 Not found, authenticated, or authorized - This replaces error code -1999 ## 11xx - 2xxx Request issues ### -1100 ILLEGAL_CHARS - Illegal characters found in a parameter. - Illegal characters found in a parameter. %s - Illegal characters found in parameter `%s`; legal range is `%s`. ### -1101 TOO_MANY_PARAMETERS - Too many parameters sent for this endpoint. - Too many parameters; expected `%s` and received `%s`. - Duplicate values for a parameter detected. ### -1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED - A mandatory parameter was not sent, was empty/null, or malformed. - Mandatory parameter `%s` was not sent, was empty/null, or malformed. - Param `%s` or `%s` must be sent, but both were empty/null! ### -1103 UNKNOWN_PARAM - An unknown parameter was sent. ### -1104 UNREAD_PARAMETERS - Not all sent parameters were read. - Not all sent parameters were read; read `%s` parameter(s) but was sent `%s`. ### -1105 PARAM_EMPTY - A parameter was empty. - Parameter `%s` was empty. ### -1106 PARAM_NOT_REQUIRED - A parameter was sent when not required. - Parameter `%s` sent when not required. ### -1111 BAD_PRECISION - Precision is over the maximum defined for this asset. ### -1112 NO_DEPTH - No orders on book for symbol. ### -1114 TIF_NOT_REQUIRED - TimeInForce parameter sent when not required. ### -1115 INVALID_TIF - Invalid timeInForce. ### -1116 INVALID_ORDER_TYPE - Invalid orderType. ### -1117 INVALID_SIDE - Invalid side. ### -1118 EMPTY_NEW_CL_ORD_ID - New client order ID was empty. ### -1119 EMPTY_ORG_CL_ORD_ID - Original client order ID was empty. ### -1120 BAD_INTERVAL - Invalid interval. ### -1121 BAD_SYMBOL - Invalid symbol. ### -1125 INVALID_LISTEN_KEY - This listenKey does not exist. ### -1127 MORE_THAN_XX_HOURS - Lookup interval is too big. - More than %s hours between startTime and endTime. ### -1128 OPTIONAL_PARAMS_BAD_COMBO - Combination of optional parameters invalid. ### -1130 INVALID_PARAMETER - Invalid data sent for a parameter. - Data sent for parameter `%s` is not valid. ### -1131 BAD_RECV_WINDOW - recvWindow must be less than 60000 ### -1134 BAD_STRATEGY_TYPE - `strategyType` was less than 1000000. #### -1145 INVALID_CANCEL_RESTRICTIONS - `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. #### -1151 DUPLICATE_SYMBOLS - Symbol is present multiple times in the list. ### -2010 NEW_ORDER_REJECTED - NEW_ORDER_REJECTED ### -2011 CANCEL_REJECTED - CANCEL_REJECTED ### -2013 NO_SUCH_ORDER - Order does not exist. ### -2014 BAD_API_KEY_FMT - API-key format invalid. ### -2015 REJECTED_MBX_KEY - Invalid API-key, IP, or permissions for action. ### -2016 NO_TRADING_WINDOW - No trading window could be found for the symbol. Try ticker/24hrs instead. #### -2026 ORDER_ARCHIVED - Order was canceled or expired with no executed qty over 90 days ago and has been archived. ## 3xxx-5xxx SAPI-specific issues ### -3000 INNER_FAILURE - Internal server error. ### -3001 NEED_ENABLE_2FA - Please enable 2FA first. ### -3002 ASSET_DEFICIENCY - We don't have this asset. ### -3003 NO_OPENED_MARGIN_ACCOUNT - Margin account does not exist. ### -3004 TRADE_NOT_ALLOWED - Trade not allowed. ### -3005 TRANSFER_OUT_NOT_ALLOWED - Transferring out not allowed. ### -3006 EXCEED_MAX_BORROWABLE - Your borrow amount has exceed maximum borrow amount. ### -3007 HAS_PENDING_TRANSACTION - You have pending transaction, please try again later. ### -3008 BORROW_NOT_ALLOWED - Borrow not allowed. ### -3009 ASSET_NOT_MORTGAGEABLE - This asset are not allowed to transfer into margin account currently. ### -3010 REPAY_NOT_ALLOWED - Repay not allowed. ### -3011 BAD_DATE_RANGE - Your input date is invalid. ### -3012 ASSET_ADMIN_BAN_BORROW - Borrow is banned for this asset. ### -3013 LT_MIN_BORROWABLE - Borrow amount less than minimum borrow amount. ### -3014 ACCOUNT_BAN_BORROW - Borrow is banned for this account. ### -3015 REPAY_EXCEED_LIABILITY - Repay amount exceeds borrow amount. ### -3016 LT_MIN_REPAY - Repay amount less than minimum repay amount. ### -3017 ASSET_ADMIN_BAN_MORTGAGE - This asset are not allowed to transfer into margin account currently. ### -3018 ACCOUNT_BAN_MORTGAGE - Transferring in has been banned for this account. ### -3019 ACCOUNT_BAN_ROLLOUT - Transferring out has been banned for this account. ### -3020 EXCEED_MAX_ROLLOUT - Transfer out amount exceeds max amount. ### -3021 PAIR_ADMIN_BAN_TRADE - Margin account are not allowed to trade this trading pair. ### -3022 ACCOUNT_BAN_TRADE - You account's trading is banned. ### -3023 WARNING_MARGIN_LEVEL - You can't transfer out/place order under current margin level. ### -3024 FEW_LIABILITY_LEFT - The unpaid debt is too small after this repayment. ### -3025 INVALID_EFFECTIVE_TIME - Your input date is invalid. ### -3026 VALIDATION_FAILED - Your input param is invalid. ### -3027 NOT_VALID_MARGIN_ASSET - Not a valid margin asset. ### -3028 NOT_VALID_MARGIN_PAIR - Not a valid margin pair. ### -3029 TRANSFER_FAILED - Transfer failed. ### -3036 ACCOUNT_BAN_REPAY - This account is not allowed to repay. ### -3037 PNL_CLEARING - PNL is clearing. Wait a second. ### -3038 LISTEN_KEY_NOT_FOUND - Listen key not found. ### -3041 BALANCE_NOT_CLEARED - Balance is not enough ### -3042 PRICE_INDEX_NOT_FOUND - PriceIndex not available for this margin pair. ### -3043 TRANSFER_IN_NOT_ALLOWED - Transferring in not allowed. ### -3044 SYSTEM_BUSY - System busy. ### -3045 SYSTEM - The system doesn't have enough asset now. ### -3999 NOT_WHITELIST_USER - This function is only available for invited users. ### -4001 CAPITAL_INVALID - Invalid operation. ### -4002 CAPITAL_IG - Invalid get. ### -4003 CAPITAL_IEV - Your input email is invalid. ### -4004 CAPITAL_UA - You don't login or auth. ### -4005 CAPAITAL_TOO_MANY_REQUEST - Too many new requests. ### -4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT - Support main account only. ### -4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS - Address validation is not passed. ### -4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS - Address tag validation is not passed. ### -4010 CAPITAL_WHITELIST_EMAIL_CONFIRM - White list mail has been confirmed. ### -4011 CAPITAL_WHITELIST_EMAIL_EXPIRED - White list mail is invalid. ### -4012 CAPITAL_WHITELIST_CLOSE - White list is not opened. ### -4013 CAPITAL_WITHDRAW_2FA_VERIFY - 2FA is not opened. ### -4014 CAPITAL_WITHDRAW_LOGIN_DELAY - Withdraw is not allowed within 2 min login. ### -4015 CAPITAL_WITHDRAW_RESTRICTED_MINUTE - Withdraw is limited. ### -4016 CAPITAL_WITHDRAW_RESTRICTED_PASSWORD - Within 24 hours after password modification, withdrawal is prohibited. ### -4017 CAPITAL_WITHDRAW_RESTRICTED_UNBIND_2FA - Within 24 hours after the release of 2FA, withdrawal is prohibited. ### -4018 CAPITAL_WITHDRAW_ASSET_NOT_EXIST - We don't have this asset. ### -4019 CAPITAL_WITHDRAW_ASSET_PROHIBIT - Current asset is not open for withdrawal. ### -4021 CAPITAL_WITHDRAW_AMOUNT_MULTIPLE - Asset withdrawal must be an %s multiple of %s. ### -4022 CAPITAL_WITHDRAW_MIN_AMOUNT - Not less than the minimum pick-up quantity %s. ### -4023 CAPITAL_WITHDRAW_MAX_AMOUNT - Within 24 hours, the withdrawal exceeds the maximum amount. ### -4024 CAPITAL_WITHDRAW_USER_NO_ASSET - You don't have this asset. ### -4025 CAPITAL_WITHDRAW_USER_ASSET_LESS_THAN_ZERO - The number of hold asset is less than zero. ### -4026 CAPITAL_WITHDRAW_USER_ASSET_NOT_ENOUGH - You have insufficient balance. ### -4027 CAPITAL_WITHDRAW_GET_TRAN_ID_FAILURE - Failed to obtain tranId. ### -4028 CAPITAL_WITHDRAW_MORE_THAN_FEE - The amount of withdrawal must be greater than the Commission. ### -4029 CAPITAL_WITHDRAW_NOT_EXIST - The withdrawal record does not exist. ### -4030 CAPITAL_WITHDRAW_CONFIRM_SUCCESS - Confirmation of successful asset withdrawal. ### -4031 CAPITAL_WITHDRAW_CANCEL_FAILURE - Cancellation failed. ### -4032 CAPITAL_WITHDRAW_CHECKSUM_VERIFY_FAILURE - Withdraw verification exception. ### -4033 CAPITAL_WITHDRAW_ILLEGAL_ADDRESS - Illegal address. ### -4034 CAPITAL_WITHDRAW_ADDRESS_CHEAT - The address is suspected of fake. ### -4035 CAPITAL_WITHDRAW_NOT_WHITE_ADDRESS - This address is not on the whitelist. Please join and try again. ### -4036 CAPITAL_WITHDRAW_NEW_ADDRESS - The new address needs to be withdrawn in {0} hours. ### -4037 CAPITAL_WITHDRAW_RESEND_EMAIL_FAIL - Re-sending Mail failed. ### -4038 CAPITAL_WITHDRAW_RESEND_EMAIL_TIME_OUT - Please try again in 5 minutes. ### -4039 CAPITAL_USER_EMPTY - The user does not exist. ### -4040 CAPITAL_NO_CHARGE - This address not charged. ### -4041 CAPITAL_MINUTE_TOO_SMALL - Please try again in one minute. ### -4042 CAPITAL_CHARGE_NOT_RESET - This asset cannot get deposit address again. ### -4043 CAPITAL_ADDRESS_TOO_MUCH - More than 100 recharge addresses were used in 24 hours. ### -4044 CAPITAL_BLACKLIST_COUNTRY_GET_ADDRESS - This is a blacklist country. ### -4045 CAPITAL_GET_ASSET_ERROR - Failure to acquire assets. ### -4046 CAPITAL_AGREEMENT_NOT_CONFIRMED - Agreement not confirmed. ### -4047 CAPITAL_DATE_INTERVAL_LIMIT - Time interval must be within 0-90 days ### -4060 CAPITAL_WITHDRAW_USER_ASSET_LOCK_DEPOSIT - As your deposit has not reached the required block confirmations, we have temporarily locked {0} asset ### -4106 TAG_NOT_SUPPORTED_FOR_NETWORK - This network does not support memo/tag. Please remove the `addressTag` field and try again. ### -5001 ASSET_DRIBBLET_CONVERT_SWITCH_OFF - Don't allow transfer to micro assets. ### -5002 ASSET_ASSET_NOT_ENOUGH - You have insufficient balance. ### -5003 ASSET_USER_HAVE_NO_ASSET - You don't have this asset. ### -5004 USER_OUT_OF_TRANSFER_FLOAT - The residual balances have exceeded 0.001BTC, Please re-choose. - The residual balances of %s have exceeded 0.001BTC, Please re-choose. ### -5005 USER_ASSET_AMOUNT_IS_TOO_LOW - The residual balances of the BTC is too low - The residual balances of %s is too low, Please re-choose. ### -5006 USER_CAN_NOT_REQUEST_IN_24_HOURS - Only transfer once in 24 hours. ### -5007 AMOUNT_OVER_ZERO - Quantity must be greater than zero. ### -5008 ASSET_WITHDRAW_WITHDRAWING_NOT_ENOUGH - Insufficient amount of returnable assets. ### -5009 PRODUCT_NOT_EXIST - Product does not exist. ### -5010 TRANSFER_FAIL - Asset transfer fail. ### -5011 FUTURE_ACCT_NOT_EXIST - future account not exists. ### -5012 TRANSFER_PENDING - Asset transfer is in pending. ### -5021 PARENT_SUB_HAVE_NO_RELATION - This parent sub have no relation ### -5012 FUTURE_ACCT_OR_SUBRELATION_NOT_EXIST - future account or sub relation not exists. ## 6XXX - Savings Issues ### -6001 DAILY_PRODUCT_NOT_EXIST - Daily product not exists. ### -6003 DAILY_PRODUCT_NOT_ACCESSIBLE - Product not exist or you don't have permission ### -6004 DAILY_PRODUCT_NOT_PURCHASABLE - Product not in purchase status ### -6005 DAILY_LOWER_THAN_MIN_PURCHASE_LIMIT - Smaller than min purchase limit ### -6006 DAILY_REDEEM_AMOUNT_ERROR - Redeem amount error ### -6007 DAILY_REDEEM_TIME_ERROR - Not in redeem time ### -6008 DAILY_PRODUCT_NOT_REDEEMABLE - Product not in redeem status ### -6009 REQUEST_FREQUENCY_TOO_HIGH - Request frequency too high ### -6011 EXCEEDED_USER_PURCHASE_LIMIT - Exceeding the maximum num allowed to purchase per user ### -6012 BALANCE_NOT_ENOUGH - Balance not enough ### -6013 PURCHASING_FAILED - Purchasing failed ### -6014 UPDATE_FAILED - Exceed up-limit allowed to purchased ### -6015 EMPTY_REQUEST_BODY - Empty request body ### -6016 PARAMS_ERR - Parameter err ### -6017 NOT_IN_WHITELIST - Not in whitelist ### -6018 ASSET_NOT_ENOUGH - Asset not enough ### -6019 PENDING - Need confirm ### -6020 PROJECT_NOT_EXISTS - Project not exists ## 70xx - Futures ### -7001 FUTURES_BAD_DATE_RANGE - Date range is not supported. ### -7002 FUTURES_BAD_TYPE - Data request type is not supported. ## 20xxx - Futures/Spot Algo ### -20121 - Invalid symbol. ### -20124 - Invalid algo id or it has been completed. ### -20130 - Invalid data sent for a parameter. ### -20132 - The client algo id is duplicated. ### -20194 - Duration is too short to execute all required quantity. ### -20195 - The total size is too small. ### -20196 - The total size is too large. ### -20198 - Reach the max open orders allowed. ### -20204 - The notional of USD is less or more than the limit. ## Filter failures | Error message | Description | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | "Filter failure: PRICE_FILTER" | `price` is too high, too low, and/or not following the tick size rule for the symbol. | | "Filter failure: PERCENT_PRICE" | `price` is X% too high or X% too low from the average weighted price over the last Y minutes. | | "Filter failure: PERCENT_PRICE_BY_SIDE" | `price` is X% too high or Y% too low from the `lastPrice` on that side (i.e. BUY/SELL) | | "Filter failure: LOT_SIZE" | `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MIN_NOTIONAL" | `price` \* `quantity` is too low to be a valid order for the symbol. | | "Filter failure: ICEBERG_PARTS" | `ICEBERG` order would break into too many parts; icebergQty is too small. | | "Filter failure: MARKET_LOT_SIZE" | `MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MAX_POSITION" | The account's position has reached the maximum defined limit.

This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY`orders. | | "Filter failure: MAX_NUM_ORDERS" | Account has too many open orders on the symbol. | | "Filter failure: MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the symbol. | | "Filter failure: MAX_NUM_ICEBERG_ORDERS" | Account has too many open iceberg orders on the symbol. | | "Filter failure: TRAILING_DELTA" | `trailingDelta` is not within the defined range of the filter for that order type. | | "Filter failure: EXCHANGE_MAX_NUM_ORDERS" | Account has too many open orders on the exchange. | | "Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the exchange. | ## 10xxx - Crypto Loans ### -10001 SYSTEM_MAINTENANCE - The system is under maintenance, please try again later. ### -10002 INVALID_INPUT - Invalid input parameters. ### -10005 NO_RECORDS - No records found. ### -10007 COIN_NOT_LOANABLE - This coin is not loanable. ### -10008 COIN_NOT_LOANABLE - This coin is not loanable ### -10009 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10010 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10011 INSUFFICIENT_ASSET - Insufficient spot assets. ### -10012 INVALID_AMOUNT - Invalid repayment amount. ### -10013 INSUFFICIENT_AMOUNT - Insufficient collateral amount. ### -10015 DEDUCTION_FAILED - Collateral deduction failed. ### -10016 LOAN_FAILED - Failed to provide loan. ### -10017 REPAY_EXCEED_DEBT - Repayment amount exceeds debt. ### -10018 INVALID_AMOUNT - Invalid repayment amount. ### -10019 CONFIG_NOT_EXIST - Configuration does not exists. ### -10020 UID_NOT_EXIST - User ID does not exist. ### -10021 ORDER_NOT_EXIST - Order does not exist. ### -10022 INVALID_AMOUNT - Invalid adjustment amount. ### -10023 ADJUST_LTV_FAILED - Failed to adjust LTV. ### -10024 ADJUST_LTV_NOT_SUPPORTED - LTV adjustment not supported. ### -10025 REPAY_FAILED - Repayment failed. ### -10026 INVALID_PARAMETER - Invalid parameter. ### -10028 INVALID_PARAMETER - Invalid parameter. ### -10029 AMOUNT_TOO_SMALL - Loan amount is too small. ### -10030 AMOUNT_TOO_LARGE - Loan amount is too much. ### -10031 QUOTA_REACHED - Individual loan quota reached. ### -10032 REPAY_NOT_AVAILABLE - Repayment is temporarily unavailable. ### -10034 REPAY_NOT_AVAILABLE - Repay with collateral is not available currently, please try to repay with borrowed coin. ### -10039 AMOUNT_TOO_SMALL - Repayment amount is too small. ### -10040 AMOUNT_TOO_LARGE - Repayment amount is too large. ### -10041 INSUFFICIENT_AMOUNT - Due to high demand, there are currently insufficient loanable assets for {0}. Please adjust your borrow amount or try again tomorrow. ### -10042 ASSET_NOT_SUPPORTED - asset %s is not supported ### -10043 ASSET_NOT_SUPPORTED - {0} borrowing is currently not supported. ### -10044 QUOTA_REACHED - Collateral amount has reached the limit. Please reduce your collateral amount or try with other collaterals. ### -10045 COLLTERAL_REPAY_NOT_SUPPORTED - The loan coin does not support collateral repayment. Please try again later. ### -10046 EXCEED_MAX_ADJUSTMENT - Collateral Adjustment exceeds the maximum limit. Please try again. ### -10047 REGION_NOT_SUPPORTED - This coin is currently not supported in your location due to local regulations. ## 13xxx - BLVT ### -13000 BLVT_FORBID_REDEEM - Redeption of the token is forbiden now ### -13001 BLVT_EXCEED_DAILY_LIMIT - Exceeds individual 24h redemption limit of the token ### -13002 BLVT_EXCEED_TOKEN_DAILY_LIMIT - Exceeds total 24h redemption limit of the token ### -13003 BLVT_FORBID_PURCHASE - Subscription of the token is forbiden now ### -13004 BLVT_EXCEED_DAILY_PURCHASE_LIMIT - Exceeds individual 24h subscription limit of the token ### -13005 BLVT_EXCEED_TOKEN_DAILY_PURCHASE_LIMIT - Exceeds total 24h subscription limit of the token ### -13006 BLVT_PURCHASE_LESS_MIN_AMOUNT - Subscription amount is too small ### -13007 BLVT_PURCHASE_AGREEMENT_NOT_SIGN - The Agreement is not signed ## 12xxx - Liquid Swap ### -12014 TOO MANY REQUESTS - More than 1 request in 2 seconds ## 18xxx - Binance Code ### -18002 - The total amount of codes you created has exceeded the 24-hour limit, please try again after UTC 0 ### -18003 - Too many codes created in 24 hours, please try again after UTC 0 ### -18004 - Too many invalid redeem attempts in 24 hours, please try again after UTC 0 ### -18005 - Too many invalid verify attempts, please try later ### -18006 - The amount is too small, please re-enter ### -18007 - This token is not currently supported, please re-enter ## 21xxx - Portfolio Margin Account ### -21001 USER_IS_NOT_UNIACCOUNT - Request ID is not a Portfolio Margin Account. ### -21002 UNI_ACCOUNT_CANT_TRANSFER_FUTURE - Portfolio Margin Account doesn't support transfer from margin to futures. ### -21003 NET_ASSET_MUST_LTE_RATIO - Fail to retrieve margin assets. ### -21004 USER_NO_LIABILITY - User doesn’t have portfolio margin bankruptcy loan ### -21005 NO_ENOUGH_ASSET - User’s spot wallet doesn’t have enough BUSD to repay portfolio margin bankruptcy loan ### -21006 HAD_IN_PROCESS_REPAY - User had portfolio margin bankruptcy loan repayment in process ### -21007 IN_FORCE_LIQUIDATION - User failed to repay portfolio margin bankruptcy loan since liquidation was in process ## Order Rejection Issues Error messages like these are indicated when the error is coming specifically from the matching engine: - `-1010 ERROR_MSG_RECEIVED` - `-2010 NEW_ORDER_REJECTED` - `-2011 CANCEL_REJECTED` The following messages which will indicate the specific error: | Error message | Description | | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | "Unknown order sent." | The order (by either `orderId`, `clientOrderId`, `origClientOrderId`) could not be found. | | "Duplicate order sent." | The `clientOrderId` is already in use. | | "Market is closed." | The symbol is not trading. | | "Account has insufficient balance for requested action." | Not enough funds to complete the action. | | "Market orders are not supported for this symbol." | `MARKET` is not enabled on the symbol. | | "Iceberg orders are not supported for this symbol." | `icebergQty` is not enabled on the symbol | | "Stop loss orders are not supported for this symbol." | `STOP_LOSS` is not enabled on the symbol | | "Stop loss limit orders are not supported for this symbol." | `STOP_LOSS_LIMIT` is not enabled on the symbol | | "Take profit orders are not supported for this symbol." | `TAKE_PROFIT` is not enabled on the symbol | | "Take profit limit orders are not supported for this symbol." | `TAKE_PROFIT_LIMIT` is not enabled on the symbol | | "Price \* QTY is zero or less." | `price` \* `quantity` is too low | | "IcebergQty exceeds QTY." | `icebergQty` must be less than the order quantity | | "This action is disabled on this account." | Contact customer support; some actions have been disabled on the account. | | "This account may not place or cancel orders." | Contact customer support; the account has trading ability disabled. | | "Unsupported order combination" | The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. | | "Order would trigger immediately." | The order's stop price is not valid when compared to the last traded price. | | "Cancel order is invalid. Check origClientOrderId and orderId." | No `origClientOrderId` or `orderId` was sent in. | | "Order would immediately match and take." | `LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. | | "The relationship of the prices for the orders is not correct." | The prices set in the `OCO` is breaking the Price rules.

The rules are:

`SELL Orders`: Limit Price > Last Price > Stop Price

`BUY Orders`: Limit Price < Last Price < Stop Price | | "OCO orders are not supported for this symbol" | `OCO` is not enabled on the symbol. | | "Quote order qty market orders are not support for this symbol." | `MARKET` orders using the parameter `quoteOrderQty` are not enabled on this symbol. | | "Trailing stop orders are not supported for this symbol." | Orders using `trailingDelta` are not enabled on the symbol. | | "Order cancel-replace is not supported for this symbol." | `POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is on enabled the symbol. | | "This symbol is not permitted for this account." | Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) | | "This symbol is restricted for this account." | Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) | | "Order was not canceled due to cancel restrictions." | Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW`
or
`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. | ## Errors regarding POST /api/v3/order/cancelReplace ### -2021 Order cancel-replace partially failed This code is sent when either the cancellation of the order failed or the new order placement failed but not both. ### -2022 Order cancel-replace failed. This code is sent when both the cancellation of the order failed and the new order placement failed. --- ## Document: /products/wallet/change-log URL: /en/dev-docs/products/wallet/change-log # Change Log ## 2026-06-01 - Added Australia local entity to travel rule questionnaires: - `Withdraw Questionnaire Content` - new `Australia` section. - `Deposit Questionnaire Content` - new `Australia` section. - New endpoints to support questionnaires: - `GET /sapi/v1/localentity/country/list` - Query active country list. - `GET /sapi/v1/localentity/region/list` - Query active region/city list for a given country. --- ## 2026-05-22 - Added `accountType` parameter to the following endpoints: - `POST /sapi/v1/asset/dust-convert/convert` - `POST /sapi/v1/asset/dust-convert/query-convertible-assets` --- ## 2026-04-28 - Added error code `-4106 TAG_NOT_SUPPORTED_FOR_NETWORK` to the [error code table](error-code.md). - Updated `POST /sapi/v1/capital/withdraw/apply` documentation to clarify `addressTag` behavior for networks that do not support memo/tag. --- ## 2026-02-27 - Added a new field `identifier` to the response of `GET /sapi/v1/localentity/vasp`. - Updated the Travel Rule deposit and withdrawal questionnaire: - The input parameter `vasp` should now use the `identifier` field from the `GET /sapi/v1/localentity/vasp` response instead of the previously expected `vaspCode`. - Both `vaspCode` and `identifier` will be accepted for the `vasp` field in the deposit and withdrawal questionnaires during the transition period until **28 May 2026**. --- ## 2025-12-26 ### Time-sensitive Notice - **The following change to REST API will occur at approximately 2026-01-15 07:00 UTC:**
When calling endpoints that require signatures, percent-encode payloads before computing signatures. Requests that do not follow this order will be rejected with [`-1022 INVALID_SIGNATURE`](error-code.md#-1022-invalid_signature). Please review and update your signing logic accordingly. ### REST API - Updated documentation for REST API regarding [Signed Endpoints examples for placing an order](general-info.md#signed-endpoint-examples-for-post-apiv3order). --- ## 2025-12-19 - Add new API for travel rule: - `PUT /sapi/v2/localentity/deposit/provide-info` - V2 version that uses `depositId` parameter instead of `tranId`. --- ## 2025-09-18 - Change menu `Onboarded VASP List` to `VASP List`. --- ## 2025-09-12 - Add 1 response field `travelRuleStatus` to `GET /sapi/v1/capital/deposit/hisrec`. travelRuleStatus: 0: travel rule not required OR info already provided and funds ready to use, 1: travel rule required to provide deposit info. --- ## 2025-09-08 - Add 1 response field `withdrawTag` to `GET /sapi/v1/capital/config/getall`. To replace `sameAddress` use before. We provide same value for these two fields for now, recommend user to switch to `withdrawTag`. --- ## 2025-08-25 - Add new deposit history api. - Update description of the address verify list api. - Update weight description of following pages: - /travel-rule/withdraw-history - /travel-rule/withdraw-history-v2 - /travel-rule/questionnaire-requirements - /travel-rule/onboarded-vasp-list --- ## 2025-08-05 - Update footnote of `POST /sapi/v1/capital/withdraw/apply` related to travel rule. --- ## 2025-07-11 - Add appendix: - Name restriction rules. - Country code for travelrule. - Add new API for travel rule questionnaire requirements. - `GET /sapi/v1/localentity/questionnaire-requirements` --- ## 2025-06-25 - Update travel rule Japan documentation: - Modify withdrawal questionnaire's `txnPurpose`: - 1: Purchase of goods within Japan - 2: Inheritance, gift or living expenses - 3: Investment - 5: Use of services provided by the beneficiary VASP - 6: Loan repayment - 7: Gifts & Donations - Remove `txnPurposeOthers` --- ## 2025-06-12 - Enable SAPI for France. - Fix issues in Chinese version. --- ## 2025-06-09 - Explained withdrawOrderId in POST `/sapi/v1/capital/withdraw/apply` and GET `/sapi/v1/capital/withdraw/history` in detail. --- ## 2025-05-29 - Update withdraw questionnaire of New Zealand to support travel rule requirements. --- ## 2025-05-19 - Update withdraw/deposit questionnaire of Bahrain - Withdraw:`bnfName` change to `bnfFirstName` and `bnfLastName` - Deposit: `orgName` change to `orgFirstName` and `orgLastName` - Remove residency field for withdraw/deposit. - Update withdraw/deposit questionnaire of Poland - Withdraw:`bnfName` change to `bnfFirstName` and `bnfLastName` - Deposit: `orgName` change to `orgFirstName` and `orgLastName` --- ## 2025-05-12 - Questionnaire update for entity KZ and IN. --- ## 2025-03-27 - Add new API `GET sapi/v1/capital/withdraw/quota`,Gets the user's withdrawal quota --- ## 2025-02-27 - Add 1 response field to `GET /sapi/v1/capital/config/getall`. To fetch "denomination of the coin", default 1 --- ## 2025-01-15 - Changed Request Weight description from IP to UID for `GET /sapi/v2/localentity/withdraw/history` - Changed UID rate limit description from 600 to 900 for `GET /sapi/v1/capital/withdraw/apply`. --- ## 2025-01-08 - Add new API `GET /sapi/v1/localentity/vasp` to fetch onboarded VASP list for the local entity. - Add new API `GET /sapi/v2/localentity/withdraw/history` to improve the performance of the query. - Support all the Binance entities combination. --- ## 2024-11-21 - Add 1 response fields to `GET /sapi/v1/capital/config/getall`. To fetch "Minimum internal withdraw amount". - The following APIs will no longer be supported from 2024-11-21: - `POST /sapi/v1/asset/convert-transfer` BUSD asset conversion function is offline. For compatible calls, it now returns: "{\"tranId\":null,\"status\":"F",\"response\":"No longer supported"}". - `GET /sapi/v1/capital/contract/convertible-coins` BUSD asset convertible stablecoin query function is offline. For compatible calls, it now returns: "{\"convertEnabled\":false,\"coins\":[],\"exchangeRates\":{}}". - `POST /sapi/v1/capital/contract/convertible-coins` BUSD asset convertible stablecoin editing function is offline. For compatible calls, there will be no changes in the backend. - Changed maximum idList in `GET /sapi/v1/capital/withdraw/history` to 45. --- ## 2024-11-08 - Add 2 new response fields to `GET /sapi/v1/account/info`. To fetch the "European Options account enable status" and the "Portfolio Margin enable status". - Add 2 new response fields to `GET /sapi/v1/account/apiRestrictions`. To fetch "FIX API trading permission" and "FIX API reading permission". --- ## 2024-10-28 - The Withdraw Query History API now supports `withdrawOrderId` as a query parameter. - The Withdraw Apply API has been updated to include logic for handling cases where the network parameter is empty. --- ## 2024-10-18 - Add the onboarded VASP list for each entity. --- ## 2024-10-16 - Add the onboarded VASP list of Travel Rule. --- ## 2024-10-09 - Update travel rule questionnaire content: - Add withdrawal/deposit questionnaire for India: India users can now use sAPI to withdraw/deposit funds --- ## 2025-06-25 - Update travel rule Japan documentation: - Modify withdrawal questionnaire's `txnPurpose`: - 1: Purchase of goods within Japan - 2: Inheritance, gift or living expenses - 3: Investment - 5: Use of services provided by the beneficiary VASP - 6: Loan repayment - 7: Gifts & Donations - Remove `txnPurposeOthers` --- ## 2024-08-14 - Fix travel rule api documentation: - For NZ travel rule content: `isAddressOwner` should be `1`: Yes, `2`: No - Add comments to withdrawal/deposit API regarding url parameters --- ## 2024-07-09 - Update travel rule questionnaire content: - Add withdrawal/deposit questionnaire for Bahrain: Bahrain users can now use sAPI to withdraw/deposit funds - Update deposit questionnaire for Japan: Adding new required filled `isAttested` and fix some text issue --- ## 2024-06-21 - Adding local entity withdrawal/deposit APIs to support travel rule requirements: - `POST /sapi/v1/localentity/withdraw/apply` - `GET /sapi/v1/localentity/withdraw/history` - `PUT /sapi/v1/localentity/deposit/provide-info` - `GET /sapi/v1/localentity/deposit/history` --- ## 2024-06-04 - Wallet Endpoints adjustment: for internal transfers, the txid prefix has been replaced to “Off-chain transfer”on 28 May 2024. “internal transfer” flag is no longer available in the TXID field, including historical transactions, the following endpoints are impacted: - `GET /sapi/v1/capital/deposit/hisrec` - `GET /sapi/v1/capital/withdraw/history` - `GET /sapi/v1/capital/deposit/subHisrec` --- ## 2024-05-22 - Update Sub Account Endpoint: - `GET /sapi/v1/sub-account/transfer/subUserHistory`: update response field `fromAccountType` and `toAccountType`. Return USDT_FUTURE/COIN_FUTURE in order to differentiate 2 futures wallets. - New Wallet Endpoint: - `GET /sapi/v1/account/info`: To fetch the “VIP Level”, “whether Margin account is enabled” and “whether Futures account is enabled” --- ## 2024-04-08 - Update Wallet Endpoint: - `GET /sapi/v1/capital/config/getall`: delete response field `resetAddressStatus` --- ## 2024-01-15 - New Endpoints for Wallet: - `GET /sapi/v1/spot/delist-schedule`: Query spot delist schedule - Update Endpoints for Wallet: - `GET /sapi/v1/asset/dribblet`:add parameter `accountType` - `POST /sapi/v1/asset/dust-btc`:add parameter `accountType` - `POST /sapi/v1/asset/dust`:add parameter `accountType` --- ## 2023-11-21 - New endpoint for Wallet: - `GET /sapi/v1/capital/deposit/address/list`: Fetch deposit address list with network. --- ## 2023-11-02 - Changes to Wallet Endpoint: - `GET /sapi/v1/account/apiRestrictions`: add new response field `enablePortfolioMarginTrading` --- ## 2023-09-22 - New endpoints for Wallet: - `GET /sapi/v1/asset/wallet/balance`: query user wallet balance - `GET /sapi/v1/asset/custody/transfer-history`: query user delegation history(For Master Account) --- ## 2023-09-04 - Rate limit adjustment for Wallet Endpoint: - `GET /sapi/v1/capital/withdraw/history`: UID rate limit is adjusted to 18000, maxmium 10 requests per second. Please refer to the endpoint description for detail --- ## 2023-05-18 - New endpoints for Wallet: - `POST /sapi/v1/capital/deposit/credit-apply`: apply deposit credit for expired address --- ## 2023-05-09 - Update endpoints for Wallet: - `POST /sapi/v1/asset/transfer`: add enum `MAIN_PORTFOLIO_MARGIN` and `PORTFOLIO_MARGIN_MAIN` --- ## 2023-02-02 - Update endpoints for Wallet: - Universal Transfer `POST /sapi/v1/asset/transfer` support option transfer --- ## 2022-12-26 - New endpoints for wallet: - `GET /sapi/v1/capital/contract/convertible-coins`: Get a user's auto-conversion settings in deposit/withdrawal - `POST /sapi/v1/capital/contract/convertible-coins`: User can use it to turn on or turn off the BUSD auto-conversion from/to a specific stable coin. --- ## 2022-11-18 - New endpoint for Wallet: - `GET /sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage`: The query of Cloud-Mining payment and refund history --- ## 2022-11-02 - Update endpoints for Wallet: - `POST /sapi/v1/capital/withdraw/apply`: Weight changed to Weight(UID): 600 --- ## 2022-10-28 - Update endpoints for Wallet: - `POST /sapi/v1/asset/convert-transfer`: New parameter `accountType` - `POST /sapi/v1/asset/convert-transfer/queryByPage`: request method is changed to `GET`, new parameter `clientTranId` --- ## 2022-09-29 - New endpoints for Wallet: - `POST /sapi/v1/asset/convert-transfer`: Convert transfer, convert between BUSD and stablecoins. - `POST /sapi/v1/asset/convert-transfer/queryByPage`: Query convert transfer --- ## 2022-07-01 - New endpoint for Wallet: - `POST /sapi/v3/asset/getUserAsset` to get user assets. --- ## 2022-2-17 The following updates will take effect on **February 24, 2022 08:00 AM UTC** - Update endpoint for Wallet: - `GET /sapi/v1/accountSnapshot` The time limit of this endpoint is shortened to only support querying the data of the latest month --- ## 2022-02-09 - New endpoint for Wallet: - `POST /sapi/v1/asset/dust-btc` to get assets that can be converted into BNB --- ## 2021-12-30 - Update endpoint for Wallet: - As the Mining account is merged into Funding account, transfer types MAIN_MINING, MINING_MAIN, MINING_UMFUTURE, MARGIN_MINING, and MINING_MARGIN will be discontinued in Universal Transfer endpoint `POST /sapi/v1/asset/transfer` on **January 05, 2022 08:00 AM UTC** --- ## 2021-11-19 - Update endpoint for Wallet: - New field`info`added in`GET /sapi/v1/capital/withdraw/history`to show the reason for withdrawal failure --- ## 2021-11-18 The following updates will take effect on **November 25, 2021 08:00 AM UTC** - Update endpoint for Wallet: - `GET /sapi/v1/accountSnapshot` The query time range of both endpoints are shortened to support data query within the last 6 months only, where startTime does not support selecting a timestamp beyond 6 months. If you do not specify startTime and endTime, the data of the last 7 days will be returned by default. --- ## 2021-11-17 - The following endpoints will be discontinued on **November 17, 2021 13:00 PM UTC**: - `POST /sapi/v1/account/apiRestrictions/ipRestriction` to support user enable and disable IP restriction for an API Key - `POST /sapi/v1/account/apiRestrictions/ipRestriction/ipList` to support user add IP list for an API Key - `GET /sapi/v1/account/apiRestrictions/ipRestriction` to support user query IP restriction for an API Key - `DELETE /sapi/v1/account/apiRestrictions/ipRestriction/ipList` to support user delete IP list for an API Key --- ## 2021-11-16 - New endpoints for Sub-Account: - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction` to support master account enable and disable IP restriction for a sub-account API Key - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList` to support master account add IP list for a sub-account API Key - `GET /sapi/v1/sub-account/subAccountApi/ipRestriction` to support master account query IP restriction for a sub-account API Key - `DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList` to support master account delete IP list for a sub-account API Key --- ## 2021-11-05 - Update endpoint for Wallet: - New parameter `walletType `added in `POST /sapi/v1/capital/withdraw/apply` to support user choose wallet type `spot wallet` and `funding wallet` when withdraw crypto. --- ## 2021-11-04 The following updates will take effect on **November 11, 2021 08:00 AM UTC** - Update endpoints for Wallet and Futures: - `GET /sapi/v1/asset/transfer` - `GET /sapi/v1/futures/transfer` The query time range of both endpoints are shortened to support data query within the last 6 months only, where startTime does not support selecting a timestamp beyond 6 months. If you do not specify startTime and endTime, the data of the last 7 days will be returned by default. --- ## 2021-10-22 - Update endpoint for Wallet: - New transfer types `MAIN_FUNDING`,`FUNDING_MAIN`,`FUNDING_UMFUTURE`,`UMFUTURE_FUNDING`,`MARGIN_FUNDING`,`FUNDING_MARGIN`,`FUNDING_CMFUTURE`and `CMFUTURE_FUNDING` added in Universal Transfer endpoint `POST /sapi/v1/asset/transfer` and `GET /sapi/v1/asset/transfer` to support transfer assets among funding account and other accounts - As the C2C account, Binance Payment, Binance Card and other business account are merged into a Funding account, transfer types `MAIN_C2C`,`C2C_MAIN`,`C2C_UMFUTURE`,`C2C_MINING`,`UMFUTURE_C2C`,`MINING_C2C`,`MARGIN_C2C`,`C2C_MARGIN`,`MAIN_PAY`and `PAY_MAIN` will be discontinued in Universal Transfer endpoint `POST /sapi/v1/asset/transfer` and `GET /sapi/v1/asset/transfer` on **November 04, 2021 08:00 AM UTC** --- ## 2021-09-03 - Update endpoint for Wallet: _ New fields `sameAddress`,`depositDust` and `specialWithdrawTips`added in `GET /sapi/v1/capital/config/getall` `sameAddress` means if the coin needs to provide memo to withdraw `depositDust` means minimum creditable amount `specialWithdrawTips` means special tips for withdraw _ New field `confirmNo`added in `GET /sapi/v1/capital/withdraw/history` to support query confirm times for withdraw history --- ## 2021-08-27 - Update endpoint for Wallet: - New parameter `withdrawOrderId`added in `GET /sapi/v1/capital/withdraw/history` to support user query withdraw history by withdrawOrderId - New field `unlockConfirm`added in `GET /sapi/v1/capital/deposit/hisrec` to support query network confirm times for unlocking --- ## 2021-08-20 - Update endpoint for Wallet: - New parameters`fromSymbol`,`toSymbol`and new transfer types `ISOLATEDMARGIN_MARGIN`, `MARGIN_ISOLATEDMARGIN`and `ISOLATEDMARGIN_ISOLATEDMARGIN` added in `POST /sapi/v1/asset/transfer` and `GET /sapi/v1/asset/transfer` to support user transfer assets between Margin(cross) account and Margin(isolated) account --- ## 2021-07-16 - New endpoint for Wallet: - `GET /sapi/v1/account/apiRestrictions` to query user API Key permission --- ## 2021-07-09 - New endpoint for Wallet: - `POST /sapi/v1/asset/get-funding-asset` to query funding wallet, includes Binance Pay, Binance Card, Binance Gift Card, Stock Token --- ## 2021-06-24 - Update endpoints for Wallet: - `GET /sapi/v1/capital/withdraw/history` added default value 1000, max value 1000 for the parameter`limit` - `GET /sapi/v1/capital/deposit/hisrec` added default value 1000, max value 1000 for the parameter`limit` --- ## 2021-05-26 - Update endpoint for Wallet: - New transfer types `MAIN_PAY` ,`PAY_MAIN` added in Universal Transfer endpoint `POST /sapi/v1/asset/transfer` and `GET /sapi/v1/asset/transfer` to support trasnfer assets between spot account and pay account --- ## 2020-12-30 - New endpoint for Wallet: - `POST /sapi/v1/asset/transfer` to support user universal transfer among Spot, Margin, Futures, C2C, MINING accounts. - `GET /sapi/v1/asset/transfer` to get user universal transfer history. --- ## 2020-04-02 - New fields in response to endpoint`GET /sapi/v1/capital/config/getall`: - `minConfirm` for min number for balance confirmation - `unLockConfirm` for confirmation number for balance unlock --- ## 2020-03-13 - New parameter `transactionFeeFlag` is available in endpoint: - `POST /sapi/v1/capital/withdraw/apply` and - `POST /wapi/v3/withdraw.html` --- ## 2020-01-15 - New parameter `withdrawOrderId` for client customized withdraw id for endpoint `POST /wapi/v3/withdraw.html`. - New field `withdrawOrderId` in response to `GET /wapi/v3/withdrawHistory.html` --- ## 2019-12-25 - Added time interval limit in `GET /sapi/v1/capital/withdraw/history`, `GET /wapi/v3/withdrawHistory.html`, `GET /sapi/v1/capital/deposit/hisrec` and `GET /wapi/v3/depositHistory.html`: _ The default `startTime` is 90 days from current time, and the default `endTime` is current time. _ Please notice the default `startTime` and `endTime` to make sure that time interval is within 0-90 days. \* If both `startTime` and `endTime` are sent, time between `startTime` and `endTime` must be less than 90 days. --- ## 2019-12-18 - New endpoint to get daily snapshot of account: `GET /sapi/v1/accountSnapshot` --- ## 2019-11-30 - Added parameter `sideEffectType` in `POST /sapi/v1/margin/order (HMAC SHA256)` with enums: - `NO_SIDE_EFFECT` for normal trade order; - `MARGIN_BUY` for margin trade order; - `AUTO_REPAY` for making auto repayment after order filled. - New field `marginBuyBorrowAmount` and `marginBuyBorrowAsset` in `FULL` response to `POST /sapi/v1/margin/order (HMAC SHA256)` --- ## 2019-10-29 - New sapi endpoints for wallet. - `POST /sapi/v1/capital/withdraw/apply (HMAC SHA256)`: withdraw. - `Get /sapi/v1/capital/withdraw/history (HMAC SHA256)`: fetch withdraw history with network. --- ## 2019-10-14 - New sapi endpoints for wallet. - `GET /sapi/v1/capital/config/getall (HMAC SHA256)`: get all coins' information for user. - `GET /sapi/v1/capital/deposit/hisrec (HMAC SHA256)`: fetch deposit history with network. - `GET /sapi/v1/capital/deposit/address (HMAC SHA256)`: fetch deposit address with network. --- ## Document: /products/wallet/Introduction URL: /en/dev-docs/products/wallet/Introduction # Introduction Wallet API provides the way to integrate the data of binance wallet. --- ## Document: /products/w3w-prediction/change-log URL: /en/dev-docs/products/w3w-prediction/change-log # Change Log ## 2026-06-16 - Documentation enhancements (no API behavior changes): - `POST /sapi/v1/w3w/wallet/prediction/trade/batch-cancel`: removed the unused per-item `cancelInfoList[i].vendor` field (server auto-fills `predict_fun`). Added Known Issues section covering the bracket-encoding incompatibility with mainstream HTTP libraries (Python `requests`, Java `URI`, Go `net/url`, Node `url`) — request returns `-1022 Signature for this request is not valid` because clients percent-encode `[`/`]` while the server signs over raw bytes; included Python / Java / Go workarounds. - `POST /sapi/v1/w3w/wallet/prediction/transfer/inbound`: added explicit warning that the endpoint requires SAS authorization (returns `-31003` if SAS is not enabled). - `POST /sapi/v1/w3w/wallet/prediction/trade/get-quote`: documented the MARKET order minimum (`amountIn` ≥ ~1.5 USDT, varies by market depth; `LIMIT` orders are not subject to this minimum). - `GET /sapi/v1/w3w/wallet/prediction/transfer/status`: corrected the response example — the success terminal state is `COMPLETED`, not `SUCCESS`. Added the full set of status values (`COMPLETED`, `FAILED`, `PROCESSING`, `PENDING`). ## 2026-05-25 - Initial release of Prediction Trading APIs. --- ## Document: /products/vip-service/change-log URL: /en/dev-docs/products/vip-service/change-log # Change Log ## 2025-09-04 - Upload to API doc --- --- ## Document: /products/vip-loan/quick-start URL: /en/dev-docs/products/vip-loan/quick-start # Quick Start ## API Key Setup - Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/articles/360002502072) regarding API key creation. - Once API key is created, it is recommended to set IP restrictions on the key for security reasons. - **Never share your API key/secret key to ANYONE.** ## API Key Restrictions - After creating the API key, the default restrictions is `Enable Reading`. - To **enable withdrawals via the API**, the API key restriction needs to be modified through the Binance UI. ## Enabling Accounts ### Spot Account A `SPOT` account is provided by default upon creation of a Binance Account. ### Margin Account To enable a `MARGIN` account for Margin Trading, please refer to the [Margin Trading Guide](https://www.binance.vision/tutorials/binance-margin-trading-guide) ## API Library ### Python connector This is a lightweight library that works as a connector to Binance public API, written in Python. [https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python) ### Javascript connector This is a lightweight library that works as a connector to Binance public API, written for JavaScript users. [https://github.com/binance/binance-connector-js](https://github.com/binance/binance-connector-js) ### Ruby connector This is a lightweight library that works as a connector to Binance public API, written for Ruby users. [https://github.com/binance/binance-connector-ruby](https://github.com/binance/binance-connector-ruby) ### DotNET connector This is a lightweight library that works as a connector to Binance public API, written for C# users. [https://github.com/binance/binance-connector-dotnet](https://github.com/binance/binance-connector-dotnet) ### Java connector This is a lightweight library that works as a connector to Binance public API, written for Java users. [https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java) ### Postman Collections There is now a Postman collection containing the API endpoints for quick and easy use. This is recommended for new users who want to get a quick-start into using the API. For more information please refer to this page: [Binance API Postman](https://github.com/binance/binance-api-postman) ### Swagger A YAML file with OpenAPI specification on the RESTful API is available to be used, as well as a Swagger UI page for the consulting. [https://github.com/binance/binance-api-swagger](https://github.com/binance/binance-api-swagger) --- ## Document: /products/vip-loan/general-info URL: /en/dev-docs/products/vip-loan/general-info # General Info ## General API Information - The following base endpoints are available: - **https://api.binance.com** - **https://api-gcp.binance.com** - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** - The last 4 endpoints in the point above (`api1`-`api4`) might give better performance but have less stability. Please use whichever works best for your setup. - All endpoints return either a JSON object or array. - Data is returned in **ascending** order. Oldest first, newest last. - All time and timestamp related fields are in **milliseconds**. ### HTTP Return Codes - HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. - HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP `409` return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.) - HTTP `429` return code is used when breaking a request rate limit. - HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. - HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. ### Error Codes and Messages - If there is an error, the API will return an error with a message of the reason. > The error payload on API and SAPI is as follows: ```json { "code": -1121, "msg": "Invalid symbol." } ``` - Specific error codes and messages defined in [Error Codes](./error-code). ### General Information on Endpoints - For `GET` endpoints, parameters must be sent as a `query string`. - For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. - Parameters may be sent in any order. - If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. --- ## LIMITS ### General Info on Limits - The following `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". - The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. - A 429 will be returned when either request rate limit or order rate limit is violated. ### IP Limits - Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. - When a 429 is received, it's your obligation as an API to back off and not spam the API. - **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** - IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. - A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - **The limits on the API are based on the IPs, not the API keys.** ### Order Rate Limits - Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. - When the order count exceeds the limit, you will receive a 429 error without the `Retry-After` header. Please check the Order Rate Limit rules using `GET api/v3/exchangeInfo` and wait for reactivation accordingly. - Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - **The order rate limit is counted against each account**. - To monitor order count usage, refer to GET `api/v3/rateLimit/order` ### Websocket Limits - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON controlled message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. - There is a limit of **300 connections per attempt every 5 minutes per IP**. ### /api/ and /sapi/ Limit Introduction The `/api/*` and `/sapi/*` endpoints adopt either of two access limiting rules, IP limits or UID (account) limits. - Endpoints related to `/api/*`: - According to the two modes of IP and UID (account) limit, each are independent. - Endpoints share the 6000 per minute limit based on IP. - Responses contain the header `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)`, defining the weight used by the current IP. - Successful order responses contain the header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`, defining the order limit used by the UID. - Endpoints related to `/sapi/*`: - Endpoints are marked according to IP or UID limit and their corresponding weight value. - Each endpoint with IP limits has an independent 12000 per minute limit. - Each endpoint with UID limits has an independent 180000 per minute limit. - Responses from endpoints with IP limits contain the header `X-SAPI-USED-IP-WEIGHT-1M`, defining the weight used by the current IP. - Responses from endpoints with UID limits contain the header `X-SAPI-USED-UID-WEIGHT-1M`, defining the weight used by the current UID. --- ## Data Sources - The API system is asynchronous, so some delay in the response is normal and expected. - Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates. - **Matching Engine** - the data is from the matching Engine - **Memory** - the data is from a server's local or external memory - **Database** - the data is taken directly from a database ## Request Security - Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](#place-new-order-trade)). - If unspecified, the security type is `NONE`. - Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](#user-data-stream-requests). - Secure endpoints require a valid API key to be specified and authenticated. - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. - API keys can be configured to allow access only to certain types of secure endpoints. - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. | Security Type | Description | | ------------- | -------------------------------------------------------- | | NONE | Endpoint can be accessed freely. | | TRADE | Endpoint requires sending a valid API-Key and signature. | | MARGIN | Endpoint requires sending a valid API-Key and signature. | | USER_DATA | Endpoint requires sending a valid API-Key and signature. | | USER_STREAM | Endpoint requires sending a valid API-Key. | | MARKET_DATA | Endpoint requires sending a valid API-Key. | - `TRADE`, `MARGIN` and `USER_DATA` endpoints are `SIGNED` endpoints. ### SIGNED Endpoint security - `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. #### Signature Case Sensitivity - **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. - **RSA:** Signatures generated using RSA are **case-sensitive**. - **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** Please consult [SIGNED request example (HMAC)](#hmac-keys), [SIGNED request example (RSA)](#rsa-keys), and [SIGNED request example (Ed25519)](#ed25519-keys) on how to compute signature, depending on which API key type you are using. ### Timing security - `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](#general-api-information)) - An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. - Maximum `recvWindow` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` **Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. **It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** ### SIGNED Endpoint Examples for POST /api/v3/order #### HMAC Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. Example API key and secret key: | Key | Value | | ----------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `secretKey` | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j | **WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | LTCBTC | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` **Step 2: Compute the signature** 1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. 2. Sign the signature payload constructed in Step 1. 3. Encode the HMAC-SHA-256 output as a hex string. Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. **Example commands** For the first set of example parameters (ASCII only): ```console $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" ``` For the second set of example parameters (some non-ASCII characters) ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" ``` Here is a sample Bash script performing all the steps above: ```bash apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" # Sign the request signature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey") signature=${signature#*= } # Keep only the part after the "= " # Send the request curl -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?$payload&signature=$signature" ``` #### RSA Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. Only `PKCS#8` keys are supported. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. These examples assume the private key is stored in the file `./test-prv-key.pem`. | Key | Value | | -------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | BTCUSDT | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` **Step 2: Compute the signature** 1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function. 2. Encode the output in base64. Note that the payload and the resulting `signature` are **case-sensitive**. For the first set of example parameters (ASCII only): ```console $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== ``` 3. Percent-encode the base64 string. For the first set of example parameters (ASCII only): ```console HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D ``` For the second set of example parameters (some non-ASCII characters): ```console qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' ``` For the second set of example parameters (some non-ASCII characters): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' ``` Here is a sample Bash script performing all the steps above: ```bash function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos The error JSON payload: ```javascript { "code":-1121, "msg":"Invalid symbol." } ``` Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. ## 10xx - General Server or Network issues ### -1000 UNKNOWN - An unknown error occurred while processing the request. - An unknown error occurred while processing the request.[%s] ### -1001 DISCONNECTED - Internal error; unable to process your request. Please try again. ### -1002 UNAUTHORIZED - You are not authorized to execute this request. ### -1003 TOO_MANY_REQUESTS - Too many requests queued. - Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. - Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. ### -1004 SERVER_BUSY - Server is busy, please wait and try again ### -1006 UNEXPECTED_RESP - An unexpected response was received from the message bus. Execution status unknown. ### -1007 TIMEOUT - Timeout waiting for response from backend server. Send status unknown; execution status unknown. ### -1008 SERVER_BUSY - Spot server is currently overloaded with other requests. Please try again in a few minutes. ### -1014 UNKNOWN_ORDER_COMPOSITION - Unsupported order combination. ### -1015 TOO_MANY_ORDERS - Too many new orders. - Too many new orders; current limit is %s orders per %s. ### -1016 SERVICE_SHUTTING_DOWN - This service is no longer available. ### -1020 UNSUPPORTED_OPERATION - This operation is not supported. ### -1021 INVALID_TIMESTAMP - Timestamp for this request is outside of the recvWindow. - Timestamp for this request was 1000ms ahead of the server's time. ### -1022 INVALID_SIGNATURE - Signature for this request is not valid. ### -1099 Not found, authenticated, or authorized - This replaces error code -1999 ## 11xx - 2xxx Request issues ### -1100 ILLEGAL_CHARS - Illegal characters found in a parameter. - Illegal characters found in a parameter. %s - Illegal characters found in parameter `%s`; legal range is `%s`. ### -1101 TOO_MANY_PARAMETERS - Too many parameters sent for this endpoint. - Too many parameters; expected `%s` and received `%s`. - Duplicate values for a parameter detected. ### -1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED - A mandatory parameter was not sent, was empty/null, or malformed. - Mandatory parameter `%s` was not sent, was empty/null, or malformed. - Param `%s` or `%s` must be sent, but both were empty/null! ### -1103 UNKNOWN_PARAM - An unknown parameter was sent. ### -1104 UNREAD_PARAMETERS - Not all sent parameters were read. - Not all sent parameters were read; read `%s` parameter(s) but was sent `%s`. ### -1105 PARAM_EMPTY - A parameter was empty. - Parameter `%s` was empty. ### -1106 PARAM_NOT_REQUIRED - A parameter was sent when not required. - Parameter `%s` sent when not required. ### -1111 BAD_PRECISION - Precision is over the maximum defined for this asset. ### -1112 NO_DEPTH - No orders on book for symbol. ### -1114 TIF_NOT_REQUIRED - TimeInForce parameter sent when not required. ### -1115 INVALID_TIF - Invalid timeInForce. ### -1116 INVALID_ORDER_TYPE - Invalid orderType. ### -1117 INVALID_SIDE - Invalid side. ### -1118 EMPTY_NEW_CL_ORD_ID - New client order ID was empty. ### -1119 EMPTY_ORG_CL_ORD_ID - Original client order ID was empty. ### -1120 BAD_INTERVAL - Invalid interval. ### -1121 BAD_SYMBOL - Invalid symbol. ### -1125 INVALID_LISTEN_KEY - This listenKey does not exist. ### -1127 MORE_THAN_XX_HOURS - Lookup interval is too big. - More than %s hours between startTime and endTime. ### -1128 OPTIONAL_PARAMS_BAD_COMBO - Combination of optional parameters invalid. ### -1130 INVALID_PARAMETER - Invalid data sent for a parameter. - Data sent for parameter `%s` is not valid. ### -1131 BAD_RECV_WINDOW - recvWindow must be less than 60000 ### -1134 BAD_STRATEGY_TYPE - `strategyType` was less than 1000000. #### -1145 INVALID_CANCEL_RESTRICTIONS - `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. #### -1151 DUPLICATE_SYMBOLS - Symbol is present multiple times in the list. ### -2010 NEW_ORDER_REJECTED - NEW_ORDER_REJECTED ### -2011 CANCEL_REJECTED - CANCEL_REJECTED ### -2013 NO_SUCH_ORDER - Order does not exist. ### -2014 BAD_API_KEY_FMT - API-key format invalid. ### -2015 REJECTED_MBX_KEY - Invalid API-key, IP, or permissions for action. ### -2016 NO_TRADING_WINDOW - No trading window could be found for the symbol. Try ticker/24hrs instead. #### -2026 ORDER_ARCHIVED - Order was canceled or expired with no executed qty over 90 days ago and has been archived. ## 3xxx-5xxx SAPI-specific issues ### -3000 INNER_FAILURE - Internal server error. ### -3001 NEED_ENABLE_2FA - Please enable 2FA first. ### -3002 ASSET_DEFICIENCY - We don't have this asset. ### -3003 NO_OPENED_MARGIN_ACCOUNT - Margin account does not exist. ### -3004 TRADE_NOT_ALLOWED - Trade not allowed. ### -3005 TRANSFER_OUT_NOT_ALLOWED - Transferring out not allowed. ### -3006 EXCEED_MAX_BORROWABLE - Your borrow amount has exceed maximum borrow amount. ### -3007 HAS_PENDING_TRANSACTION - You have pending transaction, please try again later. ### -3008 BORROW_NOT_ALLOWED - Borrow not allowed. ### -3009 ASSET_NOT_MORTGAGEABLE - This asset are not allowed to transfer into margin account currently. ### -3010 REPAY_NOT_ALLOWED - Repay not allowed. ### -3011 BAD_DATE_RANGE - Your input date is invalid. ### -3012 ASSET_ADMIN_BAN_BORROW - Borrow is banned for this asset. ### -3013 LT_MIN_BORROWABLE - Borrow amount less than minimum borrow amount. ### -3014 ACCOUNT_BAN_BORROW - Borrow is banned for this account. ### -3015 REPAY_EXCEED_LIABILITY - Repay amount exceeds borrow amount. ### -3016 LT_MIN_REPAY - Repay amount less than minimum repay amount. ### -3017 ASSET_ADMIN_BAN_MORTGAGE - This asset are not allowed to transfer into margin account currently. ### -3018 ACCOUNT_BAN_MORTGAGE - Transferring in has been banned for this account. ### -3019 ACCOUNT_BAN_ROLLOUT - Transferring out has been banned for this account. ### -3020 EXCEED_MAX_ROLLOUT - Transfer out amount exceeds max amount. ### -3021 PAIR_ADMIN_BAN_TRADE - Margin account are not allowed to trade this trading pair. ### -3022 ACCOUNT_BAN_TRADE - You account's trading is banned. ### -3023 WARNING_MARGIN_LEVEL - You can't transfer out/place order under current margin level. ### -3024 FEW_LIABILITY_LEFT - The unpaid debt is too small after this repayment. ### -3025 INVALID_EFFECTIVE_TIME - Your input date is invalid. ### -3026 VALIDATION_FAILED - Your input param is invalid. ### -3027 NOT_VALID_MARGIN_ASSET - Not a valid margin asset. ### -3028 NOT_VALID_MARGIN_PAIR - Not a valid margin pair. ### -3029 TRANSFER_FAILED - Transfer failed. ### -3036 ACCOUNT_BAN_REPAY - This account is not allowed to repay. ### -3037 PNL_CLEARING - PNL is clearing. Wait a second. ### -3038 LISTEN_KEY_NOT_FOUND - Listen key not found. ### -3041 BALANCE_NOT_CLEARED - Balance is not enough ### -3042 PRICE_INDEX_NOT_FOUND - PriceIndex not available for this margin pair. ### -3043 TRANSFER_IN_NOT_ALLOWED - Transferring in not allowed. ### -3044 SYSTEM_BUSY - System busy. ### -3045 SYSTEM - The system doesn't have enough asset now. ### -3999 NOT_WHITELIST_USER - This function is only available for invited users. ### -4001 CAPITAL_INVALID - Invalid operation. ### -4002 CAPITAL_IG - Invalid get. ### -4003 CAPITAL_IEV - Your input email is invalid. ### -4004 CAPITAL_UA - You don't login or auth. ### -4005 CAPAITAL_TOO_MANY_REQUEST - Too many new requests. ### -4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT - Support main account only. ### -4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS - Address validation is not passed. ### -4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS - Address tag validation is not passed. ### -4010 CAPITAL_WHITELIST_EMAIL_CONFIRM - White list mail has been confirmed. ### -4011 CAPITAL_WHITELIST_EMAIL_EXPIRED - White list mail is invalid. ### -4012 CAPITAL_WHITELIST_CLOSE - White list is not opened. ### -4013 CAPITAL_WITHDRAW_2FA_VERIFY - 2FA is not opened. ### -4014 CAPITAL_WITHDRAW_LOGIN_DELAY - Withdraw is not allowed within 2 min login. ### -4015 CAPITAL_WITHDRAW_RESTRICTED_MINUTE - Withdraw is limited. ### -4016 CAPITAL_WITHDRAW_RESTRICTED_PASSWORD - Within 24 hours after password modification, withdrawal is prohibited. ### -4017 CAPITAL_WITHDRAW_RESTRICTED_UNBIND_2FA - Within 24 hours after the release of 2FA, withdrawal is prohibited. ### -4018 CAPITAL_WITHDRAW_ASSET_NOT_EXIST - We don't have this asset. ### -4019 CAPITAL_WITHDRAW_ASSET_PROHIBIT - Current asset is not open for withdrawal. ### -4021 CAPITAL_WITHDRAW_AMOUNT_MULTIPLE - Asset withdrawal must be an %s multiple of %s. ### -4022 CAPITAL_WITHDRAW_MIN_AMOUNT - Not less than the minimum pick-up quantity %s. ### -4023 CAPITAL_WITHDRAW_MAX_AMOUNT - Within 24 hours, the withdrawal exceeds the maximum amount. ### -4024 CAPITAL_WITHDRAW_USER_NO_ASSET - You don't have this asset. ### -4025 CAPITAL_WITHDRAW_USER_ASSET_LESS_THAN_ZERO - The number of hold asset is less than zero. ### -4026 CAPITAL_WITHDRAW_USER_ASSET_NOT_ENOUGH - You have insufficient balance. ### -4027 CAPITAL_WITHDRAW_GET_TRAN_ID_FAILURE - Failed to obtain tranId. ### -4028 CAPITAL_WITHDRAW_MORE_THAN_FEE - The amount of withdrawal must be greater than the Commission. ### -4029 CAPITAL_WITHDRAW_NOT_EXIST - The withdrawal record does not exist. ### -4030 CAPITAL_WITHDRAW_CONFIRM_SUCCESS - Confirmation of successful asset withdrawal. ### -4031 CAPITAL_WITHDRAW_CANCEL_FAILURE - Cancellation failed. ### -4032 CAPITAL_WITHDRAW_CHECKSUM_VERIFY_FAILURE - Withdraw verification exception. ### -4033 CAPITAL_WITHDRAW_ILLEGAL_ADDRESS - Illegal address. ### -4034 CAPITAL_WITHDRAW_ADDRESS_CHEAT - The address is suspected of fake. ### -4035 CAPITAL_WITHDRAW_NOT_WHITE_ADDRESS - This address is not on the whitelist. Please join and try again. ### -4036 CAPITAL_WITHDRAW_NEW_ADDRESS - The new address needs to be withdrawn in {0} hours. ### -4037 CAPITAL_WITHDRAW_RESEND_EMAIL_FAIL - Re-sending Mail failed. ### -4038 CAPITAL_WITHDRAW_RESEND_EMAIL_TIME_OUT - Please try again in 5 minutes. ### -4039 CAPITAL_USER_EMPTY - The user does not exist. ### -4040 CAPITAL_NO_CHARGE - This address not charged. ### -4041 CAPITAL_MINUTE_TOO_SMALL - Please try again in one minute. ### -4042 CAPITAL_CHARGE_NOT_RESET - This asset cannot get deposit address again. ### -4043 CAPITAL_ADDRESS_TOO_MUCH - More than 100 recharge addresses were used in 24 hours. ### -4044 CAPITAL_BLACKLIST_COUNTRY_GET_ADDRESS - This is a blacklist country. ### -4045 CAPITAL_GET_ASSET_ERROR - Failure to acquire assets. ### -4046 CAPITAL_AGREEMENT_NOT_CONFIRMED - Agreement not confirmed. ### -4047 CAPITAL_DATE_INTERVAL_LIMIT - Time interval must be within 0-90 days ### -4060 CAPITAL_WITHDRAW_USER_ASSET_LOCK_DEPOSIT - As your deposit has not reached the required block confirmations, we have temporarily locked {0} asset ### -4106 TAG_NOT_SUPPORTED_FOR_NETWORK - This network does not support memo/tag. Please remove the `addressTag` field and try again. ### -5001 ASSET_DRIBBLET_CONVERT_SWITCH_OFF - Don't allow transfer to micro assets. ### -5002 ASSET_ASSET_NOT_ENOUGH - You have insufficient balance. ### -5003 ASSET_USER_HAVE_NO_ASSET - You don't have this asset. ### -5004 USER_OUT_OF_TRANSFER_FLOAT - The residual balances have exceeded 0.001BTC, Please re-choose. - The residual balances of %s have exceeded 0.001BTC, Please re-choose. ### -5005 USER_ASSET_AMOUNT_IS_TOO_LOW - The residual balances of the BTC is too low - The residual balances of %s is too low, Please re-choose. ### -5006 USER_CAN_NOT_REQUEST_IN_24_HOURS - Only transfer once in 24 hours. ### -5007 AMOUNT_OVER_ZERO - Quantity must be greater than zero. ### -5008 ASSET_WITHDRAW_WITHDRAWING_NOT_ENOUGH - Insufficient amount of returnable assets. ### -5009 PRODUCT_NOT_EXIST - Product does not exist. ### -5010 TRANSFER_FAIL - Asset transfer fail. ### -5011 FUTURE_ACCT_NOT_EXIST - future account not exists. ### -5012 TRANSFER_PENDING - Asset transfer is in pending. ### -5021 PARENT_SUB_HAVE_NO_RELATION - This parent sub have no relation ### -5012 FUTURE_ACCT_OR_SUBRELATION_NOT_EXIST - future account or sub relation not exists. ## 6XXX - Savings Issues ### -6001 DAILY_PRODUCT_NOT_EXIST - Daily product not exists. ### -6003 DAILY_PRODUCT_NOT_ACCESSIBLE - Product not exist or you don't have permission ### -6004 DAILY_PRODUCT_NOT_PURCHASABLE - Product not in purchase status ### -6005 DAILY_LOWER_THAN_MIN_PURCHASE_LIMIT - Smaller than min purchase limit ### -6006 DAILY_REDEEM_AMOUNT_ERROR - Redeem amount error ### -6007 DAILY_REDEEM_TIME_ERROR - Not in redeem time ### -6008 DAILY_PRODUCT_NOT_REDEEMABLE - Product not in redeem status ### -6009 REQUEST_FREQUENCY_TOO_HIGH - Request frequency too high ### -6011 EXCEEDED_USER_PURCHASE_LIMIT - Exceeding the maximum num allowed to purchase per user ### -6012 BALANCE_NOT_ENOUGH - Balance not enough ### -6013 PURCHASING_FAILED - Purchasing failed ### -6014 UPDATE_FAILED - Exceed up-limit allowed to purchased ### -6015 EMPTY_REQUEST_BODY - Empty request body ### -6016 PARAMS_ERR - Parameter err ### -6017 NOT_IN_WHITELIST - Not in whitelist ### -6018 ASSET_NOT_ENOUGH - Asset not enough ### -6019 PENDING - Need confirm ### -6020 PROJECT_NOT_EXISTS - Project not exists ## 70xx - Futures ### -7001 FUTURES_BAD_DATE_RANGE - Date range is not supported. ### -7002 FUTURES_BAD_TYPE - Data request type is not supported. ## 20xxx - Futures/Spot Algo ### -20121 - Invalid symbol. ### -20124 - Invalid algo id or it has been completed. ### -20130 - Invalid data sent for a parameter. ### -20132 - The client algo id is duplicated. ### -20194 - Duration is too short to execute all required quantity. ### -20195 - The total size is too small. ### -20196 - The total size is too large. ### -20198 - Reach the max open orders allowed. ### -20204 - The notional of USD is less or more than the limit. ## Filter failures | Error message | Description | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | "Filter failure: PRICE_FILTER" | `price` is too high, too low, and/or not following the tick size rule for the symbol. | | "Filter failure: PERCENT_PRICE" | `price` is X% too high or X% too low from the average weighted price over the last Y minutes. | | "Filter failure: PERCENT_PRICE_BY_SIDE" | `price` is X% too high or Y% too low from the `lastPrice` on that side (i.e. BUY/SELL) | | "Filter failure: LOT_SIZE" | `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MIN_NOTIONAL" | `price` \* `quantity` is too low to be a valid order for the symbol. | | "Filter failure: ICEBERG_PARTS" | `ICEBERG` order would break into too many parts; icebergQty is too small. | | "Filter failure: MARKET_LOT_SIZE" | `MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MAX_POSITION" | The account's position has reached the maximum defined limit.

This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY`orders. | | "Filter failure: MAX_NUM_ORDERS" | Account has too many open orders on the symbol. | | "Filter failure: MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the symbol. | | "Filter failure: MAX_NUM_ICEBERG_ORDERS" | Account has too many open iceberg orders on the symbol. | | "Filter failure: TRAILING_DELTA" | `trailingDelta` is not within the defined range of the filter for that order type. | | "Filter failure: EXCHANGE_MAX_NUM_ORDERS" | Account has too many open orders on the exchange. | | "Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the exchange. | ## 10xxx - Crypto Loans ### -10001 SYSTEM_MAINTENANCE - The system is under maintenance, please try again later. ### -10002 INVALID_INPUT - Invalid input parameters. ### -10005 NO_RECORDS - No records found. ### -10007 COIN_NOT_LOANABLE - This coin is not loanable. ### -10008 COIN_NOT_LOANABLE - This coin is not loanable ### -10009 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10010 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10011 INSUFFICIENT_ASSET - Insufficient spot assets. ### -10012 INVALID_AMOUNT - Invalid repayment amount. ### -10013 INSUFFICIENT_AMOUNT - Insufficient collateral amount. ### -10015 DEDUCTION_FAILED - Collateral deduction failed. ### -10016 LOAN_FAILED - Failed to provide loan. ### -10017 REPAY_EXCEED_DEBT - Repayment amount exceeds debt. ### -10018 INVALID_AMOUNT - Invalid repayment amount. ### -10019 CONFIG_NOT_EXIST - Configuration does not exists. ### -10020 UID_NOT_EXIST - User ID does not exist. ### -10021 ORDER_NOT_EXIST - Order does not exist. ### -10022 INVALID_AMOUNT - Invalid adjustment amount. ### -10023 ADJUST_LTV_FAILED - Failed to adjust LTV. ### -10024 ADJUST_LTV_NOT_SUPPORTED - LTV adjustment not supported. ### -10025 REPAY_FAILED - Repayment failed. ### -10026 INVALID_PARAMETER - Invalid parameter. ### -10028 INVALID_PARAMETER - Invalid parameter. ### -10029 AMOUNT_TOO_SMALL - Loan amount is too small. ### -10030 AMOUNT_TOO_LARGE - Loan amount is too much. ### -10031 QUOTA_REACHED - Individual loan quota reached. ### -10032 REPAY_NOT_AVAILABLE - Repayment is temporarily unavailable. ### -10034 REPAY_NOT_AVAILABLE - Repay with collateral is not available currently, please try to repay with borrowed coin. ### -10039 AMOUNT_TOO_SMALL - Repayment amount is too small. ### -10040 AMOUNT_TOO_LARGE - Repayment amount is too large. ### -10041 INSUFFICIENT_AMOUNT - Due to high demand, there are currently insufficient loanable assets for {0}. Please adjust your borrow amount or try again tomorrow. ### -10042 ASSET_NOT_SUPPORTED - asset %s is not supported ### -10043 ASSET_NOT_SUPPORTED - {0} borrowing is currently not supported. ### -10044 QUOTA_REACHED - Collateral amount has reached the limit. Please reduce your collateral amount or try with other collaterals. ### -10045 COLLTERAL_REPAY_NOT_SUPPORTED - The loan coin does not support collateral repayment. Please try again later. ### -10046 EXCEED_MAX_ADJUSTMENT - Collateral Adjustment exceeds the maximum limit. Please try again. ### -10047 REGION_NOT_SUPPORTED - This coin is currently not supported in your location due to local regulations. ## 13xxx - BLVT ### -13000 BLVT_FORBID_REDEEM - Redeption of the token is forbiden now ### -13001 BLVT_EXCEED_DAILY_LIMIT - Exceeds individual 24h redemption limit of the token ### -13002 BLVT_EXCEED_TOKEN_DAILY_LIMIT - Exceeds total 24h redemption limit of the token ### -13003 BLVT_FORBID_PURCHASE - Subscription of the token is forbiden now ### -13004 BLVT_EXCEED_DAILY_PURCHASE_LIMIT - Exceeds individual 24h subscription limit of the token ### -13005 BLVT_EXCEED_TOKEN_DAILY_PURCHASE_LIMIT - Exceeds total 24h subscription limit of the token ### -13006 BLVT_PURCHASE_LESS_MIN_AMOUNT - Subscription amount is too small ### -13007 BLVT_PURCHASE_AGREEMENT_NOT_SIGN - The Agreement is not signed ## 12xxx - Liquid Swap ### -12014 TOO MANY REQUESTS - More than 1 request in 2 seconds ## 18xxx - Binance Code ### -18002 - The total amount of codes you created has exceeded the 24-hour limit, please try again after UTC 0 ### -18003 - Too many codes created in 24 hours, please try again after UTC 0 ### -18004 - Too many invalid redeem attempts in 24 hours, please try again after UTC 0 ### -18005 - Too many invalid verify attempts, please try later ### -18006 - The amount is too small, please re-enter ### -18007 - This token is not currently supported, please re-enter ## 21xxx - Portfolio Margin Account ### -21001 USER_IS_NOT_UNIACCOUNT - Request ID is not a Portfolio Margin Account. ### -21002 UNI_ACCOUNT_CANT_TRANSFER_FUTURE - Portfolio Margin Account doesn't support transfer from margin to futures. ### -21003 NET_ASSET_MUST_LTE_RATIO - Fail to retrieve margin assets. ### -21004 USER_NO_LIABILITY - User doesn’t have portfolio margin bankruptcy loan ### -21005 NO_ENOUGH_ASSET - User’s spot wallet doesn’t have enough BUSD to repay portfolio margin bankruptcy loan ### -21006 HAD_IN_PROCESS_REPAY - User had portfolio margin bankruptcy loan repayment in process ### -21007 IN_FORCE_LIQUIDATION - User failed to repay portfolio margin bankruptcy loan since liquidation was in process ## Order Rejection Issues Error messages like these are indicated when the error is coming specifically from the matching engine: - `-1010 ERROR_MSG_RECEIVED` - `-2010 NEW_ORDER_REJECTED` - `-2011 CANCEL_REJECTED` The following messages which will indicate the specific error: | Error message | Description | | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | "Unknown order sent." | The order (by either `orderId`, `clientOrderId`, `origClientOrderId`) could not be found. | | "Duplicate order sent." | The `clientOrderId` is already in use. | | "Market is closed." | The symbol is not trading. | | "Account has insufficient balance for requested action." | Not enough funds to complete the action. | | "Market orders are not supported for this symbol." | `MARKET` is not enabled on the symbol. | | "Iceberg orders are not supported for this symbol." | `icebergQty` is not enabled on the symbol | | "Stop loss orders are not supported for this symbol." | `STOP_LOSS` is not enabled on the symbol | | "Stop loss limit orders are not supported for this symbol." | `STOP_LOSS_LIMIT` is not enabled on the symbol | | "Take profit orders are not supported for this symbol." | `TAKE_PROFIT` is not enabled on the symbol | | "Take profit limit orders are not supported for this symbol." | `TAKE_PROFIT_LIMIT` is not enabled on the symbol | | "Price \* QTY is zero or less." | `price` \* `quantity` is too low | | "IcebergQty exceeds QTY." | `icebergQty` must be less than the order quantity | | "This action is disabled on this account." | Contact customer support; some actions have been disabled on the account. | | "This account may not place or cancel orders." | Contact customer support; the account has trading ability disabled. | | "Unsupported order combination" | The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. | | "Order would trigger immediately." | The order's stop price is not valid when compared to the last traded price. | | "Cancel order is invalid. Check origClientOrderId and orderId." | No `origClientOrderId` or `orderId` was sent in. | | "Order would immediately match and take." | `LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. | | "The relationship of the prices for the orders is not correct." | The prices set in the `OCO` is breaking the Price rules.

The rules are:

`SELL Orders`: Limit Price > Last Price > Stop Price

`BUY Orders`: Limit Price < Last Price < Stop Price | | "OCO orders are not supported for this symbol" | `OCO` is not enabled on the symbol. | | "Quote order qty market orders are not support for this symbol." | `MARKET` orders using the parameter `quoteOrderQty` are not enabled on this symbol. | | "Trailing stop orders are not supported for this symbol." | Orders using `trailingDelta` are not enabled on the symbol. | | "Order cancel-replace is not supported for this symbol." | `POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is on enabled the symbol. | | "This symbol is not permitted for this account." | Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) | | "This symbol is restricted for this account." | Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) | | "Order was not canceled due to cancel restrictions." | Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW`
or
`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. | ## Errors regarding POST /api/v3/order/cancelReplace ### -2021 Order cancel-replace partially failed This code is sent when either the cancellation of the order failed or the new order placement failed but not both. ### -2022 Order cancel-replace failed. This code is sent when both the cancellation of the order failed and the new order placement failed. --- ## Document: /products/vip-loan/change-log URL: /en/dev-docs/products/vip-loan/change-log # Change Log ## 2026-06-15 - New endpoints for VIP Loans: - `GET /sapi/v1/loan/vip/fixed/market` - Query VIP Loan Fixed Rate Market. - `POST /sapi/v1/loan/vip/fixed/borrow` - VIP Loan Fixed Rate Borrow. --- ## 2025-12-26 ### Time-sensitive Notice - **The following change to REST API will occur at approximately 2026-01-15 07:00 UTC:**
When calling endpoints that require signatures, percent-encode payloads before computing signatures. Requests that do not follow this order will be rejected with [`-1022 INVALID_SIGNATURE`](./error-code.md#-1022-invalid_signature). Please review and update your signing logic accordingly. ### REST API - Updated documentation for REST API regarding [Signed Endpoints examples for placing an order](./general-info.md#signed-endpoint-examples-for-post-apiv3order). --- ## 2024-11-27 - New endpoints for VIP Loans - `GET /sapi/v1/loan/vip/interestRateHistory`: Check VIP Loan Interest Rate History - `GET /sapi/v1/loan/vip/accruedInterest`: Check VIP Loan interest record --- ## 2023-10-11 - New endpoint for VIP Loans: - `GET /sapi/v1/loan/vip/request/interestRate`: Get Borrow Interest Rate --- ## 2023-09-22 - Changes to VIP loan Endpoint: - `GET /sapi/v1/loan/vip/loanable/data`: add new response fields `_flexibleDailyInterestRate`,`_flexibleYearlyInterestRate` - `GET /sapi/v1/loan/vip/ongoing/orders`: add new response fields `loanDate`,`loanRate`,`loanTerm`,`expirationTime` --- ## 2023-09-18 - Changes to Margin Endpoint `GET /sapi/v1/margin/isolated/transfer`: - Add request field `type` - Delete request field `transFrom`,`transTo` --- ## 2023-08-18 - Update endpoints for VIP Loan: - `POST /sapi/v1/loan/vip/borrow`: add field `isFlexibleRate` to borrow using flexible rate loan --- ## 2023-07-14 - New endpoints for VIP Loan: - `POST /sapi/v1/loan/vip/renew`: VIP Loan Renew --- ## 2023-04-20 - Update endpoints for VIP Loans: - `GET /sapi/v1/loan/vip/ongoing/orders`: add fields `totalCollateralValueAfterHaircut` and `lockedCollateralValue` --- ## 2022-11-29 - New endpoint for VIP Loan: - `GET /sapi/v1/loan/vip/collateral/account`: Check Locked Value of VIP Collateral Account --- ## 2022-11-14 - New endpoints for VIP Loan: - `GET /sapi/v1/loan/vip/ongoing/orders`: Get VIP Loan Ongoing Orders - `POST /sapi/v1/loan/vip/repay`: VIP Loan Repay - `GET /sapi/v1/loan/vip/repay/history`: Get VIP Loan Repayment History --- ## Document: /products/vip-loan/Introduction URL: /en/dev-docs/products/vip-loan/Introduction # Introduction The endpoints allow you to interact with Binance VIP Loan. For more information on this, please refer to the [Binance VIP Loan](https://www.binance.com/zh-CN/vip-loan) --- ## Document: /products/vip-caas/quick-start URL: /en/dev-docs/products/vip-caas/quick-start # Quick Start ## API Key Setup - Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/articles/360002502072) regarding API key creation. - Once API key is created, it is recommended to set IP restrictions on the key for security reasons. - **Never share your API key/secret key to ANYONE.** ## API Key Restrictions - After creating the API key, the default restrictions is `Enable Reading`. - To **enable withdrawals via the API**, the API key restriction needs to be modified through the Binance UI. ## Enabling Accounts ### Spot Account A `SPOT` account is provided by default upon creation of a Binance Account. ### Margin Account To enable a `MARGIN` account for Margin Trading, please refer to the [Margin Trading Guide](https://www.binance.vision/tutorials/binance-margin-trading-guide) ## API Library ### Python connector This is a lightweight library that works as a connector to Binance public API, written in Python. [https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python) ### Javascript connector This is a lightweight library that works as a connector to Binance public API, written for JavaScript users. [https://github.com/binance/binance-connector-js](https://github.com/binance/binance-connector-js) ### Ruby connector This is a lightweight library that works as a connector to Binance public API, written for Ruby users. [https://github.com/binance/binance-connector-ruby](https://github.com/binance/binance-connector-ruby) ### DotNET connector This is a lightweight library that works as a connector to Binance public API, written for C# users. [https://github.com/binance/binance-connector-dotnet](https://github.com/binance/binance-connector-dotnet) ### Java connector This is a lightweight library that works as a connector to Binance public API, written for Java users. [https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java) ### Postman Collections There is now a Postman collection containing the API endpoints for quick and easy use. This is recommended for new users who want to get a quick-start into using the API. For more information please refer to this page: [Binance API Postman](https://github.com/binance/binance-api-postman) ### Swagger A YAML file with OpenAPI specification on the RESTful API is available to be used, as well as a Swagger UI page for the consulting. [https://github.com/binance/binance-api-swagger](https://github.com/binance/binance-api-swagger) --- ## Document: /products/vip-caas/general-info URL: /en/dev-docs/products/vip-caas/general-info # General Info ## General API Information - The following base endpoints are available: - **https://api.binance.com** - **https://api-gcp.binance.com** - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** - The last 4 endpoints in the point above (`api1`-`api4`) might give better performance but have less stability. Please use whichever works best for your setup. - All endpoints return either a JSON object or array. - Data is returned in **ascending** order. Oldest first, newest last. - All time and timestamp related fields are in **milliseconds**. ### HTTP Return Codes - HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. - HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP `409` return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.) - HTTP `429` return code is used when breaking a request rate limit. - HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. - HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. ### Error Codes and Messages - If there is an error, the API will return an error with a message of the reason. > The error payload on API and SAPI is as follows: ```json { "code": -1121, "msg": "Invalid symbol." } ``` - Specific error codes and messages defined in [Error Codes](./error-code). ### General Information on Endpoints - For `GET` endpoints, parameters must be sent as a `query string`. - For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. - Parameters may be sent in any order. - If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. --- ## LIMITS ### General Info on Limits - The following `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". - The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. - A 429 will be returned when either request rate limit or order rate limit is violated. ### IP Limits - Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. - When a 429 is received, it's your obligation as an API to back off and not spam the API. - **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** - IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. - A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - **The limits on the API are based on the IPs, not the API keys.** ### Order Rate Limits - Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. - When the order count exceeds the limit, you will receive a 429 error without the `Retry-After` header. Please check the Order Rate Limit rules using `GET api/v3/exchangeInfo` and wait for reactivation accordingly. - Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - **The order rate limit is counted against each account**. - To monitor order count usage, refer to GET `api/v3/rateLimit/order` ### Websocket Limits - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON controlled message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. - There is a limit of **300 connections per attempt every 5 minutes per IP**. ### /api/ and /sapi/ Limit Introduction The `/api/*` and `/sapi/*` endpoints adopt either of two access limiting rules, IP limits or UID (account) limits. - Endpoints related to `/api/*`: - According to the two modes of IP and UID (account) limit, each are independent. - Endpoints share the 6000 per minute limit based on IP. - Responses contain the header `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)`, defining the weight used by the current IP. - Successful order responses contain the header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`, defining the order limit used by the UID. - Endpoints related to `/sapi/*`: - Endpoints are marked according to IP or UID limit and their corresponding weight value. - Each endpoint with IP limits has an independent 12000 per minute limit. - Each endpoint with UID limits has an independent 180000 per minute limit. - Responses from endpoints with IP limits contain the header `X-SAPI-USED-IP-WEIGHT-1M`, defining the weight used by the current IP. - Responses from endpoints with UID limits contain the header `X-SAPI-USED-UID-WEIGHT-1M`, defining the weight used by the current UID. --- ## Data Sources - The API system is asynchronous, so some delay in the response is normal and expected. - Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates. - **Matching Engine** - the data is from the matching Engine - **Memory** - the data is from a server's local or external memory - **Database** - the data is taken directly from a database ## Request Security - Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](#place-new-order-trade)). - If unspecified, the security type is `NONE`. - Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](#user-data-stream-requests). - Secure endpoints require a valid API key to be specified and authenticated. - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. - API keys can be configured to allow access only to certain types of secure endpoints. - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. | Security Type | Description | | ------------- | -------------------------------------------------------- | | NONE | Endpoint can be accessed freely. | | TRADE | Endpoint requires sending a valid API-Key and signature. | | MARGIN | Endpoint requires sending a valid API-Key and signature. | | USER_DATA | Endpoint requires sending a valid API-Key and signature. | | USER_STREAM | Endpoint requires sending a valid API-Key. | | MARKET_DATA | Endpoint requires sending a valid API-Key. | - `TRADE`, `MARGIN` and `USER_DATA` endpoints are `SIGNED` endpoints. ### SIGNED Endpoint security - `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. #### Signature Case Sensitivity - **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. - **RSA:** Signatures generated using RSA are **case-sensitive**. - **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** Please consult [SIGNED request example (HMAC)](#hmac-keys), [SIGNED request example (RSA)](#rsa-keys), and [SIGNED request example (Ed25519)](#ed25519-keys) on how to compute signature, depending on which API key type you are using. ### Timing security - `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](#general-api-information)) - An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. - Maximum `recvWindow` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` **Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. **It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** ### SIGNED Endpoint Examples for POST /api/v3/order #### HMAC Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. Example API key and secret key: | Key | Value | | ----------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `secretKey` | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j | **WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | LTCBTC | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` **Step 2: Compute the signature** 1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. 2. Sign the signature payload constructed in Step 1. 3. Encode the HMAC-SHA-256 output as a hex string. Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. **Example commands** For the first set of example parameters (ASCII only): ```console $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" ``` For the second set of example parameters (some non-ASCII characters) ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" ``` Here is a sample Bash script performing all the steps above: ```bash apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" # Sign the request signature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey") signature=${signature#*= } # Keep only the part after the "= " # Send the request curl -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?$payload&signature=$signature" ``` #### RSA Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. Only `PKCS#8` keys are supported. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. These examples assume the private key is stored in the file `./test-prv-key.pem`. | Key | Value | | -------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | BTCUSDT | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` **Step 2: Compute the signature** 1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function. 2. Encode the output in base64. Note that the payload and the resulting `signature` are **case-sensitive**. For the first set of example parameters (ASCII only): ```console $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== ``` 3. Percent-encode the base64 string. For the first set of example parameters (ASCII only): ```console HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D ``` For the second set of example parameters (some non-ASCII characters): ```console qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' ``` For the second set of example parameters (some non-ASCII characters): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' ``` Here is a sample Bash script performing all the steps above: ```bash function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos If the API keys were accidentally shared, please delete them immediately and create a new key. ## API Key Restrictions - After creating the API key, the default restrictions is `Enable Reading`. - To **enable withdrawals via the API**, the API key restriction needs to be modified through the Binance UI. ## Enabling Accounts ### Spot Account A `SPOT` account is provided by default upon creation of a Binance Account. ### Margin Account To enable a `MARGIN` account for Margin Trading, please refer to the [Margin Trading Guide](https://www.binance.vision/tutorials/binance-margin-trading-guide) ## API Library ### Python connector This is a lightweight library that works as a connector to Binance public API, written in Python. [https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python) ### Javascript connector This is a lightweight library that works as a connector to Binance public API, written for JavaScript users. [https://github.com/binance/binance-connector-js](https://github.com/binance/binance-connector-js) ### Ruby connector This is a lightweight library that works as a connector to Binance public API, written for Ruby users. [https://github.com/binance/binance-connector-ruby](https://github.com/binance/binance-connector-ruby) ### DotNET connector This is a lightweight library that works as a connector to Binance public API, written for C# users. [https://github.com/binance/binance-connector-dotnet](https://github.com/binance/binance-connector-dotnet) ### Java connector This is a lightweight library that works as a connector to Binance public API, written for Java users. [https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java) ### Postman Collections There is now a Postman collection containing the API endpoints for quick and easy use. This is recommended for new users who want to get a quick-start into using the API. For more information please refer to this page: [Binance API Postman](https://github.com/binance/binance-api-postman) ### Swagger A YAML file with OpenAPI specification on the RESTful API is available to be used, as well as a Swagger UI page for the consulting. [https://github.com/binance/binance-api-swagger](https://github.com/binance/binance-api-swagger) --- ## Document: /products/sub-account/general-info URL: /en/dev-docs/products/sub-account/general-info # General Info ## General API Information - The following base endpoints are available: - **https://api.binance.com** - **https://api-gcp.binance.com** - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** - The last 4 endpoints in the point above (`api1`-`api4`) might give better performance but have less stability. Please use whichever works best for your setup. - All endpoints return either a JSON object or array. - Data is returned in **ascending** order. Oldest first, newest last. - All time and timestamp related fields are in **milliseconds**. ### HTTP Return Codes - HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. - HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP `409` return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.) - HTTP `429` return code is used when breaking a request rate limit. - HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. - HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. ### Error Codes and Messages - If there is an error, the API will return an error with a message of the reason. > The error payload on API and SAPI is as follows: ```json { "code": -1121, "msg": "Invalid symbol." } ``` - Specific error codes and messages defined in [Error Codes](./error-code). ### General Information on Endpoints - For `GET` endpoints, parameters must be sent as a `query string`. - For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. - Parameters may be sent in any order. - If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. --- ## LIMITS ### General Info on Limits - The following `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". - The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. - A 429 will be returned when either request rate limit or order rate limit is violated. ### IP Limits - Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. - When a 429 is received, it's your obligation as an API to back off and not spam the API. - **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** - IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. - A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - **The limits on the API are based on the IPs, not the API keys.** ### Order Rate Limits - Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. - When the order count exceeds the limit, you will receive a 429 error without the `Retry-After` header. Please check the Order Rate Limit rules using `GET api/v3/exchangeInfo` and wait for reactivation accordingly. - Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - **The order rate limit is counted against each account**. - To monitor order count usage, refer to GET `api/v3/rateLimit/order` ### Websocket Limits - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON controlled message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. - There is a limit of **300 connections per attempt every 5 minutes per IP**. ### /api/ and /sapi/ Limit Introduction The `/api/*` and `/sapi/*` endpoints adopt either of two access limiting rules, IP limits or UID (account) limits. - Endpoints related to `/api/*`: - According to the two modes of IP and UID (account) limit, each are independent. - Endpoints share the 6000 per minute limit based on IP. - Responses contain the header `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)`, defining the weight used by the current IP. - Successful order responses contain the header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`, defining the order limit used by the UID. - Endpoints related to `/sapi/*`: - Endpoints are marked according to IP or UID limit and their corresponding weight value. - Each endpoint with IP limits has an independent 12000 per minute limit. - Each endpoint with UID limits has an independent 180000 per minute limit. - Responses from endpoints with IP limits contain the header `X-SAPI-USED-IP-WEIGHT-1M`, defining the weight used by the current IP. - Responses from endpoints with UID limits contain the header `X-SAPI-USED-UID-WEIGHT-1M`, defining the weight used by the current UID. --- ## Data Sources - The API system is asynchronous, so some delay in the response is normal and expected. - Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates. - **Matching Engine** - the data is from the matching Engine - **Memory** - the data is from a server's local or external memory - **Database** - the data is taken directly from a database ## Request Security - Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](#place-new-order-trade)). - If unspecified, the security type is `NONE`. - Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](#user-data-stream-requests). - Secure endpoints require a valid API key to be specified and authenticated. - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. - API keys can be configured to allow access only to certain types of secure endpoints. - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. | Security Type | Description | | ------------- | -------------------------------------------------------- | | NONE | Endpoint can be accessed freely. | | TRADE | Endpoint requires sending a valid API-Key and signature. | | MARGIN | Endpoint requires sending a valid API-Key and signature. | | USER_DATA | Endpoint requires sending a valid API-Key and signature. | | USER_STREAM | Endpoint requires sending a valid API-Key. | | MARKET_DATA | Endpoint requires sending a valid API-Key. | - `TRADE`, `MARGIN` and `USER_DATA` endpoints are `SIGNED` endpoints. ### SIGNED Endpoint security - `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. #### Signature Case Sensitivity - **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. - **RSA:** Signatures generated using RSA are **case-sensitive**. - **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** Please consult [SIGNED request example (HMAC)](#hmac-keys), [SIGNED request example (RSA)](#rsa-keys), and [SIGNED request example (Ed25519)](#ed25519-keys) on how to compute signature, depending on which API key type you are using. ### Timing security - `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](#general-api-information)) - An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. - Maximum `recvWindow` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` **Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. **It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** ### SIGNED Endpoint Examples for POST /api/v3/order #### HMAC Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. Example API key and secret key: | Key | Value | | ----------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `secretKey` | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j | **WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | LTCBTC | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` **Step 2: Compute the signature** 1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. 2. Sign the signature payload constructed in Step 1. 3. Encode the HMAC-SHA-256 output as a hex string. Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. **Example commands** For the first set of example parameters (ASCII only): ```console $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" ``` For the second set of example parameters (some non-ASCII characters) ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" ``` Here is a sample Bash script performing all the steps above: ```bash apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" # Sign the request signature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey") signature=${signature#*= } # Keep only the part after the "= " # Send the request curl -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?$payload&signature=$signature" ``` #### RSA Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. Only `PKCS#8` keys are supported. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. These examples assume the private key is stored in the file `./test-prv-key.pem`. | Key | Value | | -------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | BTCUSDT | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` **Step 2: Compute the signature** 1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function. 2. Encode the output in base64. Note that the payload and the resulting `signature` are **case-sensitive**. For the first set of example parameters (ASCII only): ```console $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== ``` 3. Percent-encode the base64 string. For the first set of example parameters (ASCII only): ```console HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D ``` For the second set of example parameters (some non-ASCII characters): ```console qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' ``` For the second set of example parameters (some non-ASCII characters): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' ``` Here is a sample Bash script performing all the steps above: ```bash function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos The error JSON payload: ```javascript { "code":-1121, "msg":"Invalid symbol." } ``` Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. ## 10xx - General Server or Network issues ### -1000 UNKNOWN - An unknown error occurred while processing the request. - An unknown error occurred while processing the request.[%s] ### -1001 DISCONNECTED - Internal error; unable to process your request. Please try again. ### -1002 UNAUTHORIZED - You are not authorized to execute this request. ### -1003 TOO_MANY_REQUESTS - Too many requests queued. - Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. - Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. ### -1004 SERVER_BUSY - Server is busy, please wait and try again ### -1006 UNEXPECTED_RESP - An unexpected response was received from the message bus. Execution status unknown. ### -1007 TIMEOUT - Timeout waiting for response from backend server. Send status unknown; execution status unknown. ### -1008 SERVER_BUSY - Spot server is currently overloaded with other requests. Please try again in a few minutes. ### -1014 UNKNOWN_ORDER_COMPOSITION - Unsupported order combination. ### -1015 TOO_MANY_ORDERS - Too many new orders. - Too many new orders; current limit is %s orders per %s. ### -1016 SERVICE_SHUTTING_DOWN - This service is no longer available. ### -1020 UNSUPPORTED_OPERATION - This operation is not supported. ### -1021 INVALID_TIMESTAMP - Timestamp for this request is outside of the recvWindow. - Timestamp for this request was 1000ms ahead of the server's time. ### -1022 INVALID_SIGNATURE - Signature for this request is not valid. ### -1099 Not found, authenticated, or authorized - This replaces error code -1999 ## 11xx - 2xxx Request issues ### -1100 ILLEGAL_CHARS - Illegal characters found in a parameter. - Illegal characters found in a parameter. %s - Illegal characters found in parameter `%s`; legal range is `%s`. ### -1101 TOO_MANY_PARAMETERS - Too many parameters sent for this endpoint. - Too many parameters; expected `%s` and received `%s`. - Duplicate values for a parameter detected. ### -1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED - A mandatory parameter was not sent, was empty/null, or malformed. - Mandatory parameter `%s` was not sent, was empty/null, or malformed. - Param `%s` or `%s` must be sent, but both were empty/null! ### -1103 UNKNOWN_PARAM - An unknown parameter was sent. ### -1104 UNREAD_PARAMETERS - Not all sent parameters were read. - Not all sent parameters were read; read `%s` parameter(s) but was sent `%s`. ### -1105 PARAM_EMPTY - A parameter was empty. - Parameter `%s` was empty. ### -1106 PARAM_NOT_REQUIRED - A parameter was sent when not required. - Parameter `%s` sent when not required. ### -1111 BAD_PRECISION - Precision is over the maximum defined for this asset. ### -1112 NO_DEPTH - No orders on book for symbol. ### -1114 TIF_NOT_REQUIRED - TimeInForce parameter sent when not required. ### -1115 INVALID_TIF - Invalid timeInForce. ### -1116 INVALID_ORDER_TYPE - Invalid orderType. ### -1117 INVALID_SIDE - Invalid side. ### -1118 EMPTY_NEW_CL_ORD_ID - New client order ID was empty. ### -1119 EMPTY_ORG_CL_ORD_ID - Original client order ID was empty. ### -1120 BAD_INTERVAL - Invalid interval. ### -1121 BAD_SYMBOL - Invalid symbol. ### -1125 INVALID_LISTEN_KEY - This listenKey does not exist. ### -1127 MORE_THAN_XX_HOURS - Lookup interval is too big. - More than %s hours between startTime and endTime. ### -1128 OPTIONAL_PARAMS_BAD_COMBO - Combination of optional parameters invalid. ### -1130 INVALID_PARAMETER - Invalid data sent for a parameter. - Data sent for parameter `%s` is not valid. ### -1131 BAD_RECV_WINDOW - recvWindow must be less than 60000 ### -1134 BAD_STRATEGY_TYPE - `strategyType` was less than 1000000. #### -1145 INVALID_CANCEL_RESTRICTIONS - `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. #### -1151 DUPLICATE_SYMBOLS - Symbol is present multiple times in the list. ### -2010 NEW_ORDER_REJECTED - NEW_ORDER_REJECTED ### -2011 CANCEL_REJECTED - CANCEL_REJECTED ### -2013 NO_SUCH_ORDER - Order does not exist. ### -2014 BAD_API_KEY_FMT - API-key format invalid. ### -2015 REJECTED_MBX_KEY - Invalid API-key, IP, or permissions for action. ### -2016 NO_TRADING_WINDOW - No trading window could be found for the symbol. Try ticker/24hrs instead. #### -2026 ORDER_ARCHIVED - Order was canceled or expired with no executed qty over 90 days ago and has been archived. ## 3xxx-5xxx SAPI-specific issues ### -3000 INNER_FAILURE - Internal server error. ### -3001 NEED_ENABLE_2FA - Please enable 2FA first. ### -3002 ASSET_DEFICIENCY - We don't have this asset. ### -3003 NO_OPENED_MARGIN_ACCOUNT - Margin account does not exist. ### -3004 TRADE_NOT_ALLOWED - Trade not allowed. ### -3005 TRANSFER_OUT_NOT_ALLOWED - Transferring out not allowed. ### -3006 EXCEED_MAX_BORROWABLE - Your borrow amount has exceed maximum borrow amount. ### -3007 HAS_PENDING_TRANSACTION - You have pending transaction, please try again later. ### -3008 BORROW_NOT_ALLOWED - Borrow not allowed. ### -3009 ASSET_NOT_MORTGAGEABLE - This asset are not allowed to transfer into margin account currently. ### -3010 REPAY_NOT_ALLOWED - Repay not allowed. ### -3011 BAD_DATE_RANGE - Your input date is invalid. ### -3012 ASSET_ADMIN_BAN_BORROW - Borrow is banned for this asset. ### -3013 LT_MIN_BORROWABLE - Borrow amount less than minimum borrow amount. ### -3014 ACCOUNT_BAN_BORROW - Borrow is banned for this account. ### -3015 REPAY_EXCEED_LIABILITY - Repay amount exceeds borrow amount. ### -3016 LT_MIN_REPAY - Repay amount less than minimum repay amount. ### -3017 ASSET_ADMIN_BAN_MORTGAGE - This asset are not allowed to transfer into margin account currently. ### -3018 ACCOUNT_BAN_MORTGAGE - Transferring in has been banned for this account. ### -3019 ACCOUNT_BAN_ROLLOUT - Transferring out has been banned for this account. ### -3020 EXCEED_MAX_ROLLOUT - Transfer out amount exceeds max amount. ### -3021 PAIR_ADMIN_BAN_TRADE - Margin account are not allowed to trade this trading pair. ### -3022 ACCOUNT_BAN_TRADE - You account's trading is banned. ### -3023 WARNING_MARGIN_LEVEL - You can't transfer out/place order under current margin level. ### -3024 FEW_LIABILITY_LEFT - The unpaid debt is too small after this repayment. ### -3025 INVALID_EFFECTIVE_TIME - Your input date is invalid. ### -3026 VALIDATION_FAILED - Your input param is invalid. ### -3027 NOT_VALID_MARGIN_ASSET - Not a valid margin asset. ### -3028 NOT_VALID_MARGIN_PAIR - Not a valid margin pair. ### -3029 TRANSFER_FAILED - Transfer failed. ### -3036 ACCOUNT_BAN_REPAY - This account is not allowed to repay. ### -3037 PNL_CLEARING - PNL is clearing. Wait a second. ### -3038 LISTEN_KEY_NOT_FOUND - Listen key not found. ### -3041 BALANCE_NOT_CLEARED - Balance is not enough ### -3042 PRICE_INDEX_NOT_FOUND - PriceIndex not available for this margin pair. ### -3043 TRANSFER_IN_NOT_ALLOWED - Transferring in not allowed. ### -3044 SYSTEM_BUSY - System busy. ### -3045 SYSTEM - The system doesn't have enough asset now. ### -3999 NOT_WHITELIST_USER - This function is only available for invited users. ### -4001 CAPITAL_INVALID - Invalid operation. ### -4002 CAPITAL_IG - Invalid get. ### -4003 CAPITAL_IEV - Your input email is invalid. ### -4004 CAPITAL_UA - You don't login or auth. ### -4005 CAPAITAL_TOO_MANY_REQUEST - Too many new requests. ### -4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT - Support main account only. ### -4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS - Address validation is not passed. ### -4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS - Address tag validation is not passed. ### -4010 CAPITAL_WHITELIST_EMAIL_CONFIRM - White list mail has been confirmed. ### -4011 CAPITAL_WHITELIST_EMAIL_EXPIRED - White list mail is invalid. ### -4012 CAPITAL_WHITELIST_CLOSE - White list is not opened. ### -4013 CAPITAL_WITHDRAW_2FA_VERIFY - 2FA is not opened. ### -4014 CAPITAL_WITHDRAW_LOGIN_DELAY - Withdraw is not allowed within 2 min login. ### -4015 CAPITAL_WITHDRAW_RESTRICTED_MINUTE - Withdraw is limited. ### -4016 CAPITAL_WITHDRAW_RESTRICTED_PASSWORD - Within 24 hours after password modification, withdrawal is prohibited. ### -4017 CAPITAL_WITHDRAW_RESTRICTED_UNBIND_2FA - Within 24 hours after the release of 2FA, withdrawal is prohibited. ### -4018 CAPITAL_WITHDRAW_ASSET_NOT_EXIST - We don't have this asset. ### -4019 CAPITAL_WITHDRAW_ASSET_PROHIBIT - Current asset is not open for withdrawal. ### -4021 CAPITAL_WITHDRAW_AMOUNT_MULTIPLE - Asset withdrawal must be an %s multiple of %s. ### -4022 CAPITAL_WITHDRAW_MIN_AMOUNT - Not less than the minimum pick-up quantity %s. ### -4023 CAPITAL_WITHDRAW_MAX_AMOUNT - Within 24 hours, the withdrawal exceeds the maximum amount. ### -4024 CAPITAL_WITHDRAW_USER_NO_ASSET - You don't have this asset. ### -4025 CAPITAL_WITHDRAW_USER_ASSET_LESS_THAN_ZERO - The number of hold asset is less than zero. ### -4026 CAPITAL_WITHDRAW_USER_ASSET_NOT_ENOUGH - You have insufficient balance. ### -4027 CAPITAL_WITHDRAW_GET_TRAN_ID_FAILURE - Failed to obtain tranId. ### -4028 CAPITAL_WITHDRAW_MORE_THAN_FEE - The amount of withdrawal must be greater than the Commission. ### -4029 CAPITAL_WITHDRAW_NOT_EXIST - The withdrawal record does not exist. ### -4030 CAPITAL_WITHDRAW_CONFIRM_SUCCESS - Confirmation of successful asset withdrawal. ### -4031 CAPITAL_WITHDRAW_CANCEL_FAILURE - Cancellation failed. ### -4032 CAPITAL_WITHDRAW_CHECKSUM_VERIFY_FAILURE - Withdraw verification exception. ### -4033 CAPITAL_WITHDRAW_ILLEGAL_ADDRESS - Illegal address. ### -4034 CAPITAL_WITHDRAW_ADDRESS_CHEAT - The address is suspected of fake. ### -4035 CAPITAL_WITHDRAW_NOT_WHITE_ADDRESS - This address is not on the whitelist. Please join and try again. ### -4036 CAPITAL_WITHDRAW_NEW_ADDRESS - The new address needs to be withdrawn in {0} hours. ### -4037 CAPITAL_WITHDRAW_RESEND_EMAIL_FAIL - Re-sending Mail failed. ### -4038 CAPITAL_WITHDRAW_RESEND_EMAIL_TIME_OUT - Please try again in 5 minutes. ### -4039 CAPITAL_USER_EMPTY - The user does not exist. ### -4040 CAPITAL_NO_CHARGE - This address not charged. ### -4041 CAPITAL_MINUTE_TOO_SMALL - Please try again in one minute. ### -4042 CAPITAL_CHARGE_NOT_RESET - This asset cannot get deposit address again. ### -4043 CAPITAL_ADDRESS_TOO_MUCH - More than 100 recharge addresses were used in 24 hours. ### -4044 CAPITAL_BLACKLIST_COUNTRY_GET_ADDRESS - This is a blacklist country. ### -4045 CAPITAL_GET_ASSET_ERROR - Failure to acquire assets. ### -4046 CAPITAL_AGREEMENT_NOT_CONFIRMED - Agreement not confirmed. ### -4047 CAPITAL_DATE_INTERVAL_LIMIT - Time interval must be within 0-90 days ### -4060 CAPITAL_WITHDRAW_USER_ASSET_LOCK_DEPOSIT - As your deposit has not reached the required block confirmations, we have temporarily locked {0} asset ### -4106 TAG_NOT_SUPPORTED_FOR_NETWORK - This network does not support memo/tag. Please remove the `addressTag` field and try again. ### -5001 ASSET_DRIBBLET_CONVERT_SWITCH_OFF - Don't allow transfer to micro assets. ### -5002 ASSET_ASSET_NOT_ENOUGH - You have insufficient balance. ### -5003 ASSET_USER_HAVE_NO_ASSET - You don't have this asset. ### -5004 USER_OUT_OF_TRANSFER_FLOAT - The residual balances have exceeded 0.001BTC, Please re-choose. - The residual balances of %s have exceeded 0.001BTC, Please re-choose. ### -5005 USER_ASSET_AMOUNT_IS_TOO_LOW - The residual balances of the BTC is too low - The residual balances of %s is too low, Please re-choose. ### -5006 USER_CAN_NOT_REQUEST_IN_24_HOURS - Only transfer once in 24 hours. ### -5007 AMOUNT_OVER_ZERO - Quantity must be greater than zero. ### -5008 ASSET_WITHDRAW_WITHDRAWING_NOT_ENOUGH - Insufficient amount of returnable assets. ### -5009 PRODUCT_NOT_EXIST - Product does not exist. ### -5010 TRANSFER_FAIL - Asset transfer fail. ### -5011 FUTURE_ACCT_NOT_EXIST - future account not exists. ### -5012 TRANSFER_PENDING - Asset transfer is in pending. ### -5021 PARENT_SUB_HAVE_NO_RELATION - This parent sub have no relation ### -5012 FUTURE_ACCT_OR_SUBRELATION_NOT_EXIST - future account or sub relation not exists. ## 6XXX - Savings Issues ### -6001 DAILY_PRODUCT_NOT_EXIST - Daily product not exists. ### -6003 DAILY_PRODUCT_NOT_ACCESSIBLE - Product not exist or you don't have permission ### -6004 DAILY_PRODUCT_NOT_PURCHASABLE - Product not in purchase status ### -6005 DAILY_LOWER_THAN_MIN_PURCHASE_LIMIT - Smaller than min purchase limit ### -6006 DAILY_REDEEM_AMOUNT_ERROR - Redeem amount error ### -6007 DAILY_REDEEM_TIME_ERROR - Not in redeem time ### -6008 DAILY_PRODUCT_NOT_REDEEMABLE - Product not in redeem status ### -6009 REQUEST_FREQUENCY_TOO_HIGH - Request frequency too high ### -6011 EXCEEDED_USER_PURCHASE_LIMIT - Exceeding the maximum num allowed to purchase per user ### -6012 BALANCE_NOT_ENOUGH - Balance not enough ### -6013 PURCHASING_FAILED - Purchasing failed ### -6014 UPDATE_FAILED - Exceed up-limit allowed to purchased ### -6015 EMPTY_REQUEST_BODY - Empty request body ### -6016 PARAMS_ERR - Parameter err ### -6017 NOT_IN_WHITELIST - Not in whitelist ### -6018 ASSET_NOT_ENOUGH - Asset not enough ### -6019 PENDING - Need confirm ### -6020 PROJECT_NOT_EXISTS - Project not exists ## 70xx - Futures ### -7001 FUTURES_BAD_DATE_RANGE - Date range is not supported. ### -7002 FUTURES_BAD_TYPE - Data request type is not supported. ## 20xxx - Futures/Spot Algo ### -20121 - Invalid symbol. ### -20124 - Invalid algo id or it has been completed. ### -20130 - Invalid data sent for a parameter. ### -20132 - The client algo id is duplicated. ### -20194 - Duration is too short to execute all required quantity. ### -20195 - The total size is too small. ### -20196 - The total size is too large. ### -20198 - Reach the max open orders allowed. ### -20204 - The notional of USD is less or more than the limit. ## Filter failures | Error message | Description | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | "Filter failure: PRICE_FILTER" | `price` is too high, too low, and/or not following the tick size rule for the symbol. | | "Filter failure: PERCENT_PRICE" | `price` is X% too high or X% too low from the average weighted price over the last Y minutes. | | "Filter failure: PERCENT_PRICE_BY_SIDE" | `price` is X% too high or Y% too low from the `lastPrice` on that side (i.e. BUY/SELL) | | "Filter failure: LOT_SIZE" | `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MIN_NOTIONAL" | `price` \* `quantity` is too low to be a valid order for the symbol. | | "Filter failure: ICEBERG_PARTS" | `ICEBERG` order would break into too many parts; icebergQty is too small. | | "Filter failure: MARKET_LOT_SIZE" | `MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MAX_POSITION" | The account's position has reached the maximum defined limit.

This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY`orders. | | "Filter failure: MAX_NUM_ORDERS" | Account has too many open orders on the symbol. | | "Filter failure: MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the symbol. | | "Filter failure: MAX_NUM_ICEBERG_ORDERS" | Account has too many open iceberg orders on the symbol. | | "Filter failure: TRAILING_DELTA" | `trailingDelta` is not within the defined range of the filter for that order type. | | "Filter failure: EXCHANGE_MAX_NUM_ORDERS" | Account has too many open orders on the exchange. | | "Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the exchange. | ## 10xxx - Crypto Loans ### -10001 SYSTEM_MAINTENANCE - The system is under maintenance, please try again later. ### -10002 INVALID_INPUT - Invalid input parameters. ### -10005 NO_RECORDS - No records found. ### -10007 COIN_NOT_LOANABLE - This coin is not loanable. ### -10008 COIN_NOT_LOANABLE - This coin is not loanable ### -10009 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10010 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10011 INSUFFICIENT_ASSET - Insufficient spot assets. ### -10012 INVALID_AMOUNT - Invalid repayment amount. ### -10013 INSUFFICIENT_AMOUNT - Insufficient collateral amount. ### -10015 DEDUCTION_FAILED - Collateral deduction failed. ### -10016 LOAN_FAILED - Failed to provide loan. ### -10017 REPAY_EXCEED_DEBT - Repayment amount exceeds debt. ### -10018 INVALID_AMOUNT - Invalid repayment amount. ### -10019 CONFIG_NOT_EXIST - Configuration does not exists. ### -10020 UID_NOT_EXIST - User ID does not exist. ### -10021 ORDER_NOT_EXIST - Order does not exist. ### -10022 INVALID_AMOUNT - Invalid adjustment amount. ### -10023 ADJUST_LTV_FAILED - Failed to adjust LTV. ### -10024 ADJUST_LTV_NOT_SUPPORTED - LTV adjustment not supported. ### -10025 REPAY_FAILED - Repayment failed. ### -10026 INVALID_PARAMETER - Invalid parameter. ### -10028 INVALID_PARAMETER - Invalid parameter. ### -10029 AMOUNT_TOO_SMALL - Loan amount is too small. ### -10030 AMOUNT_TOO_LARGE - Loan amount is too much. ### -10031 QUOTA_REACHED - Individual loan quota reached. ### -10032 REPAY_NOT_AVAILABLE - Repayment is temporarily unavailable. ### -10034 REPAY_NOT_AVAILABLE - Repay with collateral is not available currently, please try to repay with borrowed coin. ### -10039 AMOUNT_TOO_SMALL - Repayment amount is too small. ### -10040 AMOUNT_TOO_LARGE - Repayment amount is too large. ### -10041 INSUFFICIENT_AMOUNT - Due to high demand, there are currently insufficient loanable assets for {0}. Please adjust your borrow amount or try again tomorrow. ### -10042 ASSET_NOT_SUPPORTED - asset %s is not supported ### -10043 ASSET_NOT_SUPPORTED - {0} borrowing is currently not supported. ### -10044 QUOTA_REACHED - Collateral amount has reached the limit. Please reduce your collateral amount or try with other collaterals. ### -10045 COLLTERAL_REPAY_NOT_SUPPORTED - The loan coin does not support collateral repayment. Please try again later. ### -10046 EXCEED_MAX_ADJUSTMENT - Collateral Adjustment exceeds the maximum limit. Please try again. ### -10047 REGION_NOT_SUPPORTED - This coin is currently not supported in your location due to local regulations. ## 13xxx - BLVT ### -13000 BLVT_FORBID_REDEEM - Redeption of the token is forbiden now ### -13001 BLVT_EXCEED_DAILY_LIMIT - Exceeds individual 24h redemption limit of the token ### -13002 BLVT_EXCEED_TOKEN_DAILY_LIMIT - Exceeds total 24h redemption limit of the token ### -13003 BLVT_FORBID_PURCHASE - Subscription of the token is forbiden now ### -13004 BLVT_EXCEED_DAILY_PURCHASE_LIMIT - Exceeds individual 24h subscription limit of the token ### -13005 BLVT_EXCEED_TOKEN_DAILY_PURCHASE_LIMIT - Exceeds total 24h subscription limit of the token ### -13006 BLVT_PURCHASE_LESS_MIN_AMOUNT - Subscription amount is too small ### -13007 BLVT_PURCHASE_AGREEMENT_NOT_SIGN - The Agreement is not signed ## 12xxx - Liquid Swap ### -12014 TOO MANY REQUESTS - More than 1 request in 2 seconds ## 18xxx - Binance Code ### -18002 - The total amount of codes you created has exceeded the 24-hour limit, please try again after UTC 0 ### -18003 - Too many codes created in 24 hours, please try again after UTC 0 ### -18004 - Too many invalid redeem attempts in 24 hours, please try again after UTC 0 ### -18005 - Too many invalid verify attempts, please try later ### -18006 - The amount is too small, please re-enter ### -18007 - This token is not currently supported, please re-enter ## 21xxx - Portfolio Margin Account ### -21001 USER_IS_NOT_UNIACCOUNT - Request ID is not a Portfolio Margin Account. ### -21002 UNI_ACCOUNT_CANT_TRANSFER_FUTURE - Portfolio Margin Account doesn't support transfer from margin to futures. ### -21003 NET_ASSET_MUST_LTE_RATIO - Fail to retrieve margin assets. ### -21004 USER_NO_LIABILITY - User doesn’t have portfolio margin bankruptcy loan ### -21005 NO_ENOUGH_ASSET - User’s spot wallet doesn’t have enough BUSD to repay portfolio margin bankruptcy loan ### -21006 HAD_IN_PROCESS_REPAY - User had portfolio margin bankruptcy loan repayment in process ### -21007 IN_FORCE_LIQUIDATION - User failed to repay portfolio margin bankruptcy loan since liquidation was in process ## Order Rejection Issues Error messages like these are indicated when the error is coming specifically from the matching engine: - `-1010 ERROR_MSG_RECEIVED` - `-2010 NEW_ORDER_REJECTED` - `-2011 CANCEL_REJECTED` The following messages which will indicate the specific error: | Error message | Description | | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | "Unknown order sent." | The order (by either `orderId`, `clientOrderId`, `origClientOrderId`) could not be found. | | "Duplicate order sent." | The `clientOrderId` is already in use. | | "Market is closed." | The symbol is not trading. | | "Account has insufficient balance for requested action." | Not enough funds to complete the action. | | "Market orders are not supported for this symbol." | `MARKET` is not enabled on the symbol. | | "Iceberg orders are not supported for this symbol." | `icebergQty` is not enabled on the symbol | | "Stop loss orders are not supported for this symbol." | `STOP_LOSS` is not enabled on the symbol | | "Stop loss limit orders are not supported for this symbol." | `STOP_LOSS_LIMIT` is not enabled on the symbol | | "Take profit orders are not supported for this symbol." | `TAKE_PROFIT` is not enabled on the symbol | | "Take profit limit orders are not supported for this symbol." | `TAKE_PROFIT_LIMIT` is not enabled on the symbol | | "Price \* QTY is zero or less." | `price` \* `quantity` is too low | | "IcebergQty exceeds QTY." | `icebergQty` must be less than the order quantity | | "This action is disabled on this account." | Contact customer support; some actions have been disabled on the account. | | "This account may not place or cancel orders." | Contact customer support; the account has trading ability disabled. | | "Unsupported order combination" | The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. | | "Order would trigger immediately." | The order's stop price is not valid when compared to the last traded price. | | "Cancel order is invalid. Check origClientOrderId and orderId." | No `origClientOrderId` or `orderId` was sent in. | | "Order would immediately match and take." | `LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. | | "The relationship of the prices for the orders is not correct." | The prices set in the `OCO` is breaking the Price rules.

The rules are:

`SELL Orders`: Limit Price > Last Price > Stop Price

`BUY Orders`: Limit Price < Last Price < Stop Price | | "OCO orders are not supported for this symbol" | `OCO` is not enabled on the symbol. | | "Quote order qty market orders are not support for this symbol." | `MARKET` orders using the parameter `quoteOrderQty` are not enabled on this symbol. | | "Trailing stop orders are not supported for this symbol." | Orders using `trailingDelta` are not enabled on the symbol. | | "Order cancel-replace is not supported for this symbol." | `POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is on enabled the symbol. | | "This symbol is not permitted for this account." | Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) | | "This symbol is restricted for this account." | Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) | | "Order was not canceled due to cancel restrictions." | Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW`
or
`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. | ## Errors regarding POST /api/v3/order/cancelReplace ### -2021 Order cancel-replace partially failed This code is sent when either the cancellation of the order failed or the new order placement failed but not both. ### -2022 Order cancel-replace failed. This code is sent when both the cancellation of the order failed and the new order placement failed. --- ## Document: /products/sub-account/change-log URL: /en/dev-docs/products/sub-account/change-log # Change Log ## 2026-06-18 ### Time-sensitive Notice - **Update:** `POST /sapi/v1/sub-account/futures/move-position` (Sub-Account Move Position) will be unavailable from 2026-06-18 until 2026-06-30 (UTC). Service will resume automatically after the window. --- ## 2026-06-04 - Update endpoints for Sub-Account: - `GET /sapi/v1/capital/deposit/subHisrec`: Added new optional parameter `includeSource`. Default: `false`. When set to `true`, the response will include the `sourceAddress` field. --- ## 2025-12-26 ### Time-sensitive Notice - **The following change to REST API will occur at approximately 2026-01-15 07:00 UTC:**
When calling endpoints that require signatures, percent-encode payloads before computing signatures. Requests that do not follow this order will be rejected with [`-1022 INVALID_SIGNATURE`](./error-code.md#-1022-invalid_signature). Please review and update your signing logic accordingly. ### REST API - Updated documentation for REST API regarding [Signed Endpoints examples for placing an order](./general-info.md#signed-endpoint-examples-for-post-apiv3order). --- ## 2025-09-17 - Update GET `/sapi/v1/sub-account/transaction-statistics` endpoints. - Supports returning the transaction information of the master account by default (without sending the email parameter) --- ## 2025-06-03 - Remove POST `/sapi/v1/sub-account/blvt/enable` and POST `/sapi/v1/sub-account/margin/enable` endpoints. - User now should make the initial transfer in the Margin account to enable it. --- ## 2025-04-30 - Update universal transfer endpoints for Sub-Account: `POST /sapi/v1/sub-account/universalTransfer ` to accept 'ALPHA' to 'ALPHA' transfer. --- ## 2025-04-08 - Update the weight of endpoints for Sub-Account: - The UID request weight of `POST /sapi/v1/sub-account/universalTransfer ` is 360. --- ## 2025-03-26 - - New endpoints for Sub-Account to support move position function: - `POST /sapi/v1/sub-account/futures/move-position`: Move position between sub-master, master-sub, or sub-sub accounts - `GET /sapi/v1/sub-account/futures/move-position`: Query move position history ## 2024-11-22 - Update endpoints for Managed Sub-Account: - GET `/sapi/v1/managed-subaccount/marginAsset`: Add a new request parameter to determine which margin account type is queried. - GET `/sapi/v1/managed-subaccount/fetch-future-asset`: Add a new request parameter to determine which futures account type is queried. --- ## 2024-11-04 - Update endpoints for Sub-Account: - `GET /sapi/v1/sub-account/universalTransfer`: The query time period must be less then 7 days. If startTime and endTime not sent, return records of the last 7 days by default. --- ## 2024-10-24 - Update endpoints for Sub-Account: - `GET /sapi/v4/sub-account/assets ` and `GET /sapi/v3/sub-account/assets`: Add 2 new asset types to the response. --- ## 2024-05-21 - Update endpoints for Sub-Account: - `GET /sapi/v1/sub-account/transfer/subUserHistory`: update response field `fromAccountType` and `toAccountType`. Return USDT_FUTURE/COIN_FUTURE in order to differentiate 2 futures wallets. --- ## 2023-06-22 - New endpoints for Sub-Account: - `POST /sapi/v1/sub-account/eoptions/enable`: enable Options for Sub-account - `GET /sapi/v1/managed-subaccount/query-trans-log`: Query Managed Sub Account Transfer Log (For Trading Team Sub Account) --- ## 2023-04-20 - New endpoints for Sub-Account: - `GET /sapi/v1/managed-subaccount/deposit/address`: get managed sub-account deposit address --- ## 2023-03-23 - Update endpoints for Sub-Account: - `GET /sapi/v1/managed-subaccount/queryTransLogForInvestor`: Add response field `tranId` - `GET /sapi/v1/managed-subaccount/queryTransLogForTradeParent`: Add response field `tranId` - New endpoints for Sub-Account: - `GET /sapi/v1/managed-subaccount/info`: query investor's managed sub-account list - `GET /sapi/v1/sub-account/transaction-statistics`: Query sub-account transaction tatistics --- ## 2023-02-13 - New endpoints for Sub-Account: - `GET /sapi/v4/sub-account/assets`: Fetch sub-account assets --- ## 2023-01-13 - The following endpoints will be discontinued on January 13, 2023 6:00 AM UTC: - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction` to support master account enable and disable IP restriction for a sub-account API Key - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList` to support master account add IP list for a sub-account API Key - New endpoints for Sub-Account: - `GET /sapi/v1/managed-subaccount/fetch-future-asset`: Investor can use this api to query managed sub account futures asset details - `GET /sapi/v1/managed-subaccount/marginAsset`: Investor can use this api to query managed sub account margin asset details - New endpoin for Margin: - `GET /sapi/v1/margin/crossMarginCollateralRatio`: Get cross margin collateral ratio --- ## 2023-01-05 - New endpoints for Sub-Account: - `GET /sapi/v1/managed-subaccount/queryTransLogForInvestor`: Investor can use this api to query managed sub account transfer log - `GET /sapi/v1/managed-subaccount/queryTransLogForTradeParent`: Trading team can use this api to query managed sub account transfer log --- ## 2022-11-18 - New endpoints for Sub-account: - `POST /sapi/v2/sub-account/subAccountApi/ipRestriction`: To support master account update IP Restriction for Sub-Account API key --- ## 2022-09-22 - Update endpoint for Sub-Account: - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction`: Add new param `thirdParty` - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList`: Add new param `thirdPartyName` - `DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList`: Add new param `thirdPartyName` --- ## 2022-09-12 - Update endpoint for Sub-account: \* `GET /sapi/v1/sub-account/subAccountApi/ipRestriction`: To support master account query Third party IP list name for a sub account API key --- ## 2022-06-02 - Update endpoint for Subaccount: - `GET /sapi/v1/sub-account/sub/transfer/history`: fromEmail and toEmail can be master email. --- ## 2022-3-29 The following updates will take effect on **March 31, 2022 08:00 AM UTC** - Update endpoint for Sub-account: - `GET /sapi/v1/sub-account/universalTransfer` The query time period must be less then 30 days; If `startTime` and `endTime` not sent, return records of the last 30 days by default --- ## 2022-03-25 - Update endpoint for Sub-Account: - New endpoint`GET /sapi/v1/managed-subaccount/accountSnapshot` to support investor master account query asset snapshot of managed sub-account --- ## 2022-03-08 - Update endpoint for Sub-Account: - New transfer types`MARGIN`,`ISOLATED_MARGIN` and parameter`symbol`added in`POST /sapi/v1/sub-account/universalTransfer` to support transfer to sub-account cross margin account and isolated margin account --- ## 2022-2-18 - Update endpoint for Sub-Account: - New fields `isManagedSubAccount`and `isAssetManagementSubAccount` added in`GET /sapi/v1/sub-account/list`to support query whether the sub-account is a managed sub-account or a asset management sub-account --- ## 2021-12-24 - Update endpoints for Sub-Account: - New parameter`clientTranId`added in`POST /sapi/v1/sub-account/universalTransfer` and `GET /sapi/v1/sub-account/universalTransfer` to support custom transfer id --- ## 2021-11-16 - New endpoints for Sub-Account: - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction` to support master account enable and disable IP whitelist for a sub-account API Key - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList` to support master account add IP Whitelist Address List for a sub-account API Key - `GET /sapi/v1/sub-account/subAccountApi/ipRestriction` to support master account query IP whitelist for a sub-account API Key - `DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList` to support master account delete IP Whitelist Address List for a sub-account API Key --- ## 2021-07-29 - Update endpoint for Sub-Account: - `GET /sapi/v1/sub-account/transfer/subUserHistory` if `startTime`and`endTime`are not sent, the recent 30-day data will be returned by default --- ## 2021-06-15 - New endpoints for Sub-Account: - `POST /sapi/v1/managed-subaccount/deposit ` to deposit assets into the managed sub-account (only for investor master account) - `GET /sapi/v1/managed-subaccount/asset` to query managed sub-account asset details (only for investor master account) - `POST /sapi/v1/managed-subaccount/withdraw` to withdrawal assets from the managed sub-account (only for investor master account) --- ## 2021-04-08 - Update endpoint for Sub-Account: - `GET /sapi/v1/sub-account/futures/accountSummary` and `GET /sapi/v2/sub-account/futures/accountSummary` the unit of field `asset` changed to USD valued summary of sub-account assets --- ## 2021-04-02 - New endpoint for Sub-Account: - `GET /sapi/v3/sub-account/assets` to query sub-account assets --- ## 2021-04-01 - Update endpoint for Sub-Account: - `GET /sapi/v1/sub-account/transfer/subUserHistory` new fields `fromAccountType` and `toAccountType` added in response --- ## 2021-03-31 - Update endpoint for Sub-Account: - `GET /wapi/v3/sub-account/transfer/history.html` added new parameters `fromEmail` and `toEmail`, the original parameter`email` is equal to`fromEmail`by default --- ## 2021-03-08 - New endpoint for Sub-Account: - `POST /sapi/v1/sub-account/virtualSubAccount` to support create a virtual sub-account - `GET /sapi/v1/sub-account/list` to support query sub-account list - `POST /sapi/v1/sub-account/blvt/enable` to support enable blvt for sub-account --- ## 2020-12-22 - New endpoint for Sub-Account: - `GET /sapi/v1/sub-account/sub/transfer/history` to get spot asset transfer history. --- ## 2020-12-02 - New endpoints for Sub-Account: - `GET /sapi/v2/sub-account/futures/account` to get detail on sub-account's USDT margined futures account and COIN margined futures account. - `GET /sapi/v2/sub-account/futures/accountSummary` to get summary of sub-account's USDT margined futures account and COIN margined futures account. - `GET /sapi/v2/sub-account/futures/positionRisk` to get position risk of sub-account's USDT margined futures account and COIN margined futures account. --- ## 2020-11-13 - New endpoints for Sub-Account: - `POST /sapi/v1/sub-account/universalTransfer` to transfer spot and futures asset between master account and sub accounts. - `GET /sapi/v1/sub-account/universalTransfer` to search transfer records. --- ## 2020-11-09 - New field `tranId` is available from endpoints: - `GET /sapi/v1/sub-account/futures/internalTransfer` - `GET /sapi/v1/sub-account/transfer/subUserHistory` --- ## 2020-10-10 - New `type` added in the endpoint `POST /sapi/v1/sub-account/futures/transfer`to support transfer asset from subaccount's spot account to its COIN-margined futures account and transfer asset from subaccount's COIN-margined futures account to its spot account. --- ## 2020-09-03 - New endpoint `POST /sapi/v1/sub-account/futures/internalTransfer` to transfer futures asset between master account and subaccount. - New endpoint`GET /sapi/v1/sub-account/futures/internalTransfer` to get futures transfer history of subaccount. --- ## 2020-09-01 - New parameter `masterAccountTotalAsset` added in the endpoint `GET /sapi/v1/sub-account/spotSummary` to get BTC valued asset summary of master account. --- ## 2020-08-27 - New endpoint `GET /sapi/v1/sub-account/spotSummary` to get BTC valued asset summary of subaccout. --- ## 2020-02-05 - New sub account endpoints: - `POST /sapi/v1/sub-account/futures/transfer` to transfer between futures and spot accout of sub-account. - `POST /sapi/v1/sub-account/margin/transfer` to transfer between margin and spot accout of sub-account. - `POST /sapi/v1/sub-account/transfer/subToSub` to transfer to another account by sub-account. - `POST /sapi/v1/sub-account/transfer/subToMaster` to transfer to same master by sub-account. - `GET /sapi/v1/sub-account/transfer/subUserHistory` to get transfer history of sub-account. --- ## 2019-11-19 - `GET /sapi/v1/sub-account/margin/account` has new field: `marginTradeCoeffVo` which contains - `forceLiquidationBar` for liquidation margin ratio - `marginCallBar` for margin call margin ratio - `normalBar` for initial margin ratio --- ## 2019-11-08 - New sapi for subaccount management on margin and futures: - `GET /sapi/v1/sub-account/status (HMAC SHA256)` - `POST /sapi/v1/sub-account/margin/enable (HMAC SHA256)` - `GET /sapi/v1/sub-account/margin/account (HMAC SHA256)` - `GET /sapi/v1/sub-account/margin/accountSummary (HMAC SHA256)` - `POST /sapi/v1/sub-account/futures/enable (HMAC SHA256)` - `GET /sapi/v1/sub-account/futures/account (HMAC SHA256)` - `GET /sapi/v1/sub-account/futures/accountSummary (HMAC SHA256)` - `GET /sapi/v1/sub-account/futures/positionRisk (HMAC SHA256)` --- ## 2019-11-04 - New sapi endpoints for subaccount wallet. - `GET /sapi/v1/capital/deposit/subAddress (HMAC SHA256))`: fetch subaccount deposit address. - `GET /sapi/v1/capital/deposit/subHisrec (HMAC SHA256))`: fetch subaccount deposit history. --- ## Document: /products/sub-account/Introduction URL: /en/dev-docs/products/sub-account/Introduction # Introduction Subaccount endpoints below allow you to interact with Binance subaccount. For more information on this, please refer to the [Binance Subaccount FAQ](https://www.binance.com/en/support/faq/binance-sub-account-functions-and-frequently-asked-questions-360020632811) --- ## Document: /products/spot-block-matching/quick-start URL: /en/dev-docs/products/spot-block-matching/quick-start # Quick Start ## API Key Setup - Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/articles/360002502072) regarding API key creation. - Once API key is created, it is recommended to set IP restrictions on the key for security reasons. - **Never share your API key/secret key to ANYONE.** ## API Key Restrictions - After creating the API key, the default restrictions is `Enable Reading`. - To **enable withdrawals via the API**, the API key restriction needs to be modified through the Binance UI. ## Enabling Accounts ### Spot Account A `SPOT` account is provided by default upon creation of a Binance Account. ### Margin Account To enable a `MARGIN` account for Margin Trading, please refer to the [Margin Trading Guide](https://www.binance.vision/tutorials/binance-margin-trading-guide) ## API Library ### Python connector This is a lightweight library that works as a connector to Binance public API, written in Python. [https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python) ### Javascript connector This is a lightweight library that works as a connector to Binance public API, written for JavaScript users. [https://github.com/binance/binance-connector-js](https://github.com/binance/binance-connector-js) ### Ruby connector This is a lightweight library that works as a connector to Binance public API, written for Ruby users. [https://github.com/binance/binance-connector-ruby](https://github.com/binance/binance-connector-ruby) ### DotNET connector This is a lightweight library that works as a connector to Binance public API, written for C# users. [https://github.com/binance/binance-connector-dotnet](https://github.com/binance/binance-connector-dotnet) ### Java connector This is a lightweight library that works as a connector to Binance public API, written for Java users. [https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java) ### Postman Collections There is now a Postman collection containing the API endpoints for quick and easy use. This is recommended for new users who want to get a quick-start into using the API. For more information please refer to this page: [Binance API Postman](https://github.com/binance/binance-api-postman) ### Swagger A YAML file with OpenAPI specification on the RESTful API is available to be used, as well as a Swagger UI page for the consulting. [https://github.com/binance/binance-api-swagger](https://github.com/binance/binance-api-swagger) --- ## Document: /products/spot-block-matching/general-info URL: /en/dev-docs/products/spot-block-matching/general-info # General Info ## General API Information - The following base endpoints are available: - **https://api.binance.com** - **https://api-gcp.binance.com** - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** - The last 4 endpoints in the point above (`api1`-`api4`) might give better performance but have less stability. Please use whichever works best for your setup. - All endpoints return either a JSON object or array. - Data is returned in **ascending** order. Oldest first, newest last. - All time and timestamp related fields are in **milliseconds**. ### HTTP Return Codes - HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. - HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP `409` return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.) - HTTP `429` return code is used when breaking a request rate limit. - HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. - HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. ### Error Codes and Messages - If there is an error, the API will return an error with a message of the reason. > The error payload on API and SAPI is as follows: ```json { "code": -1121, "msg": "Invalid symbol." } ``` - Specific error codes and messages defined in [Error Codes](./error-code). ### General Information on Endpoints - For `GET` endpoints, parameters must be sent as a `query string`. - For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. - Parameters may be sent in any order. - If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. --- ## LIMITS ### General Info on Limits - The following `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". - The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. - A 429 will be returned when either request rate limit or order rate limit is violated. ### IP Limits - Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. - When a 429 is received, it's your obligation as an API to back off and not spam the API. - **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** - IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. - A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - **The limits on the API are based on the IPs, not the API keys.** ### Order Rate Limits - Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. - When the order count exceeds the limit, you will receive a 429 error without the `Retry-After` header. Please check the Order Rate Limit rules using `GET api/v3/exchangeInfo` and wait for reactivation accordingly. - Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - **The order rate limit is counted against each account**. - To monitor order count usage, refer to GET `api/v3/rateLimit/order` ### Websocket Limits - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON controlled message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. - There is a limit of **300 connections per attempt every 5 minutes per IP**. ### /api/ and /sapi/ Limit Introduction The `/api/*` and `/sapi/*` endpoints adopt either of two access limiting rules, IP limits or UID (account) limits. - Endpoints related to `/api/*`: - According to the two modes of IP and UID (account) limit, each are independent. - Endpoints share the 6000 per minute limit based on IP. - Responses contain the header `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)`, defining the weight used by the current IP. - Successful order responses contain the header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`, defining the order limit used by the UID. - Endpoints related to `/sapi/*`: - Endpoints are marked according to IP or UID limit and their corresponding weight value. - Each endpoint with IP limits has an independent 12000 per minute limit. - Each endpoint with UID limits has an independent 180000 per minute limit. - Responses from endpoints with IP limits contain the header `X-SAPI-USED-IP-WEIGHT-1M`, defining the weight used by the current IP. - Responses from endpoints with UID limits contain the header `X-SAPI-USED-UID-WEIGHT-1M`, defining the weight used by the current UID. --- ## Data Sources - The API system is asynchronous, so some delay in the response is normal and expected. - Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates. - **Matching Engine** - the data is from the matching Engine - **Memory** - the data is from a server's local or external memory - **Database** - the data is taken directly from a database ## Request Security - Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](#place-new-order-trade)). - If unspecified, the security type is `NONE`. - Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](#user-data-stream-requests). - Secure endpoints require a valid API key to be specified and authenticated. - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. - API keys can be configured to allow access only to certain types of secure endpoints. - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. | Security Type | Description | | ------------- | -------------------------------------------------------- | | NONE | Endpoint can be accessed freely. | | TRADE | Endpoint requires sending a valid API-Key and signature. | | MARGIN | Endpoint requires sending a valid API-Key and signature. | | USER_DATA | Endpoint requires sending a valid API-Key and signature. | | USER_STREAM | Endpoint requires sending a valid API-Key. | | MARKET_DATA | Endpoint requires sending a valid API-Key. | - `TRADE`, `MARGIN` and `USER_DATA` endpoints are `SIGNED` endpoints. ### SIGNED Endpoint security - `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. #### Signature Case Sensitivity - **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. - **RSA:** Signatures generated using RSA are **case-sensitive**. - **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** Please consult [SIGNED request example (HMAC)](#hmac-keys), [SIGNED request example (RSA)](#rsa-keys), and [SIGNED request example (Ed25519)](#ed25519-keys) on how to compute signature, depending on which API key type you are using. ### Timing security - `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](#general-api-information)) - An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. - Maximum `recvWindow` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` **Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. **It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** ### SIGNED Endpoint Examples for POST /api/v3/order #### HMAC Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. Example API key and secret key: | Key | Value | | ----------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `secretKey` | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j | **WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | LTCBTC | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` **Step 2: Compute the signature** 1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. 2. Sign the signature payload constructed in Step 1. 3. Encode the HMAC-SHA-256 output as a hex string. Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. **Example commands** For the first set of example parameters (ASCII only): ```console $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" ``` For the second set of example parameters (some non-ASCII characters) ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" ``` Here is a sample Bash script performing all the steps above: ```bash apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" # Sign the request signature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey") signature=${signature#*= } # Keep only the part after the "= " # Send the request curl -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?$payload&signature=$signature" ``` #### RSA Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. Only `PKCS#8` keys are supported. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. These examples assume the private key is stored in the file `./test-prv-key.pem`. | Key | Value | | -------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | BTCUSDT | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` **Step 2: Compute the signature** 1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function. 2. Encode the output in base64. Note that the payload and the resulting `signature` are **case-sensitive**. For the first set of example parameters (ASCII only): ```console $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== ``` 3. Percent-encode the base64 string. For the first set of example parameters (ASCII only): ```console HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D ``` For the second set of example parameters (some non-ASCII characters): ```console qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' ``` For the second set of example parameters (some non-ASCII characters): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' ``` Here is a sample Bash script performing all the steps above: ```bash function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos The error JSON payload: ```javascript { "code":-1121, "msg":"Invalid symbol." } ``` Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. ## 10xx - General Server or Network issues ### -1000 UNKNOWN - An unknown error occurred while processing the request. - An unknown error occurred while processing the request.[%s] ### -1001 DISCONNECTED - Internal error; unable to process your request. Please try again. ### -1002 UNAUTHORIZED - You are not authorized to execute this request. ### -1003 TOO_MANY_REQUESTS - Too many requests queued. - Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. - Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. ### -1004 SERVER_BUSY - Server is busy, please wait and try again ### -1006 UNEXPECTED_RESP - An unexpected response was received from the message bus. Execution status unknown. ### -1007 TIMEOUT - Timeout waiting for response from backend server. Send status unknown; execution status unknown. ### -1008 SERVER_BUSY - Spot server is currently overloaded with other requests. Please try again in a few minutes. ### -1014 UNKNOWN_ORDER_COMPOSITION - Unsupported order combination. ### -1015 TOO_MANY_ORDERS - Too many new orders. - Too many new orders; current limit is %s orders per %s. ### -1016 SERVICE_SHUTTING_DOWN - This service is no longer available. ### -1020 UNSUPPORTED_OPERATION - This operation is not supported. ### -1021 INVALID_TIMESTAMP - Timestamp for this request is outside of the recvWindow. - Timestamp for this request was 1000ms ahead of the server's time. ### -1022 INVALID_SIGNATURE - Signature for this request is not valid. ### -1099 Not found, authenticated, or authorized - This replaces error code -1999 ## 11xx - 2xxx Request issues ### -1100 ILLEGAL_CHARS - Illegal characters found in a parameter. - Illegal characters found in a parameter. %s - Illegal characters found in parameter `%s`; legal range is `%s`. ### -1101 TOO_MANY_PARAMETERS - Too many parameters sent for this endpoint. - Too many parameters; expected `%s` and received `%s`. - Duplicate values for a parameter detected. ### -1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED - A mandatory parameter was not sent, was empty/null, or malformed. - Mandatory parameter `%s` was not sent, was empty/null, or malformed. - Param `%s` or `%s` must be sent, but both were empty/null! ### -1103 UNKNOWN_PARAM - An unknown parameter was sent. ### -1104 UNREAD_PARAMETERS - Not all sent parameters were read. - Not all sent parameters were read; read `%s` parameter(s) but was sent `%s`. ### -1105 PARAM_EMPTY - A parameter was empty. - Parameter `%s` was empty. ### -1106 PARAM_NOT_REQUIRED - A parameter was sent when not required. - Parameter `%s` sent when not required. ### -1111 BAD_PRECISION - Precision is over the maximum defined for this asset. ### -1112 NO_DEPTH - No orders on book for symbol. ### -1114 TIF_NOT_REQUIRED - TimeInForce parameter sent when not required. ### -1115 INVALID_TIF - Invalid timeInForce. ### -1116 INVALID_ORDER_TYPE - Invalid orderType. ### -1117 INVALID_SIDE - Invalid side. ### -1118 EMPTY_NEW_CL_ORD_ID - New client order ID was empty. ### -1119 EMPTY_ORG_CL_ORD_ID - Original client order ID was empty. ### -1120 BAD_INTERVAL - Invalid interval. ### -1121 BAD_SYMBOL - Invalid symbol. ### -1125 INVALID_LISTEN_KEY - This listenKey does not exist. ### -1127 MORE_THAN_XX_HOURS - Lookup interval is too big. - More than %s hours between startTime and endTime. ### -1128 OPTIONAL_PARAMS_BAD_COMBO - Combination of optional parameters invalid. ### -1130 INVALID_PARAMETER - Invalid data sent for a parameter. - Data sent for parameter `%s` is not valid. ### -1131 BAD_RECV_WINDOW - recvWindow must be less than 60000 ### -1134 BAD_STRATEGY_TYPE - `strategyType` was less than 1000000. #### -1145 INVALID_CANCEL_RESTRICTIONS - `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. #### -1151 DUPLICATE_SYMBOLS - Symbol is present multiple times in the list. ### -2010 NEW_ORDER_REJECTED - NEW_ORDER_REJECTED ### -2011 CANCEL_REJECTED - CANCEL_REJECTED ### -2013 NO_SUCH_ORDER - Order does not exist. ### -2014 BAD_API_KEY_FMT - API-key format invalid. ### -2015 REJECTED_MBX_KEY - Invalid API-key, IP, or permissions for action. ### -2016 NO_TRADING_WINDOW - No trading window could be found for the symbol. Try ticker/24hrs instead. #### -2026 ORDER_ARCHIVED - Order was canceled or expired with no executed qty over 90 days ago and has been archived. ## 3xxx-5xxx SAPI-specific issues ### -3000 INNER_FAILURE - Internal server error. ### -3001 NEED_ENABLE_2FA - Please enable 2FA first. ### -3002 ASSET_DEFICIENCY - We don't have this asset. ### -3003 NO_OPENED_MARGIN_ACCOUNT - Margin account does not exist. ### -3004 TRADE_NOT_ALLOWED - Trade not allowed. ### -3005 TRANSFER_OUT_NOT_ALLOWED - Transferring out not allowed. ### -3006 EXCEED_MAX_BORROWABLE - Your borrow amount has exceed maximum borrow amount. ### -3007 HAS_PENDING_TRANSACTION - You have pending transaction, please try again later. ### -3008 BORROW_NOT_ALLOWED - Borrow not allowed. ### -3009 ASSET_NOT_MORTGAGEABLE - This asset are not allowed to transfer into margin account currently. ### -3010 REPAY_NOT_ALLOWED - Repay not allowed. ### -3011 BAD_DATE_RANGE - Your input date is invalid. ### -3012 ASSET_ADMIN_BAN_BORROW - Borrow is banned for this asset. ### -3013 LT_MIN_BORROWABLE - Borrow amount less than minimum borrow amount. ### -3014 ACCOUNT_BAN_BORROW - Borrow is banned for this account. ### -3015 REPAY_EXCEED_LIABILITY - Repay amount exceeds borrow amount. ### -3016 LT_MIN_REPAY - Repay amount less than minimum repay amount. ### -3017 ASSET_ADMIN_BAN_MORTGAGE - This asset are not allowed to transfer into margin account currently. ### -3018 ACCOUNT_BAN_MORTGAGE - Transferring in has been banned for this account. ### -3019 ACCOUNT_BAN_ROLLOUT - Transferring out has been banned for this account. ### -3020 EXCEED_MAX_ROLLOUT - Transfer out amount exceeds max amount. ### -3021 PAIR_ADMIN_BAN_TRADE - Margin account are not allowed to trade this trading pair. ### -3022 ACCOUNT_BAN_TRADE - You account's trading is banned. ### -3023 WARNING_MARGIN_LEVEL - You can't transfer out/place order under current margin level. ### -3024 FEW_LIABILITY_LEFT - The unpaid debt is too small after this repayment. ### -3025 INVALID_EFFECTIVE_TIME - Your input date is invalid. ### -3026 VALIDATION_FAILED - Your input param is invalid. ### -3027 NOT_VALID_MARGIN_ASSET - Not a valid margin asset. ### -3028 NOT_VALID_MARGIN_PAIR - Not a valid margin pair. ### -3029 TRANSFER_FAILED - Transfer failed. ### -3036 ACCOUNT_BAN_REPAY - This account is not allowed to repay. ### -3037 PNL_CLEARING - PNL is clearing. Wait a second. ### -3038 LISTEN_KEY_NOT_FOUND - Listen key not found. ### -3041 BALANCE_NOT_CLEARED - Balance is not enough ### -3042 PRICE_INDEX_NOT_FOUND - PriceIndex not available for this margin pair. ### -3043 TRANSFER_IN_NOT_ALLOWED - Transferring in not allowed. ### -3044 SYSTEM_BUSY - System busy. ### -3045 SYSTEM - The system doesn't have enough asset now. ### -3999 NOT_WHITELIST_USER - This function is only available for invited users. ### -4001 CAPITAL_INVALID - Invalid operation. ### -4002 CAPITAL_IG - Invalid get. ### -4003 CAPITAL_IEV - Your input email is invalid. ### -4004 CAPITAL_UA - You don't login or auth. ### -4005 CAPAITAL_TOO_MANY_REQUEST - Too many new requests. ### -4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT - Support main account only. ### -4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS - Address validation is not passed. ### -4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS - Address tag validation is not passed. ### -4010 CAPITAL_WHITELIST_EMAIL_CONFIRM - White list mail has been confirmed. ### -4011 CAPITAL_WHITELIST_EMAIL_EXPIRED - White list mail is invalid. ### -4012 CAPITAL_WHITELIST_CLOSE - White list is not opened. ### -4013 CAPITAL_WITHDRAW_2FA_VERIFY - 2FA is not opened. ### -4014 CAPITAL_WITHDRAW_LOGIN_DELAY - Withdraw is not allowed within 2 min login. ### -4015 CAPITAL_WITHDRAW_RESTRICTED_MINUTE - Withdraw is limited. ### -4016 CAPITAL_WITHDRAW_RESTRICTED_PASSWORD - Within 24 hours after password modification, withdrawal is prohibited. ### -4017 CAPITAL_WITHDRAW_RESTRICTED_UNBIND_2FA - Within 24 hours after the release of 2FA, withdrawal is prohibited. ### -4018 CAPITAL_WITHDRAW_ASSET_NOT_EXIST - We don't have this asset. ### -4019 CAPITAL_WITHDRAW_ASSET_PROHIBIT - Current asset is not open for withdrawal. ### -4021 CAPITAL_WITHDRAW_AMOUNT_MULTIPLE - Asset withdrawal must be an %s multiple of %s. ### -4022 CAPITAL_WITHDRAW_MIN_AMOUNT - Not less than the minimum pick-up quantity %s. ### -4023 CAPITAL_WITHDRAW_MAX_AMOUNT - Within 24 hours, the withdrawal exceeds the maximum amount. ### -4024 CAPITAL_WITHDRAW_USER_NO_ASSET - You don't have this asset. ### -4025 CAPITAL_WITHDRAW_USER_ASSET_LESS_THAN_ZERO - The number of hold asset is less than zero. ### -4026 CAPITAL_WITHDRAW_USER_ASSET_NOT_ENOUGH - You have insufficient balance. ### -4027 CAPITAL_WITHDRAW_GET_TRAN_ID_FAILURE - Failed to obtain tranId. ### -4028 CAPITAL_WITHDRAW_MORE_THAN_FEE - The amount of withdrawal must be greater than the Commission. ### -4029 CAPITAL_WITHDRAW_NOT_EXIST - The withdrawal record does not exist. ### -4030 CAPITAL_WITHDRAW_CONFIRM_SUCCESS - Confirmation of successful asset withdrawal. ### -4031 CAPITAL_WITHDRAW_CANCEL_FAILURE - Cancellation failed. ### -4032 CAPITAL_WITHDRAW_CHECKSUM_VERIFY_FAILURE - Withdraw verification exception. ### -4033 CAPITAL_WITHDRAW_ILLEGAL_ADDRESS - Illegal address. ### -4034 CAPITAL_WITHDRAW_ADDRESS_CHEAT - The address is suspected of fake. ### -4035 CAPITAL_WITHDRAW_NOT_WHITE_ADDRESS - This address is not on the whitelist. Please join and try again. ### -4036 CAPITAL_WITHDRAW_NEW_ADDRESS - The new address needs to be withdrawn in {0} hours. ### -4037 CAPITAL_WITHDRAW_RESEND_EMAIL_FAIL - Re-sending Mail failed. ### -4038 CAPITAL_WITHDRAW_RESEND_EMAIL_TIME_OUT - Please try again in 5 minutes. ### -4039 CAPITAL_USER_EMPTY - The user does not exist. ### -4040 CAPITAL_NO_CHARGE - This address not charged. ### -4041 CAPITAL_MINUTE_TOO_SMALL - Please try again in one minute. ### -4042 CAPITAL_CHARGE_NOT_RESET - This asset cannot get deposit address again. ### -4043 CAPITAL_ADDRESS_TOO_MUCH - More than 100 recharge addresses were used in 24 hours. ### -4044 CAPITAL_BLACKLIST_COUNTRY_GET_ADDRESS - This is a blacklist country. ### -4045 CAPITAL_GET_ASSET_ERROR - Failure to acquire assets. ### -4046 CAPITAL_AGREEMENT_NOT_CONFIRMED - Agreement not confirmed. ### -4047 CAPITAL_DATE_INTERVAL_LIMIT - Time interval must be within 0-90 days ### -4060 CAPITAL_WITHDRAW_USER_ASSET_LOCK_DEPOSIT - As your deposit has not reached the required block confirmations, we have temporarily locked {0} asset ### -4106 TAG_NOT_SUPPORTED_FOR_NETWORK - This network does not support memo/tag. Please remove the `addressTag` field and try again. ### -5001 ASSET_DRIBBLET_CONVERT_SWITCH_OFF - Don't allow transfer to micro assets. ### -5002 ASSET_ASSET_NOT_ENOUGH - You have insufficient balance. ### -5003 ASSET_USER_HAVE_NO_ASSET - You don't have this asset. ### -5004 USER_OUT_OF_TRANSFER_FLOAT - The residual balances have exceeded 0.001BTC, Please re-choose. - The residual balances of %s have exceeded 0.001BTC, Please re-choose. ### -5005 USER_ASSET_AMOUNT_IS_TOO_LOW - The residual balances of the BTC is too low - The residual balances of %s is too low, Please re-choose. ### -5006 USER_CAN_NOT_REQUEST_IN_24_HOURS - Only transfer once in 24 hours. ### -5007 AMOUNT_OVER_ZERO - Quantity must be greater than zero. ### -5008 ASSET_WITHDRAW_WITHDRAWING_NOT_ENOUGH - Insufficient amount of returnable assets. ### -5009 PRODUCT_NOT_EXIST - Product does not exist. ### -5010 TRANSFER_FAIL - Asset transfer fail. ### -5011 FUTURE_ACCT_NOT_EXIST - future account not exists. ### -5012 TRANSFER_PENDING - Asset transfer is in pending. ### -5021 PARENT_SUB_HAVE_NO_RELATION - This parent sub have no relation ### -5012 FUTURE_ACCT_OR_SUBRELATION_NOT_EXIST - future account or sub relation not exists. ## 6XXX - Savings Issues ### -6001 DAILY_PRODUCT_NOT_EXIST - Daily product not exists. ### -6003 DAILY_PRODUCT_NOT_ACCESSIBLE - Product not exist or you don't have permission ### -6004 DAILY_PRODUCT_NOT_PURCHASABLE - Product not in purchase status ### -6005 DAILY_LOWER_THAN_MIN_PURCHASE_LIMIT - Smaller than min purchase limit ### -6006 DAILY_REDEEM_AMOUNT_ERROR - Redeem amount error ### -6007 DAILY_REDEEM_TIME_ERROR - Not in redeem time ### -6008 DAILY_PRODUCT_NOT_REDEEMABLE - Product not in redeem status ### -6009 REQUEST_FREQUENCY_TOO_HIGH - Request frequency too high ### -6011 EXCEEDED_USER_PURCHASE_LIMIT - Exceeding the maximum num allowed to purchase per user ### -6012 BALANCE_NOT_ENOUGH - Balance not enough ### -6013 PURCHASING_FAILED - Purchasing failed ### -6014 UPDATE_FAILED - Exceed up-limit allowed to purchased ### -6015 EMPTY_REQUEST_BODY - Empty request body ### -6016 PARAMS_ERR - Parameter err ### -6017 NOT_IN_WHITELIST - Not in whitelist ### -6018 ASSET_NOT_ENOUGH - Asset not enough ### -6019 PENDING - Need confirm ### -6020 PROJECT_NOT_EXISTS - Project not exists ## 70xx - Futures ### -7001 FUTURES_BAD_DATE_RANGE - Date range is not supported. ### -7002 FUTURES_BAD_TYPE - Data request type is not supported. ## 20xxx - Futures/Spot Algo ### -20121 - Invalid symbol. ### -20124 - Invalid algo id or it has been completed. ### -20130 - Invalid data sent for a parameter. ### -20132 - The client algo id is duplicated. ### -20194 - Duration is too short to execute all required quantity. ### -20195 - The total size is too small. ### -20196 - The total size is too large. ### -20198 - Reach the max open orders allowed. ### -20204 - The notional of USD is less or more than the limit. ## Filter failures | Error message | Description | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | "Filter failure: PRICE_FILTER" | `price` is too high, too low, and/or not following the tick size rule for the symbol. | | "Filter failure: PERCENT_PRICE" | `price` is X% too high or X% too low from the average weighted price over the last Y minutes. | | "Filter failure: PERCENT_PRICE_BY_SIDE" | `price` is X% too high or Y% too low from the `lastPrice` on that side (i.e. BUY/SELL) | | "Filter failure: LOT_SIZE" | `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MIN_NOTIONAL" | `price` \* `quantity` is too low to be a valid order for the symbol. | | "Filter failure: ICEBERG_PARTS" | `ICEBERG` order would break into too many parts; icebergQty is too small. | | "Filter failure: MARKET_LOT_SIZE" | `MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MAX_POSITION" | The account's position has reached the maximum defined limit.

This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY`orders. | | "Filter failure: MAX_NUM_ORDERS" | Account has too many open orders on the symbol. | | "Filter failure: MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the symbol. | | "Filter failure: MAX_NUM_ICEBERG_ORDERS" | Account has too many open iceberg orders on the symbol. | | "Filter failure: TRAILING_DELTA" | `trailingDelta` is not within the defined range of the filter for that order type. | | "Filter failure: EXCHANGE_MAX_NUM_ORDERS" | Account has too many open orders on the exchange. | | "Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the exchange. | ## 10xxx - Crypto Loans ### -10001 SYSTEM_MAINTENANCE - The system is under maintenance, please try again later. ### -10002 INVALID_INPUT - Invalid input parameters. ### -10005 NO_RECORDS - No records found. ### -10007 COIN_NOT_LOANABLE - This coin is not loanable. ### -10008 COIN_NOT_LOANABLE - This coin is not loanable ### -10009 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10010 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10011 INSUFFICIENT_ASSET - Insufficient spot assets. ### -10012 INVALID_AMOUNT - Invalid repayment amount. ### -10013 INSUFFICIENT_AMOUNT - Insufficient collateral amount. ### -10015 DEDUCTION_FAILED - Collateral deduction failed. ### -10016 LOAN_FAILED - Failed to provide loan. ### -10017 REPAY_EXCEED_DEBT - Repayment amount exceeds debt. ### -10018 INVALID_AMOUNT - Invalid repayment amount. ### -10019 CONFIG_NOT_EXIST - Configuration does not exists. ### -10020 UID_NOT_EXIST - User ID does not exist. ### -10021 ORDER_NOT_EXIST - Order does not exist. ### -10022 INVALID_AMOUNT - Invalid adjustment amount. ### -10023 ADJUST_LTV_FAILED - Failed to adjust LTV. ### -10024 ADJUST_LTV_NOT_SUPPORTED - LTV adjustment not supported. ### -10025 REPAY_FAILED - Repayment failed. ### -10026 INVALID_PARAMETER - Invalid parameter. ### -10028 INVALID_PARAMETER - Invalid parameter. ### -10029 AMOUNT_TOO_SMALL - Loan amount is too small. ### -10030 AMOUNT_TOO_LARGE - Loan amount is too much. ### -10031 QUOTA_REACHED - Individual loan quota reached. ### -10032 REPAY_NOT_AVAILABLE - Repayment is temporarily unavailable. ### -10034 REPAY_NOT_AVAILABLE - Repay with collateral is not available currently, please try to repay with borrowed coin. ### -10039 AMOUNT_TOO_SMALL - Repayment amount is too small. ### -10040 AMOUNT_TOO_LARGE - Repayment amount is too large. ### -10041 INSUFFICIENT_AMOUNT - Due to high demand, there are currently insufficient loanable assets for {0}. Please adjust your borrow amount or try again tomorrow. ### -10042 ASSET_NOT_SUPPORTED - asset %s is not supported ### -10043 ASSET_NOT_SUPPORTED - {0} borrowing is currently not supported. ### -10044 QUOTA_REACHED - Collateral amount has reached the limit. Please reduce your collateral amount or try with other collaterals. ### -10045 COLLTERAL_REPAY_NOT_SUPPORTED - The loan coin does not support collateral repayment. Please try again later. ### -10046 EXCEED_MAX_ADJUSTMENT - Collateral Adjustment exceeds the maximum limit. Please try again. ### -10047 REGION_NOT_SUPPORTED - This coin is currently not supported in your location due to local regulations. ## 13xxx - BLVT ### -13000 BLVT_FORBID_REDEEM - Redeption of the token is forbiden now ### -13001 BLVT_EXCEED_DAILY_LIMIT - Exceeds individual 24h redemption limit of the token ### -13002 BLVT_EXCEED_TOKEN_DAILY_LIMIT - Exceeds total 24h redemption limit of the token ### -13003 BLVT_FORBID_PURCHASE - Subscription of the token is forbiden now ### -13004 BLVT_EXCEED_DAILY_PURCHASE_LIMIT - Exceeds individual 24h subscription limit of the token ### -13005 BLVT_EXCEED_TOKEN_DAILY_PURCHASE_LIMIT - Exceeds total 24h subscription limit of the token ### -13006 BLVT_PURCHASE_LESS_MIN_AMOUNT - Subscription amount is too small ### -13007 BLVT_PURCHASE_AGREEMENT_NOT_SIGN - The Agreement is not signed ## 12xxx - Liquid Swap ### -12014 TOO MANY REQUESTS - More than 1 request in 2 seconds ## 18xxx - Binance Code ### -18002 - The total amount of codes you created has exceeded the 24-hour limit, please try again after UTC 0 ### -18003 - Too many codes created in 24 hours, please try again after UTC 0 ### -18004 - Too many invalid redeem attempts in 24 hours, please try again after UTC 0 ### -18005 - Too many invalid verify attempts, please try later ### -18006 - The amount is too small, please re-enter ### -18007 - This token is not currently supported, please re-enter ## 21xxx - Portfolio Margin Account ### -21001 USER_IS_NOT_UNIACCOUNT - Request ID is not a Portfolio Margin Account. ### -21002 UNI_ACCOUNT_CANT_TRANSFER_FUTURE - Portfolio Margin Account doesn't support transfer from margin to futures. ### -21003 NET_ASSET_MUST_LTE_RATIO - Fail to retrieve margin assets. ### -21004 USER_NO_LIABILITY - User doesn’t have portfolio margin bankruptcy loan ### -21005 NO_ENOUGH_ASSET - User’s spot wallet doesn’t have enough BUSD to repay portfolio margin bankruptcy loan ### -21006 HAD_IN_PROCESS_REPAY - User had portfolio margin bankruptcy loan repayment in process ### -21007 IN_FORCE_LIQUIDATION - User failed to repay portfolio margin bankruptcy loan since liquidation was in process ## Order Rejection Issues Error messages like these are indicated when the error is coming specifically from the matching engine: - `-1010 ERROR_MSG_RECEIVED` - `-2010 NEW_ORDER_REJECTED` - `-2011 CANCEL_REJECTED` The following messages which will indicate the specific error: | Error message | Description | | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | "Unknown order sent." | The order (by either `orderId`, `clientOrderId`, `origClientOrderId`) could not be found. | | "Duplicate order sent." | The `clientOrderId` is already in use. | | "Market is closed." | The symbol is not trading. | | "Account has insufficient balance for requested action." | Not enough funds to complete the action. | | "Market orders are not supported for this symbol." | `MARKET` is not enabled on the symbol. | | "Iceberg orders are not supported for this symbol." | `icebergQty` is not enabled on the symbol | | "Stop loss orders are not supported for this symbol." | `STOP_LOSS` is not enabled on the symbol | | "Stop loss limit orders are not supported for this symbol." | `STOP_LOSS_LIMIT` is not enabled on the symbol | | "Take profit orders are not supported for this symbol." | `TAKE_PROFIT` is not enabled on the symbol | | "Take profit limit orders are not supported for this symbol." | `TAKE_PROFIT_LIMIT` is not enabled on the symbol | | "Price \* QTY is zero or less." | `price` \* `quantity` is too low | | "IcebergQty exceeds QTY." | `icebergQty` must be less than the order quantity | | "This action is disabled on this account." | Contact customer support; some actions have been disabled on the account. | | "This account may not place or cancel orders." | Contact customer support; the account has trading ability disabled. | | "Unsupported order combination" | The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. | | "Order would trigger immediately." | The order's stop price is not valid when compared to the last traded price. | | "Cancel order is invalid. Check origClientOrderId and orderId." | No `origClientOrderId` or `orderId` was sent in. | | "Order would immediately match and take." | `LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. | | "The relationship of the prices for the orders is not correct." | The prices set in the `OCO` is breaking the Price rules.

The rules are:

`SELL Orders`: Limit Price > Last Price > Stop Price

`BUY Orders`: Limit Price < Last Price < Stop Price | | "OCO orders are not supported for this symbol" | `OCO` is not enabled on the symbol. | | "Quote order qty market orders are not support for this symbol." | `MARKET` orders using the parameter `quoteOrderQty` are not enabled on this symbol. | | "Trailing stop orders are not supported for this symbol." | Orders using `trailingDelta` are not enabled on the symbol. | | "Order cancel-replace is not supported for this symbol." | `POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is on enabled the symbol. | | "This symbol is not permitted for this account." | Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) | | "This symbol is restricted for this account." | Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) | | "Order was not canceled due to cancel restrictions." | Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW`
or
`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. | ## Errors regarding POST /api/v3/order/cancelReplace ### -2021 Order cancel-replace partially failed This code is sent when either the cancellation of the order failed or the new order placement failed but not both. ### -2022 Order cancel-replace failed. This code is sent when both the cancellation of the order failed and the new order placement failed. --- ## Document: /products/spot-block-matching/change-log URL: /en/dev-docs/products/spot-block-matching/change-log # Changelog ## 2025-12-26 ### Time-sensitive Notice - **The following change to REST API will occur at approximately 2026-01-15 07:00 UTC:**
When calling endpoints that require signatures, percent-encode payloads before computing signatures. Requests that do not follow this order will be rejected with [`-1022 INVALID_SIGNATURE`](./error-code.md#-1022-invalid_signature). Please review and update your signing logic accordingly. ### REST API - Updated documentation for REST API regarding [Signed Endpoints examples for placing an order](./general-info.md#signed-endpoint-examples-for-post-apiv3order). --- ## 2025-06-27 - New endpoint for Spot Block Matching: - `POST /sapi/v1/block-match/order/cancel` Order Cancel - `POST /sapi/v1/block-match/order/extend` Extend Order Validity Period by Adding 30 Minutes to the Current Time - `POST /sapi/v1/block-match/order/place` Spot block match Place order, The order is valid for 30 minutes and will automatically expire if not executed. - `POST /sapi/v1/block-match/order/take` Accept order, Complete Transaction - `POST /sapi/v1/block-match/order/query-open-order` Query User's Open Orders - `POST /sapi/v1/block-match/order/query-order-history` Query User's Order History - `POST /sapi/v1/block-match/symbols` Return Trading Symbols Supported by Block Match --- ## Document: /products/spot-block-matching/Introduction URL: /en/dev-docs/products/spot-block-matching/Introduction # Introduction Spot Block Matching is a platform that enables traders to execute large trades directly with each other, bypassing exchange order books. This enhances discretion, improves trading efficiency, minimizes market impact, and reduces slippage. Ensure your master account is whitelisted to participate in Spot Block Matching. Once whitelisted, you can act as both a maker and taker. For whitelisting requests, please contact either your Sales / Key Account Spot Coverage team; or vip@binance.com. For more information on this, please refer to the [Spot Block Matching FAQ](https://www.binance.com/en/support/faq/detail/cc66271ed16f4e24a26a0dedd90e00c8) --- ## Document: /products/staking/quick-start URL: /en/dev-docs/products/staking/quick-start # Quick Start ## API Key Setup - Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/articles/360002502072) regarding API key creation. - Once API key is created, it is recommended to set IP restrictions on the key for security reasons. - **Never share your API key/secret key to ANYONE.** ## API Key Restrictions - After creating the API key, the default restrictions is `Enable Reading`. - To **enable withdrawals via the API**, the API key restriction needs to be modified through the Binance UI. ## Enabling Accounts ### Spot Account A `SPOT` account is provided by default upon creation of a Binance Account. ### Margin Account To enable a `MARGIN` account for Margin Trading, please refer to the [Margin Trading Guide](https://www.binance.vision/tutorials/binance-margin-trading-guide) ## API Library ### Python connector This is a lightweight library that works as a connector to Binance public API, written in Python. [https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python) ### Javascript connector This is a lightweight library that works as a connector to Binance public API, written for JavaScript users. [https://github.com/binance/binance-connector-js](https://github.com/binance/binance-connector-js) ### Ruby connector This is a lightweight library that works as a connector to Binance public API, written for Ruby users. [https://github.com/binance/binance-connector-ruby](https://github.com/binance/binance-connector-ruby) ### DotNET connector This is a lightweight library that works as a connector to Binance public API, written for C# users. [https://github.com/binance/binance-connector-dotnet](https://github.com/binance/binance-connector-dotnet) ### Java connector This is a lightweight library that works as a connector to Binance public API, written for Java users. [https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java) ### Postman Collections There is now a Postman collection containing the API endpoints for quick and easy use. This is recommended for new users who want to get a quick-start into using the API. For more information please refer to this page: [Binance API Postman](https://github.com/binance/binance-api-postman) ### Swagger A YAML file with OpenAPI specification on the RESTful API is available to be used, as well as a Swagger UI page for the consulting. [https://github.com/binance/binance-api-swagger](https://github.com/binance/binance-api-swagger) --- ## Document: /products/staking/general-info URL: /en/dev-docs/products/staking/general-info # General Info ## General API Information - The following base endpoints are available: - **https://api.binance.com** - **https://api-gcp.binance.com** - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** - The last 4 endpoints in the point above (`api1`-`api4`) might give better performance but have less stability. Please use whichever works best for your setup. - All endpoints return either a JSON object or array. - Data is returned in **ascending** order. Oldest first, newest last. - All time and timestamp related fields are in **milliseconds**. ### HTTP Return Codes - HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. - HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP `409` return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.) - HTTP `429` return code is used when breaking a request rate limit. - HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. - HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. ### Error Codes and Messages - If there is an error, the API will return an error with a message of the reason. > The error payload on API and SAPI is as follows: ```json { "code": -1121, "msg": "Invalid symbol." } ``` - Specific error codes and messages defined in [Error Codes](./error-code). ### General Information on Endpoints - For `GET` endpoints, parameters must be sent as a `query string`. - For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. - Parameters may be sent in any order. - If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. --- ## LIMITS ### General Info on Limits - The following `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". - The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. - A 429 will be returned when either request rate limit or order rate limit is violated. ### IP Limits - Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. - When a 429 is received, it's your obligation as an API to back off and not spam the API. - **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** - IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. - A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - **The limits on the API are based on the IPs, not the API keys.** ### Order Rate Limits - Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. - When the order count exceeds the limit, you will receive a 429 error without the `Retry-After` header. Please check the Order Rate Limit rules using `GET api/v3/exchangeInfo` and wait for reactivation accordingly. - Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - **The order rate limit is counted against each account**. - To monitor order count usage, refer to GET `api/v3/rateLimit/order` ### Websocket Limits - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON controlled message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. - There is a limit of **300 connections per attempt every 5 minutes per IP**. ### /api/ and /sapi/ Limit Introduction The `/api/*` and `/sapi/*` endpoints adopt either of two access limiting rules, IP limits or UID (account) limits. - Endpoints related to `/api/*`: - According to the two modes of IP and UID (account) limit, each are independent. - Endpoints share the 6000 per minute limit based on IP. - Responses contain the header `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)`, defining the weight used by the current IP. - Successful order responses contain the header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`, defining the order limit used by the UID. - Endpoints related to `/sapi/*`: - Endpoints are marked according to IP or UID limit and their corresponding weight value. - Each endpoint with IP limits has an independent 12000 per minute limit. - Each endpoint with UID limits has an independent 180000 per minute limit. - Responses from endpoints with IP limits contain the header `X-SAPI-USED-IP-WEIGHT-1M`, defining the weight used by the current IP. - Responses from endpoints with UID limits contain the header `X-SAPI-USED-UID-WEIGHT-1M`, defining the weight used by the current UID. --- ## Data Sources - The API system is asynchronous, so some delay in the response is normal and expected. - Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates. - **Matching Engine** - the data is from the matching Engine - **Memory** - the data is from a server's local or external memory - **Database** - the data is taken directly from a database ## Request Security - Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](#place-new-order-trade)). - If unspecified, the security type is `NONE`. - Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](#user-data-stream-requests). - Secure endpoints require a valid API key to be specified and authenticated. - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. - API keys can be configured to allow access only to certain types of secure endpoints. - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. | Security Type | Description | | ------------- | -------------------------------------------------------- | | NONE | Endpoint can be accessed freely. | | TRADE | Endpoint requires sending a valid API-Key and signature. | | MARGIN | Endpoint requires sending a valid API-Key and signature. | | USER_DATA | Endpoint requires sending a valid API-Key and signature. | | USER_STREAM | Endpoint requires sending a valid API-Key. | | MARKET_DATA | Endpoint requires sending a valid API-Key. | - `TRADE`, `MARGIN` and `USER_DATA` endpoints are `SIGNED` endpoints. ### SIGNED Endpoint security - `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. #### Signature Case Sensitivity - **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. - **RSA:** Signatures generated using RSA are **case-sensitive**. - **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** Please consult [SIGNED request example (HMAC)](#hmac-keys), [SIGNED request example (RSA)](#rsa-keys), and [SIGNED request example (Ed25519)](#ed25519-keys) on how to compute signature, depending on which API key type you are using. ### Timing security - `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](#general-api-information)) - An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. - Maximum `recvWindow` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` **Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. **It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** ### SIGNED Endpoint Examples for POST /api/v3/order #### HMAC Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. Example API key and secret key: | Key | Value | | ----------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `secretKey` | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j | **WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | LTCBTC | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` **Step 2: Compute the signature** 1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. 2. Sign the signature payload constructed in Step 1. 3. Encode the HMAC-SHA-256 output as a hex string. Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. **Example commands** For the first set of example parameters (ASCII only): ```console $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" ``` For the second set of example parameters (some non-ASCII characters) ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" ``` Here is a sample Bash script performing all the steps above: ```bash apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" # Sign the request signature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey") signature=${signature#*= } # Keep only the part after the "= " # Send the request curl -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?$payload&signature=$signature" ``` #### RSA Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. Only `PKCS#8` keys are supported. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. These examples assume the private key is stored in the file `./test-prv-key.pem`. | Key | Value | | -------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | BTCUSDT | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` **Step 2: Compute the signature** 1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function. 2. Encode the output in base64. Note that the payload and the resulting `signature` are **case-sensitive**. For the first set of example parameters (ASCII only): ```console $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== ``` 3. Percent-encode the base64 string. For the first set of example parameters (ASCII only): ```console HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D ``` For the second set of example parameters (some non-ASCII characters): ```console qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' ``` For the second set of example parameters (some non-ASCII characters): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' ``` Here is a sample Bash script performing all the steps above: ```bash function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos The error JSON payload: ```javascript { "code":-1121, "msg":"Invalid symbol." } ``` Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. ## 10xx - General Server or Network issues ### -1000 UNKNOWN - An unknown error occurred while processing the request. - An unknown error occurred while processing the request.[%s] ### -1001 DISCONNECTED - Internal error; unable to process your request. Please try again. ### -1002 UNAUTHORIZED - You are not authorized to execute this request. ### -1003 TOO_MANY_REQUESTS - Too many requests queued. - Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. - Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. ### -1004 SERVER_BUSY - Server is busy, please wait and try again ### -1006 UNEXPECTED_RESP - An unexpected response was received from the message bus. Execution status unknown. ### -1007 TIMEOUT - Timeout waiting for response from backend server. Send status unknown; execution status unknown. ### -1008 SERVER_BUSY - Spot server is currently overloaded with other requests. Please try again in a few minutes. ### -1014 UNKNOWN_ORDER_COMPOSITION - Unsupported order combination. ### -1015 TOO_MANY_ORDERS - Too many new orders. - Too many new orders; current limit is %s orders per %s. ### -1016 SERVICE_SHUTTING_DOWN - This service is no longer available. ### -1020 UNSUPPORTED_OPERATION - This operation is not supported. ### -1021 INVALID_TIMESTAMP - Timestamp for this request is outside of the recvWindow. - Timestamp for this request was 1000ms ahead of the server's time. ### -1022 INVALID_SIGNATURE - Signature for this request is not valid. ### -1099 Not found, authenticated, or authorized - This replaces error code -1999 ## 11xx - 2xxx Request issues ### -1100 ILLEGAL_CHARS - Illegal characters found in a parameter. - Illegal characters found in a parameter. %s - Illegal characters found in parameter `%s`; legal range is `%s`. ### -1101 TOO_MANY_PARAMETERS - Too many parameters sent for this endpoint. - Too many parameters; expected `%s` and received `%s`. - Duplicate values for a parameter detected. ### -1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED - A mandatory parameter was not sent, was empty/null, or malformed. - Mandatory parameter `%s` was not sent, was empty/null, or malformed. - Param `%s` or `%s` must be sent, but both were empty/null! ### -1103 UNKNOWN_PARAM - An unknown parameter was sent. ### -1104 UNREAD_PARAMETERS - Not all sent parameters were read. - Not all sent parameters were read; read `%s` parameter(s) but was sent `%s`. ### -1105 PARAM_EMPTY - A parameter was empty. - Parameter `%s` was empty. ### -1106 PARAM_NOT_REQUIRED - A parameter was sent when not required. - Parameter `%s` sent when not required. ### -1111 BAD_PRECISION - Precision is over the maximum defined for this asset. ### -1112 NO_DEPTH - No orders on book for symbol. ### -1114 TIF_NOT_REQUIRED - TimeInForce parameter sent when not required. ### -1115 INVALID_TIF - Invalid timeInForce. ### -1116 INVALID_ORDER_TYPE - Invalid orderType. ### -1117 INVALID_SIDE - Invalid side. ### -1118 EMPTY_NEW_CL_ORD_ID - New client order ID was empty. ### -1119 EMPTY_ORG_CL_ORD_ID - Original client order ID was empty. ### -1120 BAD_INTERVAL - Invalid interval. ### -1121 BAD_SYMBOL - Invalid symbol. ### -1125 INVALID_LISTEN_KEY - This listenKey does not exist. ### -1127 MORE_THAN_XX_HOURS - Lookup interval is too big. - More than %s hours between startTime and endTime. ### -1128 OPTIONAL_PARAMS_BAD_COMBO - Combination of optional parameters invalid. ### -1130 INVALID_PARAMETER - Invalid data sent for a parameter. - Data sent for parameter `%s` is not valid. ### -1131 BAD_RECV_WINDOW - recvWindow must be less than 60000 ### -1134 BAD_STRATEGY_TYPE - `strategyType` was less than 1000000. #### -1145 INVALID_CANCEL_RESTRICTIONS - `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. #### -1151 DUPLICATE_SYMBOLS - Symbol is present multiple times in the list. ### -2010 NEW_ORDER_REJECTED - NEW_ORDER_REJECTED ### -2011 CANCEL_REJECTED - CANCEL_REJECTED ### -2013 NO_SUCH_ORDER - Order does not exist. ### -2014 BAD_API_KEY_FMT - API-key format invalid. ### -2015 REJECTED_MBX_KEY - Invalid API-key, IP, or permissions for action. ### -2016 NO_TRADING_WINDOW - No trading window could be found for the symbol. Try ticker/24hrs instead. #### -2026 ORDER_ARCHIVED - Order was canceled or expired with no executed qty over 90 days ago and has been archived. ## 3xxx-5xxx SAPI-specific issues ### -3000 INNER_FAILURE - Internal server error. ### -3001 NEED_ENABLE_2FA - Please enable 2FA first. ### -3002 ASSET_DEFICIENCY - We don't have this asset. ### -3003 NO_OPENED_MARGIN_ACCOUNT - Margin account does not exist. ### -3004 TRADE_NOT_ALLOWED - Trade not allowed. ### -3005 TRANSFER_OUT_NOT_ALLOWED - Transferring out not allowed. ### -3006 EXCEED_MAX_BORROWABLE - Your borrow amount has exceed maximum borrow amount. ### -3007 HAS_PENDING_TRANSACTION - You have pending transaction, please try again later. ### -3008 BORROW_NOT_ALLOWED - Borrow not allowed. ### -3009 ASSET_NOT_MORTGAGEABLE - This asset are not allowed to transfer into margin account currently. ### -3010 REPAY_NOT_ALLOWED - Repay not allowed. ### -3011 BAD_DATE_RANGE - Your input date is invalid. ### -3012 ASSET_ADMIN_BAN_BORROW - Borrow is banned for this asset. ### -3013 LT_MIN_BORROWABLE - Borrow amount less than minimum borrow amount. ### -3014 ACCOUNT_BAN_BORROW - Borrow is banned for this account. ### -3015 REPAY_EXCEED_LIABILITY - Repay amount exceeds borrow amount. ### -3016 LT_MIN_REPAY - Repay amount less than minimum repay amount. ### -3017 ASSET_ADMIN_BAN_MORTGAGE - This asset are not allowed to transfer into margin account currently. ### -3018 ACCOUNT_BAN_MORTGAGE - Transferring in has been banned for this account. ### -3019 ACCOUNT_BAN_ROLLOUT - Transferring out has been banned for this account. ### -3020 EXCEED_MAX_ROLLOUT - Transfer out amount exceeds max amount. ### -3021 PAIR_ADMIN_BAN_TRADE - Margin account are not allowed to trade this trading pair. ### -3022 ACCOUNT_BAN_TRADE - You account's trading is banned. ### -3023 WARNING_MARGIN_LEVEL - You can't transfer out/place order under current margin level. ### -3024 FEW_LIABILITY_LEFT - The unpaid debt is too small after this repayment. ### -3025 INVALID_EFFECTIVE_TIME - Your input date is invalid. ### -3026 VALIDATION_FAILED - Your input param is invalid. ### -3027 NOT_VALID_MARGIN_ASSET - Not a valid margin asset. ### -3028 NOT_VALID_MARGIN_PAIR - Not a valid margin pair. ### -3029 TRANSFER_FAILED - Transfer failed. ### -3036 ACCOUNT_BAN_REPAY - This account is not allowed to repay. ### -3037 PNL_CLEARING - PNL is clearing. Wait a second. ### -3038 LISTEN_KEY_NOT_FOUND - Listen key not found. ### -3041 BALANCE_NOT_CLEARED - Balance is not enough ### -3042 PRICE_INDEX_NOT_FOUND - PriceIndex not available for this margin pair. ### -3043 TRANSFER_IN_NOT_ALLOWED - Transferring in not allowed. ### -3044 SYSTEM_BUSY - System busy. ### -3045 SYSTEM - The system doesn't have enough asset now. ### -3999 NOT_WHITELIST_USER - This function is only available for invited users. ### -4001 CAPITAL_INVALID - Invalid operation. ### -4002 CAPITAL_IG - Invalid get. ### -4003 CAPITAL_IEV - Your input email is invalid. ### -4004 CAPITAL_UA - You don't login or auth. ### -4005 CAPAITAL_TOO_MANY_REQUEST - Too many new requests. ### -4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT - Support main account only. ### -4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS - Address validation is not passed. ### -4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS - Address tag validation is not passed. ### -4010 CAPITAL_WHITELIST_EMAIL_CONFIRM - White list mail has been confirmed. ### -4011 CAPITAL_WHITELIST_EMAIL_EXPIRED - White list mail is invalid. ### -4012 CAPITAL_WHITELIST_CLOSE - White list is not opened. ### -4013 CAPITAL_WITHDRAW_2FA_VERIFY - 2FA is not opened. ### -4014 CAPITAL_WITHDRAW_LOGIN_DELAY - Withdraw is not allowed within 2 min login. ### -4015 CAPITAL_WITHDRAW_RESTRICTED_MINUTE - Withdraw is limited. ### -4016 CAPITAL_WITHDRAW_RESTRICTED_PASSWORD - Within 24 hours after password modification, withdrawal is prohibited. ### -4017 CAPITAL_WITHDRAW_RESTRICTED_UNBIND_2FA - Within 24 hours after the release of 2FA, withdrawal is prohibited. ### -4018 CAPITAL_WITHDRAW_ASSET_NOT_EXIST - We don't have this asset. ### -4019 CAPITAL_WITHDRAW_ASSET_PROHIBIT - Current asset is not open for withdrawal. ### -4021 CAPITAL_WITHDRAW_AMOUNT_MULTIPLE - Asset withdrawal must be an %s multiple of %s. ### -4022 CAPITAL_WITHDRAW_MIN_AMOUNT - Not less than the minimum pick-up quantity %s. ### -4023 CAPITAL_WITHDRAW_MAX_AMOUNT - Within 24 hours, the withdrawal exceeds the maximum amount. ### -4024 CAPITAL_WITHDRAW_USER_NO_ASSET - You don't have this asset. ### -4025 CAPITAL_WITHDRAW_USER_ASSET_LESS_THAN_ZERO - The number of hold asset is less than zero. ### -4026 CAPITAL_WITHDRAW_USER_ASSET_NOT_ENOUGH - You have insufficient balance. ### -4027 CAPITAL_WITHDRAW_GET_TRAN_ID_FAILURE - Failed to obtain tranId. ### -4028 CAPITAL_WITHDRAW_MORE_THAN_FEE - The amount of withdrawal must be greater than the Commission. ### -4029 CAPITAL_WITHDRAW_NOT_EXIST - The withdrawal record does not exist. ### -4030 CAPITAL_WITHDRAW_CONFIRM_SUCCESS - Confirmation of successful asset withdrawal. ### -4031 CAPITAL_WITHDRAW_CANCEL_FAILURE - Cancellation failed. ### -4032 CAPITAL_WITHDRAW_CHECKSUM_VERIFY_FAILURE - Withdraw verification exception. ### -4033 CAPITAL_WITHDRAW_ILLEGAL_ADDRESS - Illegal address. ### -4034 CAPITAL_WITHDRAW_ADDRESS_CHEAT - The address is suspected of fake. ### -4035 CAPITAL_WITHDRAW_NOT_WHITE_ADDRESS - This address is not on the whitelist. Please join and try again. ### -4036 CAPITAL_WITHDRAW_NEW_ADDRESS - The new address needs to be withdrawn in {0} hours. ### -4037 CAPITAL_WITHDRAW_RESEND_EMAIL_FAIL - Re-sending Mail failed. ### -4038 CAPITAL_WITHDRAW_RESEND_EMAIL_TIME_OUT - Please try again in 5 minutes. ### -4039 CAPITAL_USER_EMPTY - The user does not exist. ### -4040 CAPITAL_NO_CHARGE - This address not charged. ### -4041 CAPITAL_MINUTE_TOO_SMALL - Please try again in one minute. ### -4042 CAPITAL_CHARGE_NOT_RESET - This asset cannot get deposit address again. ### -4043 CAPITAL_ADDRESS_TOO_MUCH - More than 100 recharge addresses were used in 24 hours. ### -4044 CAPITAL_BLACKLIST_COUNTRY_GET_ADDRESS - This is a blacklist country. ### -4045 CAPITAL_GET_ASSET_ERROR - Failure to acquire assets. ### -4046 CAPITAL_AGREEMENT_NOT_CONFIRMED - Agreement not confirmed. ### -4047 CAPITAL_DATE_INTERVAL_LIMIT - Time interval must be within 0-90 days ### -4060 CAPITAL_WITHDRAW_USER_ASSET_LOCK_DEPOSIT - As your deposit has not reached the required block confirmations, we have temporarily locked {0} asset ### -4106 TAG_NOT_SUPPORTED_FOR_NETWORK - This network does not support memo/tag. Please remove the `addressTag` field and try again. ### -5001 ASSET_DRIBBLET_CONVERT_SWITCH_OFF - Don't allow transfer to micro assets. ### -5002 ASSET_ASSET_NOT_ENOUGH - You have insufficient balance. ### -5003 ASSET_USER_HAVE_NO_ASSET - You don't have this asset. ### -5004 USER_OUT_OF_TRANSFER_FLOAT - The residual balances have exceeded 0.001BTC, Please re-choose. - The residual balances of %s have exceeded 0.001BTC, Please re-choose. ### -5005 USER_ASSET_AMOUNT_IS_TOO_LOW - The residual balances of the BTC is too low - The residual balances of %s is too low, Please re-choose. ### -5006 USER_CAN_NOT_REQUEST_IN_24_HOURS - Only transfer once in 24 hours. ### -5007 AMOUNT_OVER_ZERO - Quantity must be greater than zero. ### -5008 ASSET_WITHDRAW_WITHDRAWING_NOT_ENOUGH - Insufficient amount of returnable assets. ### -5009 PRODUCT_NOT_EXIST - Product does not exist. ### -5010 TRANSFER_FAIL - Asset transfer fail. ### -5011 FUTURE_ACCT_NOT_EXIST - future account not exists. ### -5012 TRANSFER_PENDING - Asset transfer is in pending. ### -5021 PARENT_SUB_HAVE_NO_RELATION - This parent sub have no relation ### -5012 FUTURE_ACCT_OR_SUBRELATION_NOT_EXIST - future account or sub relation not exists. ## 6XXX - Savings Issues ### -6001 DAILY_PRODUCT_NOT_EXIST - Daily product not exists. ### -6003 DAILY_PRODUCT_NOT_ACCESSIBLE - Product not exist or you don't have permission ### -6004 DAILY_PRODUCT_NOT_PURCHASABLE - Product not in purchase status ### -6005 DAILY_LOWER_THAN_MIN_PURCHASE_LIMIT - Smaller than min purchase limit ### -6006 DAILY_REDEEM_AMOUNT_ERROR - Redeem amount error ### -6007 DAILY_REDEEM_TIME_ERROR - Not in redeem time ### -6008 DAILY_PRODUCT_NOT_REDEEMABLE - Product not in redeem status ### -6009 REQUEST_FREQUENCY_TOO_HIGH - Request frequency too high ### -6011 EXCEEDED_USER_PURCHASE_LIMIT - Exceeding the maximum num allowed to purchase per user ### -6012 BALANCE_NOT_ENOUGH - Balance not enough ### -6013 PURCHASING_FAILED - Purchasing failed ### -6014 UPDATE_FAILED - Exceed up-limit allowed to purchased ### -6015 EMPTY_REQUEST_BODY - Empty request body ### -6016 PARAMS_ERR - Parameter err ### -6017 NOT_IN_WHITELIST - Not in whitelist ### -6018 ASSET_NOT_ENOUGH - Asset not enough ### -6019 PENDING - Need confirm ### -6020 PROJECT_NOT_EXISTS - Project not exists ## 70xx - Futures ### -7001 FUTURES_BAD_DATE_RANGE - Date range is not supported. ### -7002 FUTURES_BAD_TYPE - Data request type is not supported. ## 20xxx - Futures/Spot Algo ### -20121 - Invalid symbol. ### -20124 - Invalid algo id or it has been completed. ### -20130 - Invalid data sent for a parameter. ### -20132 - The client algo id is duplicated. ### -20194 - Duration is too short to execute all required quantity. ### -20195 - The total size is too small. ### -20196 - The total size is too large. ### -20198 - Reach the max open orders allowed. ### -20204 - The notional of USD is less or more than the limit. ## Filter failures | Error message | Description | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | "Filter failure: PRICE_FILTER" | `price` is too high, too low, and/or not following the tick size rule for the symbol. | | "Filter failure: PERCENT_PRICE" | `price` is X% too high or X% too low from the average weighted price over the last Y minutes. | | "Filter failure: PERCENT_PRICE_BY_SIDE" | `price` is X% too high or Y% too low from the `lastPrice` on that side (i.e. BUY/SELL) | | "Filter failure: LOT_SIZE" | `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MIN_NOTIONAL" | `price` \* `quantity` is too low to be a valid order for the symbol. | | "Filter failure: ICEBERG_PARTS" | `ICEBERG` order would break into too many parts; icebergQty is too small. | | "Filter failure: MARKET_LOT_SIZE" | `MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MAX_POSITION" | The account's position has reached the maximum defined limit.

This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY`orders. | | "Filter failure: MAX_NUM_ORDERS" | Account has too many open orders on the symbol. | | "Filter failure: MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the symbol. | | "Filter failure: MAX_NUM_ICEBERG_ORDERS" | Account has too many open iceberg orders on the symbol. | | "Filter failure: TRAILING_DELTA" | `trailingDelta` is not within the defined range of the filter for that order type. | | "Filter failure: EXCHANGE_MAX_NUM_ORDERS" | Account has too many open orders on the exchange. | | "Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the exchange. | ## 10xxx - Crypto Loans ### -10001 SYSTEM_MAINTENANCE - The system is under maintenance, please try again later. ### -10002 INVALID_INPUT - Invalid input parameters. ### -10005 NO_RECORDS - No records found. ### -10007 COIN_NOT_LOANABLE - This coin is not loanable. ### -10008 COIN_NOT_LOANABLE - This coin is not loanable ### -10009 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10010 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10011 INSUFFICIENT_ASSET - Insufficient spot assets. ### -10012 INVALID_AMOUNT - Invalid repayment amount. ### -10013 INSUFFICIENT_AMOUNT - Insufficient collateral amount. ### -10015 DEDUCTION_FAILED - Collateral deduction failed. ### -10016 LOAN_FAILED - Failed to provide loan. ### -10017 REPAY_EXCEED_DEBT - Repayment amount exceeds debt. ### -10018 INVALID_AMOUNT - Invalid repayment amount. ### -10019 CONFIG_NOT_EXIST - Configuration does not exists. ### -10020 UID_NOT_EXIST - User ID does not exist. ### -10021 ORDER_NOT_EXIST - Order does not exist. ### -10022 INVALID_AMOUNT - Invalid adjustment amount. ### -10023 ADJUST_LTV_FAILED - Failed to adjust LTV. ### -10024 ADJUST_LTV_NOT_SUPPORTED - LTV adjustment not supported. ### -10025 REPAY_FAILED - Repayment failed. ### -10026 INVALID_PARAMETER - Invalid parameter. ### -10028 INVALID_PARAMETER - Invalid parameter. ### -10029 AMOUNT_TOO_SMALL - Loan amount is too small. ### -10030 AMOUNT_TOO_LARGE - Loan amount is too much. ### -10031 QUOTA_REACHED - Individual loan quota reached. ### -10032 REPAY_NOT_AVAILABLE - Repayment is temporarily unavailable. ### -10034 REPAY_NOT_AVAILABLE - Repay with collateral is not available currently, please try to repay with borrowed coin. ### -10039 AMOUNT_TOO_SMALL - Repayment amount is too small. ### -10040 AMOUNT_TOO_LARGE - Repayment amount is too large. ### -10041 INSUFFICIENT_AMOUNT - Due to high demand, there are currently insufficient loanable assets for {0}. Please adjust your borrow amount or try again tomorrow. ### -10042 ASSET_NOT_SUPPORTED - asset %s is not supported ### -10043 ASSET_NOT_SUPPORTED - {0} borrowing is currently not supported. ### -10044 QUOTA_REACHED - Collateral amount has reached the limit. Please reduce your collateral amount or try with other collaterals. ### -10045 COLLTERAL_REPAY_NOT_SUPPORTED - The loan coin does not support collateral repayment. Please try again later. ### -10046 EXCEED_MAX_ADJUSTMENT - Collateral Adjustment exceeds the maximum limit. Please try again. ### -10047 REGION_NOT_SUPPORTED - This coin is currently not supported in your location due to local regulations. ## 13xxx - BLVT ### -13000 BLVT_FORBID_REDEEM - Redeption of the token is forbiden now ### -13001 BLVT_EXCEED_DAILY_LIMIT - Exceeds individual 24h redemption limit of the token ### -13002 BLVT_EXCEED_TOKEN_DAILY_LIMIT - Exceeds total 24h redemption limit of the token ### -13003 BLVT_FORBID_PURCHASE - Subscription of the token is forbiden now ### -13004 BLVT_EXCEED_DAILY_PURCHASE_LIMIT - Exceeds individual 24h subscription limit of the token ### -13005 BLVT_EXCEED_TOKEN_DAILY_PURCHASE_LIMIT - Exceeds total 24h subscription limit of the token ### -13006 BLVT_PURCHASE_LESS_MIN_AMOUNT - Subscription amount is too small ### -13007 BLVT_PURCHASE_AGREEMENT_NOT_SIGN - The Agreement is not signed ## 12xxx - Liquid Swap ### -12014 TOO MANY REQUESTS - More than 1 request in 2 seconds ## 18xxx - Binance Code ### -18002 - The total amount of codes you created has exceeded the 24-hour limit, please try again after UTC 0 ### -18003 - Too many codes created in 24 hours, please try again after UTC 0 ### -18004 - Too many invalid redeem attempts in 24 hours, please try again after UTC 0 ### -18005 - Too many invalid verify attempts, please try later ### -18006 - The amount is too small, please re-enter ### -18007 - This token is not currently supported, please re-enter ## 21xxx - Portfolio Margin Account ### -21001 USER_IS_NOT_UNIACCOUNT - Request ID is not a Portfolio Margin Account. ### -21002 UNI_ACCOUNT_CANT_TRANSFER_FUTURE - Portfolio Margin Account doesn't support transfer from margin to futures. ### -21003 NET_ASSET_MUST_LTE_RATIO - Fail to retrieve margin assets. ### -21004 USER_NO_LIABILITY - User doesn’t have portfolio margin bankruptcy loan ### -21005 NO_ENOUGH_ASSET - User’s spot wallet doesn’t have enough BUSD to repay portfolio margin bankruptcy loan ### -21006 HAD_IN_PROCESS_REPAY - User had portfolio margin bankruptcy loan repayment in process ### -21007 IN_FORCE_LIQUIDATION - User failed to repay portfolio margin bankruptcy loan since liquidation was in process ## Order Rejection Issues Error messages like these are indicated when the error is coming specifically from the matching engine: - `-1010 ERROR_MSG_RECEIVED` - `-2010 NEW_ORDER_REJECTED` - `-2011 CANCEL_REJECTED` The following messages which will indicate the specific error: | Error message | Description | | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | "Unknown order sent." | The order (by either `orderId`, `clientOrderId`, `origClientOrderId`) could not be found. | | "Duplicate order sent." | The `clientOrderId` is already in use. | | "Market is closed." | The symbol is not trading. | | "Account has insufficient balance for requested action." | Not enough funds to complete the action. | | "Market orders are not supported for this symbol." | `MARKET` is not enabled on the symbol. | | "Iceberg orders are not supported for this symbol." | `icebergQty` is not enabled on the symbol | | "Stop loss orders are not supported for this symbol." | `STOP_LOSS` is not enabled on the symbol | | "Stop loss limit orders are not supported for this symbol." | `STOP_LOSS_LIMIT` is not enabled on the symbol | | "Take profit orders are not supported for this symbol." | `TAKE_PROFIT` is not enabled on the symbol | | "Take profit limit orders are not supported for this symbol." | `TAKE_PROFIT_LIMIT` is not enabled on the symbol | | "Price \* QTY is zero or less." | `price` \* `quantity` is too low | | "IcebergQty exceeds QTY." | `icebergQty` must be less than the order quantity | | "This action is disabled on this account." | Contact customer support; some actions have been disabled on the account. | | "This account may not place or cancel orders." | Contact customer support; the account has trading ability disabled. | | "Unsupported order combination" | The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. | | "Order would trigger immediately." | The order's stop price is not valid when compared to the last traded price. | | "Cancel order is invalid. Check origClientOrderId and orderId." | No `origClientOrderId` or `orderId` was sent in. | | "Order would immediately match and take." | `LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. | | "The relationship of the prices for the orders is not correct." | The prices set in the `OCO` is breaking the Price rules.

The rules are:

`SELL Orders`: Limit Price > Last Price > Stop Price

`BUY Orders`: Limit Price < Last Price < Stop Price | | "OCO orders are not supported for this symbol" | `OCO` is not enabled on the symbol. | | "Quote order qty market orders are not support for this symbol." | `MARKET` orders using the parameter `quoteOrderQty` are not enabled on this symbol. | | "Trailing stop orders are not supported for this symbol." | Orders using `trailingDelta` are not enabled on the symbol. | | "Order cancel-replace is not supported for this symbol." | `POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is on enabled the symbol. | | "This symbol is not permitted for this account." | Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) | | "This symbol is restricted for this account." | Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) | | "Order was not canceled due to cancel restrictions." | Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW`
or
`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. | ## Errors regarding POST /api/v3/order/cancelReplace ### -2021 Order cancel-replace partially failed This code is sent when either the cancellation of the order failed or the new order placement failed but not both. ### -2022 Order cancel-replace failed. This code is sent when both the cancellation of the order failed and the new order placement failed. --- ## Document: /products/staking/change-log URL: /en/dev-docs/products/staking/change-log # Change Log ## 2025-12-26 ### Time-sensitive Notice - **The following change to REST API will occur at approximately 2026-01-15 07:00 UTC:**
When calling endpoints that require signatures, percent-encode payloads before computing signatures. Requests that do not follow this order will be rejected with [`-1022 INVALID_SIGNATURE`](./error-code.md#-1022-invalid_signature). Please review and update your signing logic accordingly. ### REST API - Updated documentation for REST API regarding [Signed Endpoints examples for placing an order](./general-info.md#signed-endpoint-examples-for-post-apiv3order). ## 2025-10-27 - Update endpoint for ETH Staking: - `GET /sapi/v1/eth-staking/eth/quota` to inquire about the minimum amount and redeem period. ## 2025-09-09 - Added new endpoints related to Soft Staking. ## 2025-07-01 - Added new endpoints related to On-Chain Yields Locked Staking. ## 2024-12-3 - New endpoints for SOL Staking: - `GET /sapi/v1/sol-staking/sol/history/boostRewardsHistory` to inquire about SOL Staking Boost APR Airdrop Rewards history records. - `GET /sapi/v1/sol-staking/sol/history/unclaimedRewards` to inquire about SOL Staking unclaimed Boost APR Airdrop Rewards. - `POST /sapi/v1/sol-staking/sol/claim` to claim SOL Staking Boost APR Airdrop Rewards. - Upgraded endpoints for SOL Staking: - `GET /sapi/v1/sol-staking/sol/history/rateHistory` to inquire about SOL Staking Boost APR rate history. ## 2024-10-15 - New endpoints for Staking: - `POST /sapi/v1/sol-staking/sol/stake` to stake SOL and get BNSOL. - `POST /sapi/v1/sol-staking/sol/redeem` to redeem BNSOL and get SOL. - `GET /sapi/v1/sol-staking/sol/history/stakingHistory` to inquire about SOL Staking subscription history records. - `GET /sapi/v1/sol-staking/sol/history/redemptionHistory` to inquire about SOL Staking redemption history records. - `GET /sapi/v1/sol-staking/sol/history/bnsolRewardsHistory` to inquire about SOL Staking rewards history records. - `GET /sapi/v1/sol-staking/sol/history/rateHistory` to inquire about SOL Staking exchange rate history. - `GET /sapi/v1/sol-staking/account` to get the total BNSOL account details. - `GET /sapi/v1/sol-staking/sol/quota` to inquire about product quota and details. --- ## 2023-12-22 - Binance will disable the following Staking SAPI endpoints at 2024-03-31 04:00: - `GET /sapi/v1/eth-staking/eth/history/wbethRewardsHistory`: add new endpoint to query WBETH income record - `POST /sapi/v2/eth-staking/eth/stake`: add new endpoint to stake ETH to get WBETH. Current v1 endpoint `POST /sapi/v1/eth-staking/eth/stake` will be deprecated in the future, with the exact timing to be determined. - `GET /sapi/v2/eth-staking/account`: add new endpoint to query positions and 30-day earnings of staked ETH. Current v1 endpoint `GET /sapi/v1/eth-staking/account` will be deprecated in the future, with the exact timing to be determined. - `POST /sapi/v1/eth-staking/wbeth/unwrap`: delete this endpoint, `POST /sapi/v1/eth-staking/eth/redeem` is able to achieve same functionality - `POST /sapi/v1/eth-staking/eth/redeem`: Add new parameter `asset`, add new response fields`ethAmount`, `conversionRatio` - `GET /sapi/v1/eth-staking/eth/history/stakingHistory`: add new response fields `distributeAsset`, `distributeAmount`, `conversionRatio` - `GET /sapi/v1/eth-staking/eth/history/redemptionHistory` add new response fields `asset`, `distributeAsset`, `distributeAmount`, `conversionRatio` - `POST /sapi/v1/eth-staking/wbeth/wrap`: add new response fields `wbethAmount`, `exchangeRate` --- ## 2023-06-29 - Added multiple new endpoints related to ETH Staking in Staking. --- ## 2022-04-28 - New endpoints for Staking: - `GET /sapi/v1/staking/productList` to get Staking product list - `POST /sapi/v1/staking/purchase` to stake product - `POST /sapi/v1/staking/redeem` to redeem product - `GET /sapi/v1/staking/position` to get Staking product holding position - `GET /sapi/v1/staking/stakingRecord` to inquiry Staking history records - `POST /sapi/v1/staking/setAutoStaking` to set Auto Staking function - `GET /sapi/v1/staking/personalLeftQuota` to inquiry Staking left quota --- ## Document: /products/staking/Introduction URL: /en/dev-docs/products/staking/Introduction # Introduction Binance Staking API is a comprehensive set of endpoints that allows users to seamlessly manage their staking activities. This API supports multiple staking options, including ETH Staking, SOL Staking, On-Chain Yields and Soft Staking, enabling users to participate in the proof-of-stake (PoS) consensus mechanisms of the Ethereum and Solana networks, as well as access a curated selection of on-chain protocols to stake and earn yields. --- ## Document: /products/simple-earn/quick-start URL: /en/dev-docs/products/simple-earn/quick-start # Quick Start ## API Key Setup - Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/articles/360002502072) regarding API key creation. - Once API key is created, it is recommended to set IP restrictions on the key for security reasons. - **Never share your API key/secret key to ANYONE.** ## API Key Restrictions - After creating the API key, the default restrictions is `Enable Reading`. - To **enable withdrawals via the API**, the API key restriction needs to be modified through the Binance UI. ## Enabling Accounts ### Spot Account A `SPOT` account is provided by default upon creation of a Binance Account. ### Margin Account To enable a `MARGIN` account for Margin Trading, please refer to the [Margin Trading Guide](https://www.binance.vision/tutorials/binance-margin-trading-guide) ## API Library ### Python connector This is a lightweight library that works as a connector to Binance public API, written in Python. [https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python) ### Javascript connector This is a lightweight library that works as a connector to Binance public API, written for JavaScript users. [https://github.com/binance/binance-connector-js](https://github.com/binance/binance-connector-js) ### Ruby connector This is a lightweight library that works as a connector to Binance public API, written for Ruby users. [https://github.com/binance/binance-connector-ruby](https://github.com/binance/binance-connector-ruby) ### DotNET connector This is a lightweight library that works as a connector to Binance public API, written for C# users. [https://github.com/binance/binance-connector-dotnet](https://github.com/binance/binance-connector-dotnet) ### Java connector This is a lightweight library that works as a connector to Binance public API, written for Java users. [https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java) ### Postman Collections There is now a Postman collection containing the API endpoints for quick and easy use. This is recommended for new users who want to get a quick-start into using the API. For more information please refer to this page: [Binance API Postman](https://github.com/binance/binance-api-postman) ### Swagger A YAML file with OpenAPI specification on the RESTful API is available to be used, as well as a Swagger UI page for the consulting. [https://github.com/binance/binance-api-swagger](https://github.com/binance/binance-api-swagger) --- ## Document: /products/simple-earn/general-info URL: /en/dev-docs/products/simple-earn/general-info # General Info ## General API Information - The following base endpoints are available: - **https://api.binance.com** - **https://api-gcp.binance.com** - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** - The last 4 endpoints in the point above (`api1`-`api4`) might give better performance but have less stability. Please use whichever works best for your setup. - All endpoints return either a JSON object or array. - Data is returned in **ascending** order. Oldest first, newest last. - All time and timestamp related fields are in **milliseconds**. ### HTTP Return Codes - HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. - HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP `409` return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.) - HTTP `429` return code is used when breaking a request rate limit. - HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. - HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. ### Error Codes and Messages - If there is an error, the API will return an error with a message of the reason. > The error payload on API and SAPI is as follows: ```json { "code": -1121, "msg": "Invalid symbol." } ``` - Specific error codes and messages defined in [Error Codes](./error-code). ### General Information on Endpoints - For `GET` endpoints, parameters must be sent as a `query string`. - For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. - Parameters may be sent in any order. - If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. --- ## LIMITS ### General Info on Limits - The following `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". - The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. - A 429 will be returned when either request rate limit or order rate limit is violated. ### IP Limits - Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. - When a 429 is received, it's your obligation as an API to back off and not spam the API. - **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** - IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. - A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - **The limits on the API are based on the IPs, not the API keys.** ### Order Rate Limits - Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. - When the order count exceeds the limit, you will receive a 429 error without the `Retry-After` header. Please check the Order Rate Limit rules using `GET api/v3/exchangeInfo` and wait for reactivation accordingly. - Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - **The order rate limit is counted against each account**. - To monitor order count usage, refer to GET `api/v3/rateLimit/order` ### Websocket Limits - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON controlled message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. - There is a limit of **300 connections per attempt every 5 minutes per IP**. ### /api/ and /sapi/ Limit Introduction The `/api/*` and `/sapi/*` endpoints adopt either of two access limiting rules, IP limits or UID (account) limits. - Endpoints related to `/api/*`: - According to the two modes of IP and UID (account) limit, each are independent. - Endpoints share the 6000 per minute limit based on IP. - Responses contain the header `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)`, defining the weight used by the current IP. - Successful order responses contain the header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`, defining the order limit used by the UID. - Endpoints related to `/sapi/*`: - Endpoints are marked according to IP or UID limit and their corresponding weight value. - Each endpoint with IP limits has an independent 12000 per minute limit. - Each endpoint with UID limits has an independent 180000 per minute limit. - Responses from endpoints with IP limits contain the header `X-SAPI-USED-IP-WEIGHT-1M`, defining the weight used by the current IP. - Responses from endpoints with UID limits contain the header `X-SAPI-USED-UID-WEIGHT-1M`, defining the weight used by the current UID. --- ## Data Sources - The API system is asynchronous, so some delay in the response is normal and expected. - Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates. - **Matching Engine** - the data is from the matching Engine - **Memory** - the data is from a server's local or external memory - **Database** - the data is taken directly from a database ## Request Security - Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](#place-new-order-trade)). - If unspecified, the security type is `NONE`. - Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](#user-data-stream-requests). - Secure endpoints require a valid API key to be specified and authenticated. - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. - API keys can be configured to allow access only to certain types of secure endpoints. - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. | Security Type | Description | | ------------- | -------------------------------------------------------- | | NONE | Endpoint can be accessed freely. | | TRADE | Endpoint requires sending a valid API-Key and signature. | | MARGIN | Endpoint requires sending a valid API-Key and signature. | | USER_DATA | Endpoint requires sending a valid API-Key and signature. | | USER_STREAM | Endpoint requires sending a valid API-Key. | | MARKET_DATA | Endpoint requires sending a valid API-Key. | - `TRADE`, `MARGIN` and `USER_DATA` endpoints are `SIGNED` endpoints. ### SIGNED Endpoint security - `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. #### Signature Case Sensitivity - **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. - **RSA:** Signatures generated using RSA are **case-sensitive**. - **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** Please consult [SIGNED request example (HMAC)](#hmac-keys), [SIGNED request example (RSA)](#rsa-keys), and [SIGNED request example (Ed25519)](#ed25519-keys) on how to compute signature, depending on which API key type you are using. ### Timing security - `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](#general-api-information)) - An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. - Maximum `recvWindow` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` **Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. **It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** ### SIGNED Endpoint Examples for POST /api/v3/order #### HMAC Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. Example API key and secret key: | Key | Value | | ----------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `secretKey` | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j | **WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | LTCBTC | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` **Step 2: Compute the signature** 1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. 2. Sign the signature payload constructed in Step 1. 3. Encode the HMAC-SHA-256 output as a hex string. Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. **Example commands** For the first set of example parameters (ASCII only): ```console $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" ``` For the second set of example parameters (some non-ASCII characters) ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" ``` Here is a sample Bash script performing all the steps above: ```bash apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" # Sign the request signature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey") signature=${signature#*= } # Keep only the part after the "= " # Send the request curl -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?$payload&signature=$signature" ``` #### RSA Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. Only `PKCS#8` keys are supported. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. These examples assume the private key is stored in the file `./test-prv-key.pem`. | Key | Value | | -------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | BTCUSDT | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` **Step 2: Compute the signature** 1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function. 2. Encode the output in base64. Note that the payload and the resulting `signature` are **case-sensitive**. For the first set of example parameters (ASCII only): ```console $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== ``` 3. Percent-encode the base64 string. For the first set of example parameters (ASCII only): ```console HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D ``` For the second set of example parameters (some non-ASCII characters): ```console qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' ``` For the second set of example parameters (some non-ASCII characters): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' ``` Here is a sample Bash script performing all the steps above: ```bash function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos The error JSON payload: ```javascript { "code":-1121, "msg":"Invalid symbol." } ``` Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. ## 10xx - General Server or Network issues ### -1000 UNKNOWN - An unknown error occurred while processing the request. - An unknown error occurred while processing the request.[%s] ### -1001 DISCONNECTED - Internal error; unable to process your request. Please try again. ### -1002 UNAUTHORIZED - You are not authorized to execute this request. ### -1003 TOO_MANY_REQUESTS - Too many requests queued. - Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. - Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. ### -1004 SERVER_BUSY - Server is busy, please wait and try again ### -1006 UNEXPECTED_RESP - An unexpected response was received from the message bus. Execution status unknown. ### -1007 TIMEOUT - Timeout waiting for response from backend server. Send status unknown; execution status unknown. ### -1008 SERVER_BUSY - Spot server is currently overloaded with other requests. Please try again in a few minutes. ### -1014 UNKNOWN_ORDER_COMPOSITION - Unsupported order combination. ### -1015 TOO_MANY_ORDERS - Too many new orders. - Too many new orders; current limit is %s orders per %s. ### -1016 SERVICE_SHUTTING_DOWN - This service is no longer available. ### -1020 UNSUPPORTED_OPERATION - This operation is not supported. ### -1021 INVALID_TIMESTAMP - Timestamp for this request is outside of the recvWindow. - Timestamp for this request was 1000ms ahead of the server's time. ### -1022 INVALID_SIGNATURE - Signature for this request is not valid. ### -1099 Not found, authenticated, or authorized - This replaces error code -1999 ## 11xx - 2xxx Request issues ### -1100 ILLEGAL_CHARS - Illegal characters found in a parameter. - Illegal characters found in a parameter. %s - Illegal characters found in parameter `%s`; legal range is `%s`. ### -1101 TOO_MANY_PARAMETERS - Too many parameters sent for this endpoint. - Too many parameters; expected `%s` and received `%s`. - Duplicate values for a parameter detected. ### -1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED - A mandatory parameter was not sent, was empty/null, or malformed. - Mandatory parameter `%s` was not sent, was empty/null, or malformed. - Param `%s` or `%s` must be sent, but both were empty/null! ### -1103 UNKNOWN_PARAM - An unknown parameter was sent. ### -1104 UNREAD_PARAMETERS - Not all sent parameters were read. - Not all sent parameters were read; read `%s` parameter(s) but was sent `%s`. ### -1105 PARAM_EMPTY - A parameter was empty. - Parameter `%s` was empty. ### -1106 PARAM_NOT_REQUIRED - A parameter was sent when not required. - Parameter `%s` sent when not required. ### -1111 BAD_PRECISION - Precision is over the maximum defined for this asset. ### -1112 NO_DEPTH - No orders on book for symbol. ### -1114 TIF_NOT_REQUIRED - TimeInForce parameter sent when not required. ### -1115 INVALID_TIF - Invalid timeInForce. ### -1116 INVALID_ORDER_TYPE - Invalid orderType. ### -1117 INVALID_SIDE - Invalid side. ### -1118 EMPTY_NEW_CL_ORD_ID - New client order ID was empty. ### -1119 EMPTY_ORG_CL_ORD_ID - Original client order ID was empty. ### -1120 BAD_INTERVAL - Invalid interval. ### -1121 BAD_SYMBOL - Invalid symbol. ### -1125 INVALID_LISTEN_KEY - This listenKey does not exist. ### -1127 MORE_THAN_XX_HOURS - Lookup interval is too big. - More than %s hours between startTime and endTime. ### -1128 OPTIONAL_PARAMS_BAD_COMBO - Combination of optional parameters invalid. ### -1130 INVALID_PARAMETER - Invalid data sent for a parameter. - Data sent for parameter `%s` is not valid. ### -1131 BAD_RECV_WINDOW - recvWindow must be less than 60000 ### -1134 BAD_STRATEGY_TYPE - `strategyType` was less than 1000000. #### -1145 INVALID_CANCEL_RESTRICTIONS - `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. #### -1151 DUPLICATE_SYMBOLS - Symbol is present multiple times in the list. ### -2010 NEW_ORDER_REJECTED - NEW_ORDER_REJECTED ### -2011 CANCEL_REJECTED - CANCEL_REJECTED ### -2013 NO_SUCH_ORDER - Order does not exist. ### -2014 BAD_API_KEY_FMT - API-key format invalid. ### -2015 REJECTED_MBX_KEY - Invalid API-key, IP, or permissions for action. ### -2016 NO_TRADING_WINDOW - No trading window could be found for the symbol. Try ticker/24hrs instead. #### -2026 ORDER_ARCHIVED - Order was canceled or expired with no executed qty over 90 days ago and has been archived. ## 3xxx-5xxx SAPI-specific issues ### -3000 INNER_FAILURE - Internal server error. ### -3001 NEED_ENABLE_2FA - Please enable 2FA first. ### -3002 ASSET_DEFICIENCY - We don't have this asset. ### -3003 NO_OPENED_MARGIN_ACCOUNT - Margin account does not exist. ### -3004 TRADE_NOT_ALLOWED - Trade not allowed. ### -3005 TRANSFER_OUT_NOT_ALLOWED - Transferring out not allowed. ### -3006 EXCEED_MAX_BORROWABLE - Your borrow amount has exceed maximum borrow amount. ### -3007 HAS_PENDING_TRANSACTION - You have pending transaction, please try again later. ### -3008 BORROW_NOT_ALLOWED - Borrow not allowed. ### -3009 ASSET_NOT_MORTGAGEABLE - This asset are not allowed to transfer into margin account currently. ### -3010 REPAY_NOT_ALLOWED - Repay not allowed. ### -3011 BAD_DATE_RANGE - Your input date is invalid. ### -3012 ASSET_ADMIN_BAN_BORROW - Borrow is banned for this asset. ### -3013 LT_MIN_BORROWABLE - Borrow amount less than minimum borrow amount. ### -3014 ACCOUNT_BAN_BORROW - Borrow is banned for this account. ### -3015 REPAY_EXCEED_LIABILITY - Repay amount exceeds borrow amount. ### -3016 LT_MIN_REPAY - Repay amount less than minimum repay amount. ### -3017 ASSET_ADMIN_BAN_MORTGAGE - This asset are not allowed to transfer into margin account currently. ### -3018 ACCOUNT_BAN_MORTGAGE - Transferring in has been banned for this account. ### -3019 ACCOUNT_BAN_ROLLOUT - Transferring out has been banned for this account. ### -3020 EXCEED_MAX_ROLLOUT - Transfer out amount exceeds max amount. ### -3021 PAIR_ADMIN_BAN_TRADE - Margin account are not allowed to trade this trading pair. ### -3022 ACCOUNT_BAN_TRADE - You account's trading is banned. ### -3023 WARNING_MARGIN_LEVEL - You can't transfer out/place order under current margin level. ### -3024 FEW_LIABILITY_LEFT - The unpaid debt is too small after this repayment. ### -3025 INVALID_EFFECTIVE_TIME - Your input date is invalid. ### -3026 VALIDATION_FAILED - Your input param is invalid. ### -3027 NOT_VALID_MARGIN_ASSET - Not a valid margin asset. ### -3028 NOT_VALID_MARGIN_PAIR - Not a valid margin pair. ### -3029 TRANSFER_FAILED - Transfer failed. ### -3036 ACCOUNT_BAN_REPAY - This account is not allowed to repay. ### -3037 PNL_CLEARING - PNL is clearing. Wait a second. ### -3038 LISTEN_KEY_NOT_FOUND - Listen key not found. ### -3041 BALANCE_NOT_CLEARED - Balance is not enough ### -3042 PRICE_INDEX_NOT_FOUND - PriceIndex not available for this margin pair. ### -3043 TRANSFER_IN_NOT_ALLOWED - Transferring in not allowed. ### -3044 SYSTEM_BUSY - System busy. ### -3045 SYSTEM - The system doesn't have enough asset now. ### -3999 NOT_WHITELIST_USER - This function is only available for invited users. ### -4001 CAPITAL_INVALID - Invalid operation. ### -4002 CAPITAL_IG - Invalid get. ### -4003 CAPITAL_IEV - Your input email is invalid. ### -4004 CAPITAL_UA - You don't login or auth. ### -4005 CAPAITAL_TOO_MANY_REQUEST - Too many new requests. ### -4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT - Support main account only. ### -4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS - Address validation is not passed. ### -4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS - Address tag validation is not passed. ### -4010 CAPITAL_WHITELIST_EMAIL_CONFIRM - White list mail has been confirmed. ### -4011 CAPITAL_WHITELIST_EMAIL_EXPIRED - White list mail is invalid. ### -4012 CAPITAL_WHITELIST_CLOSE - White list is not opened. ### -4013 CAPITAL_WITHDRAW_2FA_VERIFY - 2FA is not opened. ### -4014 CAPITAL_WITHDRAW_LOGIN_DELAY - Withdraw is not allowed within 2 min login. ### -4015 CAPITAL_WITHDRAW_RESTRICTED_MINUTE - Withdraw is limited. ### -4016 CAPITAL_WITHDRAW_RESTRICTED_PASSWORD - Within 24 hours after password modification, withdrawal is prohibited. ### -4017 CAPITAL_WITHDRAW_RESTRICTED_UNBIND_2FA - Within 24 hours after the release of 2FA, withdrawal is prohibited. ### -4018 CAPITAL_WITHDRAW_ASSET_NOT_EXIST - We don't have this asset. ### -4019 CAPITAL_WITHDRAW_ASSET_PROHIBIT - Current asset is not open for withdrawal. ### -4021 CAPITAL_WITHDRAW_AMOUNT_MULTIPLE - Asset withdrawal must be an %s multiple of %s. ### -4022 CAPITAL_WITHDRAW_MIN_AMOUNT - Not less than the minimum pick-up quantity %s. ### -4023 CAPITAL_WITHDRAW_MAX_AMOUNT - Within 24 hours, the withdrawal exceeds the maximum amount. ### -4024 CAPITAL_WITHDRAW_USER_NO_ASSET - You don't have this asset. ### -4025 CAPITAL_WITHDRAW_USER_ASSET_LESS_THAN_ZERO - The number of hold asset is less than zero. ### -4026 CAPITAL_WITHDRAW_USER_ASSET_NOT_ENOUGH - You have insufficient balance. ### -4027 CAPITAL_WITHDRAW_GET_TRAN_ID_FAILURE - Failed to obtain tranId. ### -4028 CAPITAL_WITHDRAW_MORE_THAN_FEE - The amount of withdrawal must be greater than the Commission. ### -4029 CAPITAL_WITHDRAW_NOT_EXIST - The withdrawal record does not exist. ### -4030 CAPITAL_WITHDRAW_CONFIRM_SUCCESS - Confirmation of successful asset withdrawal. ### -4031 CAPITAL_WITHDRAW_CANCEL_FAILURE - Cancellation failed. ### -4032 CAPITAL_WITHDRAW_CHECKSUM_VERIFY_FAILURE - Withdraw verification exception. ### -4033 CAPITAL_WITHDRAW_ILLEGAL_ADDRESS - Illegal address. ### -4034 CAPITAL_WITHDRAW_ADDRESS_CHEAT - The address is suspected of fake. ### -4035 CAPITAL_WITHDRAW_NOT_WHITE_ADDRESS - This address is not on the whitelist. Please join and try again. ### -4036 CAPITAL_WITHDRAW_NEW_ADDRESS - The new address needs to be withdrawn in {0} hours. ### -4037 CAPITAL_WITHDRAW_RESEND_EMAIL_FAIL - Re-sending Mail failed. ### -4038 CAPITAL_WITHDRAW_RESEND_EMAIL_TIME_OUT - Please try again in 5 minutes. ### -4039 CAPITAL_USER_EMPTY - The user does not exist. ### -4040 CAPITAL_NO_CHARGE - This address not charged. ### -4041 CAPITAL_MINUTE_TOO_SMALL - Please try again in one minute. ### -4042 CAPITAL_CHARGE_NOT_RESET - This asset cannot get deposit address again. ### -4043 CAPITAL_ADDRESS_TOO_MUCH - More than 100 recharge addresses were used in 24 hours. ### -4044 CAPITAL_BLACKLIST_COUNTRY_GET_ADDRESS - This is a blacklist country. ### -4045 CAPITAL_GET_ASSET_ERROR - Failure to acquire assets. ### -4046 CAPITAL_AGREEMENT_NOT_CONFIRMED - Agreement not confirmed. ### -4047 CAPITAL_DATE_INTERVAL_LIMIT - Time interval must be within 0-90 days ### -4060 CAPITAL_WITHDRAW_USER_ASSET_LOCK_DEPOSIT - As your deposit has not reached the required block confirmations, we have temporarily locked {0} asset ### -4106 TAG_NOT_SUPPORTED_FOR_NETWORK - This network does not support memo/tag. Please remove the `addressTag` field and try again. ### -5001 ASSET_DRIBBLET_CONVERT_SWITCH_OFF - Don't allow transfer to micro assets. ### -5002 ASSET_ASSET_NOT_ENOUGH - You have insufficient balance. ### -5003 ASSET_USER_HAVE_NO_ASSET - You don't have this asset. ### -5004 USER_OUT_OF_TRANSFER_FLOAT - The residual balances have exceeded 0.001BTC, Please re-choose. - The residual balances of %s have exceeded 0.001BTC, Please re-choose. ### -5005 USER_ASSET_AMOUNT_IS_TOO_LOW - The residual balances of the BTC is too low - The residual balances of %s is too low, Please re-choose. ### -5006 USER_CAN_NOT_REQUEST_IN_24_HOURS - Only transfer once in 24 hours. ### -5007 AMOUNT_OVER_ZERO - Quantity must be greater than zero. ### -5008 ASSET_WITHDRAW_WITHDRAWING_NOT_ENOUGH - Insufficient amount of returnable assets. ### -5009 PRODUCT_NOT_EXIST - Product does not exist. ### -5010 TRANSFER_FAIL - Asset transfer fail. ### -5011 FUTURE_ACCT_NOT_EXIST - future account not exists. ### -5012 TRANSFER_PENDING - Asset transfer is in pending. ### -5021 PARENT_SUB_HAVE_NO_RELATION - This parent sub have no relation ### -5012 FUTURE_ACCT_OR_SUBRELATION_NOT_EXIST - future account or sub relation not exists. ## 6XXX - Savings Issues ### -6001 DAILY_PRODUCT_NOT_EXIST - Daily product not exists. ### -6003 DAILY_PRODUCT_NOT_ACCESSIBLE - Product not exist or you don't have permission ### -6004 DAILY_PRODUCT_NOT_PURCHASABLE - Product not in purchase status ### -6005 DAILY_LOWER_THAN_MIN_PURCHASE_LIMIT - Smaller than min purchase limit ### -6006 DAILY_REDEEM_AMOUNT_ERROR - Redeem amount error ### -6007 DAILY_REDEEM_TIME_ERROR - Not in redeem time ### -6008 DAILY_PRODUCT_NOT_REDEEMABLE - Product not in redeem status ### -6009 REQUEST_FREQUENCY_TOO_HIGH - Request frequency too high ### -6011 EXCEEDED_USER_PURCHASE_LIMIT - Exceeding the maximum num allowed to purchase per user ### -6012 BALANCE_NOT_ENOUGH - Balance not enough ### -6013 PURCHASING_FAILED - Purchasing failed ### -6014 UPDATE_FAILED - Exceed up-limit allowed to purchased ### -6015 EMPTY_REQUEST_BODY - Empty request body ### -6016 PARAMS_ERR - Parameter err ### -6017 NOT_IN_WHITELIST - Not in whitelist ### -6018 ASSET_NOT_ENOUGH - Asset not enough ### -6019 PENDING - Need confirm ### -6020 PROJECT_NOT_EXISTS - Project not exists ## 70xx - Futures ### -7001 FUTURES_BAD_DATE_RANGE - Date range is not supported. ### -7002 FUTURES_BAD_TYPE - Data request type is not supported. ## 20xxx - Futures/Spot Algo ### -20121 - Invalid symbol. ### -20124 - Invalid algo id or it has been completed. ### -20130 - Invalid data sent for a parameter. ### -20132 - The client algo id is duplicated. ### -20194 - Duration is too short to execute all required quantity. ### -20195 - The total size is too small. ### -20196 - The total size is too large. ### -20198 - Reach the max open orders allowed. ### -20204 - The notional of USD is less or more than the limit. ## Filter failures | Error message | Description | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | "Filter failure: PRICE_FILTER" | `price` is too high, too low, and/or not following the tick size rule for the symbol. | | "Filter failure: PERCENT_PRICE" | `price` is X% too high or X% too low from the average weighted price over the last Y minutes. | | "Filter failure: PERCENT_PRICE_BY_SIDE" | `price` is X% too high or Y% too low from the `lastPrice` on that side (i.e. BUY/SELL) | | "Filter failure: LOT_SIZE" | `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MIN_NOTIONAL" | `price` \* `quantity` is too low to be a valid order for the symbol. | | "Filter failure: ICEBERG_PARTS" | `ICEBERG` order would break into too many parts; icebergQty is too small. | | "Filter failure: MARKET_LOT_SIZE" | `MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MAX_POSITION" | The account's position has reached the maximum defined limit.

This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY`orders. | | "Filter failure: MAX_NUM_ORDERS" | Account has too many open orders on the symbol. | | "Filter failure: MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the symbol. | | "Filter failure: MAX_NUM_ICEBERG_ORDERS" | Account has too many open iceberg orders on the symbol. | | "Filter failure: TRAILING_DELTA" | `trailingDelta` is not within the defined range of the filter for that order type. | | "Filter failure: EXCHANGE_MAX_NUM_ORDERS" | Account has too many open orders on the exchange. | | "Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the exchange. | ## 10xxx - Crypto Loans ### -10001 SYSTEM_MAINTENANCE - The system is under maintenance, please try again later. ### -10002 INVALID_INPUT - Invalid input parameters. ### -10005 NO_RECORDS - No records found. ### -10007 COIN_NOT_LOANABLE - This coin is not loanable. ### -10008 COIN_NOT_LOANABLE - This coin is not loanable ### -10009 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10010 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10011 INSUFFICIENT_ASSET - Insufficient spot assets. ### -10012 INVALID_AMOUNT - Invalid repayment amount. ### -10013 INSUFFICIENT_AMOUNT - Insufficient collateral amount. ### -10015 DEDUCTION_FAILED - Collateral deduction failed. ### -10016 LOAN_FAILED - Failed to provide loan. ### -10017 REPAY_EXCEED_DEBT - Repayment amount exceeds debt. ### -10018 INVALID_AMOUNT - Invalid repayment amount. ### -10019 CONFIG_NOT_EXIST - Configuration does not exists. ### -10020 UID_NOT_EXIST - User ID does not exist. ### -10021 ORDER_NOT_EXIST - Order does not exist. ### -10022 INVALID_AMOUNT - Invalid adjustment amount. ### -10023 ADJUST_LTV_FAILED - Failed to adjust LTV. ### -10024 ADJUST_LTV_NOT_SUPPORTED - LTV adjustment not supported. ### -10025 REPAY_FAILED - Repayment failed. ### -10026 INVALID_PARAMETER - Invalid parameter. ### -10028 INVALID_PARAMETER - Invalid parameter. ### -10029 AMOUNT_TOO_SMALL - Loan amount is too small. ### -10030 AMOUNT_TOO_LARGE - Loan amount is too much. ### -10031 QUOTA_REACHED - Individual loan quota reached. ### -10032 REPAY_NOT_AVAILABLE - Repayment is temporarily unavailable. ### -10034 REPAY_NOT_AVAILABLE - Repay with collateral is not available currently, please try to repay with borrowed coin. ### -10039 AMOUNT_TOO_SMALL - Repayment amount is too small. ### -10040 AMOUNT_TOO_LARGE - Repayment amount is too large. ### -10041 INSUFFICIENT_AMOUNT - Due to high demand, there are currently insufficient loanable assets for {0}. Please adjust your borrow amount or try again tomorrow. ### -10042 ASSET_NOT_SUPPORTED - asset %s is not supported ### -10043 ASSET_NOT_SUPPORTED - {0} borrowing is currently not supported. ### -10044 QUOTA_REACHED - Collateral amount has reached the limit. Please reduce your collateral amount or try with other collaterals. ### -10045 COLLTERAL_REPAY_NOT_SUPPORTED - The loan coin does not support collateral repayment. Please try again later. ### -10046 EXCEED_MAX_ADJUSTMENT - Collateral Adjustment exceeds the maximum limit. Please try again. ### -10047 REGION_NOT_SUPPORTED - This coin is currently not supported in your location due to local regulations. ## 13xxx - BLVT ### -13000 BLVT_FORBID_REDEEM - Redeption of the token is forbiden now ### -13001 BLVT_EXCEED_DAILY_LIMIT - Exceeds individual 24h redemption limit of the token ### -13002 BLVT_EXCEED_TOKEN_DAILY_LIMIT - Exceeds total 24h redemption limit of the token ### -13003 BLVT_FORBID_PURCHASE - Subscription of the token is forbiden now ### -13004 BLVT_EXCEED_DAILY_PURCHASE_LIMIT - Exceeds individual 24h subscription limit of the token ### -13005 BLVT_EXCEED_TOKEN_DAILY_PURCHASE_LIMIT - Exceeds total 24h subscription limit of the token ### -13006 BLVT_PURCHASE_LESS_MIN_AMOUNT - Subscription amount is too small ### -13007 BLVT_PURCHASE_AGREEMENT_NOT_SIGN - The Agreement is not signed ## 12xxx - Liquid Swap ### -12014 TOO MANY REQUESTS - More than 1 request in 2 seconds ## 18xxx - Binance Code ### -18002 - The total amount of codes you created has exceeded the 24-hour limit, please try again after UTC 0 ### -18003 - Too many codes created in 24 hours, please try again after UTC 0 ### -18004 - Too many invalid redeem attempts in 24 hours, please try again after UTC 0 ### -18005 - Too many invalid verify attempts, please try later ### -18006 - The amount is too small, please re-enter ### -18007 - This token is not currently supported, please re-enter ## 21xxx - Portfolio Margin Account ### -21001 USER_IS_NOT_UNIACCOUNT - Request ID is not a Portfolio Margin Account. ### -21002 UNI_ACCOUNT_CANT_TRANSFER_FUTURE - Portfolio Margin Account doesn't support transfer from margin to futures. ### -21003 NET_ASSET_MUST_LTE_RATIO - Fail to retrieve margin assets. ### -21004 USER_NO_LIABILITY - User doesn’t have portfolio margin bankruptcy loan ### -21005 NO_ENOUGH_ASSET - User’s spot wallet doesn’t have enough BUSD to repay portfolio margin bankruptcy loan ### -21006 HAD_IN_PROCESS_REPAY - User had portfolio margin bankruptcy loan repayment in process ### -21007 IN_FORCE_LIQUIDATION - User failed to repay portfolio margin bankruptcy loan since liquidation was in process ## Order Rejection Issues Error messages like these are indicated when the error is coming specifically from the matching engine: - `-1010 ERROR_MSG_RECEIVED` - `-2010 NEW_ORDER_REJECTED` - `-2011 CANCEL_REJECTED` The following messages which will indicate the specific error: | Error message | Description | | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | "Unknown order sent." | The order (by either `orderId`, `clientOrderId`, `origClientOrderId`) could not be found. | | "Duplicate order sent." | The `clientOrderId` is already in use. | | "Market is closed." | The symbol is not trading. | | "Account has insufficient balance for requested action." | Not enough funds to complete the action. | | "Market orders are not supported for this symbol." | `MARKET` is not enabled on the symbol. | | "Iceberg orders are not supported for this symbol." | `icebergQty` is not enabled on the symbol | | "Stop loss orders are not supported for this symbol." | `STOP_LOSS` is not enabled on the symbol | | "Stop loss limit orders are not supported for this symbol." | `STOP_LOSS_LIMIT` is not enabled on the symbol | | "Take profit orders are not supported for this symbol." | `TAKE_PROFIT` is not enabled on the symbol | | "Take profit limit orders are not supported for this symbol." | `TAKE_PROFIT_LIMIT` is not enabled on the symbol | | "Price \* QTY is zero or less." | `price` \* `quantity` is too low | | "IcebergQty exceeds QTY." | `icebergQty` must be less than the order quantity | | "This action is disabled on this account." | Contact customer support; some actions have been disabled on the account. | | "This account may not place or cancel orders." | Contact customer support; the account has trading ability disabled. | | "Unsupported order combination" | The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. | | "Order would trigger immediately." | The order's stop price is not valid when compared to the last traded price. | | "Cancel order is invalid. Check origClientOrderId and orderId." | No `origClientOrderId` or `orderId` was sent in. | | "Order would immediately match and take." | `LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. | | "The relationship of the prices for the orders is not correct." | The prices set in the `OCO` is breaking the Price rules.

The rules are:

`SELL Orders`: Limit Price > Last Price > Stop Price

`BUY Orders`: Limit Price < Last Price < Stop Price | | "OCO orders are not supported for this symbol" | `OCO` is not enabled on the symbol. | | "Quote order qty market orders are not support for this symbol." | `MARKET` orders using the parameter `quoteOrderQty` are not enabled on this symbol. | | "Trailing stop orders are not supported for this symbol." | Orders using `trailingDelta` are not enabled on the symbol. | | "Order cancel-replace is not supported for this symbol." | `POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is on enabled the symbol. | | "This symbol is not permitted for this account." | Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) | | "This symbol is restricted for this account." | Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) | | "Order was not canceled due to cancel restrictions." | Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW`
or
`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. | ## Errors regarding POST /api/v3/order/cancelReplace ### -2021 Order cancel-replace partially failed This code is sent when either the cancellation of the order failed or the new order placement failed but not both. ### -2022 Order cancel-replace failed. This code is sent when both the cancellation of the order failed and the new order placement failed. --- ## Document: /products/simple-earn/change-log URL: /en/dev-docs/products/simple-earn/change-log # Change Log ## 2026-05-27 - Add new Yield Arena endpoint: - `GET /sapi/v1/earn/arena/activities` - Returns the list of Earn Yield Arena activities currently available to the user (`AIRDROP`, `LEADERBOARD`, `EVENT`). Supports an optional `lang` request header for localized `title` and `description`. ## 2026-03-09 - Changes to BFUSD endpoints: - `GET /sapi/v1/bfusd/quota` - New `subscriptionQuota` object in response with `leftQuota` field. ## 2025-12-26 ### Time-sensitive Notice - **The following change to REST API will occur at approximately 2026-01-15 07:00 UTC:**
When calling endpoints that require signatures, percent-encode payloads before computing signatures. Requests that do not follow this order will be rejected with [`-1022 INVALID_SIGNATURE`](error-code.md#-1022-invalid_signature). Please review and update your signing logic accordingly. ### REST API - Updated documentation for REST API regarding [Signed Endpoints examples for placing an order](general-info.md#signed-endpoint-examples-for-post-apiv3order). ## 2025-10-27 - Increase BFUSD endpoints ## 2025-09-05 - Increase RWUSD endpoints ## 2025-09-02 - Update the file paths for Flexible and Locked products ## 2025-03-18 - Changes to Simple Earn endpoints: - `GET /sapi/v1/simple-earn/locked/subscriptionPreview` new fields in response `boostRewardAsset`, `estDailyRewardAmt` - `GET /sapi/v1/simple-earn/locked/list` new fields in response `boostRewardAsset`,`boostApr`, `boostEndTime` - `GET /sapi/v1/simple-earn/locked/position` new fields in response `boostRewardAsset`,`boostApr`, `totalBoostRewardAmt` - `GET /sapi/v1/simple-earn/locked/history/rewardsRecord` new fields in response `type` ## 2024-07-04 - Changes to Simple Earn endpoints: - `POST /sapi/v1/simple-earn/locked/subscribe` new parameter:`redeemTo` - `GET /sapi/v1/simple-earn/locked/position` new fields in response:`redeemTo` - `GET /sapi/v1/simple-earn/flexible/history/subscriptionRecord` new fields in response:`productId` - `GET /sapi/v1/simple-earn/locked/history/subscriptionRecord` new fields in response:`projectId` - `GET /sapi/v1/simple-earn/locked/history/redemptionRecord` new fields in response:`originalAmount`, `lossAmount`, `isComplete`, `rewardAsset`, `rewardAmt`, `extraRewardAsset`, `estExtraRewardAmt` - Add New endpoint in Simple Earn: - `POST /sapi/v1/simple-earn/locked/setRedeemOption` Set the redeem option of Locked products to Flexible product or Spot wallet ## 2023-08-26 - Changes to Simple Earn endpoints: - `GET /sapi/v1/simple-earn/flexible/history/subscriptionRecord`: new fields in response: `sourceAccount`,`amtFromSpot`,`amtFromFunding` - `GET /sapi/v1/simple-earn/locked/history/subscriptionRecord`: new fields in response: `sourceAccount`,`amtFromSpot`,`amtFromFunding` - `GET /sapi/v1/simple-earn/flexible/history/redemptionRecord`: new fields in response `destAccount` - `POST /sapi/v1/simple-earn/flexible/subscribe`: new parameter `sourceAccount` - `POST /sapi/v1/simple-earn/locked/subscribe`: new parameter `sourceAccount` - `POST /sapi/v1/simple-earn/flexible/redeem`: new parameter `destAccount` --- ## Document: /products/simple-earn/Introduction URL: /en/dev-docs/products/simple-earn/Introduction # Introduction Simple Earn allows you to earn rewards by depositing your digital assets for flexible or locked terms. Flexible Products can be subscribed to and redeemed at almost any time, so you can retain flexibility and liquidity over your assets while earning daily rewards. Locked Products provide higher rewards in exchange for your assets being committed for fixed terms with predetermined redemption dates. --- ## Document: /products/spot/web-socket-streams URL: /en/dev-docs/products/spot/web-socket-streams # General WebSocket Streams information - The base endpoint is: **wss://stream.binance.com:9443** or **wss://stream.binance.com:443**. - Streams can be accessed either in a single raw stream or in a combined stream. - Raw streams are accessed at **/ws/\** - Combined streams are accessed at **/stream?streams=\/\/\** - Combined stream events are wrapped as follows: **{"stream":"\","data":\}** - All symbols for streams are **lowercase** - A single connection to **stream.binance.com** is only valid for 24 hours; expect to be disconnected at the 24 hour mark. - A [`serverShutdown`](#serverShutdown) event will be sent when the server is about to shutdown, resulting in disconnection. Please establish a new connection as soon as possible to prevent interruption. - The WebSocket server will send a `ping frame` every 20 seconds. - If the WebSocket server does not receive a `pong frame` back from the connection within a minute the connection will be disconnected. - When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible. - Unsolicited `pong frames` are allowed, but will not prevent disconnection. **It is recommended that the payload for these pong frames are empty.** - The base endpoint **wss://data-stream.binance.vision** can be subscribed to receive **only** market data messages.
User data stream is **NOT** available from this URL. - All time and timestamp related fields are **milliseconds by default**. To receive the information in microseconds, please add the parameter `timeUnit=MICROSECOND or timeUnit=microsecond` in the URL. - For example: `/stream?streams=btcusdt@trade&timeUnit=MICROSECOND` - If your request contains a symbol name containing non-ASCII characters, then the stream events may contain non-ASCII characters encoded in UTF-8. - [All Market Mini Tickers Stream](#all-market-mini-tickers-stream) and [All Market Rolling Window Statistics Streams](#all-market-rolling-window-statistics-streams) events may contain non-ASCII characters encoded in UTF-8. ## WebSocket Limits - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON controlled message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. - There is a limit of **300 connections per attempt every 5 minutes per IP**. ## Server Shutdown `serverShutdown` event is sent when the server is about to shut down. - `raw` stream: ```javascript { "e": "serverShutdown", // Event type "E": 1770123456789 // Event time } ``` - `combined` stream: ```javascript { "stream": "!serverShutdown", "data": { "e": "serverShutdown", // Event type "E": 1770123456789 // Event time } } ``` Please establish a new connection as soon as possible to prevent interruption. ## Live Subscribing/Unsubscribing to streams - The following data can be sent through the WebSocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below. - The `id` is used as an identifier to uniquely identify the messages going back and forth. The following formats are accepted: - 64-bit signed integer - alphanumeric strings; max length 36 - `null` - In the response, if the `result` received is `null` this means the request sent was a success for non-query requests (e.g. Subscribing/Unsubscribing). ### Subscribe to a stream - Request ```javascript { "method": "SUBSCRIBE", "params": ["btcusdt@aggTrade", "btcusdt@depth"], "id": 1 } ``` - Response ```javascript { "result": null, "id": 1 } ``` ### Unsubscribe to a stream - Request ```javascript { "method": "UNSUBSCRIBE", "params": ["btcusdt@depth"], "id": 312 } ``` - Response ```javascript { "result": null, "id": 312 } ``` ### Listing Subscriptions - Request ```javascript { "method": "LIST_SUBSCRIPTIONS", "id": 3 } ``` - Response ```javascript { "result": ["btcusdt@aggTrade"], "id": 3 } ``` ### Setting Properties Currently, the only property that can be set is whether `combined` stream payloads are enabled or not. The combined property is set to `false` when connecting using `/ws/` ("raw streams") and `true` when connecting using `/stream/`. - Request ```javascript { "method": "SET_PROPERTY", "params": ["combined", true], "id": 5 } ``` - Response ```javascript { "result": null, "id": 5 } ``` ### Retrieving Properties - Request ```javascript { "method": "GET_PROPERTY", "params": ["combined"], "id": 2 } ``` - Response ```javascript { "result": true, // Indicates that combined is set to true. "id": 2 } ``` ### Error Messages | Error Message | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | {"code": 0, "msg": "Unknown property","id": %s} | Parameter used in the `SET_PROPERTY` or `GET_PROPERTY` was invalid | | {"code": 1, "msg": "Invalid value type: expected Boolean"} | Value should only be `true` or `false` | | {"code": 2, "msg": "Invalid request: property name must be a string"} | Property name provided was invalid | | {"code": 2, "msg": "Invalid request: request ID must be an unsigned integer"} | Parameter `id` had to be provided or the value provided in the `id` parameter is an unsupported type | | {"code": 2, "msg": "Invalid request: unknown variant %s, expected one of `SUBSCRIBE`, `UNSUBSCRIBE`, `LIST_SUBSCRIPTIONS`, `SET_PROPERTY`, `GET_PROPERTY` at line 1 column 28"} | Possible typo in the provided method or provided method was neither of the expected values | | {"code": 2, "msg": "Invalid request: too many parameters"} | Unnecessary parameters provided in the data | | {"code": 2, "msg": "Invalid request: property name must be a string"} | Property name was not provided | | {"code": 2, "msg": "Invalid request: missing field `method` at line 1 column 73"} | `method` was not provided in the data | | {"code":3,"msg":"Invalid JSON: expected value at line %s column %s"} | JSON data sent has incorrect syntax. | ## How to manage a local order book correctly 1. Open a WebSocket connection to `wss://stream.binance.com:9443/ws/bnbbtc@depth`. 1. Buffer the events received from the stream. Note the `U` of the first event you received. 1. Get a depth snapshot from `https://api.binance.com/api/v3/depth?symbol=BNBBTC&limit=5000`. 1. If the `lastUpdateId` from the snapshot is strictly less than the `U` from step 2, go back to step 3. 1. In the buffered events, discard any event where `u` is <= `lastUpdateId` of the snapshot. The first buffered event should now have `lastUpdateId` within its `[U;u]` range. 1. Set your local order book to the snapshot. Its update ID is `lastUpdateId`. 1. Apply the update procedure below to all buffered events, and then to all subsequent events received. To apply an event to your local order book, follow this update procedure: 1. Decide whether the update event can be applied: - If the event last update ID (`u`) is less than the update ID of your local order book, ignore the event. - If the event first update ID (`U`) is greater than the update ID of your local order book + 1, you have missed some events.
Discard your local order book and restart the process from the beginning. - Normally, `U` of the next event is equal to `u + 1` of the previous event. 1. For each price level in bids (`b`) and asks (`a`), set the new quantity in the order book: - If the price level does not exist in the order book, insert it with new quantity. - If the quantity is zero, remove the price level from the order book. 1. Set the order book update ID to the last update ID (`u`) in the processed event. > [!NOTE] Since depth snapshots retrieved from the API have a limit on the number of price levels > (5000 on each side maximum), you won't learn the quantities for the levels outside of the initial > snapshot unless they change.
So be careful when using the information for those levels, since > they might not reflect the full view of the order book.
However, for most use cases, seeing > 5000 levels on each side is enough to understand the market and trade effectively. --- ## Document: /products/spot/web-socket-api URL: /en/dev-docs/products/spot/web-socket-api # General WebSocket API Information - The base endpoint is: **`wss://ws-api.binance.com:443/ws-api/v3`**. - If you experience issues with the standard 443 port, alternative port 9443 is also available. - The base endpoint for [testnet](https://testnet.binance.vision/) is: `wss://ws-api.testnet.binance.vision/ws-api/v3` - A single connection to the API is only valid for 24 hours; expect to be disconnected after the 24-hour mark. - A [`serverShutdown`](#serverShutdown) event will be sent when the server is about to shutdown, resulting in disconnection. Please establish a new connection as soon as possible to prevent interruption. - We support HMAC, RSA, and Ed25519 keys. For more information, please see [API Key types](/products/spot/faqs/api_key_types). - Responses are in JSON by default. To receive responses in SBE, refer to the [SBE FAQ](/products/spot/faqs/sbe_faq) page. - If your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. - Some methods may return asset and/or symbol names containing non-ASCII characters encoded in UTF-8 even if the request did not contain non-ASCII characters. - The WebSocket server will send a `ping frame` every 20 seconds. - If the WebSocket server does not receive a `pong frame` back from the connection within a minute the connection will be disconnected. - When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible. - Unsolicited `pong frames` are allowed, but will not prevent disconnection. **It is recommended that the payload for these pong frames are empty.** - Data is returned in **chronological order**, unless noted otherwise. - Without `startTime` or `endTime`, returns the most recent items up to the limit. - With `startTime`, returns oldest items from `startTime` up to the limit. - With `endTime`, returns most recent items up to `endTime` and the limit. - With both, behaves like `startTime` but does not exceed `endTime`. - All timestamps in the JSON responses are in **milliseconds in UTC by default**. To receive the information in microseconds, please add the parameter `timeUnit=MICROSECOND` or `timeUnit=microsecond` in the URL. - Timestamp parameters (e.g. `startTime`, `endTime`, `timestamp`) can be passed in milliseconds or microseconds. - All field names and values are **case-sensitive**, unless noted otherwise. - If there are enums or terms you want clarification on, please see [SPOT Glossary](/products/spot/faqs/spot_glossary) for more information. - APIs have a timeout of 10 seconds when processing a request. If a response from the Matching Engine takes longer than this, the API responds with "Timeout waiting for response from backend server. Send status unknown; execution status unknown." [(-1007 TIMEOUT)](/products/spot/errors#-1007-timeout) - This does not always mean that the request failed in the Matching Engine. - If the status of the request has not appeared in [User Data Stream](/products/spot/user-data-stream), please perform an API query for its status. - **Please avoid SQL keywords in requests** as they may trigger a security block by a WAF (Web Application Firewall) rule. See https://www.binance.com/en/support/faq/detail/360004492232 for more details. ## Request format Requests must be sent as JSON in **text frames**, one request per frame. Example of request: ```json { "id": "e2a85d9f-07a5-4f94-8d5f-789dc3deb097", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "BUY", "type": "LIMIT", "price": "0.1", "quantity": "10", "timeInForce": "GTC", "timestamp": 1655716096498, "apiKey": "T59MTDLWlpRW16JVeZ2Nju5A5C98WkMm8CSzWC4oqynUlTm1zXOxyauT8LmwXEv9", "signature": "5942ad337e6779f2f4c62cd1c26dba71c91514400a24990a3e7f5edec9323f90" } } ``` Request fields: | Name | Type | Mandatory | Description | | -------- | --------------------- | --------- | ------------------------------------------------------------- | | `id` | INT / STRING / `null` | YES | Arbitrary ID used to match responses to requests | | `method` | STRING | YES | Request method name | | `params` | OBJECT | NO | Request parameters. May be omitted if there are no parameters | - Request `id` is truly arbitrary. You can use UUIDs, sequential IDs, current timestamp, etc. The server does not interpret `id` in any way, simply echoing it back in the response. You can freely reuse IDs within a session. However, be careful to not send more than one request at a time with the same ID, since otherwise it might be impossible to tell the responses apart. - Request method names may be prefixed with explicit version: e.g., `"v3/order.place"`. - The order of `params` is not significant. ## Response format Responses are returned as JSON in **text frames**, one response per frame. Example of successful response: ```json { "id": "e2a85d9f-07a5-4f94-8d5f-789dc3deb097", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12510053279, "orderListId": -1, "clientOrderId": "a097fe6304b20a7e4fc436", "transactTime": 1655716096505, "price": "0.10000000", "origQty": "10.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1655716096505, "selfTradePreventionMode": "NONE" }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 12 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 4043 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 321 } ] } ``` Example of failed response: ```json { "id": "e2a85d9f-07a5-4f94-8d5f-789dc3deb097", "status": 400, "error": { "code": -2010, "msg": "Account has insufficient balance for requested action." }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 13 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 4044 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 322 } ] } ``` Response fields:
Name Type Mandatory Description
id INT / STRING / null YES Same as in the original request
status INT YES Response status. See Status codes
result OBJECT / ARRAY YES Response content. Present if request succeeded
error OBJECT Error description. Present if request failed
rateLimits ARRAY NO Rate limiting status. See Rate limits
### Status codes Status codes in the `status` field are the same as in HTTP. Here are some common status codes that you might encounter: - `200` indicates a successful response. - `4XX` status codes indicate invalid requests; the issue is on your side. - `400` – your request failed, see `error` for the reason. - `403` – you have been blocked by the Web Application Firewall. This can indicate a rate limit violation or a security block. See https://www.binance.com/en/support/faq/detail/360004492232 for more details. - `409` – your request partially failed but also partially succeeded, see `error` for details. - `418` – you have been auto-banned for repeated violation of rate limits. - `429` – you have exceeded API request rate limit, please slow down. - `5XX` status codes indicate internal errors; the issue is on Binance's side. - **Important:** If a response contains 5xx status code, it **does not** necessarily mean that your request has failed. Execution status is _unknown_ and the request might have actually succeeded. Please use query methods to confirm the status. You might also want to establish a new WebSocket connection for that. See [Error codes for Binance](/products/spot/errors) for a list of error codes and messages. ## Event format [User Data Stream](/products/spot/user-data-stream) events for non-SBE sessions are sent as JSON in **text frames**, one event per frame. Events in [SBE sessions](/products/spot/faqs/sbe_faq) will be sent as **binary frames**. Please refer to [`userDataStream.subscribe`](#user-data-stream-subscribe) for details on how to subscribe to User Data Stream in WebSocket API. Example of an event: ```javascript { "subscriptionId": 0, "event": { "e": "outboundAccountPosition", "E": 1728972148778, "u": 1728972148778, "B": [ { "a": "BTC", "f": "11818.00000000", "l": "182.00000000" }, { "a": "USDT", "f": "10580.00000000", "l": "70.00000000" } ] } } ``` Event fields: | Name | Type | Mandatory | Description | | :--------------- | :----- | :-------- | :----------------------------------------------------------------------------------------------------------------------------------------- | | `event` | OBJECT | YES | Event payload. See [User Data Streams](/products/spot/user-data-stream) | | `subscriptionId` | INT | NO | Identifies which subscription the event is coming from. See [User Data Stream subscriptions](#general_info_user_data_stream_subscriptions) | ## Connection events ### Server Shutdown `serverShutdown` event is sent when the server is about to shut down. ```javascript { "event": { "e": "serverShutdown", // Event Type "E": 1770123456789 // Event Time } } ``` Please establish a new connection as soon as possible to prevent interruption. ## Rate limits ### Connection limits There is a limit of **300 connections per attempt every 5 minutes**. The connection is per **IP address**. ### General information on rate limits - Current API rate limits can be queried using the [`exchangeInfo`](#exchange-information) request. - There are multiple rate limit types across multiple intervals. - Responses can indicate current rate limit status in the optional `rateLimits` field. - Requests fail with status `429` when unfilled order count or request rate limits are violated. #### How to interpret rate limits A response with rate limit status may look like this: ```json { "id": "7069b743-f477-4ae3-81db-db9b8df085d2", "status": 200, "result": { "serverTime": 1656400526260 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 70 } ] } ``` The `rateLimits` array describes all currently active rate limits affected by the request. | Name | Type | Mandatory | Description | | --------------- | ---- | --------- | ------------------------------------------------------ | | `rateLimitType` | ENUM | YES | Rate limit type: `REQUEST_WEIGHT`, `ORDERS` | | `interval` | ENUM | YES | Rate limit interval: `SECOND`, `MINUTE`, `HOUR`, `DAY` | | `intervalNum` | INT | YES | Rate limit interval multiplier | | `limit` | INT | YES | Request limit per interval | | `count` | INT | YES | Current usage per interval | Rate limits are accounted by intervals. For example, a `1 MINUTE` interval starts every minute. Request submitted at 00:01:23.456 counts towards the 00:01:00 minute's limit. Once the 00:02:00 minute starts, the count will reset to zero again. Other intervals behave in a similar manner. For example, `1 DAY` rate limit resets at 00:00 UTC every day, and `10 SECOND` interval resets at 00, 10, 20... seconds of each minute. APIs have multiple rate-limiting intervals. If you exhaust a shorter interval but the longer interval still allows requests, you will have to wait for the shorter interval to expire and reset. If you exhaust a longer interval, you will have to wait for that interval to reset, even if shorter rate limit count is zero. #### How to show/hide rate limit information `rateLimits` field is included with every response by default. However, rate limit information can be quite bulky. If you are not interested in detailed rate limit status of every request, the `rateLimits` field can be omitted from responses to reduce their size. - Optional `returnRateLimits` boolean parameter in request. Use `returnRateLimits` parameter to control whether to include `rateLimits` fields in response to individual requests. Default request and response: ```json { "id": 1, "method": "time" } ``` ```json { "id": 1, "status": 200, "result": { "serverTime": 1656400526260 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 70 } ] } ``` Request and response without rate limit status: ```json { "id": 2, "method": "time", "params": { "returnRateLimits": false } } ``` ```json { "id": 2, "status": 200, "result": { "serverTime": 1656400527891 } } ``` - Optional `returnRateLimits` boolean parameter in connection URL. If you wish to omit `rateLimits` from all responses by default, use `returnRateLimits` parameter in the query string instead: ``` wss://ws-api.binance.com:443/ws-api/v3?returnRateLimits=false ``` This will make all requests made through this connection behave as if you have passed `"returnRateLimits": false`. If you _want_ to see rate limits for a particular request, you need to explicitly pass the `"returnRateLimits": true` parameter. **Note:** Your requests are still rate limited if you hide the `rateLimits` field in responses. ### IP limits - Every request has a certain **weight**, added to your limit as you perform requests. - The heavier the request (e.g. querying data from multiple symbols), the more weight the request will cost. - Connecting to WebSocket API costs 2 weight. - Current weight usage is indicated by the `REQUEST_WEIGHT` rate limit type. - Use the [`exchangeInfo`](#exchange-information) request to keep track of the current weight limits. - Weight is accumulated **per IP address** and is shared by all connections from that address. - If you go over the weight limit, requests fail with status `429`. - This status code indicates you should back off and stop spamming the API. - Rate-limited responses include a `retryAfter` field, indicating when you can retry the request. - **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban and you will be disconnected.** - Requests from a banned IP address fail with status `418`. - `retryAfter` field indicates the timestamp when the ban will be lifted. - IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. Successful response indicating that in 1 minute you have used 70 weight out of your 6000 limit: ```json { "id": "7069b743-f477-4ae3-81db-db9b8df085d2", "status": 200, "result": [], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 70 } ] } ``` Failed response indicating that you are banned and the ban will last until epoch `1659146400000`: ```json { "id": "fc93a61a-a192-4cf4-bb2a-a8f0f0c51e06", "status": 418, "error": { "code": -1003, "msg": "Way too much request weight used; IP banned until 1659146400000. Please use WebSocket Streams for live updates to avoid bans.", "data": { "serverTime": 1659142907531, "retryAfter": 1659146400000 } }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2411 } ] } ``` ### Unfilled Order Count - Successfully placed orders update the `ORDERS` rate limit type. - Rejected or unsuccessful orders might or might not update the `ORDERS` rate limit type. - **Please note that if your orders are consistently filled by trades, you can continuously place orders on the API**. For more information, please see [Spot Unfilled Order Count Rules](/products/spot/faqs/order_count_decrement). - Use the [`account.rateLimits.orders`](#query-unfilled-order-count) request to keep track of how many orders you have placed within this interval. - If you exceed this, requests fail with status `429`. - This status code indicates you should back off and stop spamming the API. - Responses that have a status `429` include a `retryAfter` field, indicating when you can retry the request. - This is maintained **per account** and is shared by all API keys of the account. Successful response indicating that you have placed 12 orders in 10 seconds, and 4043 orders in the past 24 hours: ```json { "id": "e2a85d9f-07a5-4f94-8d5f-789dc3deb097", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12510053279, "orderListId": -1, "clientOrderId": "a097fe6304b20a7e4fc436", "transactTime": 1655716096505, "price": "0.10000000", "origQty": "10.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1655716096505, "selfTradePreventionMode": "NONE" }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 12 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 4043 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 321 } ] } ``` ## Request security - Each method has a security type indicating required API key permissions, shown next to the method name (e.g., [Place new order (TRADE)](#place-new-order-trade)). - If unspecified, the security type is `NONE`. - Except for `NONE`, all methods with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](#user-data-stream-requests). - Secure methods require a valid API key to be specified and authenticated. - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. - API keys can be configured to allow access only to certain types of secure methods. - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. | Security type | Description | | ------------- | -------------------------------------------------------------------------- | | `NONE` | Public market data | | `TRADE` | Trading on the exchange, placing and canceling orders | | `USER_DATA` | Private account information, such as order status and your trading history | | `USER_STREAM` | Managing User Data Stream subscriptions | ### SIGNED request security - `SIGNED` requests require an additional parameter: `signature`, authorizing the request. #### Signature Case Sensitivity - **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. - **RSA:** Signatures generated using RSA are **case-sensitive**. - **Ed25519:** Signatures generated using ED25519 are also **case-sensitive** Please consult [SIGNED request example (HMAC)](#signed-request-example-hmac), [SIGNED request example (RSA)](#signed-request-example-rsa), and [SIGNED request example (Ed25519)](#signed-request-example-ed25519) on how to compute signature, depending on which API key type you are using. ### Timing security - `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](#general-api-information)) - An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. - Maximum `recvWindow` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` **Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. **It is recommended to use a small `recvWindow` of 5000 or less!** ### SIGNED request example (HMAC) Here is a step-by-step guide on how to sign requests using an HMAC secret key. Example API key and secret key: | Key | Value | | ----------- | ------------------------------------------------------------------ | | `apiKey` | `vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A` | | `secretKey` | `NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j` | **WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: ```json { "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "------ FILL ME ------" } } ``` Example of a request with a symbol name containing non-ASCII characters: ```json { "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "BUY", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "------ FILL ME ------" } } ``` As you can see, the `signature` parameter is currently missing. **Step 1: Construct the signature payload** Take all request `params` except `signature` and **sort them in alphabetical order by parameter name**: For the first set of example parameters (ASCII only): | Parameter | Value | | ------------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `price` | 52000.00 | | `quantity` | 0.01000000 | | `recvWindow` | 100 | | `side` | SELL | | `symbol` | BTCUSDT | | `timeInForce` | GTC | | `timestamp` | 1645423376532 | | `type` | LIMIT | For the second set of example parameters (some non-ASCII characters): | Parameter | Value | | ------------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `price` | 0.10000000 | | `quantity` | 1.00000000 | | `recvWindow` | 5000 | | `side` | BUY | | `symbol` | 123456 | | `timeInForce` | GTC | | `timestamp` | 1645423376532 | | `type` | LIMIT | Format parameters as `parameter=value` pairs separated by `&`. Values need to be encoded in UTF-8. For the first set of example parameters (ASCII only), the signature payload should look like this: ```console apiKey=vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT ``` For the second set of example parameters (some non-ASCII characters), the signature payload should look like this: ```console apiKey=vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT ``` **Step 2: Compute the signature** 1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. 2. Sign the UTF-8 bytes of the signature payload constructed in Step 1. 3. Encode the HMAC-SHA-256 output as a hex string. Note that `apiKey`, `secretKey`, and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. You can cross-check your signature algorithm implementation with OpenSSL: For the first set of example parameters (ASCII only): ```console $ echo -n 'apiKey=vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT' \ | openssl dgst -hex -sha256 -hmac 'NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j' aa1b5712c094bc4e57c05a1a5c1fd8d88dcd628338ea863fec7b88e59fe2db24 ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'apiKey=vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT' \ | openssl dgst -hex -sha256 -hmac 'NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j' b33892ae8e687c939f4468c6268ddd4c40ac1af18ad19a064864c47bae0752cd ``` **Step 3: Add `signature` to request `params`** Complete the request by adding the `signature` parameter with the signature string. For the first set of example parameters (ASCII only): ```json { "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "aa1b5712c094bc4e57c05a1a5c1fd8d88dcd628338ea863fec7b88e59fe2db24" } } ``` For the second set of example parameters (some non-ASCII characters): ```json { "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "BUY", "type": "LIMIT", "timeInForce": "GTC", "quantity": "1.00000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "b33892ae8e687c939f4468c6268ddd4c40ac1af18ad19a064864c47bae0752cd" } } ``` ### SIGNED request example (RSA) Here is a step-by-step guide on how to sign requests using an RSA private key. | Key | Value | | -------- | ------------------------------------------------------------------ | | `apiKey` | `CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ` | These examples assume the private key is stored in the file `test-rsa-prv.pem`. **WARNING: DO NOT SHARE YOUR API KEY AND PRIVATE KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: ```json { "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ", "signature": "------ FILL ME ------" } } ``` Example of a request with a symbol name containing non-ASCII characters: ```json { "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "BUY", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ", "signature": "------ FILL ME ------" } } ``` **Step 1: Construct the signature payload** Take all request `params` except `signature` and **sort them in alphabetical order by parameter name**: For the first set of example parameters (ASCII only): | Parameter | Value | | ------------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | | `price` | 52000.00 | | `quantity` | 0.01000000 | | `recvWindow` | 100 | | `side` | SELL | | `symbol` | BTCUSDT | | `timeInForce` | GTC | | `timestamp` | 1645423376532 | | `type` | LIMIT | For the second set of example parameters (some non-ASCII characters): | Parameter | Value | | ------------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | | `price` | 0.10000000 | | `quantity` | 1.00000000 | | `recvWindow` | 5000 | | `side` | BUY | | `symbol` | 123456 | | `timeInForce` | GTC | | `timestamp` | 1645423376532 | | `type` | LIMIT | Format parameters as `parameter=value` pairs separated by `&`. Values need to be encoded in UTF-8. For the first set of example parameters (ASCII only), the signature payload should look like this: ```console apiKey=CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT ``` For the second set of example parameters (some non-ASCII characters), the signature payload should look like this: ```console apiKey=CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT ``` **Step 2: Compute the signature** 1. Sign the UTF-8 bytes of the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function. 2. Encode the output in base64. Note that `apiKey`, the payload, and the resulting `signature` are **case-sensitive**. You can cross-check your signature algorithm implementation with OpenSSL: For the first set of example parameters (ASCII only): ```console $ echo -n 'apiKey=CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT' \ | openssl dgst -sha256 -sign test-rsa-prv.pem \ | openssl enc -base64 -A OJJaf8C/3VGrU4ATTR4GiUDqL2FboSE1Qw7UnnoYNfXTXHubIl1iaePGuGyfct4NPu5oVEZCH4Q6ZStfB1w4ssgu0uiB/Bg+fBrRFfVgVaLKBdYHMvT+ljUJzqVaeoThG9oXlduiw8PbS9U8DYAbDvWN3jqZLo4Z2YJbyovyDAvDTr/oC0+vssLqP7NmlNb3fF3Bj7StmOwJvQJTbRAtzxK5PP7OQe+0mbW+D7RqVkUiSswR8qJFWTeSe4nXXNIdZdueYhF/Xf25L+KitJS5IHdIHcKfEw3MQzHFb2ZsGWkjDQwxkwr7Noi0Zaa+gFtxCuatGFm9dFIyx217pmSHtA== ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'apiKey=CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT' \ | openssl dgst -sha256 -sign test-rsa-prv.pem \ | openssl enc -base64 -A F3o/79Ttvl2cVYGPfBOF3oEOcm5QcYmTYWpdVIrKve5u+8paMNDAdUE+teqMxFM9HcquetGcfuFpLYtsQames5bDx/tskGM76TWW8HaM+6tuSYBSFLrKqChfA9hQGLYGjAiflf1YBnDhY+7vNbJFusUborNOloOj+ufzP5q42PvI3H0uNy3W5V3pyfXpDGCBtfCYYr9NAqA4d+AQfyllL/zkO9h9JSdozN49t0/hWGoD2dWgSO0Je6MytKEvD4DQXGeqNlBTB6tUXcWnRW+FcaKZ4KYqnxCtb1u8rFXUYgFykr2CbcJLSmw6ydEJ3EZ/NaZopRr+cU0W2m0HZ3qucw== ``` **Step 3: Add `signature` to request `params`** Complete the request by adding the `signature` parameter with the signature string. For the first set of example parameters (ASCII only): ```json { "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "newOrderRespType": "ACK", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ", "signature": "OJJaf8C/3VGrU4ATTR4GiUDqL2FboSE1Qw7UnnoYNfXTXHubIl1iaePGuGyfct4NPu5oVEZCH4Q6ZStfB1w4ssgu0uiB/Bg+fBrRFfVgVaLKBdYHMvT+ljUJzqVaeoThG9oXlduiw8PbS9U8DYAbDvWN3jqZLo4Z2YJbyovyDAvDTr/oC0+vssLqP7NmlNb3fF3Bj7StmOwJvQJTbRAtzxK5PP7OQe+0mbW+D7RqVkUiSswR8qJFWTeSe4nXXNIdZdueYhF/Xf25L+KitJS5IHdIHcKfEw3MQzHFb2ZsGWkjDQwxkwr7Noi0Zaa+gFtxCuatGFm9dFIyx217pmSHtA==" } } ``` For the second set of example parameters (some non-ASCII characters): ```json { "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "1.00000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ", "signature": "F3o/79Ttvl2cVYGPfBOF3oEOcm5QcYmTYWpdVIrKve5u+8paMNDAdUE+teqMxFM9HcquetGcfuFpLYtsQames5bDx/tskGM76TWW8HaM+6tuSYBSFLrKqChfA9hQGLYGjAiflf1YBnDhY+7vNbJFusUborNOloOj+ufzP5q42PvI3H0uNy3W5V3pyfXpDGCBtfCYYr9NAqA4d+AQfyllL/zkO9h9JSdozN49t0/hWGoD2dWgSO0Je6MytKEvD4DQXGeqNlBTB6tUXcWnRW+FcaKZ4KYqnxCtb1u8rFXUYgFykr2CbcJLSmw6ydEJ3EZ/NaZopRr+cU0W2m0HZ3qucw==" } } ``` ### SIGNED Request Example (Ed25519) **Note: It is highly recommended to use Ed25519 API keys as they will provide the best performance and security out of all supported key types.** Here is a step-by-step guide on how to sign requests using an Ed25519 private key. | Key | Value | | -------- | ------------------------------------------------------------------ | | `apiKey` | `4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO` | These examples assume the private key is stored in the file `test-ed25519-prv.pem`. **WARNING: DO NOT SHARE YOUR API KEY AND PRIVATE KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: ```json { "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO", "signature": "------ FILL ME ------" } } ``` Example of a request with a symbol name containing non-ASCII characters: ```json { "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "BUY", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO", "signature": "------ FILL ME ------" } } ``` **Step 1: Construct the signature payload** Take all request `params` except `signature` and **sort them in alphabetical order by parameter name**: For the first set of example parameters (ASCII only): | Parameter | Value | | ------------- | ---------------------------------------------------------------- | | `apiKey` | 4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO | | `price` | 52000.00 | | `quantity` | 0.01000000 | | `recvWindow` | 100 | | `side` | SELL | | `symbol` | BTCUSDT | | `timeInForce` | GTC | | `timestamp` | 1645423376532 | | `type` | LIMIT | For the second set of example parameters (some non-ASCII characters): | Parameter | Value | | ------------- | ---------------------------------------------------------------- | | `apiKey` | 4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO | | `price` | 0.20000000 | | `quantity` | 1.00000000 | | `recvWindow` | 5000 | | `side` | SELL | | `symbol` | 123456 | | `timeInForce` | GTC | | `timestamp` | 1668481559918 | | `type` | LIMIT | Format parameters as `parameter=value` pairs separated by `&`. Values need to be encoded in UTF-8. For the first set of example parameters (ASCII only), the signature payload should look like this: ```console apiKey=4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT ``` For the second set of example parameters (some non-ASCII characters), the signature payload should look like this: ```console apiKey=4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT ``` **Step 2: Compute the signature** 1. Sign the UTF-8 bytes of your signature payload constructed in Step 1 using the Ed25519 private key. 2. Encode the output in base64. Note that `apiKey`, the payload, and the resulting `signature` are **case-sensitive**. You can cross-check your signature algorithm implementation with OpenSSL: For the first set of example parameters (ASCII only): ```console echo -n "apiKey=4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT" \ | openssl dgst -sign ./test-ed25519-prv.pem \ | openssl enc -base64 -A EocljwPl29jDxWYaaRaOo4pJ9wEblFbklJvPugNscLLuKd5vHM2grWjn1z+rY0aJ7r/44enxHL6mOAJuJ1kqCg== ``` For the second set of example parameters (some non-ASCII characters): ```console echo -n "apiKey=4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT" \ | openssl dgst -sign ./test-ed25519-prv.pem \ | openssl enc -base64 -A dtNHJeyKry+cNjiGv+sv5kynO9S40tf8k7D5CfAEQAp0s2scunZj+ovJdz2OgW8XhkB9G3/HmASkA9uY9eyFCA== ``` **Step 3: Add the signature to request `params`** For the first set of example parameters (ASCII only): ```json { "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "newOrderRespType": "ACK", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO", "signature": "EocljwPl29jDxWYaaRaOo4pJ9wEblFbklJvPugNscLLuKd5vHM2grWjn1z+rY0aJ7r/44enxHL6mOAJuJ1kqCg==" } } ``` For the second set of example parameters (some non-ASCII characters): ```json { "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "1.00000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO", "signature": "dtNHJeyKry+cNjiGv+sv5kynO9S40tf8k7D5CfAEQAp0s2scunZj+ovJdz2OgW8XhkB9G3/HmASkA9uY9eyFCA==" } } ``` Here is a sample Python script performing all the steps above: ```python #!/usr/bin/env python3 import base64 import time import json from cryptography.hazmat.primitives.serialization import load_pem_private_key from websocket import create_connection # Set up authentication API_KEY='put your own API Key here' PRIVATE_KEY_PATH='test-prv-key.pem' # Load the private key. # In this example the key is expected to be stored without encryption, # but we recommend using a strong password for improved security. with open(PRIVATE_KEY_PATH, 'rb') as f: private_key = load_pem_private_key(data=f.read(), password=None) # Set up the request parameters params = { 'apiKey': API_KEY, 'symbol': '123456', 'side': 'SELL', 'type': 'LIMIT', 'timeInForce': 'GTC', 'quantity': '1.0000000', 'price': '0.10000000', 'recvWindow': 5000 } # Timestamp the request timestamp = int(time.time() * 1000) # UNIX timestamp in milliseconds params['timestamp'] = timestamp # Sort parameters alphabetically by name params = dict(sorted(params.items())) # Compute the signature payload payload = '&'.join([f"{k}={v}" for k,v in params.items()]) # no percent encoding here! # Sign the request signature = base64.b64encode(private_key.sign(payload.encode('UTF-8'))) params['signature'] = signature.decode('ASCII') # Send the request request = { 'id': 'my_new_order', 'method': 'order.place', 'params': params } ws = create_connection("wss://ws-api.binance.com:443/ws-api/v3") ws.send(json.dumps(request)) result = ws.recv() ws.close() print(result) ``` ## Session Authentication **Note:** Only _Ed25519_ keys are supported for this feature. If you do not want to specify `apiKey` and `signature` in each individual request, you can authenticate your API key for the active WebSocket session. Once authenticated, you no longer have to specify `apiKey` and `signature` for those requests that need them. Requests will be performed on behalf of the account owning the authenticated API key. **Note:** You still have to specify the `timestamp` parameter for `SIGNED` requests. ### Authenticate after connection You can authenticate an already established connection using session authentication requests: - [`session.logon`](#log-in-with-api-key-signed) – authenticate, or change the API key associated with the connection - [`session.status`](#query-session-status) – check connection status and the current API key - [`session.logout`](#log-out-of-the-session) – forget the API key associated with the connection **Regarding API key revocation:** If during an active session the API key becomes invalid for _any reason_ (e.g. IP address is not whitelisted, API key was deleted, API key doesn't have correct permissions, etc), after the next request the session will be revoked with the following error message: ```javascript { "id": null, "status": 401, "error": { "code": -2015, "msg": "Invalid API-key, IP, or permissions for action." } } ``` ### Authorize _ad hoc_ requests Only one API key can be authenticated with the WebSocket connection. The authenticated API key is used by default for requests that require an `apiKey` parameter. However, you can always specify the `apiKey` and `signature` explicitly for individual requests, overriding the authenticated API key and using a different one to authorize a specific request. For example, you might want to authenticate your `USER_DATA` key to be used by default, but specify the `TRADE` key with an explicit signature when placing orders. ## Data sources - The API system is asynchronous. Some delay in the response is normal and expected. - Each method has a data source indicating where the data is coming from, and thus how up-to-date it is. | Data Source | Latency | Description | | --------------- | -------- | ---------------------------------------------------------------- | | Matching Engine | lowest | The Matching Engine produces the response directly | | Memory | low | Data is fetched from API server's local or external memory cache | | Database | moderate | Data is retrieved from the database | - Some methods have more than one data source (e.g., Memory => Database). This means that the API will look for the latest data in that order: first in the cache, then in the database. --- ## Document: /products/spot/user-data-stream URL: /en/dev-docs/products/spot/user-data-stream # User Data Streams for Binance ## General information - Subscribe via the [WebSocket API](/products/spot/web-socket-api#user-data-stream-subscribe) using an API Key. - Both [SBE](/products/spot/faqs/sbe_faq) and JSON output are supported. - Account events are pushed in **real-time**. - All timestamps in JSON payloads are in **milliseconds by default**. - Events may contain non-ASCII characters encoded in UTF-8 if you own or trade any assets or symbols whose names contain non-ASCII characters. ## User Data Stream Events ### Account Update `outboundAccountPosition` is sent any time an account balance has changed and contains the assets that were possibly changed by the event that generated the balance change. > **Schema:** > [`outboundAccountPosition`](/catalog/core-trading-spot-trading/api/ws-streams/~schemas#outboundaccountposition) ### Balance Update Balance Update occurs during the following: - Deposits or withdrawals from the account - Transfer of funds between accounts (e.g. Spot to Margin) **Payload** > **Schema:** > [`balanceUpdate`](/catalog/core-trading-spot-trading/api/ws-streams/~schemas#balanceupdate) ### Order Update Orders are updated with the `executionReport` event. **Payload:** > **Schema:** > [`executionReport`](/catalog/core-trading-spot-trading/api/ws-streams/~schemas#executionreport) **Note:** Average price can be found by doing `Z` divided by `z`. #### Conditional Fields in Execution Report These are fields that appear in the payload only if certain conditions are met. For additional information on these parameters, please refer to the [Spot Glossary](/products/spot/faqs/spot_glossary). | Field | Name | Description | | ----- | ----------------------------- | ------------------------------------------------------------------------------- | | `d` | Trailing Delta | Appears only for trailing stop orders. | | `D` | Trailing Time | Appears only for trailing stop orders. | | `j` | Strategy Id | Appears only if the `strategyId` parameter was provided upon order placement. | | `J` | Strategy Type | Appears only if the `strategyType` parameter was provided upon order placement. | | `v` | Prevented Match Id | Appears only for orders that expired due to STP. | | `A` | Prevented Quantity | Appears only for orders that expired due to STP. | | `B` | Last Prevented Quantity | Appears only for orders that expired due to STP. | | `u` | Trade Group Id | Appears only for orders that expired due to STP. | | `U` | Counter Order Id | Appears only for orders that expired due to STP. | | `Cs` | Counter Symbol | Appears only for orders that expired due to STP. | | `pl` | Prevented Execution Quantity | Appears only for orders that expired due to STP. | | `pL` | Prevented Execution Price | Appears only for orders that expired due to STP. | | `pY` | Prevented Execution Quote Qty | Appears only for orders that expired due to STP. | | `W` | Working Time | Appears when the order is working on the book | | `b` | Match Type | Appears for orders that have allocations | | `a` | Allocation ID | Appears for orders that have allocations | | `k` | Working Floor | Appears for orders that potentially have allocations | | `uS` | UsedSor | Appears for orders that used SOR | | `gP` | Pegged Price Type | Appears only for Pegged Orders | | `gOT` | Pegged Offset Type | Appears only for Pegged Orders | | `gOV` | Pegged Offset Value | Appears only for Pegged Orders | | `gp` | Pegged Price | Appears only for Pegged Orders | #### Order Reject Reason For additional details, look up the Error Message in the [Errors](/products/spot/errors#other-errors) documentation. | Rejection Reason (`r`) | Error Message | | -------------------------------------- | --------------------------------------------------------------- | | `NONE` | N/A (i.e. The order was not rejected.) | | `INSUFFICIENT_BALANCES` | "Account has insufficient balance for requested action." | | `STOP_PRICE_WOULD_TRIGGER_IMMEDIATELY` | "Order would trigger immediately." | | `WOULD_MATCH_IMMEDIATELY` | "Order would immediately match and take." | | `OCO_BAD_PRICES` | "The relationship of the prices for the orders is not correct." | If the order is an order list, an event named `ListStatus` will be sent in addition to the `executionReport` event. **Payload** > **Schema:** [`listStatus`](/catalog/core-trading-spot-trading/api/ws-streams/~schemas#liststatus) **Execution types:** - `NEW` - The order has been accepted into the engine. - `CANCELED` - The order has been canceled by the user. - `REPLACED` - The order has been amended. - `REJECTED` - The order has been rejected and was not processed (e.g. Cancel Replace Orders wherein the new order placement is rejected but the request to cancel request succeeds.) - `TRADE` - Part of the order or all of the order's quantity has filled. - `EXPIRED` - The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill) or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance). - `TRADE_PREVENTION` - The order has expired due to STP. Check the [Enums page](/products/spot/enums) for more relevant enum definitions. ## Event Stream Terminated `eventStreamTerminated` is sent when: - [A listen token subscription](/products/margin-trading/trade-data-stream/Listen-Token-Websocket-API#subscribe-to-user-data-stream-using-listentoken-user_stream) expires due to token expiration. - A [logon subscription](/products/spot/web-socket-api#log-in-with-api-key-signed) ends after sending [`session.logout`](/products/spot/web-socket-api#log-out-of-the-session) method. - The subscription is stopped via the [`userDataStream.unsubscribe`](/products/spot/web-socket-api#unsubscribe-from-user-data-stream) method. **Payload:** > **Schema:** > [`eventStreamTerminated`](/catalog/core-trading-spot-trading/api/ws-streams/~schemas#eventstreamterminated) ## External Lock Update `externalLockUpdate` is sent when part of your spot wallet balance is locked/unlocked by an external system, for example when used as margin collateral. **Payload:** > **Schema:** > [`externalLockUpdate`](/catalog/core-trading-spot-trading/api/ws-streams/~schemas#externallockupdate) --- ## Document: /products/spot/sbe-market-data-streams URL: /en/dev-docs/products/spot/sbe-market-data-streams # SBE Market Data Streams ## General Information - The base endpoint is **stream-sbe.binance.com** or **stream-sbe.binance.com:9443**. - To retrieve market data in JSON format, please refer to [this page](web-socket-streams.md). - SBE schema used for decoding the streams can be found [here](/products/spot/sbe/schemas/stream_1_0.xml). - All symbols in stream names are **lowercase**. - You can subscribe to a single stream at **/ws/\**. - You can subscribe to multiple streams at **/stream?streams=\/\/\**. - A single connection to **stream-sbe.binance.com** is **only valid for 24 hours**; expect to be disconnected at the 24 hour mark. - A [`serverShutdown`](#serverShutdown) event will be sent when the server is about to shutdown, resulting in disconnection. Please establish a new connection as soon as possible to prevent interruption. - All time and timestamp fields are in **microseconds**. - **An API Key is necessary for access**. - Only Ed25519 keys are allowed. - Please put your API Key in the `X-MBX-APIKEY` header when opening the connection. Timestamp and signature are not necessary. - No extra API key permissions are necessary to access public market data. Symbol whitelist also does not affect access to SBE Market Data Streams. - However, if you use an IP whitelist for the API key, only specified IP addresses are allowed to use the API key. - The server sends a `ping frame` every 20 seconds. - If the server does not receive a `pong frame` back from you within a minute, the connection will be closed. - When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible. - Unsolicited `pong frames` are allowed, but will not prevent disconnection. **It is recommended that the payload for these pong frames are empty.** - [Live Subscribing and Unsubscribing](web-socket-streams.md#live-subscribingunsubscribing-to-streams) is also supported. - You must send subscription requests in JSON in WebSocket text frames. You will receive subscription responses in JSON in WebSocket text frames. - You will receive [`serverShutdown`](#serverShutdown) events in JSON in WebSocket text frames. - You will receive market data events in SBE in WebSocket binary frames. - If your request contains a symbol name containing non-ASCII characters, then the stream events may contain non-ASCII characters encoded in UTF-8. ## WebSocket Limits - WebSocket connections have a rate limit of **5 requests per second**. - Only messages from your client are considered: - `PING frame` - `PONG frame` - `Text frame` with JSON control request - Events pushed by the server are not rate-limited. - Connections that go beyond the limit will be closed. Repeatedly disconnected IP addresses may be banned. - A single connection can listen to a maximum of 1024 streams. - There is a limit of **300 connection attempts every 5 minutes per IP address**. ## Server Shutdown `serverShutdown` event is sent when the server is about to shut down. Note that this message will be in JSON. ```javascript { "e": "serverShutdown", // Event type "E": 1770123456789 // Event time } ``` Please establish a new connection as soon as possible to prevent interruption. ## Available Streams ### Trades Streams Raw trade information, pushed in real-time. **SBE Message Name:** `TradesStreamEvent` **Stream Name**: \@trade **Update Speed**: Real time ### Best Bid/Ask Streams The best bid and ask price and quantity, pushed in real-time when the order book changes. > [!NOTE] Best bid/ask streams in SBE are the equivalent of bookTicker streams in JSON, except they > support auto-culling, and also include the `eventTime` field. **SBE Message Name:** `BestBidAskStreamEvent` **Stream Name**: \@bestBidAsk **Update Speed**: Real time SBE best bid/ask streams use **auto-culling**: when the system is under high load, it may drop outdated events instead of queuing all events and delivering them with a delay. For example, if a best bid/ask event is generated at time T2 when there is still an undelivered event queued at time T1 (where T1 < T2), the event for T1 is dropped, and the system will deliver only the event for T2. This is done on a per-symbol basis. ### Diff. Depth Streams Incremental updates to the order book, pushed at regular intervals. Use this stream to maintain a local order book. [How to manage a local order book.](web-socket-streams.md#how-to-manage-a-local-order-book-correctly) **SBE Message Name:** `DepthDiffStreamEvent` **Stream Name**: \@depth **Update Speed:** 25ms ### Partial Book Depth Streams Snapshots of the top 20 levels of the order book, pushed at regular intervals. **SBE Message Name:** `DepthSnapshotStreamEvent` **Stream Name**: \@depth20 **Update Speed:** 50ms --- ## Document: /products/spot/rest-api URL: /en/dev-docs/products/spot/rest-api # General REST API Information - The following base endpoints are available. Please use whichever works best for your setup: - **https://api.binance.com** - **https://api-gcp.binance.com** - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** - The last 4 endpoints in the point above (`api1`-`api4`) should give better performance but have less stability. - Responses are in JSON by default. To receive responses in SBE, refer to the [SBE FAQ](/products/spot/faqs/sbe_faq) page. - Data is returned in **chronological order**, unless noted otherwise. - Without `startTime` or `endTime`, returns the most recent items up to the limit. - With `startTime`, returns oldest items from `startTime` up to the limit. - With `endTime`, returns most recent items up to `endTime` and the limit. - With both, behaves like `startTime` but does not exceed `endTime`. - All time and timestamp related fields in the JSON responses are in **milliseconds by default.** To receive the information in microseconds, please add the header `X-MBX-TIME-UNIT:MICROSECOND` or `X-MBX-TIME-UNIT:microsecond`. - We support HMAC, RSA, and Ed25519 keys. For more information, please see [API Key types](/products/spot/faqs/api_key_types). - Timestamp parameters (e.g. `startTime`, `endTime`, `timestamp`) can be passed in milliseconds or microseconds. - For APIs that only send public market data, please use the base endpoint **https://data-api.binance.vision**. Please refer to [Market Data Only](/products/spot/faqs/market_data_only) page. - If there are enums or terms you want clarification on, please see the [SPOT Glossary](/products/spot/faqs/spot_glossary) for more information. - APIs have a timeout of 10 seconds when processing a request. If a response from the Matching Engine takes longer than this, the API responds with "Timeout waiting for response from backend server. Send status unknown; execution status unknown." [(-1007 TIMEOUT)](/products/spot/errors#-1007-timeout) - This does not always mean that the request failed in the Matching Engine. - If the status of the request has not appeared in [User Data Stream](/products/spot/user-data-stream), please perform an API query for its status. - **Please avoid SQL keywords in requests** as they may trigger a security block by a WAF (Web Application Firewall) rule. See https://www.binance.com/en/support/faq/detail/360004492232 for more details. - If your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. - Some endpoints may return asset and/or symbol names containing non-ASCII characters encoded in UTF-8 even if the request did not contain non-ASCII characters. ## HTTP Return Codes - HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. - HTTP `403` return code is used when a WAF (Web Application Firewall) rule has been violated. This can indicate a rate limit violation or a security block. See https://www.binance.com/en/support/faq/detail/360004492232 for more details. - HTTP `409` return code is used when a cancelReplace order partially succeeds. (i.e. if the cancellation of the order fails but the new order placement succeeds.) - HTTP `429` return code is used when breaking a request rate limit. - HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. - HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. ## Error Codes - Any endpoint can return an ERROR Sample Payload below: ```javascript { "code": -1121, "msg": "Invalid symbol." } ``` - Specific error codes and messages are defined in [Errors Codes](/products/spot/errors). ## General Information on Endpoints - For `GET` endpoints, parameters must be sent as a `query string`. - For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. - Parameters may be sent in any order. - If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. ## LIMITS ### General Info on Limits - The following `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". - The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. - Requests fail with HTTP status code 429 when you exceed the request rate limit. ### IP Limits - Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. - When a 429 is received, it's your obligation as an API to back off and not spam the API. - **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** - IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. - A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - **The limits on the API are based on the IPs, not the API keys.** ### Unfilled Order Count - Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header indicating how many orders you have placed for that interval.

To monitor this, refer to [`GET api/v3/rateLimit/order`](#query-unfilled-order-count). - Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - If you have exceeded this, you will receive a 429 error with the `Retry-After` header. - **Please note that if your orders are consistently filled by trades, you can continuously place orders on the API**. For more information, please see [Spot Unfilled Order Count Rules](/products/spot/faqs/order_count_decrement). - **The number of unfilled orders is tracked for each account.** ## Data Sources - The API system is asynchronous, so some delay in the response is normal and expected. - Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. These are the three sources, ordered by least to most potential for delays in data updates. - **Matching Engine** - the data is from the Matching Engine - **Memory** - the data is from a server's local or external memory - **Database** - the data is taken directly from a database Some endpoints can have more than 1 data source. (e.g. Memory => Database) This means that the endpoint will check the first Data Source, and if it cannot find the value it's looking for it will check the next one. ## Request Security - Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](#new-order-trade)). - If unspecified, the security type is `NONE`. - Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`). - Secure endpoints require a valid API key to be specified and authenticated. - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. - API keys can be configured to allow access only to certain types of secure endpoints. - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. | Security type | Description | | ------------- | -------------------------------------------------------------------------- | | `NONE` | Public market data | | `TRADE` | Trading on the exchange, placing and canceling orders | | `USER_DATA` | Private account information, such as order status and your trading history | | `USER_STREAM` | Managing User Data Stream subscriptions | ### SIGNED Endpoint security - `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. #### Signature Case Sensitivity - **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. - **RSA:** Signatures generated using RSA are **case-sensitive**. - **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** Please consult [SIGNED request example (HMAC)](#hmac-keys), [SIGNED request example (RSA)](#rsa-keys), and [SIGNED request example (Ed25519)](#ed25519-keys) on how to compute signature, depending on which API key type you are using. ### Timing security - `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](#general-api-information)) - An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. - Maximum `recvWindow` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` **Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. **It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** ### SIGNED Endpoint Examples for POST /api/v3/order #### HMAC Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. Example API key and secret key: | Key | Value | | ----------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `secretKey` | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j | **WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | LTCBTC | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` **Step 2: Compute the signature** 1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. 2. Sign the signature payload constructed in Step 1. 3. Encode the HMAC-SHA-256 output as a hex string. Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. **Example commands** For the first set of example parameters (ASCII only): ```console $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" ``` For the second set of example parameters (some non-ASCII characters) ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" ``` Here is a sample Bash script performing all the steps above: ```bash apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" # Sign the request signature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey") signature=${signature#*= } # Keep only the part after the "= " # Send the request curl -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?$payload&signature=$signature" ``` #### RSA Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. Only `PKCS#8` keys are supported. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. These examples assume the private key is stored in the file `./test-prv-key.pem`. | Key | Value | | -------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | BTCUSDT | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` **Step 2: Compute the signature** 1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function. 2. Encode the output in base64. Note that the payload and the resulting `signature` are **case-sensitive**. For the first set of example parameters (ASCII only): ```console $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== ``` 3. Percent-encode the base64 string. For the first set of example parameters (ASCII only): ```console HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D ``` For the second set of example parameters (some non-ASCII characters): ```console qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' ``` For the second set of example parameters (some non-ASCII characters): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' ``` Here is a sample Bash script performing all the steps above: ```bash function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos [!NOTE] This API can only be used with the SPOT Exchange. ## General API Information - FIX connections require TLS encryption. Please either use native TCP+TLS connection or set up a local proxy such as [stunnel](https://www.stunnel.org/) to handle TLS encryption. - APIs have a timeout of 10 seconds when processing a request. If a response from the Matching Engine takes longer than this, the API responds with "Timeout waiting for response from backend server. Send status unknown; execution status unknown." [(-1007 TIMEOUT)](errors.md#-1007-timeout) - This does not always mean that the request failed in the Matching Engine. - If the status of the request has not appeared in [User Data Stream](user-data-stream.md), please perform an API query for its status. - If your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. - To ensure uninterrupted connectivity, please make sure that your client sends **SNI (Server Name Indication)** during the TLS handshake and performs certificate validation against the intended hostname.
Clients that do not send SNI may receive an unexpected certificate, which can result in TLS handshake or hostname verification failures.
Example implementations ### NodeJS If you are using Node.js and connecting via raw TLS sockets (`tls.connect()`), you must explicitly set the servername option. Please refer to the sample below: ```javascript const tls = require("tls"); const hostname = "fix-dc.binance.com"; //EXAMPLE const options = { host: hostname, port: 9002, servername: hostname, // enables SNI }; ``` Note that: NodeJS doesn't enable SNI by default for TLS (See [https://nodejs.org/api/tls.html#tlsconnectoptions-callback](https://nodejs.org/api/tls.html#tlsconnectoptions-callback)).
If you are using standard HTTPS libraries in Node.js (e.g., `https.request()`, `axios`, `fetch`), these typically set SNI automatically when connecting via a hostname/URL. ### Other languages/custom TLS implementations When using custom TLS agents / TLS APIs, ensure you set the equivalent field (often named `server_hostname`, `hostname`, or `ServerName`) to the endpoint hostname so SNI is sent.
**FIX sessions only support Ed25519 keys.**
Please refer to [this tutorial](https://www.binance.com/en/support/faq/how-to-generate-an-ed25519-key-pair-to-send-api-requests-on-binance-6b9a63f1e3384cf48a2eedb82767a69a) on how to set up an Ed25519 key pair. ### FIX API Order Entry sessions - Endpoint is: `tcp+tls://fix-oe.binance.com:9000` - Supports placing orders, canceling orders, and querying current limit usage. - Supports receiving all of the account's [ExecutionReport`<8>`](#executionreport) and [List Status``](#liststatus). - Only API keys with `FIX_API` are allowed to connect. - QuickFIX Schema can be found [here](/products/spot/fix/schemas/spot-fix-oe.xml). ### FIX API Drop Copy sessions - Endpoint is: `tcp+tls://fix-dc.binance.com:9000` - Supports receiving all of the account's [ExecutionReport`<8>`](#executionreport) and [List Status``](#liststatus). - Only API keys with `FIX_API` or `FIX_API_READ_ONLY` are allowed to connect. - QuickFIX Schema can be found [here](/products/spot/fix/schemas/spot-fix-oe.xml). - Data in Drop Copy sessions is delayed by 1 second. ### FIX API Market Data sessions - Endpoint is: `tcp+tls://fix-md.binance.com:9000` - Supports market data streams and active instruments queries. - Does not support placing or canceling orders. - Only API keys with `FIX_API` or `FIX_API_READ_ONLY` are allowed to connect. - QuickFIX Schema can be found [here](/products/spot/fix/schemas/spot-fix-md.xml). ### FIX Connection Lifecycle - All FIX API sessions will remain open for as long as possible, on a best-effort basis. - There is no minimum connection time guarantee; a server can enter maintenance at any time. - When a server enters maintenance, a [News ``](#news) message will be sent to clients **every 10 seconds until disconnection**, prompting clients to reconnect. Upon receiving this message, a client is expected to establish a new session and close the old one. If the client does not close the old session before the server disconnects it, the server will proceed to log it out and close the session. - After connecting, the client must send a Logon `` request. For more information please refer to [How to sign a Logon request](#signaturecomputation). - The client should send a Logout `<5>` message to close the session before disconnecting. Failure to send the logout message will result in the session’s `SenderCompID (49)` being unusable for new session establishment for a duration of 2x the `HeartInt (108)` interval. - The system allows negotiation of the `HeartInt (108)` value during the logon process. Accepted values range between 5 and 60 seconds. - If the server has not sent any messages within a `HeartInt (108)` interval, a [HeartBeat `<0>`](#heartbeat) will be sent. - If the server has not received any messages within a `HeartInt (108)` interval, a [TestRequest `<1>`](#testrequest) will be sent. If the server does not receive a HeartBeat `<0>` containing the expected `TestReqID (112)` from the client within `HeartInt (108)` seconds, the server will send a Logout `<5>` message and close the connection. - If the client has not received any messages within a `HeartInt (108)` interval, the client is responsible for sending a TestRequest `<1>` to ensure the connection is healthy. Upon receiving such a TestRequest `<1>`, the server will respond with a Heartbeat `<0>` containing the expected `TestReqID (112)`. If the client does not receive the server’s response within a `HeartInt (108)` interval, the client should close the session and connection and establish new ones. ### API Key Permissions To access the FIX API order entry sessions, your API key must be configured with the `FIX_API` permission. To access the FIX Drop Copy sessions, your API key must be configured with either `FIX_API_READ_ONLY` or `FIX_API` permission. To access the FIX Market Data sessions, your API key must be configured with either `FIX_API` or `FIX_API_READ_ONLY` permission. **FIX sessions only support Ed25519 keys.** Please refer to [this tutorial](https://www.binance.com/en/support/faq/how-to-generate-an-ed25519-key-pair-to-send-api-requests-on-binance-6b9a63f1e3384cf48a2eedb82767a69a) on how to set up an Ed25519 key pair. ### On message processing order The `MessageHandling (25035)` field required in the initial [Logon``](#logon-request) message controls whether messages from the client may be reordered before they are processed by the Matching Engine. | Mode | Description | | --------------- | ------------------------------------------------------------------------------------------ | | `UNORDERED(1)` | Messages from the client are allowed to be sent to the matching engine in any order. | | `SEQUENTIAL(2)` | Messages from the client are always sent to the matching engine in `MsgSeqNum (34)` order. | In all modes, the client's `MsgSeqNum (34)` must increase monotonically, with each subsequent message having a sequence number that is exactly 1 greater than the previous message. > [!TIP] `UNORDERED(1)` should offer better performance when there are multiple messages in flight > from the client to the server. ### Response Mode By default, all concurrent order entry sessions receive all of the account's successful [ExecutionReport`<8>`](#executionreport) and [ListStatus``](#liststatus) messages, including those in response to orders placed from other FIX sessions and via non-FIX APIs. Use the `ResponseMode (25036)` field in the initial [Logon``](#logon-request) message to change this behavior. - `EVERYTHING(1)`: The default mode. - `ONLY_ACKS(2)`: Receive only ACK messages whether operation succeeded or failed. Disables ExecutionReport push. ### Timing Security - All requests require a `SendingTime(52)` field which should be the current timestamp. - An additional optional field, `RecvWindow(25000)`, specifies for how long the request stays valid in milliseconds. - `RecvWindow(25000)` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `RecvWindow(25000)` is not specified, it defaults to 5000 milliseconds only for the Logon`` request. For other requests if unset, the RecvWindow check is not executed. - Maximum `RecvWindow(25000)` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (SendingTime < (serverTime + 1 second) && (serverTime - SendingTime) <= RecvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - SendingTime) <= RecvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` ### How to sign Logon `` request The [Logon``](#logon-main) message authenticates your connection to the FIX API. This must be the first message sent by the client. - The `Username (553)` field is required to contain the API key. - The `RawData (96)` field is required to contain a valid signature made with the API key. The signature payload is a text string constructed by concatenating the values of the following fields in this exact order, separated by the SOH character: 1. `MsgType (35)` 2. `SenderCompId (49)` 3. `TargetCompId (56)` 4. `MsgSeqNum (34)` 5. `SendingTime (52)` Sign the payload using your private key. Encode the signature with **base64**. The resulting text string is the value of the `RawData (96)` field. Here is a sample Python code implementing the signature algorithm: ```python import base64 from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey from cryptography.hazmat.primitives.serialization import load_pem_private_key def logon_raw_data(private_key: Ed25519PrivateKey, sender_comp_id: str, target_comp_id: str, msg_seq_num: str, sending_time: str): """ Computes the value of RawData (96) field in Logon message. """ payload = chr(1).join([ 'A', sender_comp_id, target_comp_id, msg_seq_num, sending_time, ]) signature = private_key.sign(payload.encode('ASCII')) return base64.b64encode(signature).decode('ASCII') with open('private_key.pem', 'rb') as f: private_key = load_pem_private_key(data=f.read(), password=None) raw_data = logon_raw_data(private_key, sender_comp_id='5JQmUOsm', target_comp_id='SPOT', msg_seq_num='1', sending_time='20240612-08:52:21.613') ``` The values presented below can be used to validate the correctness of the signature computation implementation: | Field | Value | | ----------------- | ----------------------- | | MsgType (35) | `A` | | SenderCompID (49) | `EXAMPLE` | | TargetCompID (56) | `SPOT` | | MsgSeqNum (34) | `1` | | SendingTime (52) | `20240627-11:17:25.223` | The Ed25519 private key used in the example computation is shown below: > [!CAUTION] The following secret key is provided solely for illustrative purposes. Do not use this > key in any real-world application as it is not secure and may compromise your cryptographic > implementation. Always generate your own unique and secure keys for actual use. ``` -----BEGIN PRIVATE KEY----- MC4CAQAwBQYDK2VwBCIEIIJEYWtGBrhACmb9Dvy+qa8WEf0lQOl1s4CLIAB9m89u -----END PRIVATE KEY----- ``` Computed signature: ``` 4MHXelVVcpkdwuLbl6n73HQUXUf1dse2PCgT1DYqW9w8AVZ1RACFGM+5UdlGPrQHrgtS3CvsRURC1oj73j8gCA== ``` Resulting Logon `` message: ``` 8=FIX.4.4|9=247|35=A|34=1|49=EXAMPLE|52=20240627-11:17:25.223|56=SPOT|95=88|96=4MHXelVVcpkdwuLbl6n73HQUXUf1dse2PCgT1DYqW9w8AVZ1RACFGM+5UdlGPrQHrgtS3CvsRURC1oj73j8gCA==|98=0|108=30|141=Y|553=sBRXrJx2DsOraMXOaUovEhgVRcjOvCtQwnWj8VxkOh1xqboS02SPGfKi2h8spZJb|25035=2|10=227| ``` ## Limits ### Message Limits - Each connection has a limit on **how many messages can be sent to the exchange**. - The message limit **does not count the messages sent in response to the client**. - Breaching the message limit results in immediate [Logout `<5>`](#logout) and disconnection. - To understand current limits and usage, please send a [LimitQuery``](#limitquery) message. A [LimitResponse``](#limitresponse) message will be sent in response, containing information about Order Rate Limits and Message Limits. - FIX Order entry sessions have a limit of 10,000 messages every 10 seconds. - FIX Drop Copy sessions have a limit of 60 messages every 60 seconds. - FIX Market Data sessions have a limit of 2000 messages every 60 seconds. ### Connection Limits - Each Account has a limit on how many TCP connections can be established at the same time. - The limit is reduced when the TCP connection is closed. If the reduction of connections is not immediate, please wait up to twice the value of `HeartBtInt (108)` for the change to take effect. For example, if the current value of `HeartBtInt` is 5, please wait up to 10 seconds. - Upon breaching the limit a [Reject `<3>`](#reject) will be sent containing information about the connection limit breach and the current limit. - FIX Order Entry limits: - 15 connection attempts within 30 seconds - Maximum of 10 concurrent TCP connections per account - FIX Drop Copy limits: - 15 connection attempts within 30 seconds - Maximum of 10 concurrent TCP connections per account - FIX Market Data limits - 300 connection attempts within 300 seconds - Maximum of 100 concurrent TCP connections per account - A single connection can listen to a maximum of 1000 streams. ### Unfilled Order Count - To understand how many orders you have placed within a certain time interval, please send a [LimitQuery``](#limitquery) message. A [LimitResponse``](#limitresponse) message will be sent in response, containing information about Unfilled Order Count and Message Limits. - **Please note that if your orders are consistently filled by trades, you can continuously place orders on the API**. For more information, please see [Spot Unfilled Order Count Rules](./faqs/order_count_decrement.md). - If you exceed the unfilled order count your message will be rejected, and information will be transferred back to you in a reject message specific to that endpoint. - **The number of unfilled orders is tracked for each account.** ## Error Handling Client messages that contain syntax errors, missing required fields, or refer to unknown symbols will be rejected by the server with a [Reject `<3>`](#reject) message. If a valid message cannot be processed and is rejected, an appropriate reject response will be sent. Please refer to the individual message documentation for possible responses. Please refer to the `Text (58)` and `ErrorCode (25016)` fields in responses for the reject reason. The list of error codes can be found on the [Error codes](errors.md) page. ## Types Only printable ASCII characters and SOH are supported. | Type | Description | | -------------- | ------------------------------------------------------------------------------------------- | | `BOOLEAN` | Enum: `Y` or `N`. | | `CHAR` | Single character. | | `INT` | Signed 64-bit integer. | | `LENGTH` | Unsigned 64-bit integer. | | `NUMINGROUP` | Unsigned 64-bit integer. | | `PRICE` | Fixed-point number. Precision depends on the symbol definition. | | `QTY` | Fixed-point number. Precision depends on the symbol definition. | | `SEQNUM` | Unsigned 32-bit integer. Rolls over to 0 after reaching its maximum value of 4,294,967,295. | | `STRING` | Sequence of printable ASCII characters. | | `UTCTIMESTAMP` | String representing datetime in UTC. | Supported `UTCTIMESTAMP` formats: - `20011217-09:30:47` - seconds - `20011217-09:30:47.123` - milliseconds - `20011217-09:30:47.123456` - microseconds (always used in messages from the exchange) Client order ID fields must conform to the regex `^[a-zA-Z0-9-_]{1,36}$`: - `ClOrdID (11)` - `OrigClOrdID (41)` - `MDReqID (262)` - `ClListID (25014)` - `OrigClListID (25015)` - `CancelClOrdID (25034)` ## Message Components > [!NOTE] In example messages, the `|` character is used to represent SOH character: ``` 8=FIX.4.4|9=113|35=A|34=1|49=SPOT|52=20240612-08:52:21.636837|56=5JQmUOsm|98=0|108=30|25037=4392a152-3481-4499-921a-6d42c50702e2|10=051| ``` ### Header Appears at the start of every message. | Tag | Name | Type | Required | Description | | ----- | ------------ | ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 8 | BeginString | STRING | Y | Always `FIX.4.4`.

Must be the first field the message. | | 9 | BodyLength | LENGTH | Y | Message length in bytes.

Must be the second field in the message. | | 35 | MsgType | STRING | Y | Must be the third field in the message.

Possible values:

`0` - [HEARTBEAT](#heartbeat)

`1` - [TEST_REQUEST](#testrequest)

`3` - [REJECT](#reject)

`5` - [LOGOUT](#logout)

`8` - [EXECUTION_REPORT](#executionreport)

`9` - [ORDER_CANCEL_REJECT](#ordercancelreject)

`A` - [LOGON](#logon-main)

`D` - [NEW_ORDER_SINGLE](#newordersingle)

`E` - [NEW_ORDER_LIST](#neworderlist)

`F` - [ORDER_CANCEL_REQUEST](#ordercancelrequest)

`N` - [LIST_STATUS](#liststatus)

`q` - [ORDER_MASS_CANCEL_REQUEST](#ordermasscancelrequest)

`r` - [ORDER_MASS_CANCEL_REPORT](#ordermasscancelreport)

`XCN` - [ORDER_CANCEL_REQUEST_AND_NEW_ORDER_SINGLE](#ordercancelrequestandnewordersingle)

`XLQ` - [LIMIT_QUERY](#limitquery)

`XLR` - [LIMIT_RESPONSE](#limitresponse)

`B` - [NEWS](#news)

`x`- [INSTRUMENT_LIST_REQUEST](#instrumentlistrequest)

`y` - [INSTRUMENT_LIST](#instrumentlist)

`V` - [MARKET_DATA_REQUEST](#marketdatarequest)

`Y` - [MARKET_DATA_REQUEST_REJECT](#marketdatarequestreject)

`W` - [MARKET_DATA_SNAPSHOT](#marketdatasnapshot)

`X` - [MARKET_DATA_INCREMENTAL_REFRESH](#marketdataincrementalrefresh)

`XAK` - [ORDER_AMEND_KEEP_PRIORITY_REQUEST](#orderamendkeeppriorityrequest)

`XAR` - [ORDER_AMEND_REJECT](#orderamendreject) | | 49 | SenderCompID | STRING | Y | Must be unique across an account's active sessions.

Must obey regex: `^[a-zA-Z0-9-_]{1,8}$` | | 56 | TargetCompID | STRING | Y | A string identifying this TCP connection.

On messages from client required to be set to `SPOT`.

Must be unique across TCP connections.

Must conform to the regex: `^[a-zA-Z0-9-_]{1,8}$` | | 34 | MsgSeqNum | SEQNUM | Y | Integer message sequence number.

Values that will cause a gap will be rejected. | | 52 | SendingTime | UTCTIMESTAMP | Y | Time of message transmission (always expressed in UTC). | | 25000 | RecvWindow | FLOAT | N | Number of milliseconds after `SendingTime (52)` the request is valid for.

Defaults to `5000` milliseconds in [Logon``](#logon-request) and has a max value of `60000` milliseconds.
Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
### Trailer Appears at the end of every message. | Tag | Name | Type | Required | Description | | --- | -------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 10 | CheckSum | STRING | Y | Always three-character numeric string, calculated by summing the ASCII values of each preceding character in the message, including start-of-header (SOH) characters.

The resultant sum is divided by 256, with the remainder forming the CheckSum value.

To maintain a fixed length, the CheckSum field is right-justified and zero-padded as needed. | ## Administrative Messages ### Heartbeat `<0>` Sent by the server if there is no outgoing traffic during the heartbeat interval (`HeartBtInt (108)` in [Logon``](#logon-main)). Sent by the client to indicate that the session is healthy. Sent by the client or the server in response to a [TestRequest`<1>`](#testrequest) message. | Tag | Name | Type | Required | Description | | --- | --------- | ------ | -------- | -------------------------------------------------------------------------------------------------------- | | 112 | TestReqID | STRING | N | When Heartbeat`<35>` is sent in response to TestRequest`<1>`, must mirror the value in TestRequest`<1>`. | ### TestRequest `<1>` Sent by the server if there is no incoming traffic during the heartbeat interval (`HeartBtInt (108)` in [Logon``](#logon-main)). Sent by the client to request a [Heartbeat`<0>`](#heartbeat) response. > [!NOTE] If the client does not respond to TestRequest`<1>` with Heartbeat`<0>` with a correct > `TestReqID (112)` within timeout, the connection will be dropped. | Tag | Name | Type | Required | Description | | --- | --------- | ------ | -------- | ---------------------------------------------------------------------- | | 112 | TestReqID | STRING | Y | Arbitrary string that must be included in the Heartbeat`<0>` response. | ### Reject `<3>` Sent by the server in response to an invalid message that cannot be processed. Sent by the server if a new connection cannot be accepted. Please refer to [Connection Limits](#connection-limits). Please refer to the `Text (58)` and `ErrorCode (25016)` fields for the reject reason. | Tag | Name | Type | Required | Description | | ----- | ------------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 45 | RefSeqNum | INT | N | The `MsgSeqNum (34)` of the rejected message that caused issuance of this Reject`<3>`. | | 371 | RefTagID | INT | N | When present, identifies the field that directly caused the issuance of this Reject`<3>` message. | | 372 | RefMsgType | STRING | N | The `MsgType (35)` of the rejected message that caused issuance of this Reject`<3>`. | | 373 | SessionRejectReason | INT | N | A reason for the reject, can be one of the values below.

Usually accompanied by additional Text description

Possible values:

`0`- INVALID_TAG_NUMBER

`1` - REQUIRED_TAG_MISSING

`2` - TAG_NOT_DEFINED_FOR_THIS_MESSAGE_TYPE

`3` - UNDEFINED_TAG

`5` - VALUE_IS_INCORRECT

`6` - INCORRECT_DATA_FORMAT_FOR_VALUE

`8` - SIGNATURE_PROBLEM

`10` - SENDINGTIME_ACCURACY_PROBLEM

`12` - XML_VALIDATION_ERROR

`13` - TAG_APPEARS_MORE_THAN_ONCE

`14` - TAG_SPECIFIED_OUT_OF_REQUIRED_ORDER

`15` - REPEATING_GROUP_FIELDS_OUT_OF_ORDER

`16` - INCORRECT_NUMINGROUP_COUNT_FOR_REPEATING_GROUP

`99` - OTHER | | 25016 | ErrorCode | INT | N | API error code (see [Error Codes](errors.md)). | | 58 | Text | STRING | N | Human-readable error message. | ### Logon `` Sent by the client to authenticate the connection. Logon`` must be the first message sent by the client. Sent by the server in response to a successful logon. > [!NOTE] Logon`` can only be sent once for the entirety of the session. #### Logon Request | Tag | Name | Type | Required | Description | | ----- | --------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 98 | EncryptMethod | INT | Y | Required to be `0`. | | 108 | HeartBtInt | INT | Y | Required to be within range [5, 60]. Heartbeat interval in seconds. | | 95 | RawDataLength | LENGTH | Y | Length of the `RawData (96)` field that comes strictly after this field. | | 96 | RawData | DATA | Y | Signature. [How to sign Logon`` request](#signaturecomputation). | | 141 | ResetSeqNumFlag | BOOLEAN | Y | Required to be `Y`. | | 553 | Username | STRING | Y | API key. **Only Ed25519 API keys are supported.** | | 25035 | MessageHandling | INT | Y | Possible values:

`1` - UNORDERED

`2` - SEQUENTIAL

Please refer to [On message order processing](#orderedmode) for more information. | | 25036 | ResponseMode | INT | N | Please refer to [Response Mode](#responsemode). | | 9406 | DropCopyFlag | BOOLEAN | N | Must be set to 'Y' when logging into Drop Copy sessions. | **Sample message:** ``` 8=FIX.4.4|9=248|35=A|34=1|49=5JQmUOsm|52=20240612-08:52:21.613|56=SPOT|95=88|96=KhJLbZqADWknfTAcp0ZjyNz36Kxa4ffvpNf9nTIc+K5l35h+vA1vzDRvLAEQckyl6VDOwJ53NOBnmmRYxQvQBQ==|98=0|108=30|141=Y|553=W5rcOD30c0gT4jHK8oX5d5NbzWoa0k4SFVoTHIFNJVZ3NuRpYb6ZyJznj8THyx5d|25035=1|10=000| ```
#### Logon Response | Tag | Name | Type | Required | Description | | ----- | ------------- | ------ | -------- | ----------------------------------------- | | 98 | EncryptMethod | INT | Y | Always `0`. | | 108 | HeartBtInt | INT | Y | Mirrors value from the Logon request. | | 25037 | UUID | STRING | Y | UUID of the FIX API serving the requests. | **Sample message:** ``` 8=FIX.4.4|9=113|35=A|34=1|49=SPOT|52=20240612-08:52:21.636837|56=5JQmUOsm|98=0|108=30|25037=4392a152-3481-4499-921a-6d42c50702e2|10=051| ``` ### Logout `<5>` Sent to initiate the process of closing the connection, and also when responding to Logout. | Tag | Name | Type | Required | Description | | --- | ---- | ------ | -------- | ----------- | | 58 | Text | STRING | N | | **Sample messages:** Logout Request ``` 8=FIX.4.4|9=55|35=5|34=3|49=GhQHzrLR|52=20240611-09:44:25.543|56=SPOT|10=249| ``` Logout Response ``` 8=FIX.4.4|9=84|35=5|34=4|49=SPOT|52=20240611-09:44:25.544001|56=GhQHzrLR|58=Logout acknowledgment.|10=212| ``` ### News `` When the server enters maintenance, a `News` message will be sent to clients **every 10 seconds**, counting down to disconnection. When the countdown ends, clients are logged out and their sessions are closed. Upon receiving this message, clients are expected to establish a new session and close the old one. The countdown message sent will be: ``` You'll be disconnected in %d seconds. Please reconnect. ``` When there are 10 seconds remaining, the following message will be sent: ``` Your connection is about to be closed. Please reconnect. ``` If the client does not close the old session within 10 seconds of receiving the above message, the server will log it out and close the session. | Tag | Name | Type | Required | Description | | :-- | :------- | :----- | :------- | :---------- | | 148 | Headline | STRING | Y | | **Sample message:** ``` 8=FIX.4.4|9=0000113|35=B|49=SPOT|56=OE|34=4|52=20240924-21:07:35.773537|148=Your connection is about to be closed. Please reconnect.|10=165| ``` ### Resend Request `<2>` Resend requests are currently not supported. ## Application Messages ### Order Entry Messages > [!NOTE] The messages below can only be used for the FIX Order Entry and FIX Drop Copy Sessions. #### NewOrderSingle `` Sent by the client to submit a new order for execution. This adds 1 order to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. **Unfilled Order Count:** 1 Please refer to [Supported Order Types](#ordertype) for supported field combinations. > [!NOTE] Many fields become required based on the order type. Please refer to > [Supported Order Types](#NewOrderSingle-required-fields). | Tag | Name | Type | Required | Description | | ----- | ------------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 11 | ClOrdID | STRING | Y | `ClOrdID` to be assigned to the order. | | 38 | OrderQty | QTY | N | Quantity of the order | | 40 | OrdType | CHAR | Y | See the [table](#ordertype) to understand supported order types and the required fields to use them.

Possible values:

`1` - MARKET

`2` - LIMIT

`3` - STOP

`4` - STOP_LIMIT

`P`- PEGGED | | 18 | ExecInst | CHAR | N | Possible values:

`6` - PARTICIPATE_DONT_INITIATE | | 44 | Price | PRICE | N | Price of the order | | 54 | Side | CHAR | Y | Side of the order.

Possible values:

`1` - BUY

`2` - SELL | | 55 | Symbol | STRING | Y | Symbol to place the order on. | | 59 | TimeInForce | CHAR | N | Possible values:

`1` - GOOD_TILL_CANCEL

`3` - IMMEDIATE_OR_CANCEL

`4` - FILL_OR_KILL | | 111 | MaxFloor | QTY | N | Used for iceberg orders, this specifies the visible quantity of the order on the book. | | 152 | CashOrderQty | QTY | N | Quantity of the order specified in the quote asset units, for reverse market orders. | | 847 | TargetStrategy | INT | N | The value cannot be less than `1000000`. | | 7940 | StrategyID | INT | N | | | 25001 | SelfTradePreventionMode | CHAR | N | Possible values:

`1` - NONE

`2` - EXPIRE_TAKER

`3` - EXPIRE_MAKER

`4` - EXPIRE_BOTH

`5` - DECREMENT
`6` - TRANSFER | | 211 | PegOffsetValue | FLOAT | N | Amount added to the peg in the context of the PegOffsetType | | 1094 | PegPriceType | CHAR | N | Defines the type of peg
Possible values:
`4` - MARKET_PEG
`5` - PRIMARY_PEG | | 835 | PegMoveType | CHAR | N | Describes whether peg is fixed or floats. Required for Pegged Orders and must be set to `1` (FIXED) | | 836 | PegOffsetType | CHAR | N | Type of price peg offset.
Possible values:

`3` - PRICE_TIER | | 1100 | TriggerType | CHAR | N | Possible values: `4` - PRICE_MOVEMENT | | 1101 | TriggerAction | CHAR | N | Possible values:

`1` - ACTIVATE | | 1102 | TriggerPrice | PRICE | N | Activation price for contingent orders. See [table](#ordertype) | | 1107 | TriggerPriceType | CHAR | N | Possible values:

`2` - LAST_TRADE | | 1109 | TriggerPriceDirection | CHAR | N | Used to differentiate between StopLoss and TakeProfit orders. See [table](#ordertype).

Possible values:

`U` - TRIGGER_IF_THE_PRICE_OF_THE_SPECIFIED_TYPE_GOES_UP_TO_OR_THROUGH_THE_SPECIFIED_TRIGGER_PRICE

`D` - TRIGGER_IF_THE_PRICE_OF_THE_SPECIFIED_TYPE_GOES_DOWN_TO_OR_THROUGH_THE_SPECIFIED_TRIGGER_PRICE | | 25009 | TriggerTrailingDeltaBips | INT | N | Provide to create trailing orders. | | 25032 | SOR | BOOLEAN | N | Whether to activate SOR for this order. | **Sample message:** ``` 8=FIX.4.4|9=114|35=D|34=2|49=qNXO12fH|52=20240611-09:01:46.228|56=SPOT|11=1718096506197867067|38=5|40=2|44=10|54=1|55=LTCBNB|59=4|10=016| ``` **Response:** - [ExecutionReport`<8>`](#executionreport) with `ExecType (150)` value `NEW (0)` if the order was accepted. - [ExecutionReport`<8>`](#executionreport) with `ExecType (150)` value `REJECTED (8)` if the order was rejected. - [Reject`<3>`](#reject) if the message is rejected. ##### Supported Order Types | Order name | Binance OrderType | Side | required field values | required fields with user values | | ------------------------------------- | ------------------- | ----------- | ----------------------------------------------------------------------- | -------------------------------- | | Market order | `MARKET` | BUY or SELL | 40=1| | | | Limit order | `LIMIT` | BUY or SELL | 40=2| | | | Limit maker order | `LIMIT_MAKER` | BUY or SELL | 40=2|18=6| | | | Buy stop loss order | `STOP_LOSS` | BUY | 40=3|1100=4|1101=1|1107=2|1109=U| | 1102 | | Buy trailing stop loss order | `STOP_LOSS` | BUY | 40=3|1100=4|1101=1|1107=2|1109=U| | 1102,25009 | | Buy stop loss limit order | `STOP_LOSS_LIMIT` | BUY | 40=4|1100=4|1101=1|1107=2|1109=U| | 1102 | | Buy trailing stop loss limit order | `STOP_LOSS_LIMIT` | BUY | 40=4|1100=4|1101=1|1107=2|1109=U| | 1102,25009 | | Sell stop loss order | `STOP_LOSS` | SELL | 40=3|1100=4|1101=1|1107=2|1109=D| | 1102 | | Sell trailing stop loss order | `STOP_LOSS` | SELL | 40=3|1100=4|1101=1|1107=2|1109=D| | 1102,25009 | | Sell stop loss limit order | `STOP_LOSS_LIMIT` | SELL | 40=4|1100=4|1101=1|1107=2|1109=D| | 1102 | | Sell trailing stop loss limit order | `STOP_LOSS_LIMIT` | SELL | 40=4|1100=4|1101=1|1107=2|1109=D| | 1102,25009 | | Buy take profit order | `TAKE_PROFIT` | BUY | 40=3|1100=4|1101=1|1107=2|1109=D| | 1102 | | Buy trailing take profit order | `TAKE_PROFIT` | BUY | 40=3|1100=4|1101=1|1107=2|1109=D| | 1102,25009 | | Buy trailing take profit order | `TAKE_PROFIT` | BUY | 40=3|1100=4|1101=1|1107=2| | 25009 | | Buy take profit order | `TAKE_PROFIT_LIMIT` | BUY | 40=4|1100=4|1101=1|1107=2|1109=D| | 1102 | | Buy trailing take profit limit order | `TAKE_PROFIT_LIMIT` | BUY | 40=4|1100=4|1101=1|1107=2|1109=D| | 1102,25009 | | Buy trailing take profit limit order | `TAKE_PROFIT_LIMIT` | BUY | 40=4|1100=4|1101=1|1107=2| | 25009 | | Sell take profit order | `TAKE_PROFIT` | SELL | 40=3|1100=4|1101=1|1107=2|1109=U| | 1102 | | Sell trailing take profit order | `TAKE_PROFIT` | SELL | 40=3|1100=4|1101=1|1107=2|1109=U| | 1102,25009 | | Sell trailing take profit order | `TAKE_PROFIT` | SELL | 40=3|1100=4|1101=1|1107=2| | 25009 | | Sell take profit limit order | `TAKE_PROFIT_LIMIT` | SELL | 40=4|1100=4|1101=1|1107=2|1109=U| | 1102 | | Sell trailing take profit limit order | `TAKE_PROFIT_LIMIT` | SELL | 40=4|1100=4|1101=1|1107=2|1109=U| | 1102,25009 | | Sell trailing take profit limit order | `TAKE_PROFIT_LIMIT` | SELL | 40=4|1100=4|1101=1|1107=2| | 25009 | Required fields based on Binance OrderType: | Binance OrderType | Additional mandatory parameters | Additional Information | | ------------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `LIMIT` | 38, 44, 59 | | | `MARKET` | 38 OR 152 | `MARKET` orders using the `OrderQty (38)` field specifies the amount of the `base asset` the user wants to buy or sell at the market price.
E.g. `MARKET` order on BTCUSDT will specify how much BTC the user is buying or selling.

`MARKET` orders using `quoteOrderQty` specifies the amount the user wants to spend (when buying) or receive (when selling) the `quote` asset; the correct `quantity` will be determined based on the market liquidity and `quoteOrderQty`.
E.g. Using the symbol BTCUSDT:
`BUY` side, the order will buy as many BTC as `quoteOrderQty` USDT can.
`SELL` side, the order will sell as much BTC needed to receive `CashOrderQty (152)` USDT. | | `STOP_LOSS` | 38, 1102 or 25009 | This will execute a `MARKET` order when the conditions are met. (e.g. `TriggerPrice (1102)` is met or `TriggerTrailingDeltaBips (25009)` is activated) | | `STOP_LOSS_LIMIT` | 38, 44, 59, 1102 or 25009 | | | `TAKE_PROFIT` | 38, 1102 or 25009 | This will execute a `MARKET` order when the conditions are met. (e.g. `TriggerPrice (1102)` is met or `TriggerTrailingDeltaBips (25009)` is activated) | | `TAKE_PROFIT_LIMIT` | 38, 44, 59, 1102 or 25009 | | `LIMIT_MAKER` | 38, 44 | This is a `LIMIT` order that will be rejected if the order immediately matches and trades as a taker.
This is also known as a POST-ONLY order. | #### ExecutionReport `<8>` Sent by the server whenever an order state changes. > [!NOTE] > > - By default, ExecutionReport`<8>` is sent for all orders of an account, including those submitted > in different connections. Please see [Response Mode](#responsemode) for other behavior options. > - FIX API should give better performance for ExecutionReport<8> push. | Tag | Name | Type | Required | Description | | ----- | ------------------------ | ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 17 | ExecID | STRING | N | Omitted on rejected orders. | | 11 | ClOrdID | STRING | N | `ClOrdID` of the list as assigned on the request. | | 41 | OrigClOrdID | STRING | N | Original `ClOrdID` of the order. | | 37 | OrderID | INT | N | Assigned by exchange. | | 38 | OrderQty | QTY | N | Quantity of the order. | | 40 | OrdType | CHAR | Y | Possible values:

`1` - MARKET

`2` - LIMIT

`3` - STOP_LOSS

`4` - STOP_LIMIT

`P` - PEGGED | | 54 | Side | CHAR | Y | Possible values:

`1` - BUY

`2` - SELL | | 55 | Symbol | STRING | Y | Symbol of the order. | | 18 | ExecInst | CHAR | N | Possible values:

`6` - PARTICIPATE_DONT_INITIATE | | 44 | Price | PRICE | N | Price of the order. | | 59 | TimeInForce | CHAR | N | Possible values:

`1` - GOOD_TILL_CANCEL

`3` - IMMEDIATE_OR_CANCEL

`4` - FILL_OR_KILL | | 60 | TransactTime | UTCTIMESTAMP | N | Timestamp when this event occurred. | | 25018 | OrderCreationTime | INT | N | | | 111 | MaxFloor | QTY | N | Appears on iceberg orders. | | 66 | ListID | STRING | N | Appears on list orders. | | 152 | CashOrderQty | QTY | N | OrderQty specified in the quote asset units. | | 847 | TargetStrategy | INT | N | `TargetStrategy (847)` from the order placement request. | | 7940 | StrategyID | INT | N | `StrategyID (7940)` from the order placement request. | | 25001 | SelfTradePreventionMode | CHAR | N | Possible values:

`1` - NONE

`2` - EXPIRE_TAKER

`3` - EXPIRE_MAKER

`4` - EXPIRE_BOTH

`5` - DECREMENT
`6` - TRANSFER | | 150 | ExecType | CHAR | Y | **Note:** Field `PreventedMatchID(25024)` will be present if order has expired due to `SelfTradePreventionMode(25013)`

Possible values:

`0` - NEW

`4` - CANCELED

`5` - REPLACED

`8` - REJECTED

`F` - TRADE

`C` - EXPIRED | | 14 | CumQty | QTY | Y | Total number of base asset traded on this order. | | 151 | LeavesQty | QTY | N | Quantity remaining for further execution. | | 25017 | CumQuoteQty | QTY | N | Total number of quote asset traded on this order. | | 1057 | AggressorIndicator | BOOLEAN | N | Appears on trade execution reports.

Indicates whether the order was a taker in the trade. | | 1003 | TradeID | STRING | N | Appears on trade execution reports. | | 31 | LastPx | PRICE | N | The price of the last execution. | | 32 | LastQty | QTY | Y | The quantity of the last execution. | | 39 | OrdStatus | CHAR | Y | Possible values:

`0` - NEW

`1` - PARTIALLY_FILLED

`2` - FILLED

`4` - CANCELED `6` - PENDING_CANCEL

`8` - REJECTED

`A` - PENDING_NEW

`C` - EXPIRED

Note that FIX does not support `EXPIRED_IN_MATCH` status, and get converted to `EXPIRED` in FIX. | | 70 | AllocID | INT | N | Allocation ID as assigned by the exchange. | | 574 | MatchType | INT | N | Possible values:

`1` - ONE_PARTY_TRADE_REPORT

`4` - AUTO_MATCH | | 25021 | WorkingFloor | INT | N | Appears for orders that potentially have allocations. | | 25022 | TrailingTime | UTCTIMESTAMP | N | Appears only for trailing stop orders. | | 636 | WorkingIndicator | BOOLEAN | N | Set to `Y` when this order enters order book. | | 25023 | WorkingTime | UTCTIMESTAMP | N | When this order appeared on the order book. | | 25024 | PreventedMatchID | INT | N | Appears only for orders that expired due to STP. | | 25025 | PreventedExecutionPrice | PRICE | N | Appears only for orders that expired due to STP. | | 25026 | PreventedExecutionQty | QTY | N | Appears only for orders that expired due to STP. | | 25027 | TradeGroupID | INT | N | Appears only for orders that expired due to STP. | | 25028 | CounterSymbol | STRING | N | Appears only for orders that expired due to STP. | | 25029 | CounterOrderID | INT | N | Appears only for orders that expired due to STP. | | 25030 | PreventedQty | QTY | N | Appears only for orders that expired due to STP. | | 25031 | LastPreventedQty | QTY | N | Appears only for orders that expired due to STP. | | 25032 | SOR | BOOLEAN | N | Appears for orders that used SOR. | | 25016 | ErrorCode | INT | N | API error code (see [Error Codes](errors.md)). | | 58 | Text | STRING | N | Human-readable error message. | | 136 | NoMiscFees | NUMINGROUP | N | Number of repeating groups of miscellaneous fees. | | =>137 | MiscFeeAmt | QTY | Y | Amount of fees denominated in `MiscFeeCurr(138)` asset | | =>138 | MiscFeeCurr | STRING | Y | Currency of miscellaneous fee. | | =>139 | MiscFeeType | INT | Y | Possible values:

`4` - EXCHANGE_FEES | | 1100 | TriggerType | CHAR | N | Possible values:

`4` - PRICE_MOVEMENT | | 1101 | TriggerAction | CHAR | N | Possible values:

`1` - ACTIVATE | | 1102 | TriggerPrice | PRICE | N | Activation price for contingent orders. See [table](#ordertype) | | 1107 | TriggerPriceType | CHAR | N | Possible values:

`2` - LAST_TRADE | | 1109 | TriggerPriceDirection | CHAR | N | Used to differentiate between StopLoss and TakeProfit orders. See [table](#ordertype).

Possible values:

`U` - TRIGGER_IF_THE_PRICE_OF_THE_SPECIFIED_TYPE_GOES_UP_TO_OR_THROUGH_THE_SPECIFIED_TRIGGER_PRICE

`D` - TRIGGER_IF_THE_PRICE_OF_THE_SPECIFIED_TYPE_GOES_DOWN_TO_OR_THROUGH_THE_SPECIFIED_TRIGGER_PRICE | | 25009 | TriggerTrailingDeltaBips | INT | N | Appears only for trailing stop orders. | | 211 | PegOffsetValue | FLOAT | N | Amount added to the peg in the context of the PegOffsetType | | 1094 | PegPriceType | CHAR | N | Defines the type of peg
Possible values:
`4` - MARKET_PEG
`5` - PRIMARY_PEG | | 835 | PegMoveType | CHAR | N | Describes whether peg is fixed or floats. Required for Pegged Orders and must be set to `1` (FIXED) | | 836 | PegOffsetType | CHAR | N | Type of price peg offset.
Possible values:

`3` - PRICE_TIER | | 839 | PeggedPrice | PRICE | N | Current price the order is pegged at | **Sample message:** ``` 8=FIX.4.4|9=330|35=8|34=2|49=SPOT|52=20240611-09:01:46.228950|56=qNXO12fH|11=1718096506197867067|14=0.00000000|17=144|32=0.00000000|37=76|38=5.00000000|39=0|40=2|44=10.00000000|54=1|55=LTCBNB|59=4|60=20240611-09:01:46.228000|150=0|151=5.00000000|636=Y|1057=Y|25001=1|25017=0.00000000|25018=20240611-09:01:46.228000|25023=20240611-09:01:46.228000|10=095| ``` #### OrderCancelRequest `` Sent by the client to cancel an order or an order list. - To cancel an order either `OrderID (11)` or `OrigClOrdID (41)` are required. - If both `OrderID (37)` and `OrigClOrdID (41)` are provided, the `OrderID` is searched first, then the `OrigClOrdID` from that result is checked against that order. If both conditions are not met the request will be rejected. - To cancel an order list either `ListID (66)` or `OrigClListID (25015)` are required. - If both `ListID (66)` and `OrigClListID (25015)` are provided, the `ListID` is searched first, then the `OrigClListID` from that result is checked against that order. If both conditions are not met the request will be rejected. If the canceled order is part of an order list, the entire list will be canceled. **Note:** - The performance for canceling an order (single cancel or as part of a cancel-replace) is always better when only `orderId` is sent. Sending `origClientOrderId` or both `orderId` + `origClientOrderId` will be slower. | Tag | Name | Type | Required | Description | | ----- | ------------------ | ------ | -------- | ----------------------------------------------------------------------------------------------------------- | | 11 | ClOrdID | STRING | Y | `ClOrdID` of this request. | | 41 | OrigClOrdID | STRING | N | `ClOrdID (11)` of the order to cancel. | | 37 | OrderID | INT | N | `OrderID (37)` of the order to cancel. | | 25015 | OrigClListID | STRING | N | `ClListID (25014)` of the order list to cancel. | | 66 | ListID | STRING | N | `ListID (66)` of the order list to cancel. | | 55 | Symbol | STRING | Y | Symbol on which to cancel order. | | 25002 | CancelRestrictions | INT | N | Restrictions on the cancel. Possible values:

`1` - ONLY_NEW

`2` - ONLY_PARTIALLY_FILLED | **Sample message:** ``` 8=FIX.4.4|9=93|35=F|34=2|49=ieBwvCKy|52=20240613-01:11:13.784|56=SPOT|11=1718241073695674483|37=2|55=LTCBNB|10=210| ``` **Response:** - [ExecutionReport`<8>`](#executionreport) with `ExecType (150)` value `CANCELED (4)` for each canceled order. - [ListStatus``](#liststatus) if orders in an order list were canceled. - [OrderCancelReject`<9>`](#ordercancelreject) if cancellation was rejected. - [Reject`<3>`](#reject) if the message is rejected. #### OrderCancelReject `<9>` Sent by the server when [OrderCancelRequest``](#ordercancelrequest) has failed. | Tag | Name | Type | Required | Description | | ----- | ------------------ | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------- | | 11 | ClOrdID | STRING | Y | `ClOrdID (11)` of the cancel request. | | 41 | OrigClOrdID | STRING | N | `OrigClOrdID (41)` from the cancel request. | | 37 | OrderID | INT | N | `OrderID (37)` from the cancel request. | | 25015 | OrigClListID | STRING | N | `OrigClListID (25015)` from the cancel request. | | 66 | ListID | STRING | N | `ListID (66)` from the cancel request. | | 55 | Symbol | STRING | Y | `Symbol (55)` from the cancel request. | | 25002 | CancelRestrictions | INT | N | `CancelRestrictions (25002)` from the cancel request. | | 434 | CxlRejResponseTo | CHAR | Y | Type of request that this OrderCancelReject`<9>` is in response to.

Possible values:

`1` - ORDER_CANCEL_REQUEST | | 25016 | ErrorCode | INT | Y | API error code (see [Error Codes](errors.md)). | | 58 | Text | STRING | Y | Human-readable error message. | **Sample message:** ``` 8=FIX.4.4|9=137|35=9|34=2|49=SPOT|52=20240613-01:12:41.320869|56=OlZb8ht8|11=1718241161272843932|37=2|55=LTCBNB|58=Unknown order sent.|434=1|25016=-1013|10=087| ``` #### OrderCancelRequestAndNewOrderSingle `` Sent by the client to cancel an order and submit a new one for execution. - To cancel an order either `OrderID (11)` or `OrigClOrdId (41)` are required. - If both `OrderID (37)` and `OrigClOrdID (41)` are provided, the `OrderID` is searched first, then the `OrigClOrdID` from that result is checked against that order. If both conditions are not met the request will be rejected. Filters and Order Count are evaluated before the processing of the cancellation and order placement occurs. A new order that was not attempted (i.e. when `newOrderResult: NOT_ATTEMPTED`), will still increase the unfilled order count by 1. **Unfilled Order Count:** 1 Please refer to [Supported Order Types](#ordertype) for supported field combinations when describing the new order. > [!NOTE] Cancel is always processed first. Then immediately after that the new order is submitted. | Tag | Name | Type | Required | Description | | ----- | --------------------------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 25033 | OrderCancelRequestAndNewOrderSingleMode | INT | Y | What action should be taken if cancel fails.

Possible values:

`1` - STOP_ON_FAILURE

`2` - ALLOW_FAILURE | | 25038 | OrderRateLimitExceededMode | INT | N | What should be done to the cancellation request if you exceed the unfilled order rate limit.

Possible values: `1` - DO_NOTHING

`2` - CANCEL_ONLY | | 37 | OrderID | INT | N | `OrderID` of the order to cancel. | | 25034 | CancelClOrdID | STRING | N | `ClOrdID` of the cancel. | | 41 | OrigClOrdID | STRING | N | `ClOrdID` of the order to cancel. | | 11 | ClOrdID | STRING | Y | `ClOrdID` to be assigned to the new order. | | 25002 | CancelRestrictions | INT | N | Restrictions on the cancel. Possible values:

`1` - ONLY_NEW

`2` - ONLY_PARTIALLY_FILLED | | 38 | OrderQty | QTY | N | Quantity of the new order | | 40 | OrdType | CHAR | Y | See the [table](#ordertype) to understand supported order types and the required fields to use them.

Possible values:

`1` - MARKET

`2` - LIMIT

`3` - STOP

`4` - STOP_LIMIT

`P` - PEGGED | | 18 | ExecInst | CHAR | N | Possible values:

`6` - PARTICIPATE_DONT_INITIATE | | 44 | Price | PRICE | N | Price of the new order | | 54 | Side | CHAR | Y | Side of the order.

Possible values:

`1` - BUY

`2` - SELL | | 55 | Symbol | STRING | Y | Symbol to cancel and place the order on. | | 59 | TimeInForce | CHAR | N | Possible values:

`1` - GOOD_TILL_CANCEL

`3` - IMMEDIATE_OR_CANCEL

`4` - FILL_OR_KILL | | 111 | MaxFloor | QTY | N | Used for iceberg orders, this specifies the visible quantity of the order on the book. | | 152 | CashOrderQty | QTY | N | Quantity of the order specified in the quote asset units, for reverse market orders. | | 847 | TargetStrategy | INT | N | The value cannot be less than `1000000`. | | 7940 | StrategyID | INT | N | | | 25001 | SelfTradePreventionMode | CHAR | N | Possible values:

`1` - NONE

`2` - EXPIRE_TAKER

`3` - EXPIRE_MAKER

`4` - EXPIRE_BOTH

`5` - DECREMENT
`6` - TRANSFER | | 211 | PegOffsetValue | FLOAT | N | Amount added to the peg in the context of the PegOffsetType | | 1094 | PegPriceType | CHAR | N | Defines the type of peg
Possible values:
`4` - MARKET_PEG
`5` - PRIMARY_PEG | | 835 | PegMoveType | CHAR | N | Describes whether peg is fixed or floats. Required for Pegged Orders and must be set to `1` (FIXED) | | 836 | PegOffsetType | CHAR | N | Type of price peg offset.
Possible values:

`3` - PRICE_TIER | | 1100 | TriggerType | CHAR | N | Possible values: `4` - PRICE_MOVEMENT | | 1101 | TriggerAction | CHAR | N | Possible values:

`1` - ACTIVATE | | 1102 | TriggerPrice | PRICE | N | Activation price for contingent orders. See [table](#ordertype) | | 1107 | TriggerPriceType | CHAR | N | Possible values:

`2` - LAST_TRADE | | 1109 | TriggerPriceDirection | CHAR | N | Used to differentiate between StopLoss and TakeProfit orders. See [table](#ordertype).

Possible values:

`U` - TRIGGER_IF_THE_PRICE_OF_THE_SPECIFIED_TYPE_GOES_UP_TO_OR_THROUGH_THE_SPECIFIED_TRIGGER_PRICE

`D` - TRIGGER_IF_THE_PRICE_OF_THE_SPECIFIED_TYPE_GOES_DOWN_TO_OR_THROUGH_THE_SPECIFIED_TRIGGER_PRICE | | 25009 | TriggerTrailingDeltaBips | INT | N | Provide to create trailing orders. | **Sample message:** ``` 8=FIX.4.4|9=160|35=XCN|34=2|49=JS8iiXK6|52=20240613-02:31:53.753|56=SPOT|11=1718245913721036458|37=8|38=5|40=2|44=4|54=1|55=LTCBNB|59=1|111=1|25033=1|25034=1718245913721036819|10=229| ``` **Response:** - [ExecutionReport`<8>`](#executionreport) with `ExecType (150)` value `CANCELED (4)` for the canceled order. - [ExecutionReport`<8>`](#executionreport) with `ExecType (150)` value `NEW (0)` for the new order. - [ExecutionReport`<8>`](#executionreport) with `ExecType (150)` value `REJECTED (8)` if the new order was rejected. - [OrderCancelReject`<9>`](#ordercancelreject) if the cancellation was rejected. - [Reject`<3>`](#reject) if the message is rejected. #### OrderMassCancelRequest `` Sent by the client to cancel all open orders on a symbol. > [!NOTE] All orders of the account will be canceled, including those placed in different > connections. | Tag | Name | Type | Required | Description | | --- | --------------------- | ------ | -------- | ----------------------------------------------------- | | 11 | ClOrdID | STRING | Y | `ClOrdId` of this mass cancel request. | | 55 | Symbol | STRING | Y | Symbol on which to cancel orders. | | 530 | MassCancelRequestType | CHAR | Y | Possible values:

`1` - CANCEL_SYMBOL_ORDERS | **Sample message:** ``` 8=FIX.4.4|9=95|35=q|34=2|49=dpYPesqv|52=20240613-01:24:36.948|56=SPOT|11=1718241876901971671|55=BTCUSDT|530=1|10=243| ``` **Responses:** - [ExecutionReport`<8>`](#executionreport) with `ExecType (150)` value `CANCELED (4)` for the every order canceled. - [OrderMassCancelReport``](#ordermasscancelreport) with `MassCancelResponse (531)` field indicating whether the message is accepted or rejected. - [Reject`<3>`](#reject) if the message is rejected. #### OrderMassCancelReport `` Sent by the server in response to [OrderMassCancelRequest``](#ordermasscancelrequest). | Tag | Name | Type | Required | Description | | ----- | ---------------------- | ------ | -------- | --------------------------------------------------------------------------------------------- | | 55 | Symbol | STRING | Y | `Symbol (55)` from the cancel request. | | 11 | ClOrdID | STRING | Y | `ClOrdID (11)` of the cancel request. | | 530 | MassCancelRequestType | CHAR | Y | `MassCancelRequestType (530)` from the cancel request. | | 531 | MassCancelResponse | CHAR | Y | Possible values:

`0` - CANCEL_REQUEST_REJECTED

`1` - CANCEL_SYMBOL_ORDERS | | 532 | MassCancelRejectReason | INT | N | Possible values:

`99` - OTHER | | 533 | TotalAffectedOrders | INT | N | How many orders were canceled. | | 25016 | ErrorCode | INT | N | API error code (see [Error Codes](errors.md)). | | 58 | Text | STRING | N | Human-readable error message. | **Sample message:** ``` 8=FIX.4.4|9=109|35=r|34=2|49=SPOT|52=20240613-01:24:36.949763|56=dpYPesqv|11=1718241876901971671|55=LTCBNB|530=1|531=1|533=5|10=083| ``` #### NewOrderList `` Sent by the client to submit a list of orders for execution. - OCOs or OTOs add **2 orders** to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. - OTOCOs add **3 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. **Unfilled Order Count:** - OCO: 2 - OTO: 2 - OTOCO: 3 Orders in an order list are contingent on one another. Please refer to [Supported Order List Types](#order-list-types) for supported order types and triggering instructions. | Tag | Name | Type | Required | Description | | -------- | ---------------------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 25014 | ClListID | STRING | Y | `ClListID` to be assigned to the order list. | | 1385 | ContingencyType | INT | N | Possible values:

`1` - ONE_CANCELS_THE_OTHER

`2` - ONE_TRIGGERS_THE_OTHER | | 25046 | OPO | BOOLEAN | N | Sets this order list as an [OPO](./faqs/opo.md) when set to `true`. | | 73 | NoOrders | NUMINGROUP | N | The length of the array for Orders. Only 2 or 3 are allowed. | | =>11 | ClOrdID | STRING | Y | `ClOrdID` to be assigned to the order | | =>38 | OrderQty | QTY | N | Quantity of the order | | =>40 | OrdType | CHAR | Y | See the [table](#ordertype) to understand supported order types and the required fields to use them.

Possible values:

`1` - MARKET

`2` - LIMIT

`3` - STOP

`4` - STOP_LIMIT

`P` - PEGGED | | =>18 | ExecInst | CHAR | N | Possible values:

`6` - PARTICIPATE_DONT_INITIATE | | =>44 | Price | PRICE | N | Price of the order | | =>54 | Side | CHAR | Y | Side of the order. Possible values:

`1` - BUY

`2` - SELL | | =>55 | Symbol | STRING | Y | Symbol to place the order on. | | =>59 | TimeInForce | CHAR | N | Possible values:

`1` - GOOD_TILL_CANCEL

`3` - IMMEDIATE_OR_CANCEL

`4` - FILL_OR_KILL | | =>111 | MaxFloor | QTY | N | Used for iceberg orders, this specifies the visible quantity of the order on the book. | | =>152 | CashOrderQty | QTY | N | Quantity of the order specified in the quote asset units, for reverse market orders. | | =>847 | TargetStrategy | INT | N | The value cannot be less than `1000000`. | | =>7940 | StrategyID | INT | N | | | =>25001 | SelfTradePreventionMode | CHAR | N | Possible values:

`1` - NONE

`2` - EXPIRE_TAKER

`3` - EXPIRE_MAKER

`4` - EXPIRE_BOTH

`5` - DECREMENT
`6` - TRANSFER | | =>211 | PegOffsetValue | FLOAT | N | Amount added to the peg in the context of the PegOffsetType | | =>1094 | PegPriceType | CHAR | N | Defines the type of peg
Possible values:
`4` - MARKET_PEG
`5` - PRIMARY_PEG | | =>835 | PegMoveType | CHAR | N | Describes whether peg is fixed or floats. Required for Pegged Orders and must be set to `1` (FIXED) | | =>836 | PegOffsetType | CHAR | N | Type of price peg offset.
Possible values:

`3` - PRICE_TIER | | =>1100 | TriggerType | CHAR | N | Possible values:

`4` - PRICE_MOVEMENT | | =>1101 | TriggerAction | CHAR | N | Possible values:

`1` - ACTIVATE | | =>1102 | TriggerPrice | PRICE | N | Activation price for contingent orders. See [table](#ordertype) | | =>1107 | TriggerPriceType | CHAR | N | Possible values:

`2` - LAST_TRADE | | =>1109 | TriggerPriceDirection | CHAR | N | Used to differentiate between StopLoss and TakeProfit orders. See [table](#ordertype).

Possible values:

`U` - TRIGGER_IF_THE_PRICE_OF_THE_SPECIFIED_TYPE_GOES_UP_TO_OR_THROUGH_THE_SPECIFIED_TRIGGER_PRICE

`D` - TRIGGER_IF_THE_PRICE_OF_THE_SPECIFIED_TYPE_GOES_DOWN_TO_OR_THROUGH_THE_SPECIFIED_TRIGGER_PRICE | | =>25009 | TriggerTrailingDeltaBips | INT | N | Provide to create trailing orders. | | =>25010 | NoListTriggeringInstructions | NUMINGROUP | N | The length of the array for ListTriggeringInstructions. | | ==>25011 | ListTriggerType | CHAR | N | What needs to happen to the order pointed to by ListTriggerTriggerIndex in order for the action to take place.

Possible values:

`1` - ACTIVATED

`2` - PARTIALLY_FILLED

`3` - FILLED | | ==>25012 | ListTriggerTriggerIndex | INT | N | Index of the trigger order: 0-indexed. | | ==>25013 | ListTriggerAction | CHAR | N | Action to take place on this order after the ListTriggerType has been fulfilled.

Possible values:

`1` - RELEASE

`2` - CANCEL | **Sample message:** ``` 8=FIX.4.4|9=236|35=E|34=2|49=Eg13pOvN|52=20240607-02:19:07.836|56=SPOT|73=2|11=w1717726747805308656|55=LTCBNB|54=2|38=1|40=2|44=0.25|59=1|11=p1717726747805308656|55=LTCBNB|54=2|38=1|40=1|25010=1|25011=3|25012=0|25013=1|1385=2|25014=1717726747805308656|10=171| ``` #### Supported Order List Types > [!NOTE] Orders must be specified in the sequence indicated in the _Order Names_ column in the > table below. | Order list name | Contingency Type (1385) | Order names | Order sides | Allowed Binance order types | List Triggering Instructions | | --------------- | ----------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | OCO | `1` | 1. below order



2. above order | 1. below order=`SELL`



2. above order=`SELL` | 1. below order=`STOP_LOSS` or `STOP_LOSS_LIMIT`



2. above order=`LIMIT_MAKER` | 1. below order:

25010=1|25011=2|25012=1|25013=2|



2. above order:

25010=1|25011=1|25012=0|25013=2| | | OCO | `1` | 1. below order



2. above order | 1. below order=`BUY`



2. above order=`BUY` | 1. below order=`LIMIT_MAKER`



2. above order=`STOP_LOSS` or `STOP_LOSS_LIMIT` | 1. below order:

25010=1|25011=1|25012=1|25013=2|



2. above order:

25010=1|25011=2|25012=0|25013=2| | | OCO | `1` | 1. below order



2. above order | 1. below order=`SELL`



2. above order=`SELL` | 1. below order=`STOP_LOSS` or `STOP_LOSS_LIMIT`



2. above order= `TAKE_PROFIT` | 1. below order:

25010=1|25011=1|25012=1|25013=2|



2. above order:

25010=1|25011=1|25012=0|25013=2| | | OCO | `1` | 1. below order



2. above order | 1. below order=`BUY`



2. above order=`BUY` | 1. below order=`TAKE_PROFIT`



2. above order = `STOP_LOSS` or `STOP_LOSS_LIMIT` | 1. below order:

25010=1|25011=1|25012=1|25013=2|



2. above order:

25010=1|25011=1|25012=0|25013=2| | | OTO | `2` | 1. working order



2. pending order | 1. working order=`SELL` or `BUY`



2. pending order=`SELL` or `BUY` | 1. working order=`LIMIT` or `LIMIT_MAKER`



2. pending order=ANY | 1. working order:

NONE



2. pending order:

25010=1|25011=3|25012=0|25013=1| | | OTOCO | `2` | 1. working order



2. pending below order



3. pending above order | 1. working order=`SELL` or `BUY`



2. pending below order=`SELL`



3. pending above order=`SELL` | 1. working order=`LIMIT` or `LIMIT_MAKER`



2. pending below order=`STOP_LOSS` or `STOP_LOSS_LIMIT`



3. pending above order=`LIMIT_MAKER` | 1. working order:

NONE



2. pending below order:

25010=2|25011=3|25012=0|25013=2|25011=2|25012=2|25013=2|



3. pending above order:

25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2| | | OTOCO | `2` | 1. working order



2. pending below order



3. pending above order | 1. working order=`SELL` or `BUY`



2. pending below order=`BUY`



3. pending above order=`BUY` | 1. working order=`LIMIT` or `LIMIT_MAKER`



2. pending below order=`LIMIT_MAKER`



3. pending above order=`STOP_LOSS` or `STOP_LOSS_LIMIT` | 1. working order:

NONE



2. pending below order:

25010=2|25011=3|25012=0|25013=2|25011=1|25012=2|25013=2|



3. pending above order:

25010=2|25011=3|25012=0|25013=2|25011=2|25012=1|25013=2| | | OTOCO | `2` | 1. working order



2. pending below order



3. pending above order | 1. working order=`SELL` or `BUY`



2. pending below order=`SELL`



3. pending above order=`SELL` | 1. working order=`LIMIT` or `LIMIT_MAKER`



2. pending below order=`STOP_LOSS` or `STOP_LOSS_LIMIT`



3. pending above order=`TAKE_PROFIT` | 1. working order:

NONE



2. pending below order:

25010=2|25011=3|25012=0|25013=2|25011=1|25012=2|25013=2|



3. pending above order:

25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2| | | OTOCO | `2` | 1. working order



2. pending below order



3. pending above order | 1. working order=`SELL` or `BUY`



2. pending below order=`BUY`



3. pending above order=`BUY` | 1. working order=`LIMIT` or `LIMIT_MAKER`



2. pending below order=`TAKE_PROFIT`



3. pending above order=`STOP_LOSS` or `STOP_LOSS_LIMIT` | 1. working order:

NONE



2. pending below order:

25010=2|25011=3|25012=0|25013=2|25011=1|25012=2|25013=2|



3. pending above order:

25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2| | | OPO | `2` | 1. working order



2. pending order | 1. working order=`BUY`



2. pending order=`SELL` | 1. working order=`LIMIT` or `LIMIT_MAKER`



2. pending order=ANY | 1. working order:

NONE



2. pending order:

25010=1|25011=3|25012=0|25013=1| | | OPOCO | `2` | 1. working order



2. pending below order



3. pending above order | 1. working order=`BUY`



2. pending below order=`SELL`



3. pending above order=`SELL` | 1. working order=`LIMIT` or `LIMIT_MAKER`



2. pending below order=`STOP_LOSS` or `STOP_LOSS_LIMIT`



3. pending above order=`LIMIT_MAKER` | 1. working order:

NONE



2. pending below order:

25010=2|25011=3|25012=0|25013=2|25011=2|25012=2|25013=2|



3. pending above order:

25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2| | | OPOCO | `2` | 1. working order



2. pending below order



3. pending above order | 1. working order=`BUY`

2. pending below order=`SELL`



3. pending above order=`SELL` | 1. working order=`LIMIT` or `LIMIT_MAKER`



2. pending below order=`STOP_LOSS` or `STOP_LOSS_LIMIT`



3. pending above order=`TAKE_PROFIT` or `TAKE_PROFIT_LIMIT` | 1. working order:

NONE



2. pending below order:

25010=2|25011=3|25012=0|25013=2|25011=1|25012=2|25013=2|



3. pending above order:

25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2| | #### ListStatus `` Sent by the server whenever an order list state changes. > [!NOTE] By default, ListStatus`` is sent for all order lists of an account, including those > submitted in different connections. Please see [Response Mode](#responsemode) for other behavior > options. | Tag | Name | Type | Required | Description | | -------- | ---------------------------- | ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------ | | 55 | Symbol | STRING | Y | Symbol of the order list. | | 66 | ListID | STRING | N | `ListID` of the list as assigned by the exchange. | | 25014 | ClListID | STRING | N | `ClListID` of the list as assigned on the request. | | 25015 | OrigClListID | STRING | N | | | 1385 | ContingencyType | INT | N | Possible values:

`1` - ONE_CANCELS_THE_OTHER

`2` - ONE_TRIGGERS_THE_OTHER | | 429 | ListStatusType | INT | Y | Possible values:

`2` - RESPONSE

`4` - EXEC_STARTED

`5` - ALL_DONE

`100` - UPDATED | | 431 | ListOrderStatus | INT | Y | Possible values:

`3` - EXECUTING

`6` - ALL_DONE

`7` - REJECT | | 1386 | ListRejectReason | INT | N | Possible values:

`99` - OTHER | | 103 | OrdRejReason | INT | N | Possible values:

`99` - OTHER | | 60 | TransactTime | UTCTIMESTAMP | N | Timestamp when this event occurred. | | 25016 | ErrorCode | INT | N | API error code (see [Error Codes](errors.md)). | | 58 | Text | STRING | N | Human-readable error message. | | 73 | NoOrders | NUMINGROUP | N | The length of the array for Orders. | | =>55 | Symbol | STRING | Y | Symbol of the order. | | =>37 | OrderID | INT | Y | `OrderID` of the order as assigned by the exchange. | | =>11 | ClOrdID | STRING | Y | `ClOrdID` of the order as assigned on the request. | | =>25010 | NoListTriggeringInstructions | NUMINGROUP | N | The length of the array for ListTriggeringInstructions. | | ==>25011 | ListTriggerType | CHAR | N | Possible values:

`1` - ACTIVATED

`2` - PARTIALLY_FILLED

`3` - FILLED | | ==>25012 | ListTriggerTriggerIndex | INT | N | | | ==>25013 | ListTriggerAction | CHAR | N | Possible values:

`1` - RELEASE

`2` - CANCEL | **Sample message:** ``` 8=FIX.4.4|9=293|35=N|34=2|49=SPOT|52=20240607-02:19:07.837191|56=Eg13pOvN|55=BTCUSDT|60=20240607-02:19:07.836000|66=25|73=2|55=BTCUSDT|37=52|11=w1717726747805308656|55=BTCUSDT|37=53|11=p1717726747805308656|25010=1|25011=3|25012=0|25013=1|429=4|431=3|1385=2|25014=1717726747805308656|25015=1717726747805308656|10=162| ``` #### OrderAmendKeepPriorityRequest `` Sent by the client to reduce the original quantity of their order. This adds 0 orders to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. **Unfilled Order Count:** 0 Read [Order Amend Keep Priority FAQ](faqs/order_amend_keep_priority.md) to learn more. **Notes:** - The `ClOrdID (11)` is not required to be different from the `ClOrdID` of the order. When the `ClOrdID` of the request is the same as the `ClOrdID` of the order being amended, the `ClOrdID` will remain unchanged. - If both `OrderID (37)` and `OrigClOrdID (41)` are provided, the `OrderID` is searched first, then the `OrigClOrdID (41)` from that result is checked against that order. If both conditions are not met the request will be rejected. | Tag | Name | Type | Required | Description | | :-- | :---------- | :----- | :------- | ------------------------------------------------------------------------------------------------------- | | 11 | ClOrdID | STRING | Y | The ClOrdID of this request. | | 41 | OrigClOrdID | STRING | N | `ClOrdID (11)` of the order to amend. Either `OrigClOrdID (41)` or `OrderId (37)` have to be specified. | | 37 | OrderID | INT | N | `OrderID (37)` of the order to amend. Either `OrigClOrdID (41)` or `OrderId (37)` have to be specified. | | 55 | Symbol | STRING | Y | Symbol on which to amend the order. | | 38 | OrderQty | QTY | N | New quantity of the order. Required to be smaller than the original OrderQty of the order. | **Sample message:** ``` 8=FIX.4.4|9=103|35=XAK|34=2|49=EXAMPLE|52=20250319-12:35:21.087|56=SPOT|11=O2EIAS01742387721086|37=0|38=0.9|55=BTCUSDT|10=254| ``` **Response:** - [Reject `<3>`](#reject) if the incoming request is invalid either due to missing required fields, invalid fields, refers to an invalid symbol, or exceeds the message limit. - [OrderAmendReject ``](#orderamendreject) if failed due to insufficient order rate limits, pointing to a non-existent order, quantity is invalid, etc. - [ExecutionReport `<8>`](#executionreport) if the request succeeded for amending a single order. - [ExecutionReport `<8>`](#executionreport) \+ [ListStatus ``](#liststatus) if the request succeeded for amending an order which is part of an Order list. ### OrderAmendReject `` Sent by the server when the OrderAmendKeepPriorityRequest `` has failed. | Tag | Name | Type | Required | Description | | :---- | :---------- | :----- | :------- | :--------------------------------------------- | | 11 | ClOrdID | STRING | Y | `ClOrdId` of the amend request. | | 41 | OrigClOrdID | STRING | N | `OrigClOrdId` (41) from the amend request. | | 37 | OrderID | INT | N | `OrderId (37)` from the amend request. | | 55 | Symbol | STRING | Y | `Symbol (55)` from the amend request. | | 38 | OrderQty | QTY | Y | | | 25016 | ErrorCode | INT | Y | API error code (see [Error Codes](errors.md)). | | 58 | Text | STRING | Y | Human-readable error message. | **Sample message:** ``` 8=FIX.4.4|9=0000176|35=XAR|49=SPOT|56=OE|34=2|52=20250319-14:27:32.751074|11=1WRGW5J1742394452749|37=0|55=BTCUSDT|38=1.000000|25016=-2038|58=The requested action would change no state; rejecting.|10=235| ``` ### Limit Messages #### LimitQuery `` Sent by the client to query current limits. | Tag | Name | Type | Required | Description | | ---- | ----- | ------ | -------- | ------------------ | | 6136 | ReqID | STRING | Y | ID of this request | **Sample message:** ``` 8=FIX.4.4|9=82|35=XLQ|34=2|49=7buKHZxZ|52=20240614-05:35:35.357|56=SPOT|6136=1718343335357229749|10=170| ``` #### LimitResponse `` Sent by the server in response to [LimitQuery``](#limitquery). | Tag | Name | Type | Required | Description | | ------- | ---------------------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | 6136 | ReqID | STRING | Y | `ReqID` from the request. | | 25003 | NoLimitIndicators | NUMINGROUP | Y | The length of the array for LimitIndicators. | | =>25004 | LimitType | CHAR | Y | Possible values:

`1` - ORDER_LIMIT

`2` - MESSAGE_LIMIT | | =>25005 | LimitCount | INT | Y | The current use of this limit. | | =>25006 | LimitMax | INT | Y | The maximum allowed for this limit. | | =>25007 | LimitResetInterval | INT | N | How often the limit resets. | | =>25008 | LimitResetIntervalResolution | CHAR | N | Time unit of `LimitResetInterval`. Possible values:

`s` - SECOND

`m` - MINUTE

`h` - HOUR

`d` - DAY | **Sample message:** ``` 8=FIX.4.4|9=225|35=XLR|34=2|49=SPOT|52=20240614-05:42:42.724057|56=uGnG0ef8|6136=1718343762723730315|25003=3|25004=2|25005=1|25006=1000|25007=10|25008=s|25004=1|25005=0|25006=200|25007=10|25008=s|25004=1|25005=0|25006=200000|25007=1|25008=d|10=241| ``` ### Market Data Messages > [!NOTE] The messages below can only be used for the FIX Market Data. #### InstrumentListRequest `` Sent by the client to query information about instruments. | Tag | Name | Type | Required | Description | | --- | ------------------------- | ------ | -------- | ---------------------------------------------------------------------------------- | | 320 | InstrumentReqID | STRING | Y | ID of this request | | 559 | InstrumentListRequestType | INT | Y | Possible values:

`0` - SINGLE_INSTRUMENT

`4` - ALL_INSTRUMENTS | | 55 | Symbol | STRING | N | Required when the `InstrumentListRequestType` is set to `SINGLE_INSTRUMENT(0)` | **Sample message:** ``` 8=FIX.4.4|9=92|35=x|49=BMDWATCH|56=SPOT|34=2|52=20250114-08:46:56.096691|320=BTCUSDT_INFO|559=0|55=BTCUSDT|10=164| ``` #### InstrumentList `` Sent by the server in a response to the [InstrumentListRequest``](#instrumentlistrequest). > [!NOTE] More detailed symbol information is available through the > [exchangeInfo](/products/spot/rest-api.md#exchange-information) endpoint. | Tag | Name | Type | Required | Description | | ------- | --------------------- | ---------- | -------- | ----------------------------------------------------------------------- | | 320 | InstrumentReqID | STRING | Y | `InstrumentReqID` from the request. | | 146 | NoRelatedSym | NUMINGROUP | Y | Number of symbols | | =>55 | Symbol | STRING | Y | | | =>15 | Currency | STRING | Y | Quote asset of this symbol | | =>562 | MinTradeVol | QTY | N | Corresponds to the [LOT_SIZE](filters.md#lot_size) filter | | =>1140 | MaxTradeVol | QTY | N | Corresponds to the [LOT_SIZE](filters.md#lot_size) filter | | =>25039 | MinQtyIncrement | QTY | N | Corresponds to the [LOT_SIZE](filters.md#lot_size) filter | | =>25040 | MarketMinTradeVol | QTY | N | Corresponds to the [MARKET_LOT_SIZE](filters.md#market_lot_size) filter | | =>25041 | MarketMaxTradeVol | QTY | N | Corresponds to the [MARKET_LOT_SIZE](filters.md#market_lot_size) filter | | =>25042 | MarketMinQtyIncrement | QTY | N | Corresponds to the [MARKET_LOT_SIZE](filters.md#market_lot_size) filter | | =>969 | MinPriceIncrement | PRICE | N | Corresponds to the [PRICE](filters.md#price_filter) filter | | =>2551 | StartPriceRange | PRICE | N | Corresponds to the [PRICE](filters.md#price_filter) filter | | =>2552 | EndPriceRange | PRICE | N | Corresponds to the [PRICE](filters.md#price_filter) filter | **Sample message:** ``` 8=FIX.4.4|9=218|35=y|49=SPOT|56=BMDWATCH|34=2|52=20250114-08:46:56.100147|320=BTCUSDT_INFO|146=1|55=BTCUSDT|15=USDT|562=0.00001000|1140=9000.00000000|25039=0.00001000|25040=0.00000001|25041=76.79001236|25042=0.00000001|969=0.01000000|10=093| ``` #### MarketDataRequest `` Sent by the client to subscribe to or unsubscribe from market data stream. **Trade Stream** The Trade Streams push raw trade information; each trade has a unique buyer and seller. **Fields required to subscribe:** - `SubscriptionRequestType` present with value `SUBSCRIBE(1)` - `MDEntryType` present with value `TRADE(2)` **Update Speed:** Real-time **Individual Symbol Book Ticker Stream** Pushes any update to the best bid or offers price or quantity in real-time for a specified symbol. **Fields required to subscribe:** - `SubscriptionRequestType` with value `SUBSCRIBE(1)` - `MDEntryType` with value `BID(0)` - `MDEntryType` with value `OFFER(1)` - `MarketDepth` with value `1` **Update Speed:** Real-time > [!NOTE] In the [Individual Symbol Book Ticker Stream](#symbolbooktickerstream), when > `MDUpdateAction` is set to `CHANGE(1)` in a > [MarketDataIncrementalRefresh``](#marketdataincrementalrefresh) message sent from the server, > it replaces the previous best quote. **Diff. Depth Stream** Order book price and quantity depth updates used to locally manage an order book. **Fields required to subscribe:** - `SubscriptionRequestType` with value `SUBSCRIBE(1)` - `MDEntryType` with value `BID(0)` - `MDEntryType` with value `OFFER(1)` - `MarketDepth` with a value between `2` and `5000`, which controls the size of the initial snapshot and has no effect on subsequent [MarketDataIncrementalRefresh``](#marketdataincrementalrefresh) messages **Update Speed:** 100ms > [!NOTE] Since the [MarketDataSnapshot``](#marketdatasnapshot) have a limit on the number of > price levels (5000 on each side maximum), you won't learn the quantities for the levels outside of > the initial snapshot unless they change. So be careful when using the information for those > levels, since they might not reflect the full view of the order book. However, for most use cases, > seeing 5000 levels on each side is enough to understand the market and trade effectively. | Tag | Name | Type | Required | Description | | :---- | ----------------------- | ---------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- | | 262 | MDReqID | STRING | Y | ID of this request | | 263 | SubscriptionRequestType | CHAR | Y | Subscription Request Type. Possible values:

`1` - SUBSCRIBE

`2` - UNSUBSCRIBE | | 264 | MarketDepth | INT | N | Subscription depth.

Possible values:

`1` - Book Ticker subscription

`2`-`5000` - Diff. Depth Stream | | 266 | AggregatedBook | NUMINGROUP | N | Possible values:

`Y` - one book entry per side per price | | 146 | NoRelatedSym | NUMINGROUP | N | Number of symbols | | =>55 | Symbol | STRING | Y | | | 267 | NoMDEntryTypes | NUMINGROUP | N | Number of entry types | | =>269 | MDEntryType | CHAR | Y | Possible values:

`0` - BID

`1` - OFFER

`2` - TRADE | **Sample message:** ``` # Subscriptions # BOOK TICKER Stream 8=FIX.4.4|9=132|35=V|49=TRADER1|56=SPOT|34=4|52=20241122-06:17:14.183428|262=BOOK_TICKER_STREAM|263=1|264=1|266=Y|146=1|55=BTCUSDT|267=2|269=0|269=1|10=010| # DEPTH Stream 8=FIX.4.4|9=127|35=V|49=TRADER1|56=SPOT|34=7|52=20241122-06:17:14.443822|262=DEPTH_STREAM|263=1|264=10|266=Y|146=1|55=BTCUSDT|267=2|269=0|269=1|10=111| # TRADE Stream 8=FIX.4.4|9=120|35=V|49=TRADER1|56=SPOT|34=3|52=20241122-06:34:14.775606|262=TRADE_STREAM|263=1|264=1|266=Y|146=1|55=BTCUSDT|267=1|269=2|10=040| # Unsubscription from TRADE Stream 8=FIX.4.4|9=79|35=V|49=TRADER1|56=SPOT|34=7|52=20241122-06:41:56.966969|262=TRADE_STREAM|263=2|264=1|10=113| ``` ### MarketDataRequestReject `` Sent by the server in a response to an invalid MarketDataRequest ``. | Tag | Name | Type | Required | Description | | ----- | -------------- | ------ | -------- | ----------------------------------------------------------------------------------------- | | 262 | MDReqID | STRING | Y | ID of the invalid [MarketDataRequest``](#marketdatarequest) | | 281 | MDReqRejReason | CHAR | N | Possible values:

`1` - DUPLICATE_MDREQID

`2` - TOO_MANY_SUBSCRIPTIONS | | 25016 | ErrorCode | INT | N | API Error code. See [Errors](errors.md) | | 58 | Text | STRING | N | Human-readable error message. | **Sample message:** ``` 8=FIX.4.4|9=0000218|35=Y|49=SPOT|56=EXAMPLE|34=5|52=20241019-05:39:36.688964|262=BOOK_TICKER_2|281=2|25016=-1191|58=Similar subscription is already active on this connection. Symbol='BNBBUSD', active subscription id: 'BOOK_TICKER_1'.|10=137| ``` ### MarketDataSnapshot `` Sent by the server in response to a [MarketDataRequest``](#marketdatarequest), activating [Individual Symbol Book Ticker Stream](#symbolbooktickerstream) or [Diff. Depth Stream](#diffdepthstream) subscriptions. | Tag | Name | Type | Required | Description | | ----- | ---------------- | ---------- | -------- | --------------------------------------------------------------------------------------- | | 262 | MDReqID | STRING | Y | ID of the [MarketDataRequest``](#marketdatarequest) that activated this subscription | | 55 | Symbol | STRING | Y | | | 25044 | LastBookUpdateID | INT | N | | | 268 | NoMDEntries | NUMINGROUP | Y | Number of entries | | =>269 | MDEntryType | CHAR | Y | Possible values:

`0` - BID

`1` - OFFER

`2` - TRADE | | =>270 | MDEntryPx | PRICE | Y | Price | | =>271 | MDEntrySize | QTY | Y | Quantity | **Sample message:** ``` 8=FIX.4.4|9=0000107|35=W|49=SPOT|56=EXAMPLE|34=34|52=20241019-05:41:52.867164|262=BOOK_TICKER_1_2|55=BNBBUSD|25044=0|268=0|10=151| ``` ### MarketDataIncrementalRefresh `` Sent by the server when there is a change in a subscribed stream. | Tag | Name | Type | Required | Description | | ------- | ----------------- | ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | 262 | MDReqID | STRING | Y | ID of the [MarketDataRequest``](#marketdatarequest) that activated this subscription | | 268 | NoMDEntries | NUMINGROUP | Y | Number of entries | | =>279 | MDUpdateAction | CHAR | Y | Possible values:

`0` - NEW

`1` - CHANGE

`2` - DELETE | | =>270 | MDEntryPx | PRICE | Y | Price | | =>271 | MDEntrySize | QTY | N | Quantity | | =>269 | MDEntryType | CHAR | Y | Possible values:

`0` - BID

`1` - OFFER

`2` - TRADE | | =>55 | Symbol | STRING | N | Market Data Entry will default to the same `Symbol` of the previous Market Data Entry in the same Market Data message if `Symbol` is not specified | | =>60 | TransactTime | UTCTIMESTAMP | N | | | =>1003 | TradeID | INT | N | | | =>2446 | AggressorSide | CHAR | N | Possible values:

`1` - BUY

`2` - SELL | | =>25043 | FirstBookUpdateID | INT | N | Only present in [Diff. Depth Stream](#diffdepthstream).

Market Data Entry will default to the same `FirstBookUpdateID` of the previous Market Data Entry in the same Market Data message if `FirstBookUpdateID` is not specified | | =>25044 | LastBookUpdateID | INT | N | Only present in [Diff. Depth Stream](#diffdepthstream) and [Individual Symbol Book Ticker Stream](#symbolbooktickerstream).

Market Data Entry will default to the same `LastBookUpdateID` of the previous Market Data Entry in the same Market Data message if `LastBookUpdateID` is not specified | **Sample message:** ``` 8=FIX.4.4|9=0000303|35=X|49=SPOT|56=EXAMPLE|34=16|52=20241019-05:40:11.466313|262=TRADE_3|268=3|279=0|269=2|270=10.00000|271=0.01000|55=BNBBUSD|1003=0|60=20241019-05:40:11.464000|279=0|269=2|270=10.00000|271=0.01000|1003=1|60=20241019-05:40:11.464000|279=0|269=2|270=10.00000|271=0.01000|1003=2|60=20241019-05:40:11.464000|10=042| ``` ## FIX SBE FIX SBE (Simple Binary Encoding) can be used instead of FIX with the [spot_fix_prod_latest.xml](/products/spot/sbe/schemas/spot_fix_prod_latest.xml) schema file. ### SBE Read the [SBE FAQ](./faqs/sbe_faq.md) for important information about using SBE with Binance APIs. - Please review and understand the [SBE specification](https://www.fixtrading.org/standards/sbe-online/) before attempting to use FIX SBE - When encoding and decoding SBE payloads, it is recommended to use code generated by [`SbeTool`](https://github.com/aeron-io/simple-binary-encoding) to ensure compliance with the FIX SBE specification. ### Endpoints In addition to FIX encoding available on port 9000, two request/response encoding schemes are supported on additional TCP ports. See below endpoints for each API. #### Order Entry - `tcp+tls://fix-oe.binance.com:9001`: Send FIX requests; receive FIX SBE responses - FIX `SbeSchemaId` tag (=25050) must be set to the FIX SBE schema ID (e.g. 1) - The FIX `SbeSchemaVersion` tag (=25051) must be set to the FIX SBE schema version (e.g. 0) - `tcp+tls://fix-oe.binance.com:9002`: Send FIX SBE requests; receive FIX SBE responses #### Drop Copy - `tcp+tls://fix-dc.binance.com:9001`: Send FIX requests; receive FIX SBE responses - FIX `SbeSchemaId` tag (=25050) must be set to the FIX SBE schema ID (e.g. 1) - The FIX `SbeSchemaVersion` tag (=25051) must be set to the FIX SBE schema version (e.g. 0) - `tcp+tls://fix-dc.binance.com:9002`: Send FIX SBE requests; receive FIX SBE responses #### Market data - `tcp+tls://fix-md.binance.com:9001`: Send FIX requests; receive FIX SBE responses - FIX `SbeSchemaId` tag (=25050) must be set to the FIX SBE schema ID (e.g. 1) - The FIX `SbeSchemaVersion` tag (=25051) must be set to the FIX SBE schema version (e.g. 0) - `tcp+tls://fix-md.binance.com:9002`: Send FIX SBE requests; receive FIX SBE responses ### FIX SBE encoding layout FIX SBE request/response messages always come with a SOFH (Simple Open Framing Header) and message header. A given FIX SBE message of N bytes has the following wire format: ` ` SOFH: This corresponds to the "sofh" composite type in the schema file. This acts as a framing header so that the FIX SBE servers/clients can know the length of SBE messages and ensure messages have been fully received prior to deserializing them Notes: - The two fields within the SOFH MUST be encoded in little-endian - The FIX servers only support `0xEB50` for the encodingType field, i.e. only little-endian is supported for all fields Message header: This corresponds to the "messageHeader" composite type in the schema file. ### Logon The logon signature (RawData) is computed as documented in the [signature computation](#signaturecomputation) section. #### Sample FIX SBE `Logon` request message Please see below the hexdump of a sample FIX SBE `Logon` message obtained by following the above instructions. | Bytes | Description | | ---------------------------------------------- | -------------------------- | | 0xd1, 0x00, 0x00, 0x00 | sofh.messageLength | | 0x50, 0xeb | sofh.encodingType | | 0x0e, 0x00 | messageHeader.blockLength | | 0x28, 0x4e | messageHeader.templateId | | 0x01, 0x00 | messageHeader.schemaId | | 0x00, 0x00 | messageHeader.version | | 0x01, 0x00, 0x00, 0x00 | messageHeader.seqNum | | 0x58, 0x7a, 0x5f, 0x99, 0xdb, 0x1b, 0x06, 0x00 | messageHeader.sendingTime | | 0x00 | Logon.EncryptMethod | | 0x1e, 0x00, 0x00, 0x00 | Logon.HeartBtInt | | 0x01 | Logon.ResetSeqNumFlag | | 0x02 | Logon.MessageHandling | | 0xff | Logon.ResponseMode | | 0xff | Logon.ExecutionReportType | | 0xff | Logon.DropCopyFlag | | 0xff, 0xff, 0xff, 0xff | Logon.RecvWindow | | 0x07 | Logon.SenderCompId.length | | 0x45, 0x58, 0x41, 0x4d, 0x50, 0x4c, 0x45 | Logon.SenderCompId.varData | | 0x04 | Logon.TargetCompId.length | | 0x53, 0x50, 0x4f, 0x54 | Logon.TargetCompId.varData | | 0x58, 0x00 | Logon.RawData.length | | 0x34, 0x4d, 0x48, 0x58, 0x65, 0x6c, 0x56, 0x56 | Logon.RawData.varData | | 0x63, 0x70, 0x6b, 0x64, 0x77, 0x75, 0x4c, 0x62 | Logon.RawData.varData | | 0x6c, 0x36, 0x6e, 0x37, 0x33, 0x48, 0x51, 0x55 | Logon.RawData.varData | | 0x58, 0x55, 0x66, 0x31, 0x64, 0x73, 0x65, 0x32 | Logon.RawData.varData | | 0x50, 0x43, 0x67, 0x54, 0x31, 0x44, 0x59, 0x71 | Logon.RawData.varData | | 0x57, 0x39, 0x77, 0x38, 0x41, 0x56, 0x5a, 0x31 | Logon.RawData.varData | | 0x52, 0x41, 0x43, 0x46, 0x47, 0x4d, 0x2b, 0x35 | Logon.RawData.varData | | 0x55, 0x64, 0x6c, 0x47, 0x50, 0x72, 0x51, 0x48 | Logon.RawData.varData | | 0x72, 0x67, 0x74, 0x53, 0x33, 0x43, 0x76, 0x73 | Logon.RawData.varData | | 0x52, 0x55, 0x52, 0x43, 0x31, 0x6f, 0x6a, 0x37 | Logon.RawData.varData | | 0x33, 0x6a, 0x38, 0x67, 0x43, 0x41, 0x3d, 0x3d | Logon.RawData.varData | | 0x40, 0x00 | Logon.Username.length | | 0x73, 0x42, 0x52, 0x58, 0x72, 0x4a, 0x78, 0x32 | Logon.Username.varData | | 0x44, 0x73, 0x4f, 0x72, 0x61, 0x4d, 0x58, 0x4f | Logon.Username.varData | | 0x61, 0x55, 0x6f, 0x76, 0x45, 0x68, 0x67, 0x56 | Logon.Username.varData | | 0x52, 0x63, 0x6a, 0x4f, 0x76, 0x43, 0x74, 0x51 | Logon.Username.varData | | 0x77, 0x6e, 0x57, 0x6a, 0x38, 0x56, 0x78, 0x6b | Logon.Username.varData | | 0x4f, 0x68, 0x31, 0x78, 0x71, 0x62, 0x6f, 0x53 | Logon.Username.varData | | 0x30, 0x32, 0x53, 0x50, 0x47, 0x66, 0x4b, 0x69 | Logon.Username.varData | | 0x32, 0x68, 0x38, 0x73, 0x70, 0x5a, 0x4a, 0x62 | Logon.Username.varData | ### FIX vs. FIX SBE General: - The `sofh.messageLength` field _must_ include the size of the SOFH (6 bytes) - FIX SBE has no `Checksum` field - When sending FIX SBE requests on port 9002 - All fields must be set in the payload - Optional fields that are not present must be set to the corresponding `nullValue` - The encoders generated by `SbeTool` handle this correctly - Please refer to the definition of `nullValue` in the [SBE specification](https://www.fixtrading.org/standards/sbe-online/) if encoding payloads manually Decimal encoding: - In request messages, the values for `PriceExponent` and `QtyExponent` must be no more precise than the precision of the symbol being transacted. Symbol precision can be retrieved from the `InstrumentList` response. **Logon** message: - The `SenderCompID`, `TargetCompID` and `RecvWindow` fields are provided in the `Logon` FIX SBE message instead of the message header - The `RecvWindow` field set in the `Logon` message applies to all trading request messages within the FIX SBE session - When set, the `RecvWindow` field is in microseconds - When the `ResponseMode` field is set to `OnlyAcks`, the `ExecutionReportType` field can be set to `Mini` to receive `ExecutionReportAck` messages instead of `ExecutionReport` - Note: The `ExecutionReportType` field is only supported on port 9001 and port 9002 for the Order Entry and Drop Copy endpoints **MarketDataIncrementalRefresh** message: - This single message in the FIX schema is split into the following FIX SBE messages: `MarketDataIncrementalTrade`, `MarketDataIncrementalBookTicker` and `MarketDataIncrementalDepth` - The `MDReqID` field is omitted from the market data snapshot and refresh messages as these messages can be tied to the subscription request using the `Symbol` field and the message's template ID - `MDReqID` is required in the `MarketDataRequest` message so that it may appear in `MarketDataRequestReject` - The value of `MDReqID` must be unique across subscriptions **MarketDataIncrementalTrade** message: - The MDUpdateAction field available in the FIX schema is omitted in FIX SBE since the value is always `NEW`. **MarketDataIncrementalBookTicker** message: - FIX SBE book ticker subscriptions use **auto-culling**: when the system is under high load, it may drop outdated events instead of queuing all events and delivering them with a delay. - For example, if a best bid/ask event is generated at time T2 when there is still an undelivered event queued at time T1 (where T1 < T2), the event for T1 is dropped, and the system will deliver only the event for T2. This is done on a per-symbol basis. - The `MDUpdateAction` field available in the FIX schema is omitted in FIX SBE as its value may be derived from `MDEntrySize`. - When `MDEntrySize` is unset (`NullVal`), `MDUpdateAction` is `DELETE`. - When `MDEntrySize` is set, - if the price level exists in your local order book, `MDUpdateAction` is `CHANGE` - else `MDUpdateAction` is `NEW`. **MarketDataIncrementalDepth** message: - FIX SBE depth update speed: 25ms - The `MDUpdateAction` field available in the FIX schema is omitted in FIX SBE as its value may be derived from `MDEntrySize`. - When `MDEntrySize` is unset (`NullVal`), `MDUpdateAction` is `DELETE`. - When `MDEntrySize` is set, - if the price level exists in your local order book, `MDUpdateAction` is `CHANGE` - else `MDUpdateAction` is `NEW`. ### Limits Connection limits are shared between FIX and FIX SBE. ### Errors The following FIX SBE-specific errors may be returned: | Code | Message | Description | | ----- | ------------------------------------------- | --------------------------------------------------------------- | | -1152 | Invalid SBE message header. | Error when decoding `messageHeader` in FIX SBE request | | -1153 | Invalid SBE schema ID or version specified. | Error when parsing/decoding FIX SBE schema ID/version | | -1177 | Invalid encodingType. | Error when decoding `encodingType` field in sofh composite type | | -1221 | Invalid/missing field(s) in SBE message. | Invalid/missing field when decoding FIX SBE request | Note: Error codes returned for semantically equivalent FIX and FIX SBE requests may not be identical. ### FAQ See the [SBE FAQ](./faqs/sbe_faq.md) for more information on generating SBE decoders and handling schema updates. --- ## Document: /products/spot/filters URL: /en/dev-docs/products/spot/filters # Filters Filters define trading rules on a symbol or an exchange. Filters come in three forms: `symbol filters`, `exchange filters` and `asset filters`. ## Symbol filters ### PRICE_FILTER The `PRICE_FILTER` defines the `price` rules for a symbol. There are 3 parts: - `minPrice` defines the minimum `price`/`stopPrice` allowed; disabled on `minPrice` == 0. - `maxPrice` defines the maximum `price`/`stopPrice` allowed; disabled on `maxPrice` == 0. - `tickSize` defines the intervals that a `price`/`stopPrice` can be increased/decreased by; disabled on `tickSize` == 0. Any of the above variables can be set to 0, which disables that rule in the `price filter`. In order to pass the `price filter`, the following must be true for `price`/`stopPrice` of the enabled rules: - `price` >= `minPrice` - `price` <= `maxPrice` - `price` % `tickSize` == 0 **/exchangeInfo format:** ```javascript { "filterType": "PRICE_FILTER", "minPrice": "0.00000100", "maxPrice": "100000.00000000", "tickSize": "0.00000100" } ``` ### PERCENT_PRICE The `PERCENT_PRICE` filter defines the valid range for an order `price` based on an `average of previous trade prices`. - When a non-null [reference price](/products/spot/faqs/price_range_execution_rules) for the symbol exists, it is used in the filter evaluation. - When a non-null reference price for the symbol does not exist, then the volume weighted average price over the preceding `avgPriceMins` minutes is used in the filter evaluation. - If `avgPriceMins` is 0, then the last price is used in the filter evaluation. An order will pass this filter evaluation if: - `price` <= `average of previous trade prices` \* `multiplierUp` - `price` >= `average of previous trade prices` \* `multiplierDown` **/exchangeInfo format:** ```javascript { "filterType": "PERCENT_PRICE", "multiplierUp": "1.3000", "multiplierDown": "0.7000", "avgPriceMins": 5 } ``` ### PERCENT_PRICE_BY_SIDE The `PERCENT_PRICE_BY_SIDE` filter defines the valid range for an order `price` based on an `average of previous trade prices`. - When a non-null [reference price](/products/spot/faqs/price_range_execution_rules) for the symbol exists, it is used in the filter evaluation. - When a non-null reference price for the symbol does not exist, then the volume weighted average price over the preceding `avgPriceMins` minutes is used in the filter evaluation. - If `avgPriceMins` is 0, then the last price is used in the filter evaluation. There is a different range depending on whether an order is placed on the `BUY` side or the `SELL` side. A `BUY` order will pass this filter evaluation if: - `price` <= `average of previous trade prices` \* `bidMultiplierUp` - `price` >= `average of previous trade prices` \* `bidMultiplierDown` A `SELL` order will pass this filter evaluation if: - `price` <= `average of previous trade prices` \* `askMultiplierUp` - `price` >= `average of previous trade prices` \* `askMultiplierDown` **/exchangeInfo format:** ```javascript { "filterType": "PERCENT_PRICE_BY_SIDE", "bidMultiplierUp": "1.2", "bidMultiplierDown": "0.2", "askMultiplierUp": "5", "askMultiplierDown": "0.8", "avgPriceMins": 1 } ``` ### LOT_SIZE The `LOT_SIZE` filter defines the `quantity` (aka "lots" in auction terms) rules for a symbol. There are 3 parts: - `minQty` defines the minimum `quantity`/`icebergQty` allowed. - `maxQty` defines the maximum `quantity`/`icebergQty` allowed. - `stepSize` defines the intervals that a `quantity`/`icebergQty` can be increased/decreased by. In order to pass the `lot size`, the following must be true for `quantity`/`icebergQty`: - `quantity` >= `minQty` - `quantity` <= `maxQty` - `quantity` % `stepSize` == 0 **/exchangeInfo format:** ```javascript { "filterType": "LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000" } ``` ### MIN_NOTIONAL The `MIN_NOTIONAL` filter defines the minimum notional value allowed for an order on a symbol. - An order's notional value is the `price` \* `quantity`. - `applyToMarket` determines whether or not the `MIN_NOTIONAL` filter will also be applied to `MARKET` orders. - Since `MARKET` orders have no `price`, an `average of previous trade prices` is used instead. - When a non-null [reference price](/products/spot/faqs/price_range_execution_rules) for the symbol exists, it is used as `price`. - When a non-null reference price for the symbol does not exist, then the volume weighted average price over the preceding `avgPriceMins` minutes is used as `price`. - If `avgPriceMins` is 0, then the last price is used as `price`. An order will pass this filter evaluation if: - `price` \* `quantity` >= `minNotional` **/exchangeInfo format:** ```javascript { "filterType": "MIN_NOTIONAL", "minNotional": "0.00100000", "applyToMarket": true, "avgPriceMins": 5 } ``` ### NOTIONAL The `NOTIONAL` filter defines the acceptable notional range allowed for an order on a symbol. - `applyMinToMarket` determines whether `minNotional` will be applied to `MARKET` orders. - `applyMaxToMarket` determines whether `maxNotional` will be applied to `MARKET` orders. - Since `MARKET` orders have no `price`, an `average of previous trade prices` is used instead. - When a non-null [reference price](/products/spot/faqs/price_range_execution_rules) for the symbol exists, it is used as `price`. - When a non-null reference price for the symbol does not exist, then the volume weighted average price over the preceding `avgPriceMins` minutes is used as `price`. - If `avgPriceMins` is 0, then the last price is used as `price`. An order will pass this filter evaluation if: - `price` \* `quantity` <= `maxNotional` - `price` \* `quantity` >= `minNotional` **/exchangeInfo format:** ```javascript { "filterType": "NOTIONAL", "minNotional": "10.00000000", "applyMinToMarket": false, "maxNotional": "10000.00000000", "applyMaxToMarket": false, "avgPriceMins": 5 } ``` ### ICEBERG_PARTS The `ICEBERG_PARTS` filter defines the maximum parts an iceberg order can have. The number of `ICEBERG_PARTS` is defined as `CEIL(qty / icebergQty)`. **/exchangeInfo format:** ```javascript { "filterType": "ICEBERG_PARTS", "limit": 10 } ``` ### MARKET_LOT_SIZE The `MARKET_LOT_SIZE` filter defines the `quantity` (aka "lots" in auction terms) rules for `MARKET` orders on a symbol. There are 3 parts: - `minQty` defines the minimum `quantity` allowed. - `maxQty` defines the maximum `quantity` allowed. - `stepSize` defines the intervals that a `quantity` can be increased/decreased by. In order to pass the `market lot size`, the following must be true for `quantity`: - `quantity` >= `minQty` - `quantity` <= `maxQty` - `quantity` % `stepSize` == 0 **/exchangeInfo format:** ```javascript { "filterType": "MARKET_LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000" } ``` ### MAX_NUM_ORDERS The `MAX_NUM_ORDERS` filter defines the maximum number of orders an account is allowed to have open on a symbol. Note that both "algo" orders and normal orders are counted for this filter. **/exchangeInfo format:** ```javascript { "filterType": "MAX_NUM_ORDERS", "maxNumOrders": 25 } ``` ### MAX_NUM_ALGO_ORDERS The `MAX_NUM_ALGO_ORDERS` filter defines the maximum number of "algo" orders an account is allowed to have open on a symbol. "Algo" orders are `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, and `TAKE_PROFIT_LIMIT` orders. **/exchangeInfo format:** ```javascript { "filterType": "MAX_NUM_ALGO_ORDERS", "maxNumAlgoOrders": 5 } ``` ### MAX_NUM_ICEBERG_ORDERS The `MAX_NUM_ICEBERG_ORDERS` filter defines the maximum number of `ICEBERG` orders an account is allowed to have open on a symbol. An `ICEBERG` order is any order where the `icebergQty` is > 0. **/exchangeInfo format:** ```javascript { "filterType": "MAX_NUM_ICEBERG_ORDERS", "maxNumIcebergOrders": 5 } ``` ### MAX_POSITION The `MAX_POSITION` filter defines the allowed maximum position an account can have on the base asset of a symbol. An account's position defined as the sum of the account's: 1. free balance of the base asset 1. locked balance of the base asset 1. sum of the qty of all open BUY orders `BUY` orders will be rejected if the account's position is greater than the maximum position allowed. If an order's `quantity` can cause the position to overflow, this will also fail the `MAX_POSITION` filter. **/exchangeInfo format:** ```javascript { "filterType": "MAX_POSITION", "maxPosition": "10.00000000" } ``` ### TRAILING_DELTA The `TRAILING_DELTA` filter defines the minimum and maximum value for the parameter [`trailingDelta`](/products/spot/faqs/trailing-stop-faq). In order for a trailing stop order to pass this filter, the following must be true: For `STOP_LOSS BUY`, `STOP_LOSS_LIMIT_BUY`,`TAKE_PROFIT SELL` and `TAKE_PROFIT_LIMIT SELL` orders: - `trailingDelta` >= `minTrailingAboveDelta` - `trailingDelta` <= `maxTrailingAboveDelta` For `STOP_LOSS SELL`, `STOP_LOSS_LIMIT SELL`, `TAKE_PROFIT BUY`, and `TAKE_PROFIT_LIMIT BUY` orders: - `trailingDelta` >= `minTrailingBelowDelta` - `trailingDelta` <= `maxTrailingBelowDelta` **/exchangeInfo format:** ```javascript { "filterType": "TRAILING_DELTA", "minTrailingAboveDelta": 10, "maxTrailingAboveDelta": 2000, "minTrailingBelowDelta": 10, "maxTrailingBelowDelta": 2000 } ``` ### MAX_NUM_ORDER_AMENDS The `MAX_NUM_ORDER_AMENDS` filter defines the maximum number of times an order can be amended on the given symbol. If there are too many order amendments made on a single order, you will receive the `-2038` error code. **/exchangeInfo format:** ```javascript { "filterType": "MAX_NUM_ORDER_AMENDS", "maxNumOrderAmends": 10 } ``` ### MAX_NUM_ORDER_LISTS The `MAX_NUM_ORDER_LISTS` filter defines the maximum number of open order lists an account can have on a symbol. Note that OTOCOs count as one order list. **/exchangeInfo format:** ```javascript { "filterType": "MAX_NUM_ORDER_LISTS", "maxNumOrderLists": 20 } ``` ## Exchange Filters ### EXCHANGE_MAX_NUM_ORDERS The `EXCHANGE_MAX_NUM_ORDERS` filter defines the maximum number of orders an account is allowed to have open on the exchange. Note that both "algo" orders and normal orders are counted for this filter. **/exchangeInfo format:** ```javascript { "filterType": "EXCHANGE_MAX_NUM_ORDERS", "maxNumOrders": 1000 } ``` ### EXCHANGE_MAX_NUM_ALGO_ORDERS The `EXCHANGE_MAX_NUM_ALGO_ORDERS` filter defines the maximum number of "algo" orders an account is allowed to have open on the exchange. "Algo" orders are `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, and `TAKE_PROFIT_LIMIT` orders. **/exchangeInfo format:** ```javascript { "filterType": "EXCHANGE_MAX_NUM_ALGO_ORDERS", "maxNumAlgoOrders": 200 } ``` ### EXCHANGE_MAX_NUM_ICEBERG_ORDERS The `EXCHANGE_MAX_NUM_ICEBERG_ORDERS` filter defines the maximum number of iceberg orders an account is allowed to have open on the exchange. **/exchangeInfo format:** ```javascript { "filterType": "EXCHANGE_MAX_NUM_ICEBERG_ORDERS", "maxNumIcebergOrders": 10000 } ``` ### EXCHANGE_MAX_NUM_ORDER_LISTS The `EXCHANGE_MAX_NUM_ORDER_LISTS` filter defines the maximum number of order lists an account is allowed to have open on the exchange. Note that OTOCOs count as one order list. **/exchangeInfo format:** ```javascript { "filterType": "EXCHANGE_MAX_NUM_ORDER_LISTS", "maxNumOrderLists": 20 } ``` ## Asset Filters ### MAX_ASSET The `MAX_ASSET` filter defines the maximum quantity of an asset that an account is allowed to transact in a single order. - When the asset is a symbol's base asset, the limit applies to the order's quantity. - When the asset is a symbol's quote asset, the limit applies to the order's notional value. - For example, a MAX_ASSET filter for USDC applies to all symbols that have USDC as either a base or quote asset, such as: - USDCBNB - BNBUSDC **/myFilters format:** ```javascript { "filterType": "MAX_ASSET", "asset": "USDC", "limit": "42.00000000" } ``` --- ## Document: /products/spot/errors URL: /en/dev-docs/products/spot/errors # Error codes for Binance Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. Here is the error JSON payload: ```javascript { "code":-1121, "msg":"Invalid symbol." } ``` ## 10xx - General Server or Network issues ### -1000 UNKNOWN - An unknown error occurred while processing the request. ### -1001 DISCONNECTED - Internal error; unable to process your request. Please try again. ### -1002 UNAUTHORIZED - You are not authorized to execute this request. ### -1003 TOO_MANY_REQUESTS - Too many requests queued. - Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. - Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. ### -1006 UNEXPECTED_RESP - An unexpected response was received from the message bus. Execution status unknown. ### -1007 TIMEOUT - Timeout waiting for response from backend server. Send status unknown; execution status unknown. ### -1008 SERVER_BUSY - Server is currently overloaded with other requests. Please try again in a few minutes. ### -1013 INVALID_MESSAGE - The request is rejected by the API. (i.e. The request didn't reach the Matching Engine.) - Potential error messages can be found in [Filter Failures](#filter-failures) or [Failures during order placement](#other-errors). ### -1014 UNKNOWN_ORDER_COMPOSITION - Unsupported order combination. ### -1015 TOO_MANY_ORDERS - Too many new orders. - Too many new orders; current limit is %s orders per %s. ### -1016 SERVICE_SHUTTING_DOWN - This service is no longer available. ### -1020 UNSUPPORTED_OPERATION - This operation is not supported. ### -1021 INVALID_TIMESTAMP - Timestamp for this request is outside of the recvWindow. - Timestamp for this request was 1000ms ahead of the server's time. ### -1022 INVALID_SIGNATURE - Signature for this request is not valid. ### -1033 COMP_ID_IN_USE - `SenderCompId(49)` is currently in use. Concurrent use of the same SenderCompId within one account is not allowed. ### -1034 TOO_MANY_CONNECTIONS - Too many concurrent connections; current limit is '%s'. - Too many connection attempts for account; current limit is %s per '%s'. - Too many connection attempts from IP; current limit is %s per '%s'. ### -1035 LOGGED_OUT - Please send [Logout`<5>`](fix-api.md#logout) message to close the session. ## 11xx - Request issues ### -1100 ILLEGAL_CHARS - Illegal characters found in a parameter. - Illegal characters found in parameter '%s'; legal range is '%s'. ### -1101 TOO_MANY_PARAMETERS - Too many parameters sent for this endpoint. - Too many parameters; expected '%s' and received '%s'. - Duplicate values for a parameter detected. ### -1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED - A mandatory parameter was not sent, was empty/null, or malformed. - Mandatory parameter '%s' was not sent, was empty/null, or malformed. - Param '%s' or '%s' must be sent, but both were empty/null! - Required tag '%s' missing. - Field value was empty or malformed. - '%s' contains unexpected value. Cannot be greater than %s. ### -1103 UNKNOWN_PARAM - An unknown parameter was sent. - Undefined Tag. ### -1104 UNREAD_PARAMETERS - Not all sent parameters were read. - Not all sent parameters were read; read '%s' parameter(s) but was sent '%s'. ### -1105 PARAM_EMPTY - A parameter was empty. - Parameter '%s' was empty. ### -1106 PARAM_NOT_REQUIRED - A parameter was sent when not required. - Parameter '%s' sent when not required. - A tag '%s' was sent when not required. ### -1108 PARAM_OVERFLOW - Parameter '%s' overflowed. ### -1111 BAD_PRECISION - Parameter '%s' has too much precision. ### -1112 NO_DEPTH - No orders on book for symbol. ### -1114 TIF_NOT_REQUIRED - TimeInForce parameter sent when not required. ### -1115 INVALID_TIF - Invalid timeInForce. ### -1116 INVALID_ORDER_TYPE - Invalid orderType. ### -1117 INVALID_SIDE - Invalid side. ### -1118 EMPTY_NEW_CL_ORD_ID - New client order ID was empty. ### -1119 EMPTY_ORG_CL_ORD_ID - Original client order ID was empty. ### -1120 BAD_INTERVAL - Invalid interval. ### -1121 BAD_SYMBOL - Invalid symbol. ### -1122 INVALID_SYMBOLSTATUS - Invalid symbolStatus. ### -1125 INVALID_LISTEN_KEY - This listenKey does not exist. ### -1127 MORE_THAN_XX_HOURS - Lookup interval is too big. - More than %s hours between startTime and endTime. ### -1128 OPTIONAL_PARAMS_BAD_COMBO - Combination of optional parameters invalid. - Combination of optional fields invalid. Recommendation: '%s' and '%s' must both be sent. - Fields [%s] must be sent together or omitted entirely. - Invalid `MDEntryType (269)` combination. BID and OFFER must be requested together. - Conflicting fields: ['%s'...] ### -1130 INVALID_PARAMETER - Invalid data sent for a parameter. - Data sent for parameter '%s' is not valid. ### -1134 BAD_STRATEGY_TYPE - `strategyType` was less than 1000000. - `TargetStrategy (847)` was less than 1000000. ### -1135 INVALID_JSON - Invalid JSON Request - JSON sent for parameter '%s' is not valid ### -1139 INVALID_TICKER_TYPE - Invalid ticker type. ### -1145 INVALID_CANCEL_RESTRICTIONS - `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. ### -1151 DUPLICATE_SYMBOLS - Symbol is present multiple times in the list. ### -1152 INVALID_SBE_HEADER - Invalid `X-MBX-SBE` header; expected `:`. - Invalid SBE message header. ### -1153 UNSUPPORTED_SCHEMA_ID - Unsupported SBE schema ID or version specified in the `X-MBX-SBE` header. - Invalid SBE schema ID or version specified. ### -1155 SBE_DISABLED - SBE is not enabled. ### -1158 OCO_ORDER_TYPE_REJECTED - Order type not supported in OCO. - If the order type provided in the `aboveType` and/or `belowType` is not supported. ### -1160 OCO_ICEBERGQTY_TIMEINFORCE - Parameter '%s' is not supported if `aboveTimeInForce`/`belowTimeInForce` is not GTC. - If the order type for the above or below leg is `STOP_LOSS_LIMIT`, and `icebergQty` is provided for that leg, the `timeInForce` has to be `GTC` else it will throw an error. - `TimeInForce (59)` must be `GTC (1)` when `MaxFloor (111)` is used. ### -1161 DEPRECATED_SCHEMA - Unable to encode the response in SBE schema 'x'. Please use schema 'y' or higher. ### -1165 BUY_OCO_LIMIT_MUST_BE_BELOW - A limit order in a buy OCO must be below. ### -1166 SELL_OCO_LIMIT_MUST_BE_ABOVE - A limit order in a sell OCO must be above. ### -1168 BOTH_OCO_ORDERS_CANNOT_BE_LIMIT - At least one OCO order must be contingent. ### -1169 INVALID_TAG_NUMBER - Invalid tag number. ### -1170 TAG_NOT_DEFINED_IN_MESSAGE - Tag '%s' not defined for this message type. ### -1171 TAG_APPEARS_MORE_THAN_ONCE - Tag '%s' appears more than once. ### -1172 TAG_OUT_OF_ORDER - Tag '%s' specified out of required order. ### -1173 GROUP_FIELDS_OUT_OF_ORDER - Repeating group '%s' fields out of order. ### -1174 INVALID_COMPONENT - Component '%s' is incorrectly populated on '%s' order. Recommendation: '%s' ### -1175 RESET_SEQ_NUM_SUPPORT - Continuation of sequence numbers to new session is currently unsupported. Sequence numbers must be reset for each new session. ### -1176 ALREADY_LOGGED_IN - [Logon``](fix-api.md#logon-main) should only be sent once. ### -1177 GARBLED_MESSAGE - `CheckSum(10)` contains an incorrect value. - `BeginString (8)` is not the first tag in a message. - `MsgType (35)` is not the third tag in a message. - `BodyLength (9)` does not contain the correct byte count. - Only printable ASCII characters and SOH (Start of Header) are allowed. - Tag specified without a value. - Invalid encodingType. ### -1178 BAD_SENDER_COMPID - `SenderCompId(49)` contains an incorrect value. The SenderCompID value should not change throughout the lifetime of a session. ### -1179 BAD_SEQ_NUM - `MsgSeqNum(34)` contains an unexpected value. Expected: '%d'. ### -1180 EXPECTED_LOGON - [Logon``](fix-api.md#logon-main) must be the first message in the session. ### -1181 TOO_MANY_MESSAGES - Too many messages; current limit is '%d' messages per '%s'. ### -1182 PARAMS_BAD_COMBO - Conflicting fields: [%s] ### -1183 NOT_ALLOWED_IN_DROP_COPY_SESSIONS - Requested operation is not allowed in DropCopy sessions. ### -1184 DROP_COPY_SESSION_NOT_ALLOWED - DropCopy sessions are not supported on this server. Please reconnect to a drop copy server. ### -1185 DROP_COPY_SESSION_REQUIRED - Only DropCopy sessions are supported on this server. Either reconnect to order entry server or send `DropCopyFlag (9406)` field. ### -1186 NOT_ALLOWED_IN_ORDER_ENTRY_SESSIONS - Requested operation is not allowed in order entry sessions. ### -1187 NOT_ALLOWED_IN_MARKET_DATA_SESSIONS - Requested operation is not allowed in market data sessions. ### -1188 INCORRECT_NUM_IN_GROUP_COUNT - Incorrect NumInGroup count for repeating group '%s'. ### -1189 DUPLICATE_ENTRIES_IN_A_GROUP - Group '%s' contains duplicate entries. ### -1190 INVALID_REQUEST_ID - `MDReqID (262)` contains a subscription request id that is already in use on this connection. - `MDReqID (262)` contains an unsubscription request id that does not match any active subscription. ### -1191 TOO_MANY_SUBSCRIPTIONS - Too many subscriptions. Connection may create up to '%s' subscriptions at a time. - Similar subscription is already active on this connection. Symbol='%s', active subscription id: '%s'. ### -1194 INVALID_TIME_UNIT - Invalid value for time unit; expected either MICROSECOND or MILLISECOND. ### -1196 BUY_OCO_STOP_LOSS_MUST_BE_ABOVE - A stop loss order in a buy OCO must be above. ### -1197 SELL_OCO_STOP_LOSS_MUST_BE_BELOW - A stop loss order in a sell OCO must be below. ### -1198 BUY_OCO_TAKE_PROFIT_MUST_BE_BELOW - A take profit order in a buy OCO must be below. ### -1199 SELL_OCO_TAKE_PROFIT_MUST_BE_ABOVE - A take profit order in a sell OCO must be above. ### -1210 INVALID_PEG_PRICE_TYPE - Invalid pegPriceType. ### -1211 INVALID_PEG_OFFSET_TYPE - Invalid pegOffsetType. ### -1220 SYMBOL_DOES_NOT_MATCH_STATUS - The symbol's status does not match the requested symbolStatus. ### -1221 INVALID_SBE_MESSAGE_FIELD - Invalid/missing field(s) in SBE message. ### -1222 OPO_WORKING_MUST_BE_BUY - Working order in an OPO list must be a bid. ### -1223 OPO_PENDING_MUST_BE_SELL - Pending orders in an OPO list must be asks. ### -1224 WORKING_PARAM_REQUIRED - Working order must include the '{param}' tag. ### -1225 PENDING_PARAM_NOT_REQUIRED - Pending orders should not include the '%s' tag. ### -2010 NEW_ORDER_REJECTED - NEW_ORDER_REJECTED ### -2011 CANCEL_REJECTED - CANCEL_REJECTED ### -2013 NO_SUCH_ORDER - Order does not exist. ### -2014 BAD_API_KEY_FMT - API-key format invalid. ### -2015 REJECTED_MBX_KEY - Invalid API-key, IP, or permissions for action. ### -2016 NO_TRADING_WINDOW - No trading window could be found for the symbol. Try ticker/24hrs instead. ### -2026 ORDER_ARCHIVED - Order was canceled or expired with no executed qty over 90 days ago and has been archived. ### -2035 SUBSCRIPTION_ACTIVE - User Data Stream subscription already active. ### -2036 SUBSCRIPTION_INACTIVE - User Data Stream subscription not active. ### -2039 CLIENT_ORDER_ID_INVALID - Client order ID is not correct for this order ID. ### -2042 MAXIMUM_SUBSCRIPTION_IDS - Maximum subscription ID reached for this connection. ### -2043 NO_REFERENCE_PRICE - This symbol doesn't have a reference price. ## Messages for -1010 ERROR_MSG_RECEIVED, -2010 NEW_ORDER_REJECTED, -2011 CANCEL_REJECTED, and -2038 ORDER_AMEND_REJECTED This code is sent when an error has been returned by the matching engine. The following messages which will indicate the specific error: | Error message | Description | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | "Unknown order sent." | The order (by either `orderId`, `clOrdId`, `origClOrdId`) could not be found. | | "Duplicate order sent." | The `clOrdId` is already in use. | | "Market is closed." | The symbol is not trading. | | "Account has insufficient balance for requested action." | Not enough funds to complete the action. | | "Market orders are not supported for this symbol." | `MARKET` is not enabled on the symbol. | | "Iceberg orders are not supported for this symbol." | `icebergQty` is not enabled on the symbol. | | "Stop loss orders are not supported for this symbol." | `STOP_LOSS` is not enabled on the symbol. | | "Stop loss limit orders are not supported for this symbol." | `STOP_LOSS_LIMIT` is not enabled on the symbol. | | "Take profit orders are not supported for this symbol." | `TAKE_PROFIT` is not enabled on the symbol. | | "Take profit limit orders are not supported for this symbol." | `TAKE_PROFIT_LIMIT` is not enabled on the symbol. | | "Order amend is not supported for this symbol." | Order amend keep priority is not enabled on the symbol. | | "Price \* QTY is zero or less." | `price` \* `quantity` is too low. | | "IcebergQty exceeds QTY." | `icebergQty` must be less than the order quantity. | | "This action is disabled on this account." | Contact customer support; some actions have been disabled on the account. | | "This account may not place or cancel orders." | Contact customer support; the account has trading ability disabled. | | "Unsupported order combination" | The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. | | "Order would trigger immediately." | The order's stop price is not valid when compared to the last traded price. | | "Cancel order is invalid. Check origClOrdId and orderId." | No `origClOrdId` or `orderId` was sent in. | | "Order would immediately match and take." | `LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. | | "The relationship of the prices for the orders is not correct." | The prices set in the `OCO` is breaking the Price restrictions.
For reference:
`BUY` : `LIMIT_MAKER` `price` < Last Traded Price < `stopPrice`
`SELL` : `LIMIT_MAKER` `price` > Last Traded Price > `stopPrice` | | "OCO orders are not supported for this symbol" | `OCO` is not enabled on the symbol. | | "Quote order qty market orders are not support for this symbol." | `MARKET` orders using the parameter `quoteOrderQty` are not enabled on the symbol. | | "Trailing stop orders are not supported for this symbol." | Orders using `trailingDelta` are not enabled on the symbol. | | "Order cancel-replace is not supported for this symbol." | `POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is not enabled on the symbol. | | "This symbol is not permitted for this account." | Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) | | "This symbol is restricted for this account." | Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) | | "Order was not canceled due to cancel restrictions." | Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW`
or
`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. | | "Rest API trading is not enabled." / "WebSocket API trading is not enabled." | Order is being placed or a server that is not configured to allow access to `TRADE` endpoints. | | "FIX API trading is not enabled. | Order is placed on a FIX server that is not TRADE enabled. | | "Order book liquidity is less than `LOT_SIZE` filter minimum quantity." | Quote quantity market orders cannot be placed when the order book liquidity is less than minimum quantity configured for the `LOT_SIZE` filter. | | "Order book liquidity is less than `MARKET_LOT_SIZE` filter minimum quantity." | Quote quantity market orders cannot be placed when the order book liquidity is less than the minimum quantity for `MARKET_LOT_SIZE` filter. | | "Order book liquidity is less than symbol minimum quantity." | Quote quantity market orders cannot be placed when there are no orders on the book. | | "Order amend (quantity increase) is not supported." | `newQty` must be less than the order quantity. | | "The requested action would change no state; rejecting". | The request sent would not have changed the status quo.

(e.g. `newQty` cannot equal the order quantity.) | | "Pegged orders are not supported for this symbol." | `pegInstructionsAllowed` has not been enabled. | | "This order type may not use pegged price." | You are using parameter `pegPriceType` with an unsupported order type. (e.g. `MARKET`) | | "This price peg cannot be used with this order type." | You are using `pegPriceType`=`MARKET_PEG` for a `LIMIT_MAKER` order. | | "Order book liquidity is too low for this pegged order." | The order book doesn’t have the best price level to peg the price to. | | OPO orders are not supported for this symbol. | | | Order amend (pending OPO order) is not supported. | You cannot amend the pending quantity of an OPO order | ## Errors regarding placing orders via cancelReplace ### -2021 Order cancel-replace partially failed - This code is sent when either the cancellation of the order failed or the new order placement failed but not both. ### -2022 Order cancel-replace failed. - This code is sent when both the cancellation of the order failed and the new order placement failed. ## Filter failures | Error message | Description | | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | "Filter failure: PRICE_FILTER" | `price` is too high, too low, and/or not following the tick size rule for the symbol. | | "Filter failure: PERCENT_PRICE" | `price` is X% too high or X% too low from the average weighted price over the last Y minutes. | | "Filter failure: LOT_SIZE" | `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MIN_NOTIONAL" | `price` \* `quantity` is too low to be a valid order for the symbol. | | "Filter failure: NOTIONAL" | `price` \* `quantity` is not within range of the `minNotional` and `maxNotional` | | "Filter failure: ICEBERG_PARTS" | `ICEBERG` order would break into too many parts; icebergQty is too small. | | "Filter failure: MARKET_LOT_SIZE" | `MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MAX_POSITION" | The account's position has reached the maximum defined limit.
This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY` orders. | | "Filter failure: MAX_NUM_ORDERS" | Account has too many open orders on the symbol. | | "Filter failure: MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the symbol. | | "Filter failure: MAX_NUM_ICEBERG_ORDERS" | Account has too many open iceberg orders on the symbol. | | "Filter failure: MAX_NUM_ORDER_AMENDS" | Account has made too many amendments to a single order on the symbol. | | "Filter failure: MAX_NUM_ORDER_LISTS" | Account has too many open order lists on the symbol. | | "Filter failure: TRAILING_DELTA" | `trailingDelta` is not within the defined range of the filter for that order type. | | "Filter failure: EXCHANGE_MAX_NUM_ORDERS" | Account has too many open orders on the exchange. | | "Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the exchange. | | "Filter failure: EXCHANGE_MAX_NUM_ICEBERG_ORDERS" | Account has too many open iceberg orders on the exchange. | | "Filter failure: EXCHANGE_MAX_NUM_ORDER_LISTS" | Account has too many open order lists on the exchange. | --- ## Document: /products/spot/enums URL: /en/dev-docs/products/spot/enums # ENUM Definitions This will apply for both REST API and WebSocket API. ## Symbol status (status) - `TRADING` - `END_OF_DAY` - `HALT` - `BREAK` ## Account and Symbol Permissions (permissions) - `SPOT` - `MARGIN` - `LEVERAGED` - `TRD_GRP_002` - `TRD_GRP_003` - `TRD_GRP_004` - `TRD_GRP_005` - `TRD_GRP_006` - `TRD_GRP_007` - `TRD_GRP_008` - `TRD_GRP_009` - `TRD_GRP_010` - `TRD_GRP_011` - `TRD_GRP_012` - `TRD_GRP_013` - `TRD_GRP_014` - `TRD_GRP_015` - `TRD_GRP_016` - `TRD_GRP_017` - `TRD_GRP_018` - `TRD_GRP_019` - `TRD_GRP_020` - `TRD_GRP_021` - `TRD_GRP_022` - `TRD_GRP_023` - `TRD_GRP_024` - `TRD_GRP_025` ## Order status (status) | Status | Description | | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `NEW` | The order has been accepted by the engine. | | `PENDING_NEW` | The order is in a pending phase until the working order of an order list has been fully filled. | | `PARTIALLY_FILLED` | A part of the order has been filled. | | `FILLED` | The order has been completed. | | `CANCELED` | The order has been canceled by the user. | | `PENDING_CANCEL` | Currently unused | | `REJECTED` | The order was not accepted by the engine and not processed. | | `EXPIRED` | The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill)
or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance) | | `EXPIRED_IN_MATCH` | The order was expired by the exchange due to STP. (e.g. an order with `EXPIRE_TAKER` will match with existing orders on the book with the same account or same `tradeGroupId`) | ## Order List Status (listStatusType) | Status | Description | | -------------- | -------------------------------------------------------------------------------------------------------------- | | `RESPONSE` | This is used when the ListStatus is responding to a failed action. (E.g. order list placement or cancellation) | | `EXEC_STARTED` | The order list has been placed or there is an update to the order list status. | | `UPDATED` | The clientOrderId of an order in the order list has been changed. | | `ALL_DONE` | The order list has finished executing and thus is no longer active. | ## Order List Order Status (listOrderStatus) | Status | Description | | ----------- | ------------------------------------------------------------------------------------------------- | | `EXECUTING` | Either an order list has been placed or there is an update to the status of the list. | | `ALL_DONE` | An order list has completed execution and thus no longer active. | | `REJECT` | The List Status is responding to a failed action either during order placement or order canceled. | ## ContingencyType - `OCO` - `OTO` ## AllocationType - `SOR` ## Order types (orderTypes, type) - `LIMIT` - `MARKET` - `STOP_LOSS` - `STOP_LOSS_LIMIT` - `TAKE_PROFIT` - `TAKE_PROFIT_LIMIT` - `LIMIT_MAKER` ## Order Response Type (newOrderRespType) - `ACK` - `RESULT` - `FULL` ## Working Floor - `EXCHANGE` - `SOR` ## Order side (side) - `BUY` - `SELL` ## Time in force (timeInForce) This sets how long an order will be active before expiration. | Status | Description | | ------ | --------------------------------------------------------------------------------------------------------- | | `GTC` | Good Til Canceled
An order will be on the book unless the order is canceled. | | `IOC` | Immediate Or Cancel
An order will try to fill the order as much as it can before the order expires. | | `FOK` | Fill or Kill
An order will expire if the full order cannot be filled upon execution. | ## Rate limiters (rateLimitType) - REQUEST_WEIGHT ```json { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000 } ``` - ORDERS ```json { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 1, "limit": 10 } ``` - RAW_REQUESTS ```json { "rateLimitType": "RAW_REQUESTS", "interval": "MINUTE", "intervalNum": 5, "limit": 61000 } ``` ## Rate limit intervals (interval) - SECOND - MINUTE - DAY ## STP Modes Read [Self Trade Prevention (STP) FAQ](faqs/stp_faq.md) to learn more. - `NONE` - `EXPIRE_MAKER` - `EXPIRE_TAKER` - `EXPIRE_BOTH` - `DECREMENT` - `TRANSFER` ## Execution types: | Status | Description | | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `NEW` | The order has been accepted into the engine. | | `CANCELED` | The order has been canceled by the user. | | `REPLACED` | The order has been amended. | | `REJECTED` | The order has been rejected and was not processed (e.g. Cancel Replace Orders wherein the new order placement is rejected but the request to cancel request succeeds.) | | `TRADE` | Part of the order or all of the order's quantity has filled. | | `EXPIRED` | The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill) or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance). | | `TRADE_PREVENTION` | The order has expired due to STP. | ## Execution Rules - `PRICE_RANGE` ## Expiry Reasons - `NONE` - `REJECTED` - `EXCHANGE_CANCELED` - `OCO_TRIGGER` - `OTO_PHASE_ONE_EXPIRED` - `UNFILLED_IOC_QUANTITY_EXPIRED` - `UNFILLED_FOK_ORDER_EXPIRED` - `INSUFFICIENT_LIQUIDITY` - `EXECUTION_RULE_PRICE_RANGE_EXCEEDED` --- ## Document: /products/spot/PROD-TERMS-OF-USE URL: /en/dev-docs/products/spot/PROD-TERMS-OF-USE # SPOT Exchange Terms of Use Binance products and services are subject to the [Product Terms of Use](https://www.binance.com/en/terms).
Please read it carefully before proceeding. --- ## Document: /products/spot/CHANGELOG URL: /en/dev-docs/products/spot/CHANGELOG # CHANGELOG for Binance's API **Last Updated: 2026-06-24** ### 2026-06-24 - Beginning at **2026-07-09 07:00 UTC**, [WebSocket Streams](/products/spot/web-socket-streams) will undergo an infrastructure upgrade and will approximately take up to an hour. - During the upgrade, your WebSocket connection may be disconnected; please reconnect to restore your connection. --- ### 2026-06-22 REST and WebSocket API: - Reminder that SBE 3:1 schema will be retired on 2026-06-29, [6 months after being deprecated](/products/spot/faqs/sbe_faq#sbe-schema). - The [SBE lifecycle for Production](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/sbe_schema_lifecycle_prod.json) has been updated to reflect this change. --- ### 2026-06-10 #### FIX API - Documentation update: removed `LastFragment (893)` from [FIX API](/products/spot/fix-api#marketdataincrementalrefresh). - As [previously announced](#2025-12-02), `MarketDataIncrementalRefresh ` messages stopped being fragmented on 2025-12-18, and the server no longer sends `LastFragment (893)`. - The field has been removed from the [FIX API](/products/spot/fix-api) field list and from the corresponding [QuickFIX MD schema](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-md.xml). - Documentation update: updated the [News ``](/products/spot/fix-api#news-b) message description to be consistent with the announcement from [2026-06-09](#2026-06-09). --- ### 2026-06-09 **Update:** - Updated the [Price Range Execution Rule FAQ](/products/spot/faqs/price_range_execution_rules#external-reference-price-calculation-method-1) with new External Reference Price Calculation Methods. The `serverShutdown` event will be sent when the **server is about to be shut down**; when you receive this event, please disconnect and open a new connection. All mention of a fixed time before the server shuts down has been removed from the documentation. - Documented the `serverShutdown` event in [SBE Market Data Streams](/products/spot/sbe-market-data-streams#serverShutdown). - ~~`serverShutdown` event will be sent 10 minutes before disconnection.~~ - Please establish a new connection as soon as possible to prevent connection interruption. - Note that you will receive `serverShutdown` events in JSON in WebSocket text frames. --- ### 2026-05-11 The following rollout will occur at **approximately 07:00 UTC on 2026-05-12**. - Added WebSocket Stream support for [Block Trades](https://www.binance.info/en/support/faq/detail/557f95eaf8fb4460aed0a891d42a1425). - New stream: - `@blockTrade` --- ### 2026-05-06 **Notice: The following changes will be deployed on 2026-05-08, starting at 06:00 UTC and may take several hours to complete.** - Added `serverShutdown` event to [WebSocket API](/products/spot/web-socket-api#serverShutdown) and [WebSocket Streams](/products/spot/web-socket-streams#serverShutdown). - `serverShutdown` event will be sent 10 minutes before disconnection. - [`PERCENT_PRICE`](/products/spot/filters#percent_price), [`PERCENT_PRICE_BY_SIDE`](/products/spot/filters#percent_price_by_side), [`MIN_NOTIONAL`](/products/spot/filters#min_notional), and [`NOTIONAL`](/products/spot/filters#notional) filters now use [reference price](/products/spot/faqs/price_range_execution_rules) when it exists and is non-null. The filters fall back to their previous behavior when the reference price does not exist or is null. - Market data for [Block Trades](https://www.binance.info/en/support/faq/detail/557f95eaf8fb4460aed0a891d42a1425). - New Endpoints/Methods - REST API: - `GET /api/v3/historicalBlockTrades` - WebSocket API: - `blockTrades.historical` - Order query responses may include an [`expiryReason`](/products/spot/enums#expiryreasons) field. - This field is returned **only for expired orders** and helps users understand why an order expired, including cases where the order is expired due to the **execution price range rule**. - This field is included in both JSON and SBE 3:4 responses. - This applies to the following endpoint/method: - REST API: - `GET /api/v3/order` - `GET /api/v3/allOrders` - `GET /api/v3/orderList` - `GET /api/v3/allOrderList` - WebSocket API: - `order.status` - `allOrders` - `orderList.status` - `allOrderLists` - REST and WebSocket API SBE schema 3:4 - The current schema 3:3 [spot_3_3.xml](/products/spot/sbe/schemas/spot_3_3.xml) is deprecated and will be retired in 6 months as per our schema deprecation policy. - Changes in schema 3:4: - New message `BlockTradesResponse` - New type `blockTradeId` - New field `expiryReason` in `OrderResponse` and `OrdersResponse` --- ### 2026-04-28 - Corrected the JSON in the `Price Range Execution Rule FAQ` for the question [`How does the Price Range Execution Rule work?`](/products/spot/faqs/price_range_execution_rules#how-does-the-price-range-execution-rule-work). --- ### 2026-04-17 The following will occur on **2026-05-05 at approximately 10:00 UTC**. - The update speed of the below SBE Market Data Streams will be changed **from 50ms to 25ms**: - SBE Market Data Streams: [Diff Depth Streams](/products/spot/sbe-market-data-streams#diff-depth-streams) - FIX SBE: [MarketDataIncrementalDepth](/products/spot/fix-api#marketdataincrementaldepth) --- ### 2026-04-16 - Updated the documentation to clarify that if a symbol has never had a reference price set, an error code [`-2043`](/products/spot/errors#-2043-no_reference_price) is returned when querying the reference price. This applies to the following endpoint/method: - REST API: `GET /api/v3/referencePrice` - WebSocket API: `referencePrice` --- ### 2026-04-06 - Updated [Price Range Execution Rule](/products/spot/faqs/price_range_execution_rules#price_range_enforcement) with additional information on rule enforcement. --- ### 2026-04-02 Clarifcation on the announcement from [2026-03-27](#2026-03-27) regarding new behavior for request weight charged on selected endpoints: For orders that are amended, the request weight only becomes 0 when the order expires because of the amendment. Successful requests that do not cause the order to expire are still charged the documented weight. Failed requests are still charged the documented weight. This applies to the following endpoint and method: - REST API: `PUT /api/v3/order/amend/keepPriority` - WebSocket API: `order.amend.keepPriority` --- ### 2026-03-30 - Updated [Price Range Execution Rule](/products/spot/faqs/price_range_execution_rules#execution_price_limits) to explain execution price limits for an order. --- ### 2026-03-27 The following will occur on **2026-04-02 at approximately 07:00 UTC**. - `RAW_REQUESTS` rate limit increases to 300,000 per 5 minutes. - Request weights for the following endpoints and methods become 0 when the request is successful. Failed requests are still charged the documented weight.
IPs that only call these endpoints and methods successfully will never hit the `REQUEST_WEIGHT` rate limit. - REST API - `POST /api/v3/order` - `POST /api/v3/sor/order` - `DELETE /api/v3/order` - `DELETE /api/v3/openOrders` - `POST /api/v3/order/cancelReplace` - `POST /api/v3/order/oco` - `POST /api/v3/orderList/oco` - `POST /api/v3/orderList/oto` - `POST /api/v3/orderList/otoco` - `POST /api/v3/orderList/opo` - `POST /api/v3/orderList/opoco` - `DELETE /api/v3/orderList` - `PUT /api/v3/order/amend/keepPriority` (see [2026-04-02](#2026-04-02) for an update) - WebSocket API - `order.place` - `sor.order.place` - `order.cancel` - `openOrders.cancelAll` - `order.cancelReplace` - `orderList.place` - `orderList.place.oco` - `orderList.place.oto` - `orderList.place.otoco` - `orderList.place.opo` - `orderList.place.opoco` - `orderList.cancel` - `order.amend.keepPriority` (see [2026-04-02](#2026-04-02) for an update) - [STP Transfer](/products/spot/faqs/stp_faq) will be allowed on all symbols on **2026-04-02 at approximately 07:00 UTC**. --- ### 2026-03-13 - Updated [Price Range Execution Rule](/products/spot/faqs/price_range_execution_rules#external-reference-price-calculation-method-0) with a new External Reference Price Calculation Method. --- ### 2026-03-11 **Notice:** FIX TLS Connectivity Update on **2026-06-08**, starting from **03:00 UTC** and will take about 1 hour to complete. **Action Required:** During the update window, existing FIX connections may drop intermittently. To ensure successful reconnections and new connections afterward, please verify before our update that your client sends SNI (Server Name Indication) during the TLS handshake and validates the certificate against the requested hostname.
Clients without SNI may receive an error message during handshake related to incorrect certificate during or after the update window, leading to TLS handshake or hostname verification failures. This can occur with some Node.js clients if SNI is not explicitly configured.
Please consult the [FIX API documentation](/products/spot/fix-api#general-api-information) for full context. --- ### 2026-03-10 - Clarified about the reference price calculation for [Price Range Execution Rule](/products/spot/faqs/price_range_execution_rules#matching-engine-calculation) --- ### 2026-03-09 **Notice:** The changes in this section will be gradually rolled out and will take approximately three weeks to complete. #### New Features - [Price Range Execution Rule](/products/spot/faqs/price_range_execution_rules) - New Endpoints/Methods - REST API: - `GET /api/v3/executionRules` - `GET /api/v3/referencePrice` - `GET /api/v3/referencePrice/calculation` - WebSocket API: - `executionRules` - `referencePrice` - `referencePrice.calculation` - New JSON Stream: `@referencePrice` - REST and WebSocket API SBE schema 3:3 - The current schema 3:2 [spot_3_2.xml](/products/spot/sbe/schemas/spot_3_2.xml) is deprecated and will be retired in 6 months as per our schema deprecation policy. - Changes in schema 3:3: - New message `ExecutionRulesResponse` - New message `PriceRangeExecutionRule` (to be embedded in `ExecutionRulesResponse`) - New message `ReferencePriceResponse` - New message `ReferencePriceCalculationResponse` - New enum `executionRuleType` - New enum `expiryReason` - New enum `calculationType` - New field `expiryReason` in `NewOrderResultResponse`, `NewOrderFullResponse`, `NewOrderListResultResponse` and `NewOrderListFullResponse` - New field `expiryReason` in `ExecutionReportEvent` - New message `ServerShutdownEvent` for WebSocket API only - FIX SBE schema 1:1 - This will be used for FIX Order Entry, FIX Drop Copy, and FIX Market Data. - The current FIX schema 1:0 [spot-fixsbe-1_0.xml](/products/spot/sbe/schemas/spot-fixsbe-1_0.xml) is deprecated and will be retired in 6 months as per our schema deprecation policy. - Changes in schema 1:1: - New enum `expiryReason` - New field `ExpiryReason` in `ExecutionReport` #### FIX API - ExpiryReason `<25056>` is optionally added to the ExecutionReport `` message. - Updated QuickFIX Schema for FIX Market Data and FIX Order Entry. #### WebSocket API - `serverShutdown` event added. #### Future Changes - These endpoints have been [deprecated](#2019-11-13) for a long time and will be retired on **2026-03-25**: - `GET /api/v1/ping` - `GET /api/v1/time` - `POST /api/v1/userDataStream` - `PUT /api/v1/userDataStream` - `GET /api/v1/ticker/bookTicker` - `GET /api/v1/ticker/price` - `GET /api/v1/klines` - `GET /api/v1/historicalTrades` - `GET /api/v1/depth` - `GET /api/v1/aggTrades` - `GET /api/v1/ticker/24hr` - The following endpoints will be retired **2026-03-25**: - `GET /api/v1/userDataStream` - `DELETE /api/v1/userDataStream` - `GET /api/v1/trades` - **The following changes will occur at 2026-03-26 at approximately 07:00 UTC** - The responses to order placement and order list placement endpoints display the expiry reason depending on the value of `newOrderRespAck`: - If `newOrderRespType=ACK`, the expiry reason is not displayed. - If `newOrderRespType=RESULT` or `newOrderRespType=FULL` mode, the expiry reason, if any, is displayed in field `expiryReason`. - This affects the following endpoints/methods: - REST API - `POST /api/v3/order` - `POST /api/v3/sor/order` - `POST /api/v3/order/cancelReplace` - `POST /api/v3/order/oco` - `POST /api/v3/orderList/oco` - `POST /api/v3/orderList/oto` - `POST /api/v3/orderList/otoco` - `POST /api/v3/orderList/opo` - `POST /api/v3/orderList/opoco` - WebSocket API - `order.place` - `sor.order.place` - `order.cancelReplace` - `orderList.place` - `orderList.place.oco` - `orderList.place.oto` - `orderList.place.otoco` - `orderList.place.opo` - `orderList.place.opoco` - In User Data Streams, `executionReport` events have a new optional field, `eR`, which shows the expiry reason, if any. --- ### 2026-02-24 - [ICEBERG_PARTS](/products/spot/filters#iceberg_parts) will be increased to 100 for all symbols at **2026-03-12 07:00 UTC**. - Following the announcement on [2025-12-02](#2025-12-02), `!ticker@arr` will be retired on **2026-03-26**. --- ### 2026-02-12 REST and WebSocket API: - Reminder that SBE 3:0 schema will be retired on 2026-02-19, [6 months after being deprecated](/products/spot/faqs/sbe_faq#sbe-schema). - The [SBE lifecycle for Production](/products/spot/sbe/schemas/sbe_schema_lifecycle_prod.json) has been updated to reflect this change. --- ### 2026-02-09 - Clarified exponent field requirements in [FIX SBE documentation](/products/spot/fix-api#fix-sbe) --- ### 2026-02-02 - Documented that [FIX Drop Copy session](/products/spot/fix-api#fix-api-drop-copy-sessions) data is delayed by 1 second. This has been the delay since the inception of the FIX API. --- ### 2026-01-29 - [Demo Mode](./demo-mode/general-info) is now available. - For information on when the Spot Demo Mode environment will be unavailable due to maintenance, please refer to the [Demo Mode Changelog](./demo-mode/CHANGELOG) --- ### 2026-01-27 **Notice: The following changes will occur at 2026-02-11 7:00 UTC**: - [ICEBERG_PARTS](/products/spot/filters#iceberg_parts) will be increased to 50 for all symbols. --- ### 2026-01-26 - Added undocumented `recvWindow` to `userDataStream.subscribe.signature`. --- ### 2026-01-21 Following the announcement from [2025-10-24](#2025-10-24), the following endpoints/methods will no longer be available starting from **2026-02-20,07:00 UTC** REST API - `POST /api/v3/userDataStream` - `PUT /api/v3/userDataStream` - `DELETE /api/v3/userDataStream` WebSocket API - `userDataStream.start` - `userDataStream.ping` - `userDataStream.stop` --- ### 2025-12-18 - Updated [FIX SBE documentation](/products/spot/fix-api#fix-sbe) - Clarified User Data Stream documentation regarding [`eventStreamTerminated`](/products/spot/user-data-stream#event-stream-terminated). - Assets `这是测试币` and `456` and symbol `这是测试币456` have been added to [SPOT Testnet](http://testnet.binance.vision) for testing endpoints/methods with a Unicode symbol. See the [Testnet CHANGELOG](/products/spot/testnet) for more information. --- ### 2025-12-17 #### Time-sensitive Notice - **The following change to REST API will occur at approximately 2026-01-15 07:00 UTC:**
When calling endpoints that require signatures, percent-encode payloads before computing signatures. Requests that do not follow this order will be rejected with [`-1022 INVALID_SIGNATURE`](/products/spot/errors#-1022-invalid_signature). Please review and update your signing logic accordingly. This has now been enabled on [SPOT Testnet](http://testnet.binance.vision) #### REST API - Updated documentation for REST API regarding [Signed Endpoints examples for placing an order](/products/spot/rest-api/request-security#signed-endpoint-examples-for-post-apiv3order). #### WebSocket API - Updated documentation for WebSocket API regarding [SIGNED request security](/products/spot/websocket-api/request-security#signed-request-security). --- ### 2025-12-15 **Clarification Regarding UTF-8 Encoding:** - In [FIX](/products/spot/fix-api), [REST](/products/spot/rest-api/general-api-information), and [WebSocket APIs](/products/spot/websocket-api/general-api-information), if your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. - In REST and WebSocket APIs, some endpoints/methods may return asset and/or symbol names containing non-ASCII characters encoded in UTF-8 even if the request did not contain non-ASCII characters. - In [WebSocket Streams](/products/spot/web-socket-streams), if your request contains a symbol name containing non-ASCII characters, then the stream events may contain non-ASCII characters encoded in UTF-8. - In WebSocket Streams, [All Market Mini Tickers Stream](/products/spot/web-socket-streams#all-market-mini-tickers-stream) and [All Market Rolling Window Statistics Streams](/products/spot/web-socket-streams#all-market-rolling-window-statistics-streams) events may contain non-ASCII characters encoded in UTF-8. - In [SBE Market Data Streams](/products/spot/sbe-market-data-streams), if your request contains a symbol name containing non-ASCII characters, then the stream events may contain non-ASCII characters encoded in UTF-8. - [UserDataStream events](/products/spot/user-data-stream) may contain non-ASCII characters encoded in UTF-8 if you own or trade any assets or symbols whose names contain non-ASCII characters. - For full compatibility with Binance APIs, please ensure your code is designed to handle UTF-8-encoded strings. --- ### 2025-12-09 - [Schema for FIX SBE](/products/spot/sbe/schemas/spot-fixsbe-1_0.xml) has been updated to use `smallGroupSize16Encoding` in `MarketDataSnapshot` and use `presence="optional"` for incremental book ticker/depth `MDEntrySize` fields. - Updated documentation re: [FIX vs FIX SBE](/products/spot/fix-api#fix-vs-fix-sbe) - Added documentation in REST, and WebSocket APIs stating:
**Please avoid SQL keywords in requests** as they may trigger a security block by a WAF (Web Application Firewall) rule.
See https://www.binance.com/en/support/faq/detail/360004492232 for more details. --- ### 2025-12-02 **Notice:** The changes in this section will be gradually rolled out, and will take approximately up to two weeks to complete. #### General Changes - Parameter `symbol` and `symbols` can now support Unicode values encoded in UTF-8. - Following the announcement from [2025-11-14](#2025-11-14), all documentation related to `!ticker@arr` has been removed. - The feature will remain available until a future retirement announcement is made. - Please use `@ticker` or `!miniTicker@arr` instead. #### FIX API - Unicode values encoded in UTF-8 can now be accepted in FIX messages. This is allowed for the following tags only: - `Currency (15)` - `MiscFeeCurr (138)` - `Symbol (55)` - `SecondarySymbol (25019)` - `CounterSymbol (25028)` - `SecurityDesc (107)` - When Unicode is put in a tag value that is not one of the tags above, FIX API will now send back a `RefTagID (371)` tag in the Reject `<3>`, pointing to exactly which tag is not allowed to contain Unicode. - NewOrderList `` accepts `TriggerPriceDirection (1109)` without `TriggerPrice (1102)`. #### WebSocket Streams - WebSocket Market Streams supports URL-encoded urls.

**Notice: The following changes will occur at approximately 2025-12-18 7:00 UTC**: - [ICEBERG_PARTS](/products/spot/filters#iceberg_parts) will be increased to 25 for all symbols. - [FIX SBE support](/products/spot/fix-api) becomes available. - [One Pays the Other (OPO)](/products/spot/faqs/opo) becomes available on all symbols. - `opoAllowed` begins to appear in Exchange Information requests, indicating if One-Pays-the-Other (OPO) orders are supported on each symbol. - REST API: `GET /api/v3/exchangeInfo` - WebSocket API: `exchangeInfo` - New requests for OPO: - REST API: - `POST /api/v3/orderList/opo` - `POST /api/v3/orderList/opoco` - WebSocket API - `orderList.place.opo` - `orderList.place.opoco` - FIX API - NewOrderList `` has field `OPO (25046)`. Please update to the latest QuickFIX Schema for OPO support. - STP mode [`TRANSFER`](/products/spot/faqs/stp_faq) has been added. The exact date that STP `TRANSFER` will be enabled has not yet been determined. - **SBE: A new schema 3:2 ([spot_3_2.xml](/products/spot/sbe/schemas/spot_3_2.xml)) is available.** - The current schema 3:1 ([spot_3_1.xml](/products/spot/sbe/schemas/spot_3_1.xml)) is deprecated and will be retired in 6 months as per our schema deprecation policy. - Changes in 3:2: - New enum variant `TRANSFER` for `selfTradePreventionMode` and `allowedSelfTradePreventionModes`. - All schemas below 3:1 are unable to represent any response that could contain the STP mode `TRANSFER` (e.g. Exchange Information, order placement, order cancellation, or querying the status of an order).
When a response cannot be represented in the requested schema, an error is returned. - FIX API changes: - `LastFragment (893)` becomes deprecated. - This means that the MarketIncrementalRefresh `` messages will no longer be fragmented and may contain more than 10,000 entries. - The documentation has been updated to reflect this change. - ListStatus `` will no longer emit the optional `symbol` field. - This applies to FIX Order Entry and FIX Drop Copy. - The documentation has been updated to reflect this change. --- ### 2025-11-14 - All Market Tickers Stream (`!ticker@arr`) has been deprecated; This means this will be removed both from the documentation and from our systems at a later date. More details to follow. - Please use [`@ticker`](/products/spot/web-socket-streams#individual-symbol-ticker-streams) or [`!miniTicker@arr`](/products/spot/web-socket-streams#all-market-mini-tickers-stream) instead. --- ### 2025-11-12 - The steps on [how to manage a local order book correctly](/products/spot/web-socket-streams#how-to-manage-a-local-order-book-correctly) has been corrected. --- ### 2025-11-11 #### SBE Market Data - **At 2025-11-26 07:00 UTC, the update speed of `@depth` and `@depth20` streams will be changed to 50ms**. - This change will apply automatically to all users of SBE Market Data and doesn't require any action. - The total amount of data received per second will be increased (up to 2x). - [SPOT Testnet](https://testnet.binance.vision/) will have these changes at **2025-11-11 07:00 UTC**. - [SBE Market Data](/products/spot/sbe-market-data-streams) has been updated to reflect these changes. --- ### 2025-11-10 - "Last Updated" dates will be removed from all documents except for CHANGELOG. - Moving forward, CHANGELOG will be the source of reference for when changes were made to any document. --- ### 2025-10-28 **Notice: The following changes will be deployed on 2025-10-28, starting at 04:00 UTC and may take several hours to complete:** - An optional parameter, `symbolStatus`, has been added to the following endpoints: - **REST API** - `GET /api/v3/depth` - `GET /api/v3/ticker/price` - `GET /api/v3/ticker/bookTicker` - `GET /api/v3/ticker/24hr` - `GET /api/v3/ticker/tradingDay` - `GET /api/v3/ticker` - **WebSocket API** - `depth` - `ticker.price` - `ticker.book` - `ticker.24hr` - `ticker.tradingDay` - `ticker` - When the parameter `symbolStatus=` is provided, only symbols whose trading status matches the specified `STATUS` will be included in the response:\_ - If a single symbol is specified using the `symbol=` parameter and its trading status does not match the given `STATUS`, the endpoint will return error code [`-1220 SYMBOL_DOES_NOT_MATCH_STATUS`](/products/spot/errors#-1220-symbol_does_not_match_status). - If multiple symbols are specified using the `symbols=[...]` parameter, the response will be an array that excludes any symbols whose trading status does not match `STATUS`. If no symbols from the symbols parameter have a trading status that matches `STATUS`, the response is an empty array. - For endpoints where the `symbol` and `symbols` parameters are optional, omitting these parameters is treated as if all symbols had been specified in the `symbols=[...]` parameter. See the previous line for the behavior of `symbolStatus=`. --- ### 2025-10-24 #### SBE - SBE: schema 3:1 ([spot_3_1.xml](/products/spot/sbe/schemas/spot_3_1.xml)) has been updated to support [listenToken Subscription Methods](/products/margin_trading/trade-data-stream/Listen-Token-Websocket-API) for Margin Trading. #### REST and WebSocket API Following the announcement from [2025-04-07](#2025-04-07), all documentation related with `listenKey` for use on `wss://stream.binance.com` has been removed. **We remind you that you should instead get user data updates by subscribing to the [User Data Stream on the WebSocket API](/products/spot/websocket-api/user-data-stream-requests). This will offer better performance (lower latency).** Please refer to the list of requests and methods below for more information. The features will remain available until a future retirement announcement is made. - REST API - `POST /api/v3/userDataStream` - `PUT /api/v3/userDataStream` - `DELETE /api/v3/userDataStream` - WebSocket API - `userDataStream.start` - `userDataStream.ping` - `userDataStream.stop` --- ### 2025-10-21 REST and WebSocket API: - Reminder that SBE 2:1 schema will be retired on 2025-10-24, [6 months after being deprecated](/products/spot/faqs/sbe_faq#sbe-schema). - The [SBE lifecycle for Production](/products/spot/sbe/schemas/sbe_schema_lifecycle_prod.json) has been updated to reflect this change. --- ### 2025-10-08 #### FIX API - Updated [QuickFIX Schema](/products/spot/fix/schemas/spot-fix-md.xml) for FIX Market Data: - Updated `RecvWindow(25000)` to reflect microsecond support announced on [2025-08-12](#2025-08-12). - Updated [InstrumentList ``](/products/spot/fix-api#instrumentlist) message: - Added fields: `StartPriceRange`, `EndPriceRange`. - Made the following fields optional: `MinTradeVol(562)`, `MaxTradeVol(1140)`, `MinQtyIncrement(25039)`, `MarketMinTradeVol(25040)`, `MarketMaxTradeVol(25041)`, `MarketMinQtyIncrement(25042)`, `MinPriceIncrement(969)`. - **The changes to InstrumentList are breaking changes, and will roll out at around 2025-10-23 07:00 UTC. Please update to the new schema before then.** - [SPOT Testnet](https://testnet.binance.vision/) has the breaking changes already enabled. --- ### 2025-09-29 **Notice: The following changes will be deployed on 2025-09-29, starting at 10:00 UTC and may take several hours to complete.** - Added an endpoint to retrieve the list of filters relevant to an account on a given symbol. This is the only endpoint that shows if an account has `MAX_ASSET` filters applied to it. - REST API: [`GET /api/v3/myFilters`](rest-api#myFilters) - WebSocket API: [`myFilters`](/products/spot/web-socket-api#myFilters) - Comments in **SBE: schema 3:1 ([spot_3_1.xml](/products/spot/sbe/schemas/spot_3_1.xml))** have been added, modified, and removed. Although there is no need for users of `3:1` to update to this version of the file, we advise updating to maintain consistency. - Added documentation for filter [`MAX_ASSET`](/products/spot/filters#max_asset). --- ### 2025-09-18 - Updated documentation for `recvWindow` to reflect microsecond support announced on [2025-08-12](#2025-08-12). - REST API: [Timing Security](rest-api#timingsecurity) - WebSocket API: [Timing Security](/products/spot/web-socket-api#timingsecurity) --- ### 2025-09-12 - The [QuickFix schema for FIX Order Entry](/products/spot/fix/schemas/spot-fix-oe.xml) has been updated to support Pegged Orders. - Updated FIX API Documentation for `RecvWindow` in - [Message Components](/products/spot/fix-api#header) - [Timing Security](/products/spot/fix-api#timing-security) --- ### 2025-08-28 - Updated SBE FAQ section [regarding legacy support](/products/spot/faqs/sbe_faq#regarding-legacy-support) to include more details on schema compatibility and explain `NonRepresentable` and `NonRepresentableMessage`. --- ### 2025-08-26 - Updated "Request Security" documentation for [REST API](rest-api#request-security) and [WebSocket API](/products/spot/web-socket-api#request-security) with no functional changes. --- ### 2025-08-25 - **SBE: schema 3:1 ([spot_3_1.xml](/products/spot/sbe/schemas/spot_3_1.xml))** will be updated on **2025-08-25 at 05:00 UTC** - The following fields have been renamed because the [SbeTool](/products/spot/faqs/sbe_faq#generate-sbe-decoders) code generator has been found to generate Java code that does not compile. - Although only users impacted by this issue need to update the schema, we advise all users to upgrade to the latest version to maintain consistency. - Message `MaxAssetFilter` - field `limitExponent` renamed to `qtyExponent` - field `limit` renamed to `maxQty` --- ### 2025-08-19 - `userDataStream.subscribe` returns `subscriptionId` in the responses.
This was missed in the [previous](#2025-08-12) changelog entry. --- ### 2025-08-12 **Notice:** The changes in this section will be gradually rolled out, and will take approximately up to two weeks to complete. #### General Changes - New error codes `-1120` and `1211`. See [Errors](/products/spot/errors) for more information. - The following requests have a new structure called `specialCommission`. See [Commission Rates](/products/spot/faqs/commission_faq). - REST API - `GET /api/v3/account/commission` - `POST /api/v3/order/test` with `computeCommissionRates=true` - `POST /api/v3/sor/order/test` with `computeCommissionRates=true` - WebSocket API - `account.commission` - `order.test` with `computeCommissionRates=true` - `sor.order.test` with `computeCommissionRates=true` - **SBE: A new schema 3:1 ([spot_3_1.xml](/products/spot/sbe/schemas/spot_3_1.xml)) is available.** - The current schema 3:0 ([spot_3_0.xml](/products/spot/sbe/schemas/spot_3_0.xml)) is deprecated and will retire in 6 months as per our schema deprecation policy. - Changes in schema 3:1: - `ExchangeInfoResponse`: new field `pegInstructionsAllowed` - `ExecutionReportEvent`: new fields `pricePeg`, `pricePegOffsetLevel`, `peggedPrice` - `UserDataStreamSubscribeResponse`: new field `subscriptionId` - New field `subscriptionId` for all user data stream events. - Field `apiKey` renamed to `loggedOnApiKey` for `WebSocketSessionLogonResponse`, `WebSocketSessionStatusResponse` and `WebSocketSessionLogoutResponse` - `OrderTestWithCommissionsResponse`: 2 new fields `specialCommissionForOrderMaker` and `specialCommissionForOrderTaker` - `AccountCommissionResponse`: 4 new fields `specialCommissionMaker`, `specialCommissionTaker`, `specialCommissionBuyer` and `specialCommissionSeller` - Support for `EXCHANGE_MAX_NUM_ORDER_LISTS`, `MAX_NUM_ORDER_LISTS`, and `MAX_NUM_ORDER_AMENDS` filters. - `ExecutionReportEvent`: fields `rejectReason` and `origClientOrderId` now show their default values in SBE format to match the JSON format. - `NonRepresentableMessage`: New message added to represent a message that cannot be represented in this schema ID and version. Receipt of this message indicates that something should be available, but it is not representable using the SBE schema currently in use. - Orders with cumulative quantity of 0 in the final state `EXPIRED_IN_MATCH` (i.e., the order expired due to STP) will be archived after 90 days. - Query order lists requests will first query the data in the cache, and if it cannot be found, will query the database. - REST API: `GET /api/v3/openOrderLists` - WebSocket API: `openOrderLists.status` #### WebSocket API - A single WebSocket connection can subscribe to multiple User Data Streams at once. - Only one subscription per account is allowed on a single connection. - Method `userDataStream.subscribe.signature` has been added that allows you to subscribe to the User Data Stream without needing to login first. - This also doesn’t require an Ed25519 API Key, and can work with any [API Key type](/products/spot/faqs/api_key_types). - For [SBE support](/products/spot/faqs/sbe_faq), you need to use at least schema 3:1. - Method `session.subscriptions` has been added to list all active subscriptions for the current session. - The meaning of the field `userDataStream` in the session requests has changed slightly. - Previously, this returned `true` if you were subscribed to the user data stream of your logged-on account. - Now returns `true` if you have at least one active user data stream subscription, otherwise `false`. - `userDataStream.unsubscribe` supports closing multiple subscriptions. - When called with no parameter, this will close all subscriptions. - When called with `subscriptionId`, this will attempt to close the subscription matching that Id, if it exists. - The authorization for this request has been changed to `NONE`. - Field `subscriptionId` has been added to the User Data Stream events payload when listening through the [WebSocket API](/products/spot/web-socket-api#user-data-stream-subscribe). This will identify which subscription the event is coming from. #### FIX API - When a client sends a reject message, the FIX API will no longer send the client back a Reject `<3>` message. - Error messages are now clearer when a tag is invalid, missing a value, or when the field value is empty or malformed. - ```json { "code": -1169, "msg": "Invalid tag number." } ``` - ```json { "code": -1177, "msg": "Tag specified without a value." } ``` - ```json { "code": -1102, "msg": "Field value was empty or malformed." } ``` #### Future Changes The following changes will be available on **2025-08-27 starting at 07:00 UTC**: - Exchange Information requests will emit a new field, `pegInstructionsAllowed`. - Bug fix: The Matching Engine will no longer accept order lists that exceed the order count filter limits. Affected filters: - `MAX_NUM_ORDERS` - `MAX_ALGO_ORDERS` - `MAX_ICEBERG_ORDERS` - `EXCHANGE_MAX_NUM_ORDERS` - `EXCHANGE_MAX_ALGO_ORDERS` - `EXCHANGE_MAX_ICEBERG_ORDERS` The following changes will be available on **2025-08-28 starting at 07:00 UTC**: - The [pegged orders](/products/spot/faqs/pegged_orders) functionality will be available. - `pegInstructionsAllowed` will be set to `true` for all symbols, enabling the use of pegged orders for all APIs. - The following conditional fields `pegPriceType`, `pegOffSetType`, `pegOffsetValues`, and `peggedPrice` will appear in responses of the following requests if the order is a pegged order: - REST API - `GET /api/v3/order` - `GET /api/v3/orderList` - `GET /api/v3/openOrderList` - `GET /api/v3/allOrders` - `DELETE /api/v3/order` - `DELETE /api/v3/orderList` - `DELETE /api/v3/openOrders` - `PUT /api/v3/order/amend/keepPriority` - WebSocket API - `order.status` - `orderList.status` - `allOrders` - `order.cancel` - `orderList.cancel` - `openOrders.cancelAll` - `order.amend.keepPriority` - FIX API - `OrdType(40)` supports new value `P(PEGGED)` - Tags `PegOffsetValue(211)`, `PegPriceType(1094)`, `PegMoveType(835)`, and `PegOffsetType(836)` have been added to the following messages: - NewOrderSingle `` - NewOrderList `` - OrderCancelRequestAndNewOrderSingle `` - When placing an order, the `ExecutionReport` `<8>` message will echo back `PegInstructions`, with an extra optional field `PeggedPrice (839)`. - New error messages for pegged orders are added. Please see the [Errors](/products/spot/errors) document for more information. - Changes with `recvWindow` will be enabled. - A third check is performed after your message leaves our message broker, just before it is sent to the Matching Engine. - This does not cover potential delays inside the Matching Engine itself. - `recvWindow` supports microseconds. - The value is still specified in milliseconds, but it can now include a decimal component for higher precision. - This means the parameter can now support up to **three decimal places** (e.g., 6000.346). - APIs affected: - FIX API - REST API - WebSocket API - New [`MAX_NUM_ORDER_LISTS`](/products/spot/filters#max_num_order_lists) filter will be enabled, limiting the number of order lists to 20 per symbol. - New [`MAX_NUM_ORDER_AMENDS`](/products/spot/filters#max_num_order_amends) filter will be enabled, limiting each order to a maximum of 10 amendments. --- ### 2025-08-07 - Updated FIX API documentation - [FIX Market Data limits](/products/spot/fix-api#connection-limits): The subscription limit has always been present but was undocumented. - [On message processing order](/products/spot/fix-api#on-message-processing-order): Reworded and reformatted. --- ### 2025-07-03 - Beginning at **2025-07-08 07:00 UTC**, [WebSocket Streams](/products/spot/web-socket-streams) will be upgraded. - During the upgrade, **existing and new connections may be disconnected in less than 24 hours**. - The upgrade may take up to 2 hours; We apologize for the inconvenience. --- ### 2025-06-04 REST and WebSocket API: - Reminder that SBE 2:0 schema will be retired on 2025-06-12, [6 months after being deprecated](/products/spot/faqs/sbe_faq#sbe-schema). - The [SBE lifecycle for Production](/products/spot/sbe/schemas/sbe_schema_lifecycle_prod.json) has been updated to reflect this change. --- ### 2025-05-28 - Documented API timeout value and error under General API Information for each API: - [FIX](/products/spot/fix-api#general-api-information) - [REST](rest-api#general-api-information) - [WebSocket](/products/spot/web-socket-api#general-api-information) --- ### 2025-05-22 **Notice: The following changes will happen at 2025-06-06 7:00 UTC.** - The previous behavior of `recvWindow` on FIX, REST, and WebSocket APIs will be augmented by an additional check. - To review, the existing behavior is: - If `timestamp` is greater than `serverTime` + 1 second at receipt of the request, the request is rejected. Rejection by this check increments message limits (FIX API) and IP limits (REST and WebSocket APIs), but not Unfilled Order Count (order placement endpoints of all APIs). - If the difference between `timestamp` and `serverTime` at receipt of the request is greater than `recvWindow`, the request is rejected. Rejection by this check increments message limits (FIX API) and IP limits (REST and WebSocket APIs) but not Unfilled Order Count (order placement endpoints of all APIs). - The additional check is: - Just before a request is forwarded to the Matching Engine, if the difference between `timestamp` and the current `serverTime` is greater than `recvWindow`, the request is rejected. Rejection by this check increments message limits (FIX API), IP limits (REST and WebSocket APIs), and Unfilled Order Count (order placement endpoints of all APIs). - The documentation for Timing security has been updated to reflect the additional check. - [REST API](rest-api#timing-security) - [WebSocket API](/products/spot/web-socket-api#timing-security) - [FIX API](/products/spot/fix-api#timing-security) - Fixed a bug in FIX Market Data message InstrumentList ``. Previously, the value of `NoRelatedSym(146)` could have been incorrect. --- ### 2025-04-29 - Features that currently require an Ed25519 API key will soon be opened up to HMAC and RSA keys. - For example, subscribing to User Data Stream in WebSocket API will be possible with any API key type before listenKeys are removed. - Users are still encouraged to migrate to Ed25519 API keys as they are more secure and performant on Binance Spot Trading. - More details to come. --- ### 2025-04-25 - The following request weights have been increased from 1 to 4: - REST API: `PUT /api/v3/order/amend/keepPriority` - WebSocket API: `order.amend.keepPriority` - The documentation for both REST and WebSocket API has been updated to reflect these changes. - Clarified that `SEQNUM` in the FIX-API is a 32-bit unsigned integer that rolls over. This has been the `SEQNUM` data type since the inception of the FIX-API. --- ### 2025-04-21 **Clarification on the release of [Order Amend Keep Priority](/products/spot/faqs/order_amend_keep_priority) and [STP Decrement](/products/spot/faqs/stp_faq):** - At **2025-05-07 07:00 UTC** - Order Amend Keep Priority will be enabled on all symbols. - STP Decrement will be allowed on all symbols. - At **2025-04-24, 07:00 UTC**, the field `amendAllowed` will become visible on Exchange Information requests, but the feature will not be enabled yet. - [SPOT Testnet](https://testnet.binance.vision/) has both features enabled/allowed on all symbols. --- ### 2025-04-08 **Notice:** The changes in this section will be gradually rolled out, and will take a week to complete. - New Error code `-2039` where if querying an order with both `orderId` and `origClientOrderId` and no order is found with this combination. - Affected requests: - REST API: `GET /api/v3/order` - WebSocket API: `order.status` - The [Errors Documentation](/products/spot/errors) has also been updated with the new error messages for code `-1034` when the FIX connection rate limits have exceeded. (More details can be found in yesterday's [update](#2025-04-07)) --- ### 2025-04-07 #### General Changes **Notice:** The changes in this section will be gradually rolled out, and will take a week to complete. - FIX Market Data connection limits were increased from 5 to 100 on January 16, 2025. This was not previously highlighted in changelog. - New Error code `-2038` for order amend keep priority requests that fail. - New messages for error code `-1034`. - If the unfilled order count for `intervalNum:DAY` is exceeded, the unfilled order count for `intervalNum:SECOND` is no longer incremented. - Previously, the request weight for myTrades was 20 regardless of the parameters provided. Now, if you provide `orderId`, the request weight is 5. - REST API: `GET /api/v3/myTrades` - WebSocket API: `myTrades` - Change when querying and deleting orders: - When neither `orderId` nor `origClientOrderId` are present, the request is now rejected with `-1102` instead of `-1128`. - Affected requests: - REST API: - `GET /api/v3/order` - `DELETE /api/v3/order` - WebSocket API - `order.status` - `order.cancel` - FIX API - OrderCancelRequest `` #### FIX API **Notice:** The following changes will occur during April 21, 2025. - FIX API verifies that `EncryptMethod(98)` is 0 at Logon ``. - FIX Order Entry connection limits will be a maximum of 10 concurrent connections per account. - The connection rate limits are now enforced. Note that these limits are checked independently for both the account and the IP address. - FIX Order Entry: 15 connection attempts within 30 seconds - FIX Drop Copy: 15 connection attempts within 30 seconds - FIX Market Data: 300 connection attempts within 300 seconds - News `` contains a countdown until disconnection in the Headline field. - Following the completion of this update, when the server enters maintenance, a `News` message will be sent to clients **every 10 seconds for 10 minutes**. After this period, clients will be logged out and their sessions will be closed. - OrderCancelRequest `` and OrderCancelRequestAndNewOrderSingle `` now allow both `orderId` and `clientOrderId`. - The [QuickFix schema for FIX OE](/products/spot/fix/schemas/spot-fix-oe.xml) is updated to support the Order Amend Keep Priority feature and new STP mode, `DECREMENT`. #### User Data Streams - **Receiving user data streams on wss://stream.binance.com:9443 using a `listenKey` is now deprecated.** - This feature will be removed from our systems at a later date. - **Instead, you should get user data updates by subscribing to the [User Data Stream on the WebSocket API](/products/spot/websocket-api/user-data-stream-requests)**. - This should offer slightly better performance **(lower latency)**. - This requires the use of an Ed25519 API Key. - In a future update, information about the base WebSocket endpoint for the User Data Streams will be removed. - In a future update, the following requests will be removed from the documentation: - `POST /api/v3/userDataStream` - `PUT /api/v3/userDataStream` - `DELETE /api/v3/userDataStream` - `userDataStream.start` - `userDataStream.ping` - `userDataStream.stop` - The [User Data Stream documentation](/products/spot/user-data-stream) will remain as reference for the payloads you can receive. #### Future Changes The following changes will occur at **April 24, 2025, 07:00 UTC**: - ~~[Order Amend Keep Priority](/products/spot/faqs/order_amend_keep_priority) becomes available. (Note that the symbol has to have the feature enabled to be used.)~~ - **UPDATE 2025-04-21: The exact date "Order Amend Keep Priority" will be enabled has not yet been determined.** - New field `amendAllowed` becomes visible in Exchange Information responses. - REST API: `GET /api/v3/exchangeInfo` - WebSocket API: `exchangeInfo` - FIX API: New Order Entry Messages **OrderAmendKeepPriorityRequest** and **OrderAmendReject** - REST API: `PUT /api/v3/order/amend/keepPriority` - WebSocket API: `order.amend.keepPriority` - ~~STP mode `DECREMENT` becomes visible in Exchange Information if the symbol has it configured.~~ - **UPDATE 2025-04-21: The exact date `DECREMENT` STP will be enabled has not yet been determined.** - Instead of expiring only the maker, only the taker, or unconditionally both orders, STP decrement decreases the available quantity of **both** orders and increases the `prevented quantity` of **both** orders by the amount of the prevented match. - This expires the order with less available quantity as (`filled quantity` \+ `prevented quantity`) equals `order quantity`. Both orders expire if their available quantities are equal. It is called a "decrement" because it reduces available quantity. - Behavior when querying and/or canceling with `orderId` and `origClientOrderId/cancelOrigClientOrderId`: - The behavior when both parameters were provided was not consistent across all endpoints. - Moving forward, when both parameters are provided, the order is first searched for using its `orderId`, and if found, `origClientOrderId`/`cancelOrigClientOrderId` is checked against that order. If both conditions pass, the request succeeds. If both conditions are not met the request is rejected. - Affected requests: - REST API: - `GET /api/v3/order` - `DELETE /api/v3/order` - `POST /api/v3/order/cancelReplace` - WebSocket API: - `order.status` - `order.cancel` - `order.cancelReplace` - FIX API - OrderCancelRequest `` - OrderCancelRequestAndNewOrderSingle `` - Behavior when canceling with `listOrderId` and `listClientOrderId`: - The behavior when both parameters were provided was not consistent across all endpoints. - Moving forward, when both parameters are passed, the order list is first searched for using its `listOrderId`, and if found, `listClientOrderId` is checked against that order list. If both conditions are not met the request is rejected. - Affected requests: - REST API - `DELETE /api/v3/orderList` - WebSocket API - `orderList.cancel` - **SBE: A new schema 3:0 ([spot_3_0.xml](/products/spot/sbe/schemas/spot_3_0.xml)) is now available.** - The current schema 2:1 ([spot_2_1.xml](/products/spot/sbe/schemas/spot_2_1.xml)) is now deprecated and will be retired in 6 months as per our schema deprecation policy. - Note that trying to use schema 3:0 before it is released will result in an error. - Changes in schema 3:0: - Support for Order Amend Keep Priority: - Added field `amendAllowed` to ExchangeInfoResponse. - New Messages `OrderAmendmentsResponse` and `OrderAmendKeepPriorityResponse` - All enums now have a `NON_REPRESENTABLE` variant. This will be used to encode new enum values in the future, which would be incompatible with 3:0. - New enum variant `DECREMENT` for `selfTradePreventionMode` and `allowedSelfTradePreventionModes` - `symbolStatus` enum values `AUCTION_MATCH`, `PRE_TRADING` and `POST_TRADING` have been removed. - Fields `usedSor`, `orderCapacity`, `workingFloor`, `preventedQuantity`, and `matchType` are no longer optional. - Field `orderCreationTime` in `ExecutionReportEvent` is now optional. - When using deprecated schema 2:1 on the WebSocket API to listen to the User Data Stream: - `ListStatusEvent` field `listStatusType` will be rendered as `ExecStarted` when it should have been `Updated`. Upgrade to schema 3:0 to get the correct value. - `ExecutionReportEvent` field `selfTradePreventionMode` will be rendered as `None` when it should have been `Decrement`. This only happens when `executionType` is `TradePrevention`. - `ExecutionReportEvent` field `orderCreationTime` will be rendered as -1 when it has no value. - All schemas below 3:0 are unable to represent responses for Order Amend Keep Priority requests and any response that could contain the STP mode `DECREMENT` (e.g. Exchange Information, order placement, order cancelation, or querying the status of your order). When a response cannot be represented in the requested schema, an error is returned. --- ### 2025-04-03 - Following SPOT Testnet's latest announcement, updating the URL in the WebSocket API to the latest URL for [SPOT Testnet](https://testnet.binance.vision/). --- ### 2025-03-31 - Added a clarification on the performance of canceling an order. --- ### 2025-03-10 - **Notice: The following changes will happen on 2025-03-13 09:00 UTC** - FIX Drop Copy sessions will have a limit of **60 messages per minute**. - FIX Market Data sessions will have a limit of **2000 messages per minute**. - The FIX API documentation has been updated to reflect the upcoming changes. - **SBE Market Data Streams will be available on March 18 2025, 07:00 UTC.** These streams offer a smaller payload and should offer better latency than the equivalent JSON streams for a subset of latency-sensitive market data streams. - Streams available in SBE format: - Real-time: trade stream - Real-time: best bid/ask - Every 100 ms: diff. depth - Every 100 ms: partial book depth - For more information please refer to the [SBE Market Data Streams](/products/spot/sbe-market-data-streams). --- ### 2025-03-05 - **Notice: The following changes will happen on March 10, 2025 12:00 UTC.**
The following request weights will be increased from 2 to 4: - REST API: `GET /api/v3/aggTrade` - WebSocket API: `trades.aggregate` - The documentation for both REST and WebSocket API has been updated to reflect the upcoming changes. --- ### 2025-02-12 - **Notice: These changes will take effect on February 26, 2025 05:00 UTC.** Please ensure you have downloaded the latest schema before then. - `AggressorSide (2446)` will be rendered in the [FIX Market Data Trade Stream](/products/spot/fix-api#tradestream). The QuickFix schema [file](/products/spot/fix/schemas/spot-fix-md.xml) has also been updated. --- ### 2025-01-28 - **Notice: These changes will be gradually rolled out between February 3, 2025 and February 14, 2025.** **The following changes will apply to WebSocket Market Data Streams, User Data Streams, and the WebSocket API:** - Our WebSocket services will send a ping frame **every 20 seconds** instead of 3 minutes. - The allowed pong delay will be **every 1 minute** instead of 10 minutes. - The documentation for these services have been updated to reflect the change. --- ### 2025-01-09 - FIX Market Data will be available at **January 16, 05:00 UTC**. The FIX API documentation has been updated regarding this feature. - Please refer to this [link](/products/spot/fix/schemas/spot-fix-md.xml) for the QuickFIX Schema for FIX Market Data. --- ### 2024-12-17 General Changes: The system now supports microseconds in all related time and/or timestamp fields. Microsecond support is **opt-in**, by default the requests and responses still use milliseconds. Examples in documentation are also using milliseconds for the foreseeable future. WebSocket Streams - A new optional parameter `timeUnit` can be used in the connection URL to select the time unit. - For example: `/stream?streams=btcusdt@trade&timeUnit=millisecond` - Supported values are: - `MILLISECOND` - `millisecond` - `MICROSECOND` - `microsecond` - If the time unit is not selected, milliseconds will be used by default. REST API - A new optional header `X-MBX-TIME-UNIT` can be sent in the request to select the time unit. - Supported values: - `MILLISECOND` - `millisecond` - `MICROSECOND` - `microsecond` - The time unit affects timestamp fields in JSON responses (e.g., `time`, `transactTime`). - SBE responses continue to be in microseconds regardless of time unit. - If the time unit is not selected, milliseconds will be used by default. - Timestamp parameters (e.g. `startTime`, `endTime`, `timestamp)` can now be passed in milliseconds or microseconds. WebSocket API - A new optional parameter `timeUnit` can be used in the connection URL to select the time unit. - Supported values: - `MILLISECOND` - `millisecond` - `MICROSECOND` - `microsecond` - The time unit affects timestamp fields in JSON responses (e.g., `time`, `transactTime`). - SBE responses continue to be in microseconds regardless of time unit. - If the time unit is not selected, milliseconds will be used by default. - Timestamp parameters (e.g. `startTime`, `endTime`, `timestamp)` can now be passed in milliseconds or microseconds. User Data Streams - A new optional parameter `timeUnit` can be used in the connection URL to select the time unit. - Supported values - `MILLISECOND` - `MICROSECOND`. - `microsecond` - `millisecond` --- ### 2024-12-09 **Notice:** The changes below will be rolled out starting at **2024-12-12** and may take approximately a week to complete. General Changes - Timestamp parameters now reject values too far into the past or the future. To be specific, the parameter will be rejected if: - `timestamp` before 2017-01-01 (less than 1483228800000) - `timestamp` is more than 10 seconds after the current time (e.g., if current time is 1729745280000 then it is an error to use 1729745291000 or greater) - If `startTime` and/or `endTime` values are outside of range, the values will be adjusted to fit the correct range. - The field for quote order quantity (`origQuoteOrderQty`) has been added to responses that previously did not have it. Note that for order placement endpoints the field will only appear for requests with `newOrderRespType` set to `RESULT` or `FULL`. - Please refer to the table below for affected requests with: `origQuoteOrderQty`: | Service | Request | | :------------ | :--------------------------------- | | REST | `POST /api/v3/order` | | | `POST /api/v3/sor/order` | | | `POST /api/v3/order/oco` | | | `POST /api/v3/orderList/oco` | | | `POST /api/v3/orderList/oto` | | | `POST /api/v3/orderList/otoco` | | | `DELETE /api/v3/order` | | | `DELETE /api/v3/orderList` | | | `POST /api/v3/order/cancelReplace` | | WebSocket API | `order.place` | | | `sor.order.place` | | | `orderList.place` | | | `orderList.place.oco` | | | `orderList.place.oto` | | | `orderList.place.otoco` | | | `order.cancel` | | | `orderList.cancel` | | | `order.cancelReplace` | SBE - A new schema 2:1 [spot_2_1.xml](/products/spot/sbe/schemas/spot_2_1.xml) has been released. The current schema 2:0 [spot_2_0.xml](/products/spot/sbe/schemas/spot_2_0.xml) will thus be deprecated, and retired from the API in 6 months as per our schema deprecation policy. - Schema 2:1 is a backward compatible update of schema 2:0. You will always receive payloads in 2:1 format when you request either schema 2:0 or 2:1. - Changes in SBE schema 2:1: - New field `origQuoteOrderQty` in order placement/cancellation responses (Note: Decoders generated using the 2:0 schema will skip this field.): - `NewOrderResultResponse` - `NewOrderFullResponse` - `CancelOrderResponse` - `NewOrderListResultResponse` - `NewOrderListFullResponse` - `CancelOrderListResponse` - WebSocket API only: New field `userDataStream` in session status responses: - `WebSocketSessionLogonResponse` - `WebSocketSessionStatusResponse` - `WebSocketSessionLogoutResponse` - WebSocket API only: New messages for User Data Stream support: - `UserDataStreamSubscribeResponse` - `UserDataStreamUnsubscribeResponse` - `BalanceUpdateEvent` - `EventStreamTerminatedEvent` - `ExecutionReportEvent` - `ExternalLockUpdateEvent` - `ListStatusEvent` - `OutboundAccountPositionEvent` WebSocket API - You can now subscribe to User Data Stream events through your WebSocket API connection. - Note: This feature is only available for users of the Ed25519 API keys. - Note: New SBE schema 2:1 is required for User Data Stream subscriptions in SBE format. - New requests: - `userDataStream.subscribe` - `userDataStream.unsubscribe` - Changes to `session.logon`, `session.status`, and `session.logout` - Added a new field `userDataStream` indicating if the user data stream subscription is active. - Fixed a bug where you wouldn't receive a new listenKey using `userDataStream.start` after `session.logon` User Data Stream - WebSocket API only: New event `eventStreamTerminated` is emitted when you either logout from your WebSocket session or you have unsubscribed from the user data stream. - New event `externalLockUpdate` is sent when your spot wallet balance is locked/unlocked by an external system. FIX API - The [schema](/products/spot/fix/schemas/spot-fix-oe.xml) has been updated with a new Administrative message News \, which can be used for all FIX services. Receiving this message indicates that your connection is about to be closed. The following changes will occur **between 2024-12-16 to 2024-12-20**: - Fixed a bug that prevented orders from being placed when submitting OCOs on the `BUY` side without providing a `stopPrice`. - `TAKE_PROFIT` and `TAKE_PROFIT_LIMIT` support has been added for OCOs. - Previously OCOs could only be composed by the following order types: - `LIMIT_MAKER` \+ `STOP_LOSS` - `LIMIT_MAKER` \+ `STOP_LOSS_LIMIT` - Now OCOs can be composed of the following order types: - `LIMIT_MAKER` \+ `STOP_LOSS` - `LIMIT_MAKER` \+ `STOP_LOSS_LIMIT` - `TAKE_PROFIT` \+ `STOP_LOSS` - `TAKE_PROFIT` \+ `STOP_LOSS_LIMIT` - `TAKE_PROFIT_LIMIT` \+ `STOP_LOSS` - `TAKE_PROFIT_LIMIT` \+ `STOP_LOSS_LIMIT` - This is supported by the following requests: - `POST /api/v3/orderList/oco` - `POST /api/v3/orderList/otoco` - `orderList.place.oco` - `orderList.place.otoco` - `NewOrderList` - Error code \-1167 will be obsolete after this update and will be removed from the documentation in a later update. --- ### 2024-10-18 REST and WebSocket API: - Reminder that SBE 1:0 schema will be disabled on 2024-10-25, [6 months after being deprecated](/products/spot/faqs/sbe_faq), as per our SBE policy. - The [SBE lifecycle for Prod](/products/spot/sbe/schemas/sbe_schema_lifecycle_prod.json) has been updated to reflect this change. --- ### 2024-10-17 Changes to Exchange Information (i.e. [`GET /api/v3/exchangeInfo`](rest-api#exchangeInfo) from REST and [`exchangeInfo`](/products/spot/web-socket-api#exchangeInfo) for WebSocket API). - A new optional parameter `showPermissionSets` can be used to hide the permissions from `permissionsSets`; This can be used for a reduced payload size. - A new optional parameter `symbolStatus` can now be used to only show symbols with the specified status. (e.g. `TRADING`, `HALT`, `BREAK`) --- ### 2024-08-26 - [Spot Unfilled Order Count Rules](/products/spot/faqs/order_count_decrement) have been updated to explain how to decrease your unfilled order count when placing orders. --- ### 2024-08-16 **Notice:** The changes below are being rolled out gradually, and may take approximately a week to complete. General Changes: - New error messages have been added when quote quantity market orders (aka reverse market orders) are rejected in low-liquidity situations. --- ### 2024-08-01 - [FIX API and Drop Copy Sessions](/products/spot/fix-api) will be available on **August 8, 05:00 UTC**. --- ### 2024-07-26 - [FIX API and Drop Copy Sessions](/products/spot/fix-api) has been added to the documentation. - The release date to the live exchange has not been determined. --- ### 2024-07-22 General changes: - Fixed a bug where klines had incorrect timestamps. - REST API: `GET /api/v3/klines` and `GET /api/v3/uiKlines` with `timeZone` parameter - WebSocket API: `klines` and `uiKlines` with `timeZone` parameter - WebSocket Streams: `@kline_@+08:00` streams --- ### 2024-06-11 - On **June 11, 05:00 UTC**, One-Triggers-the-Other (OTO) orders and One-Triggers-a-One-Cancels-The-Other (OTOCO) orders will be enabled. (Note this may take a few hours to be rolled out to all servers.) - New requests have been added: - REST API: - `POST /api/v3/orderList/oto` - `POST /api/v3/orderList/otoco` - WebSocket API: - `orderList.place.oto` - `orderList.place.otoco` - On **June 18, 05:00 UTC**, Buyer order ID `b` and Seller order ID `a` will be removed from the Trade Streams (i.e. `@trade`). (Note that this may take a few hours to be rolled out to all servers.) - [WebSocket Streams](/products/spot/web-socket-streams) has been updated regarding this change. - To monitor if your order was part of a trade, please listen to the [User Data Streams](/products/spot/user-data-stream) --- ### 2024-06-06 This will be available by **June 6, 11:59 UTC**. REST API - `orderRateLimitExceededMode` has been added to `POST /api/v3/order/cancelReplace`. WebSocket API - `orderRateLimitExceededMode` has been added to `order.cancelReplace`. --- ### 2024-05-30 WebSocket Streams: - Kline/Candlestick streams can now support a UTC+8 timezone offset. (e.g. `btcusdt@kline_1d@+08:00`) --- ### 2024-04-10 The following changes have been postponed to take effect on **April 25, 05:00 UTC** General changes: - Symbol permission information in Exchange Information responses has moved from field `permissions` to field `permissionSets`. - Field `permissions` will be empty and will be removed in a future release. - Previously, `"permissions":["SPOT","MARGIN"]` meant that you could place an order on the symbol if your account had `SPOT` or `MARGIN` permissions. The equivalent is `"permissionSets":[["SPOT","MARGIN"]]`. (Note the extra set of square brackets.) Each array of permissions inside the `permissionSets` array is called a "permission set". - Symbol permissions can now be more complex. `"permissionSets":[["SPOT","MARGIN"],["TRD_GRP_004","TRD_GRP_005"]]` means that you may place an order on the symbol if your account has SPOT or MARGIN permissions **and** `TRD_GRP_004` or `TRD_GRP_005` permissions. There may be an arbitrary number of permission sets in a symbol's `permissionSets`. REST API - `otoAllowed` will now appear on `GET /api/v3/exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. WebSocket API - `otoAllowed` will now appear on `exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. SBE - A new schema 2:0 [spot_2_0.xml](/products/spot/sbe/schemas/spot_2_0.xml) has been released. The current schema 1:0 [spot_1_0.xml](/products/spot/sbe/schemas/spot_1_0.xml) will thus be deprecated, and retired from the API in 6 months as per our schema deprecation policy. - When using schema 1:0 on REST API or WebSocket API, group "permissions" in message "ExchangeInfoResponse" will always be empty. Upgrade to schema 2:0 to find permission information in group "permissionSets". See General changes above for more details. - Deprecated OCO requests will still be supported by the latest schema. - Note that trying to use schema 2:0 before it is actually released will result in an error. --- ### 2024-04-02 **Notice:** The changes below are being rolled out gradually, and will take approximately a week to complete. General changes: - `GET /api/v3/account` has a new optional parameter `omitZeroBalances`, which if enabled hides all zero balances. - `account.status` has a new optional parameter `omitZeroBalances` which if enabled hides all zero balances. - **The weight of the following requests has been increased from 10 to 25 (This will take effect on April 4, 2024)**: - `GET /api/v3/trades` - `GET /api/v3/historicalTrades` - `trades.recent` - `trades.historical` User Data Stream: - New event `listenKeyExpired` that will be emitted in the streams if the `listenKey` expired. REST API - The `POST /api/v3/order/oco` endpoint is now deprecated on the REST API. You should use the new `POST /api/v3/orderList/oco` endpoint instead. Note that this new endpoint uses different parameters. WebSocket API - The `orderList.place` request is now deprecated on the WebSocket API. You should now use the new `orderList.place.oco` request instead. Note that this new request uses different parameters. **The following will take effect _approximately_ a week after the release date:** General changes: - Symbol permission information in Exchange Information responses has moved from field `permissions` to field `permissionSets`. - Field `permissions` will be empty and will be removed in a future release. - Previously, `"permissions":["SPOT","MARGIN"]` meant that you could place an order on the symbol if your account had `SPOT` or `MARGIN` permissions. The equivalent is `"permissionSets":[["SPOT","MARGIN"]]`. (Note the extra set of square brackets.) Each array of permissions inside the `permissionSets` array is called a "permission set". - Symbol permissions can now be more complex. `"permissionSets":[["SPOT","MARGIN"],["TRD_GRP_004","TRD_GRP_005"]]` means that you may place an order on the symbol if your account has SPOT or MARGIN permissions **and** `TRD_GRP_004` or `TRD_GRP_005` permissions. There may be an arbitrary number of permission sets in a symbol's `permissionSets`. REST API - `otoAllowed` will now appear on `GET /api/v3/exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. WebSocket API - `otoAllowed` will now appear on `exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. SBE - A new schema 2:0 [spot_2_0.xml](/products/spot/sbe/schemas/spot_2_0.xml) has been released. The current schema 1:0 [spot_1_0.xml](/products/spot/sbe/schemas/spot_1_0.xml) will thus be deprecated, and retired from the API in 6 months as per our schema deprecation policy. - When using schema 1:0 on REST API or WebSocket API, group "permissions" in message "ExchangeInfoResponse" will always be empty. Upgrade to schema 2:0 to find permission information in group "permissionSets". See General changes above for more details. - Deprecated OCO requests will still be supported by the latest schema. - Note that trying to use schema 2:0 before it is actually released will result in an error. --- ### 2024-02-28 **This will take effect on March 5, 2024.** Simple Binary Encoding (SBE) will be added to the live exchange, both for the Rest API and WebSocket API. For more information on SBE, please refer to the [FAQ](/products/spot/faqs/sbe_faq) --- ### 2024-02-08 The SPOT WebSocket API can now support SBE on [SPOT Testnet](https://testnet.binance.vision). The SBE schema has been updated with WebSocket API metadata without incrementing either `schemaId` or `version`. Users using SBE only on the REST API may continue to use the SBE schema with git commit hash [`128b94b2591944a536ae427626b795000100cf1d`](/products/spot/sbe/schemas/spot_1_0.xml) or update to the newly-published SBE schema. Users who want to use SBE on the WebSocket API must use the [newly-published SBE schema](/products/spot/sbe/schemas/spot_1_0.xml). The [FAQ](/products/spot/faqs/sbe_faq) for SBE has been updated. --- ### 2023-12-08 Simple Binary Encoding (SBE) has been added to [SPOT Testnet](https://testnet.binance.vision). This will be added to the live exchange at a later date. For more information on what SBE is, please refer to the [FAQ](/products/spot/faqs/sbe_faq) --- ### 2023-12-04 **Notice:** The changes below are being rolled out gradually, and will take approximately a week to complete. General Changes: - Error message `Precision is over the maximum defined for this asset.` has been changed to `Parameter '%s' has too much precision.` - This error message is returned when a parameter has more precision than allowed: e.g. if `base asset` precision is 6 and `quantity=0.1234567` then this error message will appear. - This affects all requests with the following parameters: - `quantity` - `quoteOrderQty` - `icebergQty` - `limitIcebergQty` - `stopIcebergQty` - `price` - `stopPrice` - `stopLimitPrice` - Requests for open OCO now correctly return results in **ascending order**. This affects the following requests: - REST API: `GET /api/v3/openOrderList` - WebSocket API: `openOrderList.status` - Requests for all OCO now correctly return results in **ascending order** when `startTime` or `fromId` are specified. This affects the following requests: - REST API: `GET /api/v3/allOrderList` - WebSocket API: `allOrderLists` - Fixed a bug where order query requests would incorrectly return [`-2026 ORDER_ARCHIVED`](/products/spot/errors#-2026-order_archived) error for newly placed orders. - REST API: `GET /api/v3/order` - WebSocket API: `order.status` REST API - New endpoint `GET /api/v3/account/commission` - New endpoint `GET /api/v3/ticker/tradingDay` - `GET /api/v3/avgPrice` response has a new field `closeTime`, indicating the last trade time. - `GET /api/v3/klines` and `/api/v3/uiKlines` have a new optional parameter `timeZone`. - `POST /api/v3/order/test` and `POST /api/v3/sor/order/test` have a new optional parameter `computeCommissionRates`. - Changes regarding invalid endpoints being sent: - Previously, if you query an non-existing endpoint (e.g. `curl -X GET "https://api.binance.com/api/v3/exchangie`) you would get a HTTP 404 code with the response `

404 Not found

` - From now on the HTML response will only appear if the Accept request header has `text/html` for this situation. The HTTP code will remain the same. WebSocket API - New request `account.commission` - New requests to allow session authentication: **(Note that these requests can only be used with Ed25519 keys.)** - `session.logon` - `session.logout` - `session.status` - New request `ticker.tradingDay` - `avgPrice` response has a new field `closeTime`, indicating the last trade time. - `klines` and `uiKlines` have a new optional parameter `timeZone`. - `order.test` and `sor.order.test` have a new optional parameter `computeCommissionRates`. - Fixed a bug where unsolicited pongs sent before the ping would cause disconnection. WebSocket Streams - New stream `@avgPrice` - `id` now supports the same values as used for `id` in the WebSocket API: - 64-bit signed integers (previously this was unsigned) - Alphanumeric strings, max of 36 in length - `null` - Fixed a bug where unsolicited pongs sent before the ping would cause disconnection. User Data Streams - When an event of type `executionReport` has an execution type (`x`) of `TRADE_PREVENTION`, fields `l`, `L` and `Y` will now always be 0. New fields `pl`, `pL` and `pY` will describe the prevented execution quantity, prevented execution price, and prevented execution notional instead. These new fields show the values of what would `l`, `L` and `Y` have been if the taker order didn't have self-trade prevention enabled. **The following will take effect _approximately_ a week after the release date:** - Symbol Permissions will only affect order placement, not cancellation. - `permissions` still apply to Cancel-Replace orders (i.e. The cancellation won't be allowed if your account does have the permission to place an order using this request.) --- ### 2023-10-19 **Effective on 2023-10-19 00:00 UTC** - The request weights of the following requests have been increased:
REST API WebSocket API Condition Previous Request Weight New Request Weight
GET /api/v3/trades trades.recent N/A 2 10
GET /api/v3/depth depth Limit 1-100 2 5
Limit 101-500 10 25
Limit 501-1000 20 50
Limit 1001-5000 100 250
--- ### 2023-10-03 - **Order decrement feature went live at 06:15 UTC**. - For more information on this feature, please refer to our [FAQ](/products/spot/faqs/order_count_decrement) --- ### 2023-08-25 - For WebSocket API, removed `RAW REQUESTS` rate limit in `exchangeInfo`, replaced it with `CONNECTIONS` rate limit, which is the limit for new Websocket connections. **The following changes will be effective from 2023-08-25 at UTC 00:00.** - The `CONNECTIONS` rate limit for WebSocket API has been adjusted to 300 every 5 minutes. - The `REQUEST_WEIGHT` rate limit for both REST and WebSocket API has been adjusted to 6,000 every minute. - The `RAW_REQUESTS` rate limit for REST API has been adjusted to 61,000 every 5 minutes. - Previously, connecting to WebSocket API used to cost 1 weight. **The cost is now 2**. - The weights to the following requests for both REST API and WebSocket API have been adjusted. Please refer to the table for more details: | Request | Previous Request Weight | New Request Weight | | ---------------------------------------------------------------------------------------------------------- | ----------------------- | ------------------ | | `GET /api/v3/order`
`order.status` | 2 | 4 | | `GET /api/v3/orderList`
orderList.status | 2 | 4 | | `GET /api/v3/openOrders`
`openOrders.status` - **With `symbol`** | 3 | 6 | | `GET /api/v3/openOrders`
`openOrders.status` - **Without `symbol`** | 40 | 80 | | `GET /api/v3/openOrderList`
`openOrderLists.status` | 3 | 6 | | `GET /api/v3/allOrders`
`allOrders` | 10 | 20 | | `GET /api/v3/allOrderList`
`allOrderLists` | 10 | 20 | | `GET /api/v3/myTrades`
`myTrades` | 10 | 20 | | `GET /api/v3/myAllocations`
`myAllocations` | 10 | 20 | | `GET /api/v3/myPreventedMatches`
`myPreventedMatches` - **Using `preventedMatchId`** | 1 | 2 | | `GET /api/v3/myPreventedMatches`
`myPreventedMatches` - **Using `orderId`** | 10 | 20 | | `GET /api/v3/account`
`account.status` | 10 | 20 | | `GET /api/v3/rateLimit/order`
`account.rateLimits.orders` | 20 | 40 | | `GET /api/v3/exchangeInfo`
`exchangeInfo` | 10 | 20 | | `GET /api/v3/depth`
`depth` - **Limit 1-100** | 1 | 2 | | `GET /api/v3/depth`
`depth` - **Limit 101-500** | 5 | 10 | | `GET /api/v3/depth`
`depth` - **Limit 501-1000** | 10 | 20 | | `GET /api/v3/depth`
`depth` - **Limit 1001-5000** | 50 | 100 | | `GET /api/v3/aggTrades`
`trades.aggregate` | 1 | 2 | | `GET /api/v3/trades`
`trades.recent` | 1 | 2 | | `GET /api/v3/historicalTrades`
`trades.historical` | 5 | 10 | | `GET /api/v3/klines`
`klines` | 1 | 2 | | `GET /api/v3/uiKlines`
`uiKlines` | 1 | 2 | | `GET /api/v3/ticker/bookTicker`
`ticker.book` - **With `symbol`** | 1 | 2 | | `GET /api/v3/ticker/bookTicker`
`ticker.book` - **Without `symbol`** or **With `symbols`** | 2 | 4 | | `GET /api/v3/ticker/price`
`ticker.price` - **With `symbol`** | 1 | 2 | | `GET /api/v3/ticker/price`
`ticker.price` - **Without `symbol`** or **With `symbols`** | 2 | 4 | | `GET /api/v3/ticker/24hr`
`ticker.24hr` - **With `symbol`** or **With `symbols` using 1-20 symbols** | 1 | 2 | | `GET /api/v3/ticker/24hr`
`ticker.24hr` - **With `symbols using 21-100 symbols`** | 20 | 40 | | `GET /api/v3/ticker/24hr`
`ticker.24hr` - **Without `symbol` or `symbols using 101 or more symbols`** | 40 | 80 | | `GET /api/v3/avgPrice`
`avgPrice` | 1 | 2 | | `GET /api/v3/ticker`
`ticker` | 2 | 4 | | `GET /api/v3/ticker`
`ticker` - Maximum weight for this request | 100 | 200 | | `POST /api/v3/userDataStream`
`userDataStream.start` | 1 | 2 | | `PUT /api/v3/userDataStream`
`userDataStream.ping` | 1 | 2 | | `DELETE /api/v3/userDataStream`
`userDataStream.stop` | 1 | 2 | --- ### 2023-08-08 Smart Order Routing (SOR) has been added to the APIs. For more information please refer to our [FAQ](/products/spot/faqs/sor_faq). Please wait for future announcements on when the feature will be enabled. REST API - Changes to `GET /api/v3/exchangeInfo`: - New field in response: `sors`, describing SORs enabled on the exchange. - Changes to `GET /api/v3/myPreventedMatches` - New field `makerSymbol` will appear in the response for all prevented matches. - New endpoints for order placement using SOR: - `POST /api/v3/sor/order` - `POST /api/v3/sor/order/test` - New endpoint `GET /api/v3/myAllocations` WEBSOCKET API - Changes to `exchangeInfo`: - New field in response: `sors`, describing SORs enabled on the exchange. - Changes to `myPreventedMatches`: - New field `makerSymbol` will appear in the response for all prevented matches. - New requests for order placement using SOR: - `sor.order.place` - `sor.order.test` - New request `myAllocations` USER DATA STREAM - Changes to `executionReport`: - These fields are only relevant for orders placed using SOR: - New field `b` for `matchType` - New field `a` for `allocId` - New field `k` for `workingFloor` - This field is only relevant for orders expiring due to STP: - New field `Cs` for `counterSymbol` --- ### 2023-07-18 - New API key type – Ed25519 – is now supported. (UI support will be released this week.) - Ed25519 API keys are an alternative to RSA API keys, using asymmetric cryptography to authenticate your requests on the API. - **We recommend switching to Ed25519** for improved performance and security.
For more information, please refer to the [API Key Types](/products/spot/faqs/api_key_types). - Documentation has been updated with how to sign a payload with Ed25519 keys. --- ### 2023-07-11 **Notice:** The change below are being rolled out, and will take approximately a week to complete. General Changes: - Changes to error messages: - Previously, when duplicate symbols were passed to requests that do not allow it, the error would be "Mandatory parameter symbols was not sent, was empty/null, or malformed." - Now, the error message is "Symbol is present multiple times in the list", with a new error code `-1151` - This affects the following requests: - `GET /api/v3/exchangeInfo` - `GET /api/v3/ticker/24hr` - `GET /api/v3/ticker/price` - `GET/api/v3/ticker/bookTicker` - `exchangeInfo` - `ticker.24hr` - `ticker.price` - `ticker.book` - Fixed a bug where some non-archived orders being queried would receive the error code that their order was archived. Rest API - Changes to `GET /api/v3/account`: - New field `preventSor` will appear in the response. - New field `uid` that shows the User Id/Account will appear in the response. - Changes to `GET /api/v3/historicalTrades`: - Changed security type from `MARKET_DATA` to `NONE`. - This means that the `X-MBX-APIKEY` header is no longer necessary and is now ignored. Websocket API - Changes to `account.status`: - New field `preventSor` will appear in the response. - New field `uid` that shows the User Id/Account will appear in the response. - Changes to `trades.historical`: - Changed security type from `MARKET_DATA` to `NONE`. - This means that the `apiKey` parameter is no longer necessary and is now ignored. **The following changes will take effect _approximately a week from the release date_:**: - Fixed multiple bugs with orders that use `type=MARKET` and `quoteOrderQty`, also known as “reverse market orders”: - Reverse market orders are no longer partially filled, or filled for zero or negative quantity under extreme market conditions. - `MARKET_LOT_SIZE` filter now correctly rejects reverse market orders that go over the symbol's `maxQty`. - Fixed a bug where OCO orders using `trailingDelta` could have an incorrect `trailingTime` value after either leg of the OCO is touched. - New field `transactTime` will appear in order cancellation responses. This affects the following requests: - `DELETE /api/v3/order` - `POST /api/v3/order/cancelReplace` - `DELETE /api/v3/openOrders` - `DELETE /api/v3/orderList` - `order.cancel` - `order.cancelReplace` - `openOrders.cancelAll` - `orderList.cancel` --- ### 2023-06-06 - A new endpoint is now available for redundancy: **https://api-gcp.binance.com/** - This is using the GCP (Google Cloud Platform) CDN and may have slower performance compared to `api1`-`api4` endpoints. --- ### 2023-05-26 **Notice:** The change below are being rolled out, and will take approximately a week to complete. - The following base endpoints may give better performance but have less stability than **https://api.binance.com**: - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** --- ### 2023-05-24 - **The previous market data URLs have been deprecated. Please update your code immediately to prevent interruption of our services.** - API Market data from `data.binance.com` can now be accessed from `data-api.binance.vision`. - Websocket Market Data from `data-stream.binance.com` can now be accessed from `data-stream.binance.vision`. --- ### 2023-03-13 **Notice:** All changes are being rolled out gradually to all our servers, and may take a week to complete. GENERAL CHANGES - The error messages for certain issues have been improved for easier troubleshooting.
Situation Old Error Message New Error Message
An account cannot place or cancel an order, due to trading ability disabled. This action is disabled on this account. This account may not place or cancel orders.
When the permissions configured on the symbol do not match the permissions on the account. This symbol is not permitted for this account.
When the account tries to place an order on a symbol it has no permissions for. This symbol is restricted for this account.
Placing an order when symbol is not TRADING. Unsupported order combination. This order type is not possible in this trading phase.
Placing an order with timeinForce=IOC or FOK on a trading phase that does not support it. Limit orders require GTC for this phase.
- Fixed error message for querying archived orders: - Previously, if an archived order (i.e. order with status `CANCELED` or `EXPIRED` where `executedQty` == 0 that occurred more than 90 days in the past.) is queried, the error message would be: ```json { "code": -2013, "msg": "Order does not exist." } ``` - Now, the error message is: ```json { "code": -2026, "msg": "Order was canceled or expired with no executed qty over 90 days ago and has been archived." } ``` - Behavior for API requests with `startTime` and `endTime`: - Previously some requests failed if the `startTime` == `endTime`. - Now, all API requests that accept `startTime` and `endTime` allow the parameters to be equal. This applies to the following requests: - Rest API - `GET /api/v3/aggTrades` - `GET /api/v3/klines` - `GET /api/v3/allOrderList` - `GET /api/v3/allOrders` - `GET /api/v3/myTrades` - Websocket API - `trades.aggregate` - `klines` - `allOrderList` - `allOrders` - `myTrades` - Users connected to the websocket API will now be disconnected if their IP is banned due to violation of the IP rate limits (status `418`). The following changes will take effect **approximately a week from the release date**, but the rest of the documentation has been updated to reflect the future changes: - Changes to Filter Evaluation: - Previous behavior: `LOT_SIZE` and `MARKET_LOT_SIZE` required that (`quantity` - `minQty`) % `stepSize` == 0. - New behavior: This has now been changed to (`quantity` % `stepSize`) == 0. - Bug fix with reverse `MARKET` orders (i.e., `MARKET` using `quoteOrderQty`): - Previous behavior: Reverse market orders would always have the status `FILLED` even if the order did not fully fill due to low liquidity. - New behavior: If the reverse market order did not fully fill due to low liquidity the order status will be `EXPIRED`, and `FILLED` only if the order was completely filled. REST API - Changes to `DELETE /api/v3/order` and `POST /api/v3/order/cancelReplace`: - A new optional parameter `cancelRestrictions` that determines whether the cancel will succeed if the order status is `NEW` or `PARTIALLY_FILLED`. - If the order cancellation fails due to `cancelRestrictions`, the error will be: ```json { "code": -2011, "msg": "Order was not canceled due to cancel restrictions." } ``` WEBSOCKET API - Changes to `order.cancel` and `order.cancelReplace`: - A new optional parameter `cancelRestrictions` that determines whether the cancel will succeed if the order status is `NEW` or `PARTIALLY_FILLED`. - If the order cancellation fails due to `cancelRestrictions`, the error will be: ```json { "code": -2011, "msg": "Order was not canceled due to cancel restrictions." } ``` --- ### 2023-02-17 **Changes to Websocket Limits** The WS-API and Websocket Stream now only allows 300 connections requests every 5 minutes. This limit is **per IP address**. Please be careful when trying to open multiple connections or reconnecting to the Websocket API. --- ### 2023-01-26 As per the [announcement](https://www.binance.com/en/support/announcement/binance-spot-launches-self-trade-prevention-stp-function-on-api-312fd0112fb44635b397c116e56d8f84), Self Trade Prevention will be enabled at **2023-01-26 08:00 UTC**. Please refer to `GET /api/v3/exchangeInfo` from the Rest API or `exchangeInfo` from the Websocket API on the default and allowed modes. --- ### 2023-01-23 New API cluster has been added. Note that all endpoints are functionally equal, but may vary in performance. - https://api4.binance.com --- ### 2023-01-19 **ACTUAL RELEASE DATE TBD** **New Feature**: Self-Trade Prevention (aka STP) will be added to the system at a later date. This will prevent orders from matching with orders from the same account, or accounts under the same `tradeGroupId`. Please refer to `GET /api/v3/exchangeInfo` from the Rest API or `exchangeInfo` from the Websocket API on the status. ```javascript { "defaultSelfTradePreventionMode": "NONE", // If selfTradePreventionMode not provided, this will be the value passed to the engine "allowedSelfTradePreventionModes": [ // What the allowed modes of selfTradePrevention are "NONE", "EXPIRE_TAKER", "EXPIRE_BOTH", "EXPIRE_MAKER" ] } ``` Additional details on the functionality of STP is explained in the [STP FAQ](/products/spot/faqs/stp_faq) document. REST API - New order status: `EXPIRED_IN_MATCH` - This means that the order expired due to STP being triggered. - New endpoint: - `GET /api/v3/myPreventedMatches` - This queries the orders that expired due to STP being triggered. - New optional parameter `selfTradePreventionMode` has been added to the following endpoints: - `POST /api/v3/order` - `POST /api/v3/order/oco` - `POST /api/v3/cancelReplace` - New responses that will appear for all order placement endpoints if there was a prevented match (i.e. if an order could have matched with an order of the same account, or the accounts are in the same `tradeGroupId`): - `tradeGroupId` - This will only appear if account is configured to a `tradeGroupId` and if there was a prevented match. - `preventedQuantity` - Only appears if there was a prevented match. - An array `preventedMatches` with the following fields: - `preventedMatchId` - `makerOrderId` - `price` - `takerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_TAKER` or `EXPIRE_BOTH`. - `makerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_MAKER` or `EXPIRE_BOTH`. - New fields `preventedMatchId` and `preventedQuantity` that can appear in the order query endpoints if the order had expired due to an STP trigger: - `GET /api/v3/order` - `GET /api/v3/openOrders` - `GET /api/v3/allOrders` WEBSOCKET API - New order status: `EXPIRED_IN_MATCH` - This means that the order expired due to STP being triggered. - New optional parameter `selfTradePreventionMode` has been added to the following requests: - `order.place` - `orderList.place` - `order.cancelReplace` - New request: `myPreventedMatches` - This queries the orders that expired due to STP being triggered. - New responses that will appear for all order placement endpoints if there was a prevented match (i.e. if an order could have matched with an order of the same account, or the accounts are in the same `tradeGroupId`): - `tradeGroupId` - This will only appear if account is configured to a `tradeGroupId` and if there was a prevented match. - `preventedQuantity` - Only appears if there was a prevented match. - An array `preventedMatches` with the following fields: - `preventedMatchId` - `makerOrderId` - `price` - `takerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_TAKER` or `EXPIRE_BOTH`. - `makerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_MAKER` or `EXPIRE_BOTH`. - New fields `preventedMatchId` and `preventedQuantity` that can appear in the order query requests if the order had expired due to STP trigger: - `order.status` - `openOrders.status` - `allOrders` USER DATA STREAM - New execution Type: `TRADE_PREVENTION` - New fields for `executionReport` (These fields will only appear if the order has expired due to STP trigger) - `u` - `tradeGroupId` - `v` - `preventedMatchId` - `U` - `counterOrderId` - `A` - `preventedQuantity` - `B` - `lastPreventedQuantity` --- ### 2022-12-28 - SPOT WebSocket API documentation has been updated to show how to sign a request using an RSA key. --- ### 2022-12-26 - Spot WebSocket API is now available on the live exchange. - Spot Websocket API can be accessed through this URL: `wss://ws-api.binance.com/ws-api/v3` --- ### 2022-12-15 - New RSA signature - Documentation has been updated to show how to create RSA keys. - For security reasons, we recommend to use RSA keys instead of HMAC keys when generating an API key. - We accept `PKCS#8` (BEGIN PUBLIC KEY). - More details on how to upload your RSA public key will be added at a later date. - SPOT WebSocket API is now available on **SPOT Testnet**. - WebSocket API allows placing orders, canceling orders, etc. through a WebSocket connection. - WebSocket API is a **separate** service from WebSocket Market Data streams. I.e., placing orders and listening to market data requires two separate WebSocket connections. - WebSocket API is subject to the same Filter and Rate Limit rules as REST API. - WebSocket API and REST API are functionally equivalent: they provide the same features, accept the same parameters, return the same status and error codes. **WEBSOCKET API WILL BE AVAILABLE ON THE LIVE EXCHANGE AT A LATER DATE.** --- ### 2022-12-13 REST API Some error messages on error code `-1003` have changed. - Previous error message: `Too much request weight used; current limit is %s request weight per %s %s. Please use the websocket for live updates to avoid polling the API.` has been updated to: ``` Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. ``` - Previous error message `Way too much request weight used; IP banned until %s. Please use the websocket for live updates to avoid bans.` has been updated to: ``` Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. ``` --- ### 2022-12-05 **Notice:** These changes are being rolled out gradually to all our servers, and will take approximately a week to complete. WEBSOCKET - `!bookTicker` will be removed by **December 7, 2022**. Please use the Individual Book Ticker Streams instead (`@bookTicker`). - Multiple `@bookTicker` streams can be subscribed to over one connection. (E.g. `wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/bnbbtc@bookTicker`) REST API - New error code `-1135` - This error code will occur if a parameter requiring a JSON object is invalid. - New error code `-1108` - This error will occur if a value to a parameter being sent was too large, potentially causing overflow. - This error code can occur in the following endpoints: - `POST /api/v3/order` - `POST /api/v3/order/cancelReplace` - `POST /api/v3/order/oco` - Changes to `GET /api/v3/aggTrades` - Previous behavior: `startTime` and `endTime` had to be used in combination and could only be an hour apart. - New behavior: `startTime` and `endTime` can be used individually and the 1 hour limit has been removed. - When using `startTime` only, this will return trades from that time, up to the `limit` provided. - When using `endTime` only, this will return trades before that time, up to the `limit` provided. - If `limit` not provided, regardless of used in combination or sent individually, the endpoint will use the default limit. - Changes to `GET /api/v3/myTrades` - Fixed a bug where `symbol` + `orderId` combination would return all trades even if the number of trades went beyond the `500` default limit. - Previous behavior: The API would send specific error messages depending on the combination of parameters sent. E.g: ```json { "code": -1106, "msg": "Parameter X was sent when not required." } ``` - New behavior: If the combinations of optional parameters to the endpoint were not supported, then the endpoint will respond with the generic error: ```json { "code": -1128, "msg": "Combination of optional parameters invalid." } ``` - Added a new combination of supported parameters: `symbol` + `orderId` + `fromId`. - The following combinations of parameters were previously supported but no longer accepted, as these combinations were only taking `fromId` into consideration, ignoring `startTime` and `endTime`: - `symbol` + `fromId` + `startTime` - `symbol` + `fromId` + `endTime` - `symbol` + `fromId` + `startTime` + `endTime` - Thus, these are the supported combinations of parameters: - `symbol` - `symbol` + `orderId` - `symbol` + `startTime` - `symbol` + `endTime` - `symbol` + `fromId` - `symbol` + `startTime` + `endTime` - `symbol`+ `orderId` + `fromId` **Note:** These new fields will appear approximately a week from the release date. - Changes to `GET /api/v3/exchangeInfo` - New fields `defaultSelfTradePreventionMode` and `allowedSelfTradePreventionModes` - Changes to the Order Placement Endpoints/Order Query/Order Cancellation Endpoints: - New field `selfTradePreventionMode` will appear in the response. - Affects the following endpoints: - `POST /api/v3/order` - `POST /api/v3/order/oco` - `POST /api/v3/order/cancelReplace` - `GET /api/v3/order` - `DELETE /api/v3/order` - `DELETE /api/v3/orderList` - Changes to `GET /api/v3/account` - New field `requireSelfTradePrevention` will appear in the response. - New field `workingTime`, indicating when the order started working on the order book, will appear in the following endpoints: - `POST /api/v3/order` - `GET /api/v3/order` - `POST /api/v3/order/cancelReplace` - `POST /api/v3/order/oco` - `GET /api/v3/order` - `GET /api/v3/openOrders` - `GET /api/v3/allOrders` - Field `trailingTime`, indicating the time when the trailing order is active and tracking price changes, will appear for the following order types (`TAKE_PROFIT`, `TAKE_PROFIT_LIMIT`, `STOP_LOSS`, `STOP_LOSS_LIMIT` if `trailingDelta` parameter was provided) for the following endpoints: - `POST /api/v3/order` - `GET /api/v3/order` - `GET /api/v3/openOrders` - `GET /api/v3/allOrders` - `POST /api/v3/order/cancelReplace` - `DELETE /api/v3/order` - Field `commissionRates` will appear in the `GET /api/v3/acccount` response USER DATA STREAM - eventType `executionReport` has new fields - `V` - `selfTradePreventionMode` - `D` - `trailing_time` (Appears if the trailing stop order is active) - `W` - `workingTime` (Appears if `isWorking`=`true`) --- ### 2022-12-02 - Added a new market data base URL `https://data.binance.com`. - Added a new WebSocket URL `wss://data-stream.binance.com`. --- ### 2022-09-30 Scheduled changes to the removal of `!bookTicker` around November 2022. - The All Book Tickers stream (`!bookTicker`) is set to be removed in **November 2022**. - More details of the actual removal date will be announced at a later time. - Please use the Individual Book Ticker Streams instead. (`@bookTicker`). - Multiple `@bookTicker` streams can be subscribed to over one connection. - Example: wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/bnbbtc@bookTicker --- ### 2022-09-15 Note that these are rolling changes, so it may take a few days for it to rollout to all our servers. - Changes to `GET /api/v3/exchangeInfo` - New optional parameter `permissions` added to display all symbols with the permissions matching the parameter provided. (eg.`SPOT`,`MARGIN`) - If not provided, the default value will be `["SPOT","MARGIN","LEVERAGED"]`. - This means the request `GET /api/v3/exchangeInfo` without any parameters will show all symbols that can be used for `SPOT`, `MARGIN`, and/or `LEVERAGED` trading. - To search for symbols that can be traded on other permissions (e.g. `TRD_GRP_004`, etc), then this needs to be searched for explicitly. (e.g.`permissions`=`TRD_GRP_004`) - Cannot be combined with `symbol` or `symbols` --- ### 2022-08-23 Note that these are rolling changes, so it may take a few days for it to rollout to all our servers. - Changes to `GET /api/v3/ticker` and `GET /api/v3/ticker/24hr` - New optional parameter `type` added - Supported values for parameter `type` are `FULL` and `MINI` - `FULL` is the default value and the response that is currently being returned from the endpoint - `MINI` omits the following fields from the response: `priceChangePercent`, `weightedAvgPrice`, `bidPrice`, `bidQty`, `askPrice`, `askQty`, and `lastQty` - New error code `-1008` - This is sent whenever the servers are overloaded with requests. - New field `brokered` has been added to `GET /api/v3/account` - New kline interval: `1s` - New endpoint added: `GET /api/v3/uiKlines` --- ### 2022-08-08 REST API - Changes to `POST /api/v3/order` and `POST /api/v3/order/cancelReplace` - New optional fields `strategyId` and `strategyType` - `strategyId` is a parameter used to identify an order as part of a strategy. - `strategyType` is a parameter used to identify what strategy was running. (E.g. If all the orders are part of spot grid strategy, it can be set to `strategyType=1000000`) - Note that the minimum value allowed for `strategyType` is `1000000`. - Changes to `POST /api/v3/order/oco` - New optional fields `limitStrategyId`, `limitStrategyType`, `stopStrategyId`, `stopStrategyType` - These are the strategy metadata parameters for both legs of the OCO orders. - `limitStrategyType` and `stopStrategyType` both cannot be less than `1000000`. - Changes to `GET /api/v3/order`, `GET /api/v3/openOrders`, and `GET /api/v3/allOrders` - New fields `strategyId` and `strategyType` will appear in the response JSON for orders that had these fields populated upon order placement. - Changes to `DELETE /api/v3/order` and `DELETE /api/v3/openOrders` - New fields `strategyId` and `strategyType` will appear in the response JSON for cancelled orders that had these fields populated upon order placement. USER DATA STREAM - New fields to eventType `executionReport` - `j` for `strategyId` - `J` for `strategyType` - Note that these fields only appear if these were populated upon order placement. --- ### 2022-06-20 Changes to `GET /api/v3/ticker` - Weight has been reduced from 5 to 2 per symbol, regardless of `windowSize`. - The max number of symbols that can be processed in a request is 100. - If the number of `symbols` sent is more than 100, the error will be as follows: ```json { "code": -1101, "msg": "Too many values sent for parameter 'symbols', maximum allowed up to 100." } ``` - The max Weight for this endpoint will cap at 100. - I.e. If the request has more than 50 symbols, the Weight will still be 100, regardless of `windowSize`. --- ### 2022-06-15 **Note:** The update is being rolled out over the next few days, so these changes may not be visible right away. SPOT API - `GET /api/v3/ticker` added - Rolling window price change statistics based on `windowSize` provided. - Contrary to `GET /api/v3/ticker/24hr` the list of symbols cannot be omitted. - If `windowSize` not specified, the value will default to `1d`. - Response is similar to `GET /api/v3/ticker/24hr`, minus the following fields: `prevClosePrice`, `lastQty`, `bidPrice`, `bidQty`, `askPrice`, `askQty` - `GET /api/v3/exchangeInfo` returns new field `cancelReplaceAllowed` in `symbols` list. - `POST /api/v3/order/cancelReplace` added - Cancels an existing order and places a new order on the same symbol. - The filters are evaluated **before** the cancel order is placed. - e.g. If the `MAX_NUM_ORDERS` filter is 10, and the total number of open orders on the account is also 10, when using `POST /api/v3/order/cancelReplace` both the cancel order placement and new order will fail because of the filter. - The change is being rolled out in the next few days, thus this feature will be enabled once the upgrade is completed. - New filter `NOTIONAL` has been added. - Defines the allowed notional value (`price * quantity`) based on a configured `minNotional` and `maxNotional` - New exchange filter `EXCHANGE_MAX_NUM_ICEBERG_ORDERS` has been added. - Defines the limit of open iceberg orders on an account --- ### 2022-05-23 - Changes to Order Book Depth Levels - Quantities in the Depth levels were returning negative values in situations where they were exceeding the max value, resulting in an overflow. - Going forward depth levels will not overflow, but will be capped at the max value based on the precision of the base asset. This means that the depth level is at max value _or more_. - E.g. If the precision is 8, then the max value for quantity will be at 92,233,720,368.54775807. - When the fix has been applied, a change in the order book at the affected price level is required for the changes to be visible. - What does this affect? - SPOT API - `GET /api/v3/depth` - Websocket Streams - `@depth` - `@depth@100ms` - `@depth` - `@depth@100ms` - Updates to `MAX_POSITION` - If an order's `quantity` can cause the position to overflow, this will now fail the `MAX_POSITION` filter. --- ### 2022-05-17 - Changes to GET `api/v3/aggTrades` - When providing `startTime` and `endTime`, the oldest items are returned. - Changed error messaging on `GET /api/v3/myTrades` where parameter `symbol` is not provided: ```json { "code": -1102, "msg": "Mandatory parameter 'symbol' was not sent, was empty/null, or malformed." } ``` - The following endpoints now support multi-symbol querying using the parameter `symbols`. - `GET /api/v3/ticker/24hr` - `GET /api/v3/ticker/price` - `GET /api/v3/ticker/bookTicker` - In the above, the request weight will depend on the number of symbols provided in `symbols`.
Please refer to the table below: | Endpoint | Number of Symbols | Weight | | ------------------------------- | ----------------- | ------ | | `GET /api/v3/ticker/price` | Any | 2 | | `GET /api/v3/ticker/bookTicker` | Any | 2 | | `GET /api/v3/ticker/24hr` | 1-20 | 1 | | `GET /api/v3/ticker/24hr` | 21-100 | 20 | | `GET /api/v3/ticker/24hr` | 101 or more | 40 | --- ### 2022-04-13 REST API - Trailing Stops have been enabled. - This is a type of algo order where the activation is based on a percentage of a price change in the market using the new parameter `trailingDelta`. - This can only used with any of the following order types: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT`. - The `trailingDelta` parameter will be done in Basis Points or BIPS. - For example: a STOP_LOSS SELL order with a `trailingDelta` of 100 will trigger after a price decrease of 1% from the highest price after the order is placed. (100 / 10,000 => 0.01 => 1%) - When used in combination with OCO Orders, the `trailingDelta` will determine when the contingent leg of the OCO will trigger. - When `trailingDelta` is used in combination with `stopPrice`, once the `stopPrice` condition is met, the trailing stop starts tracking the price change from the `stopPrice` based on the `trailingDelta` provided. - When no `stopPrice` is sent, the trailing stop starts tracking the price changes from the last price based on the `trailingDelta` provided. - Changes to POST `/api/v3/order` - New optional field `trailingDelta` - Changes to POST `/api/v3/order/test` - New optional field `trailingDelta` - Changes to POST `/api/v3/order/oco` - New optional field `trailingDelta` - A new filter `TRAILING_DELTA` has been added. - This filter is defined by the minimum and maximum values for the `trailingDelta` value. USER DATA STREAM - New field in `executionReport` - "d" for `trailingDelta` --- ### 2022-04-12 **Note:** The changes are being rolled out during the next few days, so these will not appear right away. - Error message changed on `GET api/v3/allOrders` where `symbol` is not provided: ```json { "code": -1102, "msg": "Mandatory parameter 'symbol' was not sent, was empty/null, or malformed." } ``` - Fixed a typo with an error message when an account has disabled permissions (e.g. to withdraw, to trade, etc) ```json "This action is disabled on this account." ``` - During a market data audit, we detected some issues with the Spot aggregate trade data. - Missing aggregate trades were recovered. - Duplicated records were marked invalid with the following values: - p = '0' // price - q = '0' // qty - f = -1 // first_trade_id - l = -1 // last_trade_id --- ### 2022-02-28 - New field `allowTrailingStop` has been added to `GET /api/v3/exchangeInfo` --- ### 2022-02-24 - `(price-minPrice) % tickSize == 0` rule in `PRICE_FILTER` has been changed to `price % tickSize == 0`. - A new filter `PERCENT_PRICE_BY_SIDE` has been added. - Changes to GET `api/v3/depth` - The `limit` value can be outside of the previous values (i.e. 5, 10, 20, 50, 100, 500, 1000,5000) and will return the correct limit. (i.e. if limit=3 then the response will be the top 3 bids and asks) - The limit still cannot exceed 5000. If the limit provided is greater than 5000, then the response will be truncated to 5000. - Due to the changes, these are the updated request weights based on the limit value provided: | Limit | Request Weight | | --------- | -------------- | | 1-100 | 1 | | 101-500 | 5 | | 501-1000 | 10 | | 1001-5000 | 50 | - Changes to GET `api/v3/aggTrades` - When providing `startTime` and `endTime`, the oldest items are returned. --- ### 2021-12-29 - Removed out dated "Symbol Type" enum; added "Permissions" enum. ### 2021-11-01 - `GET /api/v3/rateLimit/order` added - The endpoint will display the user's current order count usage for all intervals. - This endpoint will have a request weight of 20. ### 2021-09-14 - Add a [YAML file](https://github.com/binance/binance-api-swagger) with OpenApi specification on the RESTful API. ### 2021-08-12 - GET `api/v3/myTrades` has a new optional field `orderId` --- ### 2021-05-12 - Added `Data Source` in the documentation to explain where each endpoint is retrieving its data. - Added field `Data Source` to each API endpoint in the documentation - GET `api/v3/exchangeInfo` now supports single or multi-symbol query --- ### 2021-04-26 On **April 28, 2021 00:00 UTC** the weights to the following endpoints will be adjusted: - `GET /api/v3/order` weight increased to 2 - `GET /api/v3/openOrders` weight increased to 3 - `GET /api/v3/allOrders` weight increased to 10 - `GET /api/v3/orderList` weight increased to 2 - `GET /api/v3/openOrderList` weight increased to 3 - `GET /api/v3/account` weight increased to 10 - `GET /api/v3/myTrades` weight increased to 10 - `GET /api/v3/exchangeInfo` weight increased to 10 --- ### 2021-01-01 **USER DATA STREAM** - `outboundAccountInfo` has been removed. --- ### 2020-11-27 New API clusters have been added in order to improve performance. Users can access any of the following API clusters, in addition to `api.binance.com` If there are any performance issues with accessing `api.binance.com` please try any of the following instead: - https://api1.binance.com/api/v3/* - https://api2.binance.com/api/v3/* - https://api3.binance.com/api/v3/* ### 2020-09-09 USER DATA STREAM - `outboundAccountInfo` has been deprecated. - `outboundAccountInfo` will be removed in the future. (Exact date unknown) **Please use `outboundAccountPosition` instead.** - `outboundAccountInfo` will now only show the balance of non-zero assets and assets that have been reduced to 0. --- ### 2020-05-01 - From 2020-05-01 UTC 00:00, all symbols will have a limit of 200 open orders using the [MAX_NUM_ORDERS](./filters#max_num_orders) filter. - No existing orders will be removed or canceled. - Accounts that have 200 or more open orders on a symbol will not be able to place new orders on that symbol until the open order count is below 200. - OCO orders count as 2 open orders before the `LIMIT` order is touched or the `STOP_LOSS` (or `STOP_LOSS_LIMIT`) order is triggered; once this happens the other order is canceled and will no longer count as an open order. --- ### 2020-04-25 REST API - New field `permissions` - Defines the trading permissions that are allowed on accounts and symbols. - `permissions` is an enum array; values: - `SPOT` - `MARGIN` - `permissions` will replace `isSpotTradingAllowed` and `isMarginTradingAllowed` on `GET api/v3/exchangeInfo` in future API versions (v4+). - For an account to trade on a symbol, the account and symbol must share at least 1 permission in common. - Updates to `GET api/v3/exchangeInfo` - New field `permissions` added. - New field `quoteAssetPrecision` added; a duplicate of the `quotePrecision` field. `quotePrecision` will be removed in future API versions (v4+). - Updates to `GET api/v3/account` - New field `permissions` added. - New endpoint `DELETE api/v3/openOrders` - This will allow a user to cancel all open orders on a single symbol. - This endpoint will cancel all open orders including OCO orders. - Orders can be canceled via the API on symbols in the `BREAK` or `HALT` status. USER DATA STREAM - `OutboundAccountInfo` has new field `P` which shows the trading permissions of the account. --- ### 2020-04-23 WEB SOCKET STREAM - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON control message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. --- ### 2020-03-24 - `MAX_POSITION` filter added. - This filter defines the allowed maximum position an account can have on the base asset of a symbol. An account's position defined as the sum of the account's: - free balance of the base asset - locked balance of the base asset - sum of the qty of all open BUY orders - `BUY` orders will be rejected if the account's position is greater than the maximum position allowed. --- ### 2019-11-22 - Quote Order Qty Market orders have been enabled on all symbols. - Quote Order Qty `MARKET` orders allow a user to specify the total `quoteOrderQty` spent or received in the `MARKET` order. - Quote Order Qty `MARKET` orders will not break `LOT_SIZE` filter rules; the order will execute a quantity that will have the notional value as close as possible to `quoteOrderQty`. - Using `BNBBTC` as an example: - On the `BUY` side, the order will buy as many BNB as `quoteOrderQty` BTC can. - On the `SELL` side, the order will sell as much BNB as needed to receive `quoteOrderQty` BTC. --- ### 2019-11-13 REST API - api/v3/exchangeInfo has new fields: - `quoteOrderQtyMarketAllowed` - `baseCommissionDecimalPlaces` - `quoteCommissionDecimalPlaces` - `MARKET` orders have a new optional field: `quoteOrderQty` used to specify the quote quantity to BUY or SELL. This cannot be used in combination with `quantity`. - The exact timing that `quoteOrderQty` MARKET orders will be enabled is TBD. There will be a separate announcement and further details at that time. - All order query endpoints will return a new field `origQuoteOrderQty` in the JSON payload. (e.g. GET api/v3/allOrders) - Updated error messages for -1128 - Sending an `OCO` with a `stopLimitPrice` but without a `stopLimitTimeInForce` will return the error: ```json { "code": -1128, "msg": "Combination of optional parameters invalid. Recommendation: 'stopLimitTimeInForce' should also be sent." } ``` - Updated error messages for -1003 to specify the limit is referring to the request weight, not to the number of requests. **Deprecation of v1 endpoints**: By end of Q1 2020, the following endpoints will be removed from the API. The documentation has been updated to use the v3 versions of these endpoints. - GET api/v1/depth - GET api/v1/historicalTrades - GET api/v1/aggTrades - GET api/v1/klines - GET api/v1/ticker/24hr - GET api/v1/ticker/price - GET api/v1/exchangeInfo - POST api/v1/userDataStream - PUT api/v1/userDataStream - GET api/v1/ping - GET api/v1/time - GET api/v1/ticker/bookTicker **These endpoints however, will NOT be migrated to v3. Please use the following endpoints instead moving forward.**
Old V1 Endpoints New V3 Endpoints
GET api/v1/ticker/allPrices GET api/v3/ticker/price
GET api/v1/ticker/allBookTickers GET api/v3/ticker/bookTicker
USER DATA STREAM - Changes to`executionReport` event - If the C field is empty, it will now properly return `null`, instead of `"null"`. - New field Q which represents the `quoteOrderQty`. - `balanceUpdate` event type added - This event occurs when funds are deposited or withdrawn from your account. WEB SOCKET STREAMS - WSS now supports live subscribing/unsubscribing to streams. --- ### 2019-09-09 - New WebSocket streams for bookTickers added: `@bookTicker` and `!bookTicker`. See `web-socket-streams.md` for details. --- ### 2019-09-03 - Faster order book data with 100ms updates: `@depth@100ms` and `@depth#@100ms` - Added "Update Speed:" to `web-socket-streams.md` - Removed deprecated v1 endpoints as per previous announcement: - GET api/v1/order - GET api/v1/openOrders - POST api/v1/order - DELETE api/v1/order - GET api/v1/allOrders - GET api/v1/account - GET api/v1/myTrades --- ### 2019-08-16 (Update 2) - GET api/v1/depth `limit` of 10000 has been temporarily removed --- ### 2019-08-16 - In Q4 2017, the following endpoints were deprecated and removed from the API documentation. They have been permanently removed from the API as of this version. We apologize for the omission from the original changelog: - GET api/v1/order - GET api/v1/openOrders - POST api/v1/order - DELETE api/v1/order - GET api/v1/allOrders - GET api/v1/account - GET api/v1/myTrades - Streams, endpoints, parameters, payloads, etc. described in the documents in this repository are **considered official** and **supported**. The use of any other streams, endpoints, parameters, or payloads, etc. is **not supported; use them at your own risk and with no guarantees.** --- ### 2019-08-15 REST API - New order type: OCO ("One Cancels the Other") - An OCO has 2 orders: (also known as legs in financial terms) - `STOP_LOSS` or `STOP_LOSS_LIMIT` leg - `LIMIT_MAKER` leg - Price Restrictions: - `SELL Orders` : Limit Price > Last Price > Stop Price - `BUY Orders` : Limit Price < Last Price < Stop Price - As stated, the prices must "straddle" the last traded price on the symbol. EX: If the last price is 10: - A SELL OCO must have the limit price greater than 10, and the stop price less than 10. - A BUY OCO must have a limit price less than 10, and the stop price greater than 10. - Quantity Restrictions: - Both legs must have the **same quantity**. - `ICEBERG` quantities however, do not have to be the same. - Execution Order: - If the `LIMIT_MAKER` is touched, the limit maker leg will be executed first BEFORE canceling the Stop Loss Leg. - if the Market Price moves such that the `STOP_LOSS` or `STOP_LOSS_LIMIT` will trigger, the Limit Maker leg will be canceled BEFORE executing the `STOP_LOSS` Leg. - Canceling an OCO - Canceling either order leg will cancel the entire OCO. - The entire OCO can be canceled via the `orderListId` or the `listClientOrderId`. - New Enums for OCO: 1. `ListStatusType` - `RESPONSE` - used when ListStatus is responding to a failed action. (either order list placement or cancellation) - `EXEC_STARTED` - used when an order list has been placed or there is an update to a list's status. - `ALL_DONE` - used when an order list has finished executing and is no longer active. 1. `ListOrderStatus` - `EXECUTING` - used when an order list has been placed or there is an update to a list's status. - `ALL_DONE` - used when an order list has finished executing and is no longer active. - `REJECT` - used when ListStatus is responding to a failed action. (either order list placement or cancellation) 1. `ContingencyType` - `OCO` - specifies the type of order list. - New Endpoints: - POST api/v3/order/oco - DELETE api/v3/orderList - GET api/v3/orderList - `recvWindow` cannot exceed 60000. - New `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - New Headers `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` will give your current used request weight for the (intervalNum)(intervalLetter) rate limiter. For example, if there is a one minute request rate weight limiter set, you will get a `X-MBX-USED-WEIGHT-1M` header in the response. The legacy header `X-MBX-USED-WEIGHT` will still be returned and will represent the current used weight for the one minute request rate weight limit. - New Header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`that is updated on any valid order placement and tracks your current order count for the interval; rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - Eg. `X-MBX-ORDER-COUNT-1S` for "orders per 1 second" and `X-MBX-ORDER-COUNT-1D` for orders per "one day" - GET api/v1/depth now supports `limit` 5000 and 10000; weights are 50 and 100 respectively. - GET api/v1/exchangeInfo has a new parameter `ocoAllowed`. USER DATA STREAM - `executionReport` event now contains "g" which has the `orderListId`; it will be set to -1 for non-OCO orders. - New Event Type `listStatus`; `listStatus` is sent on an update to any OCO order. - New Event Type `outboundAccountPosition`; `outboundAccountPosition` is sent any time an account's balance changes and contains the assets that could have changed by the event that generated the balance change (a deposit, withdrawal, trade, order placement, or cancellation). NEW ERRORS - **-1131 BAD_RECV_WINDOW** - `recvWindow` must be less than 60000 - **-1099 Not found, authenticated, or authorized** - This replaces error code -1999 NEW -2011 ERRORS - **OCO_BAD_ORDER_PARAMS** - A parameter for one of the orders is incorrect. - **OCO_BAD_PRICES** - The relationship of the prices for the orders is not correct. - **UNSUPPORTED_ORD_OCO** - OCO orders are not supported for this symbol. --- ### 2019-03-12 REST API - X-MBX-USED-WEIGHT header added to Rest API responses. - Retry-After header added to Rest API 418 and 429 responses. - When canceling the Rest API can now return `errorCode` -1013 OR -2011 if the symbol's `status` isn't `TRADING`. - `api/v1/depth` no longer has the ignored and empty `[]`. - `api/v3/myTrades` now returns `quoteQty`; the price \* qty of for the trade. WEBSOCKET STREAMS - `@depth` and `@depthX` streams no longer have the ignored and empty `[]`. SYSTEM IMPROVEMENTS - Matching Engine stability/reliability improvements. - Rest API performance improvements. --- ### 2018-11-13 REST API - Can now cancel orders through the Rest API during a trading ban. - New filters: `PERCENT_PRICE`, `MARKET_LOT_SIZE`, `MAX_NUM_ICEBERG_ORDERS`. - Added `RAW_REQUESTS` rate limit. Limits based on the number of requests over X minutes regardless of weight. - /api/v3/ticker/price increased to weight of 2 for a no symbol query. - /api/v3/ticker/bookTicker increased weight of 2 for a no symbol query. - DELETE /api/v3/order will now return an execution report of the final state of the order. - `MIN_NOTIONAL` filter has two new parameters: `applyToMarket` (whether or not the filter is applied to MARKET orders) and `avgPriceMins` (the number of minutes over which the price averaged for the notional estimation). - `intervalNum` added to /api/v1/exchangeInfo limits. `intervalNum` describes the amount of the interval. For example: `intervalNum` 5, with `interval` minute, means "every 5 minutes". #### Explanation for the average price calculation: 1. (qty \* price) of all trades / sum of qty of all trades over previous 5 minutes. 2. If there is no trade in the last 5 minutes, it takes the first trade that happened outside of the 5min window. For example if the last trade was 20 minutes ago, that trade's price is the 5 min average. 3. If there is no trade on the symbol, there is no average price and market orders cannot be placed. On a new symbol with `applyToMarket` enabled on the `MIN_NOTIONAL` filter, market orders cannot be placed until there is at least 1 trade. 4. The current average price can be checked here: `https://api.binance.com/api/v3/avgPrice?symbol=` For example: https://api.binance.com/api/v3/avgPrice?symbol=BNBUSDT USER DATA STREAM - `Last quote asset transacted quantity` (as variable `Y`) added to execution reports. Represents the `lastPrice` _ `lastQty` (`L` _ `l`). --- ### 2018-07-18 REST API - New filter: `ICEBERG_PARTS` - `POST api/v3/order` new defaults for `newOrderRespType`. `ACK`, `RESULT`, or `FULL`; `MARKET` and `LIMIT` order types default to `FULL`, all other orders default to `ACK`. - POST api/v3/order `RESULT` and `FULL` responses now have `cummulativeQuoteQty` - GET api/v3/openOrders with no symbol weight reduced to 40. - GET api/v3/ticker/24hr with no symbol weight reduced to 40. - Max amount of trades from GET /api/v1/trades increased to 1000. - Max amount of trades from GET /api/v1/historicalTrades increased to 1000. - Max amount of aggregate trades from GET /api/v1/aggTrades increased to 1000. - Max amount of aggregate trades from GET /api/v1/klines increased to 1000. - Rest API Order lookups now return `updateTime` which represents the last time the order was updated; `time` is the order creation time. - Order lookup endpoints will now return `cummulativeQuoteQty`. If `cummulativeQuoteQty` is < 0, it means the data isn't available for this order at this time. - `REQUESTS` rate limit type changed to `REQUEST_WEIGHT`. This limit was always logically request weight and the previous name for it caused confusion. USER DATA STREAM - `cummulativeQuoteQty` field added to order responses and execution reports (as variable `Z`). Represents the cummulative amount of the `quote` that has been spent (with a `BUY` order) or received (with a `SELL` order). Historical orders will have a value < 0 in this field indicating the data is not available at this time. `cummulativeQuoteQty` divided by `cummulativeQty` will give the average price for an order. - `O` (order creation time) added to execution reports --- ### 2018-01-23 - GET /api/v1/historicalTrades weight decreased to 5 - GET /api/v1/aggTrades weight decreased to 1 - GET /api/v1/klines weight decreased to 1 - GET /api/v1/ticker/24hr all symbols weight decreased to number of trading symbols / 2 - GET /api/v3/allOrders weight decreased to 5 - GET /api/v3/myTrades weight decreased to 5 - GET /api/v3/account weight decreased to 5 - GET /api/v1/depth limit=500 weight decreased to 5 - GET /api/v1/depth limit=1000 weight decreased to 10 - -1003 error message updated to direct users to websockets --- ### 2018-01-20 - GET /api/v1/ticker/24hr single symbol weight decreased to 1 - GET /api/v3/openOrders all symbols weight decreased to number of trading symbols / 2 - GET /api/v3/allOrders weight decreased to 15 - GET /api/v3/myTrades weight decreased to 15 - GET /api/v3/order weight decreased to 1 - myTrades will now return both sides of a self-trade/wash-trade --- ### 2018-01-14 - GET /api/v1/aggTrades weight changed to 2 - GET /api/v1/klines weight changed to 2 - GET /api/v3/order weight changed to 2 - GET /api/v3/allOrders weight changed to 20 - GET /api/v3/account weight changed to 20 - GET /api/v3/myTrades weight changed to 20 - GET /api/v3/historicalTrades weight changed to 20 --- ## Document: /products/rebate/quick-start URL: /en/dev-docs/products/rebate/quick-start # Quick Start ## API Key Setup - Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/articles/360002502072) regarding API key creation. - Once API key is created, it is recommended to set IP restrictions on the key for security reasons. - **Never share your API key/secret key to ANYONE.** ## API Key Restrictions - After creating the API key, the default restrictions is `Enable Reading`. - To **enable withdrawals via the API**, the API key restriction needs to be modified through the Binance UI. ## Enabling Accounts ### Spot Account A `SPOT` account is provided by default upon creation of a Binance Account. ### Margin Account To enable a `MARGIN` account for Margin Trading, please refer to the [Margin Trading Guide](https://www.binance.vision/tutorials/binance-margin-trading-guide) ## API Library ### Python connector This is a lightweight library that works as a connector to Binance public API, written in Python. [https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python) ### Javascript connector This is a lightweight library that works as a connector to Binance public API, written for JavaScript users. [https://github.com/binance/binance-connector-js](https://github.com/binance/binance-connector-js) ### Ruby connector This is a lightweight library that works as a connector to Binance public API, written for Ruby users. [https://github.com/binance/binance-connector-ruby](https://github.com/binance/binance-connector-ruby) ### DotNET connector This is a lightweight library that works as a connector to Binance public API, written for C# users. [https://github.com/binance/binance-connector-dotnet](https://github.com/binance/binance-connector-dotnet) ### Java connector This is a lightweight library that works as a connector to Binance public API, written for Java users. [https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java) ### Postman Collections There is now a Postman collection containing the API endpoints for quick and easy use. This is recommended for new users who want to get a quick-start into using the API. For more information please refer to this page: [Binance API Postman](https://github.com/binance/binance-api-postman) ### Swagger A YAML file with OpenAPI specification on the RESTful API is available to be used, as well as a Swagger UI page for the consulting. [https://github.com/binance/binance-api-swagger](https://github.com/binance/binance-api-swagger) --- ## Document: /products/rebate/general-info URL: /en/dev-docs/products/rebate/general-info # General Info ## General API Information - The following base endpoints are available: - **https://api.binance.com** - **https://api-gcp.binance.com** - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** - The last 4 endpoints in the point above (`api1`-`api4`) might give better performance but have less stability. Please use whichever works best for your setup. - All endpoints return either a JSON object or array. - Data is returned in **ascending** order. Oldest first, newest last. - All time and timestamp related fields are in **milliseconds**. ### HTTP Return Codes - HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. - HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP `409` return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.) - HTTP `429` return code is used when breaking a request rate limit. - HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. - HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. ### Error Codes and Messages - If there is an error, the API will return an error with a message of the reason. > The error payload on API and SAPI is as follows: ```json { "code": -1121, "msg": "Invalid symbol." } ``` - Specific error codes and messages defined in [Error Codes](./error-code). ### General Information on Endpoints - For `GET` endpoints, parameters must be sent as a `query string`. - For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. - Parameters may be sent in any order. - If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. --- ## LIMITS ### General Info on Limits - The following `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". - The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. - A 429 will be returned when either request rate limit or order rate limit is violated. ### IP Limits - Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. - When a 429 is received, it's your obligation as an API to back off and not spam the API. - **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** - IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. - A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - **The limits on the API are based on the IPs, not the API keys.** ### Order Rate Limits - Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. - When the order count exceeds the limit, you will receive a 429 error without the `Retry-After` header. Please check the Order Rate Limit rules using `GET api/v3/exchangeInfo` and wait for reactivation accordingly. - Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - **The order rate limit is counted against each account**. - To monitor order count usage, refer to GET `api/v3/rateLimit/order` ### Websocket Limits - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON controlled message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. - There is a limit of **300 connections per attempt every 5 minutes per IP**. ### /api/ and /sapi/ Limit Introduction The `/api/*` and `/sapi/*` endpoints adopt either of two access limiting rules, IP limits or UID (account) limits. - Endpoints related to `/api/*`: - According to the two modes of IP and UID (account) limit, each are independent. - Endpoints share the 6000 per minute limit based on IP. - Responses contain the header `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)`, defining the weight used by the current IP. - Successful order responses contain the header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`, defining the order limit used by the UID. - Endpoints related to `/sapi/*`: - Endpoints are marked according to IP or UID limit and their corresponding weight value. - Each endpoint with IP limits has an independent 12000 per minute limit. - Each endpoint with UID limits has an independent 180000 per minute limit. - Responses from endpoints with IP limits contain the header `X-SAPI-USED-IP-WEIGHT-1M`, defining the weight used by the current IP. - Responses from endpoints with UID limits contain the header `X-SAPI-USED-UID-WEIGHT-1M`, defining the weight used by the current UID. --- ## Data Sources - The API system is asynchronous, so some delay in the response is normal and expected. - Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates. - **Matching Engine** - the data is from the matching Engine - **Memory** - the data is from a server's local or external memory - **Database** - the data is taken directly from a database
## Request Security - Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](#place-new-order-trade)). - If unspecified, the security type is `NONE`. - Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](#user-data-stream-requests). - Secure endpoints require a valid API key to be specified and authenticated. - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. - API keys can be configured to allow access only to certain types of secure endpoints. - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. | Security Type | Description | | ------------- | -------------------------------------------------------- | | NONE | Endpoint can be accessed freely. | | TRADE | Endpoint requires sending a valid API-Key and signature. | | MARGIN | Endpoint requires sending a valid API-Key and signature. | | USER_DATA | Endpoint requires sending a valid API-Key and signature. | | USER_STREAM | Endpoint requires sending a valid API-Key. | | MARKET_DATA | Endpoint requires sending a valid API-Key. | - `TRADE`, `MARGIN` and `USER_DATA` endpoints are `SIGNED` endpoints. ### SIGNED Endpoint security - `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. #### Signature Case Sensitivity - **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. - **RSA:** Signatures generated using RSA are **case-sensitive**. - **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** Please consult [SIGNED request example (HMAC)](#hmac-keys), [SIGNED request example (RSA)](#rsa-keys), and [SIGNED request example (Ed25519)](#ed25519-keys) on how to compute signature, depending on which API key type you are using. ### Timing security - `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](#general-api-information)) - An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. - Maximum `recvWindow` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` **Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. **It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** ### SIGNED Endpoint Examples for POST /api/v3/order #### HMAC Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. Example API key and secret key: | Key | Value | | ----------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `secretKey` | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j | **WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | LTCBTC | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` **Step 2: Compute the signature** 1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. 2. Sign the signature payload constructed in Step 1. 3. Encode the HMAC-SHA-256 output as a hex string. Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. **Example commands** For the first set of example parameters (ASCII only): ```console $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" ``` For the second set of example parameters (some non-ASCII characters) ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" ``` Here is a sample Bash script performing all the steps above: ```bash apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" # Sign the request signature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey") signature=${signature#*= } # Keep only the part after the "= " # Send the request curl -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?$payload&signature=$signature" ``` #### RSA Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. Only `PKCS#8` keys are supported. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. These examples assume the private key is stored in the file `./test-prv-key.pem`. | Key | Value | | -------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | BTCUSDT | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` **Step 2: Compute the signature** 1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function. 2. Encode the output in base64. Note that the payload and the resulting `signature` are **case-sensitive**. For the first set of example parameters (ASCII only): ```console $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== ``` 3. Percent-encode the base64 string. For the first set of example parameters (ASCII only): ```console HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D ``` For the second set of example parameters (some non-ASCII characters): ```console qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' ``` For the second set of example parameters (some non-ASCII characters): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' ``` Here is a sample Bash script performing all the steps above: ```bash function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos The error JSON payload: ```javascript { "code":-1121, "msg":"Invalid symbol." } ``` Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. ## 10xx - General Server or Network issues ### -1000 UNKNOWN - An unknown error occurred while processing the request. - An unknown error occurred while processing the request.[%s] ### -1001 DISCONNECTED - Internal error; unable to process your request. Please try again. ### -1002 UNAUTHORIZED - You are not authorized to execute this request. ### -1003 TOO_MANY_REQUESTS - Too many requests queued. - Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. - Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. ### -1004 SERVER_BUSY - Server is busy, please wait and try again ### -1006 UNEXPECTED_RESP - An unexpected response was received from the message bus. Execution status unknown. ### -1007 TIMEOUT - Timeout waiting for response from backend server. Send status unknown; execution status unknown. ### -1008 SERVER_BUSY - Spot server is currently overloaded with other requests. Please try again in a few minutes. ### -1014 UNKNOWN_ORDER_COMPOSITION - Unsupported order combination. ### -1015 TOO_MANY_ORDERS - Too many new orders. - Too many new orders; current limit is %s orders per %s. ### -1016 SERVICE_SHUTTING_DOWN - This service is no longer available. ### -1020 UNSUPPORTED_OPERATION - This operation is not supported. ### -1021 INVALID_TIMESTAMP - Timestamp for this request is outside of the recvWindow. - Timestamp for this request was 1000ms ahead of the server's time. ### -1022 INVALID_SIGNATURE - Signature for this request is not valid. ### -1099 Not found, authenticated, or authorized - This replaces error code -1999 ## 11xx - 2xxx Request issues ### -1100 ILLEGAL_CHARS - Illegal characters found in a parameter. - Illegal characters found in a parameter. %s - Illegal characters found in parameter `%s`; legal range is `%s`. ### -1101 TOO_MANY_PARAMETERS - Too many parameters sent for this endpoint. - Too many parameters; expected `%s` and received `%s`. - Duplicate values for a parameter detected. ### -1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED - A mandatory parameter was not sent, was empty/null, or malformed. - Mandatory parameter `%s` was not sent, was empty/null, or malformed. - Param `%s` or `%s` must be sent, but both were empty/null! ### -1103 UNKNOWN_PARAM - An unknown parameter was sent. ### -1104 UNREAD_PARAMETERS - Not all sent parameters were read. - Not all sent parameters were read; read `%s` parameter(s) but was sent `%s`. ### -1105 PARAM_EMPTY - A parameter was empty. - Parameter `%s` was empty. ### -1106 PARAM_NOT_REQUIRED - A parameter was sent when not required. - Parameter `%s` sent when not required. ### -1111 BAD_PRECISION - Precision is over the maximum defined for this asset. ### -1112 NO_DEPTH - No orders on book for symbol. ### -1114 TIF_NOT_REQUIRED - TimeInForce parameter sent when not required. ### -1115 INVALID_TIF - Invalid timeInForce. ### -1116 INVALID_ORDER_TYPE - Invalid orderType. ### -1117 INVALID_SIDE - Invalid side. ### -1118 EMPTY_NEW_CL_ORD_ID - New client order ID was empty. ### -1119 EMPTY_ORG_CL_ORD_ID - Original client order ID was empty. ### -1120 BAD_INTERVAL - Invalid interval. ### -1121 BAD_SYMBOL - Invalid symbol. ### -1125 INVALID_LISTEN_KEY - This listenKey does not exist. ### -1127 MORE_THAN_XX_HOURS - Lookup interval is too big. - More than %s hours between startTime and endTime. ### -1128 OPTIONAL_PARAMS_BAD_COMBO - Combination of optional parameters invalid. ### -1130 INVALID_PARAMETER - Invalid data sent for a parameter. - Data sent for parameter `%s` is not valid. ### -1131 BAD_RECV_WINDOW - recvWindow must be less than 60000 ### -1134 BAD_STRATEGY_TYPE - `strategyType` was less than 1000000. #### -1145 INVALID_CANCEL_RESTRICTIONS - `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. #### -1151 DUPLICATE_SYMBOLS - Symbol is present multiple times in the list. ### -2010 NEW_ORDER_REJECTED - NEW_ORDER_REJECTED ### -2011 CANCEL_REJECTED - CANCEL_REJECTED ### -2013 NO_SUCH_ORDER - Order does not exist. ### -2014 BAD_API_KEY_FMT - API-key format invalid. ### -2015 REJECTED_MBX_KEY - Invalid API-key, IP, or permissions for action. ### -2016 NO_TRADING_WINDOW - No trading window could be found for the symbol. Try ticker/24hrs instead. #### -2026 ORDER_ARCHIVED - Order was canceled or expired with no executed qty over 90 days ago and has been archived. ## 3xxx-5xxx SAPI-specific issues ### -3000 INNER_FAILURE - Internal server error. ### -3001 NEED_ENABLE_2FA - Please enable 2FA first. ### -3002 ASSET_DEFICIENCY - We don't have this asset. ### -3003 NO_OPENED_MARGIN_ACCOUNT - Margin account does not exist. ### -3004 TRADE_NOT_ALLOWED - Trade not allowed. ### -3005 TRANSFER_OUT_NOT_ALLOWED - Transferring out not allowed. ### -3006 EXCEED_MAX_BORROWABLE - Your borrow amount has exceed maximum borrow amount. ### -3007 HAS_PENDING_TRANSACTION - You have pending transaction, please try again later. ### -3008 BORROW_NOT_ALLOWED - Borrow not allowed. ### -3009 ASSET_NOT_MORTGAGEABLE - This asset are not allowed to transfer into margin account currently. ### -3010 REPAY_NOT_ALLOWED - Repay not allowed. ### -3011 BAD_DATE_RANGE - Your input date is invalid. ### -3012 ASSET_ADMIN_BAN_BORROW - Borrow is banned for this asset. ### -3013 LT_MIN_BORROWABLE - Borrow amount less than minimum borrow amount. ### -3014 ACCOUNT_BAN_BORROW - Borrow is banned for this account. ### -3015 REPAY_EXCEED_LIABILITY - Repay amount exceeds borrow amount. ### -3016 LT_MIN_REPAY - Repay amount less than minimum repay amount. ### -3017 ASSET_ADMIN_BAN_MORTGAGE - This asset are not allowed to transfer into margin account currently. ### -3018 ACCOUNT_BAN_MORTGAGE - Transferring in has been banned for this account. ### -3019 ACCOUNT_BAN_ROLLOUT - Transferring out has been banned for this account. ### -3020 EXCEED_MAX_ROLLOUT - Transfer out amount exceeds max amount. ### -3021 PAIR_ADMIN_BAN_TRADE - Margin account are not allowed to trade this trading pair. ### -3022 ACCOUNT_BAN_TRADE - You account's trading is banned. ### -3023 WARNING_MARGIN_LEVEL - You can't transfer out/place order under current margin level. ### -3024 FEW_LIABILITY_LEFT - The unpaid debt is too small after this repayment. ### -3025 INVALID_EFFECTIVE_TIME - Your input date is invalid. ### -3026 VALIDATION_FAILED - Your input param is invalid. ### -3027 NOT_VALID_MARGIN_ASSET - Not a valid margin asset. ### -3028 NOT_VALID_MARGIN_PAIR - Not a valid margin pair. ### -3029 TRANSFER_FAILED - Transfer failed. ### -3036 ACCOUNT_BAN_REPAY - This account is not allowed to repay. ### -3037 PNL_CLEARING - PNL is clearing. Wait a second. ### -3038 LISTEN_KEY_NOT_FOUND - Listen key not found. ### -3041 BALANCE_NOT_CLEARED - Balance is not enough ### -3042 PRICE_INDEX_NOT_FOUND - PriceIndex not available for this margin pair. ### -3043 TRANSFER_IN_NOT_ALLOWED - Transferring in not allowed. ### -3044 SYSTEM_BUSY - System busy. ### -3045 SYSTEM - The system doesn't have enough asset now. ### -3999 NOT_WHITELIST_USER - This function is only available for invited users. ### -4001 CAPITAL_INVALID - Invalid operation. ### -4002 CAPITAL_IG - Invalid get. ### -4003 CAPITAL_IEV - Your input email is invalid. ### -4004 CAPITAL_UA - You don't login or auth. ### -4005 CAPAITAL_TOO_MANY_REQUEST - Too many new requests. ### -4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT - Support main account only. ### -4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS - Address validation is not passed. ### -4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS - Address tag validation is not passed. ### -4010 CAPITAL_WHITELIST_EMAIL_CONFIRM - White list mail has been confirmed. ### -4011 CAPITAL_WHITELIST_EMAIL_EXPIRED - White list mail is invalid. ### -4012 CAPITAL_WHITELIST_CLOSE - White list is not opened. ### -4013 CAPITAL_WITHDRAW_2FA_VERIFY - 2FA is not opened. ### -4014 CAPITAL_WITHDRAW_LOGIN_DELAY - Withdraw is not allowed within 2 min login. ### -4015 CAPITAL_WITHDRAW_RESTRICTED_MINUTE - Withdraw is limited. ### -4016 CAPITAL_WITHDRAW_RESTRICTED_PASSWORD - Within 24 hours after password modification, withdrawal is prohibited. ### -4017 CAPITAL_WITHDRAW_RESTRICTED_UNBIND_2FA - Within 24 hours after the release of 2FA, withdrawal is prohibited. ### -4018 CAPITAL_WITHDRAW_ASSET_NOT_EXIST - We don't have this asset. ### -4019 CAPITAL_WITHDRAW_ASSET_PROHIBIT - Current asset is not open for withdrawal. ### -4021 CAPITAL_WITHDRAW_AMOUNT_MULTIPLE - Asset withdrawal must be an %s multiple of %s. ### -4022 CAPITAL_WITHDRAW_MIN_AMOUNT - Not less than the minimum pick-up quantity %s. ### -4023 CAPITAL_WITHDRAW_MAX_AMOUNT - Within 24 hours, the withdrawal exceeds the maximum amount. ### -4024 CAPITAL_WITHDRAW_USER_NO_ASSET - You don't have this asset. ### -4025 CAPITAL_WITHDRAW_USER_ASSET_LESS_THAN_ZERO - The number of hold asset is less than zero. ### -4026 CAPITAL_WITHDRAW_USER_ASSET_NOT_ENOUGH - You have insufficient balance. ### -4027 CAPITAL_WITHDRAW_GET_TRAN_ID_FAILURE - Failed to obtain tranId. ### -4028 CAPITAL_WITHDRAW_MORE_THAN_FEE - The amount of withdrawal must be greater than the Commission. ### -4029 CAPITAL_WITHDRAW_NOT_EXIST - The withdrawal record does not exist. ### -4030 CAPITAL_WITHDRAW_CONFIRM_SUCCESS - Confirmation of successful asset withdrawal. ### -4031 CAPITAL_WITHDRAW_CANCEL_FAILURE - Cancellation failed. ### -4032 CAPITAL_WITHDRAW_CHECKSUM_VERIFY_FAILURE - Withdraw verification exception. ### -4033 CAPITAL_WITHDRAW_ILLEGAL_ADDRESS - Illegal address. ### -4034 CAPITAL_WITHDRAW_ADDRESS_CHEAT - The address is suspected of fake. ### -4035 CAPITAL_WITHDRAW_NOT_WHITE_ADDRESS - This address is not on the whitelist. Please join and try again. ### -4036 CAPITAL_WITHDRAW_NEW_ADDRESS - The new address needs to be withdrawn in {0} hours. ### -4037 CAPITAL_WITHDRAW_RESEND_EMAIL_FAIL - Re-sending Mail failed. ### -4038 CAPITAL_WITHDRAW_RESEND_EMAIL_TIME_OUT - Please try again in 5 minutes. ### -4039 CAPITAL_USER_EMPTY - The user does not exist. ### -4040 CAPITAL_NO_CHARGE - This address not charged. ### -4041 CAPITAL_MINUTE_TOO_SMALL - Please try again in one minute. ### -4042 CAPITAL_CHARGE_NOT_RESET - This asset cannot get deposit address again. ### -4043 CAPITAL_ADDRESS_TOO_MUCH - More than 100 recharge addresses were used in 24 hours. ### -4044 CAPITAL_BLACKLIST_COUNTRY_GET_ADDRESS - This is a blacklist country. ### -4045 CAPITAL_GET_ASSET_ERROR - Failure to acquire assets. ### -4046 CAPITAL_AGREEMENT_NOT_CONFIRMED - Agreement not confirmed. ### -4047 CAPITAL_DATE_INTERVAL_LIMIT - Time interval must be within 0-90 days ### -4060 CAPITAL_WITHDRAW_USER_ASSET_LOCK_DEPOSIT - As your deposit has not reached the required block confirmations, we have temporarily locked {0} asset ### -4106 TAG_NOT_SUPPORTED_FOR_NETWORK - This network does not support memo/tag. Please remove the `addressTag` field and try again. ### -5001 ASSET_DRIBBLET_CONVERT_SWITCH_OFF - Don't allow transfer to micro assets. ### -5002 ASSET_ASSET_NOT_ENOUGH - You have insufficient balance. ### -5003 ASSET_USER_HAVE_NO_ASSET - You don't have this asset. ### -5004 USER_OUT_OF_TRANSFER_FLOAT - The residual balances have exceeded 0.001BTC, Please re-choose. - The residual balances of %s have exceeded 0.001BTC, Please re-choose. ### -5005 USER_ASSET_AMOUNT_IS_TOO_LOW - The residual balances of the BTC is too low - The residual balances of %s is too low, Please re-choose. ### -5006 USER_CAN_NOT_REQUEST_IN_24_HOURS - Only transfer once in 24 hours. ### -5007 AMOUNT_OVER_ZERO - Quantity must be greater than zero. ### -5008 ASSET_WITHDRAW_WITHDRAWING_NOT_ENOUGH - Insufficient amount of returnable assets. ### -5009 PRODUCT_NOT_EXIST - Product does not exist. ### -5010 TRANSFER_FAIL - Asset transfer fail. ### -5011 FUTURE_ACCT_NOT_EXIST - future account not exists. ### -5012 TRANSFER_PENDING - Asset transfer is in pending. ### -5021 PARENT_SUB_HAVE_NO_RELATION - This parent sub have no relation ### -5012 FUTURE_ACCT_OR_SUBRELATION_NOT_EXIST - future account or sub relation not exists. ## 6XXX - Savings Issues ### -6001 DAILY_PRODUCT_NOT_EXIST - Daily product not exists. ### -6003 DAILY_PRODUCT_NOT_ACCESSIBLE - Product not exist or you don't have permission ### -6004 DAILY_PRODUCT_NOT_PURCHASABLE - Product not in purchase status ### -6005 DAILY_LOWER_THAN_MIN_PURCHASE_LIMIT - Smaller than min purchase limit ### -6006 DAILY_REDEEM_AMOUNT_ERROR - Redeem amount error ### -6007 DAILY_REDEEM_TIME_ERROR - Not in redeem time ### -6008 DAILY_PRODUCT_NOT_REDEEMABLE - Product not in redeem status ### -6009 REQUEST_FREQUENCY_TOO_HIGH - Request frequency too high ### -6011 EXCEEDED_USER_PURCHASE_LIMIT - Exceeding the maximum num allowed to purchase per user ### -6012 BALANCE_NOT_ENOUGH - Balance not enough ### -6013 PURCHASING_FAILED - Purchasing failed ### -6014 UPDATE_FAILED - Exceed up-limit allowed to purchased ### -6015 EMPTY_REQUEST_BODY - Empty request body ### -6016 PARAMS_ERR - Parameter err ### -6017 NOT_IN_WHITELIST - Not in whitelist ### -6018 ASSET_NOT_ENOUGH - Asset not enough ### -6019 PENDING - Need confirm ### -6020 PROJECT_NOT_EXISTS - Project not exists ## 70xx - Futures ### -7001 FUTURES_BAD_DATE_RANGE - Date range is not supported. ### -7002 FUTURES_BAD_TYPE - Data request type is not supported. ## 20xxx - Futures/Spot Algo ### -20121 - Invalid symbol. ### -20124 - Invalid algo id or it has been completed. ### -20130 - Invalid data sent for a parameter. ### -20132 - The client algo id is duplicated. ### -20194 - Duration is too short to execute all required quantity. ### -20195 - The total size is too small. ### -20196 - The total size is too large. ### -20198 - Reach the max open orders allowed. ### -20204 - The notional of USD is less or more than the limit. ## Filter failures | Error message | Description | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | "Filter failure: PRICE_FILTER" | `price` is too high, too low, and/or not following the tick size rule for the symbol. | | "Filter failure: PERCENT_PRICE" | `price` is X% too high or X% too low from the average weighted price over the last Y minutes. | | "Filter failure: PERCENT_PRICE_BY_SIDE" | `price` is X% too high or Y% too low from the `lastPrice` on that side (i.e. BUY/SELL) | | "Filter failure: LOT_SIZE" | `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MIN_NOTIONAL" | `price` \* `quantity` is too low to be a valid order for the symbol. | | "Filter failure: ICEBERG_PARTS" | `ICEBERG` order would break into too many parts; icebergQty is too small. | | "Filter failure: MARKET_LOT_SIZE" | `MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MAX_POSITION" | The account's position has reached the maximum defined limit.

This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY`orders. | | "Filter failure: MAX_NUM_ORDERS" | Account has too many open orders on the symbol. | | "Filter failure: MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the symbol. | | "Filter failure: MAX_NUM_ICEBERG_ORDERS" | Account has too many open iceberg orders on the symbol. | | "Filter failure: TRAILING_DELTA" | `trailingDelta` is not within the defined range of the filter for that order type. | | "Filter failure: EXCHANGE_MAX_NUM_ORDERS" | Account has too many open orders on the exchange. | | "Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the exchange. | ## 10xxx - Crypto Loans ### -10001 SYSTEM_MAINTENANCE - The system is under maintenance, please try again later. ### -10002 INVALID_INPUT - Invalid input parameters. ### -10005 NO_RECORDS - No records found. ### -10007 COIN_NOT_LOANABLE - This coin is not loanable. ### -10008 COIN_NOT_LOANABLE - This coin is not loanable ### -10009 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10010 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10011 INSUFFICIENT_ASSET - Insufficient spot assets. ### -10012 INVALID_AMOUNT - Invalid repayment amount. ### -10013 INSUFFICIENT_AMOUNT - Insufficient collateral amount. ### -10015 DEDUCTION_FAILED - Collateral deduction failed. ### -10016 LOAN_FAILED - Failed to provide loan. ### -10017 REPAY_EXCEED_DEBT - Repayment amount exceeds debt. ### -10018 INVALID_AMOUNT - Invalid repayment amount. ### -10019 CONFIG_NOT_EXIST - Configuration does not exists. ### -10020 UID_NOT_EXIST - User ID does not exist. ### -10021 ORDER_NOT_EXIST - Order does not exist. ### -10022 INVALID_AMOUNT - Invalid adjustment amount. ### -10023 ADJUST_LTV_FAILED - Failed to adjust LTV. ### -10024 ADJUST_LTV_NOT_SUPPORTED - LTV adjustment not supported. ### -10025 REPAY_FAILED - Repayment failed. ### -10026 INVALID_PARAMETER - Invalid parameter. ### -10028 INVALID_PARAMETER - Invalid parameter. ### -10029 AMOUNT_TOO_SMALL - Loan amount is too small. ### -10030 AMOUNT_TOO_LARGE - Loan amount is too much. ### -10031 QUOTA_REACHED - Individual loan quota reached. ### -10032 REPAY_NOT_AVAILABLE - Repayment is temporarily unavailable. ### -10034 REPAY_NOT_AVAILABLE - Repay with collateral is not available currently, please try to repay with borrowed coin. ### -10039 AMOUNT_TOO_SMALL - Repayment amount is too small. ### -10040 AMOUNT_TOO_LARGE - Repayment amount is too large. ### -10041 INSUFFICIENT_AMOUNT - Due to high demand, there are currently insufficient loanable assets for {0}. Please adjust your borrow amount or try again tomorrow. ### -10042 ASSET_NOT_SUPPORTED - asset %s is not supported ### -10043 ASSET_NOT_SUPPORTED - {0} borrowing is currently not supported. ### -10044 QUOTA_REACHED - Collateral amount has reached the limit. Please reduce your collateral amount or try with other collaterals. ### -10045 COLLTERAL_REPAY_NOT_SUPPORTED - The loan coin does not support collateral repayment. Please try again later. ### -10046 EXCEED_MAX_ADJUSTMENT - Collateral Adjustment exceeds the maximum limit. Please try again. ### -10047 REGION_NOT_SUPPORTED - This coin is currently not supported in your location due to local regulations. ## 13xxx - BLVT ### -13000 BLVT_FORBID_REDEEM - Redeption of the token is forbiden now ### -13001 BLVT_EXCEED_DAILY_LIMIT - Exceeds individual 24h redemption limit of the token ### -13002 BLVT_EXCEED_TOKEN_DAILY_LIMIT - Exceeds total 24h redemption limit of the token ### -13003 BLVT_FORBID_PURCHASE - Subscription of the token is forbiden now ### -13004 BLVT_EXCEED_DAILY_PURCHASE_LIMIT - Exceeds individual 24h subscription limit of the token ### -13005 BLVT_EXCEED_TOKEN_DAILY_PURCHASE_LIMIT - Exceeds total 24h subscription limit of the token ### -13006 BLVT_PURCHASE_LESS_MIN_AMOUNT - Subscription amount is too small ### -13007 BLVT_PURCHASE_AGREEMENT_NOT_SIGN - The Agreement is not signed ## 12xxx - Liquid Swap ### -12014 TOO MANY REQUESTS - More than 1 request in 2 seconds ## 18xxx - Binance Code ### -18002 - The total amount of codes you created has exceeded the 24-hour limit, please try again after UTC 0 ### -18003 - Too many codes created in 24 hours, please try again after UTC 0 ### -18004 - Too many invalid redeem attempts in 24 hours, please try again after UTC 0 ### -18005 - Too many invalid verify attempts, please try later ### -18006 - The amount is too small, please re-enter ### -18007 - This token is not currently supported, please re-enter ## 21xxx - Portfolio Margin Account ### -21001 USER_IS_NOT_UNIACCOUNT - Request ID is not a Portfolio Margin Account. ### -21002 UNI_ACCOUNT_CANT_TRANSFER_FUTURE - Portfolio Margin Account doesn't support transfer from margin to futures. ### -21003 NET_ASSET_MUST_LTE_RATIO - Fail to retrieve margin assets. ### -21004 USER_NO_LIABILITY - User doesn’t have portfolio margin bankruptcy loan ### -21005 NO_ENOUGH_ASSET - User’s spot wallet doesn’t have enough BUSD to repay portfolio margin bankruptcy loan ### -21006 HAD_IN_PROCESS_REPAY - User had portfolio margin bankruptcy loan repayment in process ### -21007 IN_FORCE_LIQUIDATION - User failed to repay portfolio margin bankruptcy loan since liquidation was in process ## Order Rejection Issues Error messages like these are indicated when the error is coming specifically from the matching engine: - `-1010 ERROR_MSG_RECEIVED` - `-2010 NEW_ORDER_REJECTED` - `-2011 CANCEL_REJECTED` The following messages which will indicate the specific error: | Error message | Description | | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | "Unknown order sent." | The order (by either `orderId`, `clientOrderId`, `origClientOrderId`) could not be found. | | "Duplicate order sent." | The `clientOrderId` is already in use. | | "Market is closed." | The symbol is not trading. | | "Account has insufficient balance for requested action." | Not enough funds to complete the action. | | "Market orders are not supported for this symbol." | `MARKET` is not enabled on the symbol. | | "Iceberg orders are not supported for this symbol." | `icebergQty` is not enabled on the symbol | | "Stop loss orders are not supported for this symbol." | `STOP_LOSS` is not enabled on the symbol | | "Stop loss limit orders are not supported for this symbol." | `STOP_LOSS_LIMIT` is not enabled on the symbol | | "Take profit orders are not supported for this symbol." | `TAKE_PROFIT` is not enabled on the symbol | | "Take profit limit orders are not supported for this symbol." | `TAKE_PROFIT_LIMIT` is not enabled on the symbol | | "Price \* QTY is zero or less." | `price` \* `quantity` is too low | | "IcebergQty exceeds QTY." | `icebergQty` must be less than the order quantity | | "This action is disabled on this account." | Contact customer support; some actions have been disabled on the account. | | "This account may not place or cancel orders." | Contact customer support; the account has trading ability disabled. | | "Unsupported order combination" | The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. | | "Order would trigger immediately." | The order's stop price is not valid when compared to the last traded price. | | "Cancel order is invalid. Check origClientOrderId and orderId." | No `origClientOrderId` or `orderId` was sent in. | | "Order would immediately match and take." | `LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. | | "The relationship of the prices for the orders is not correct." | The prices set in the `OCO` is breaking the Price rules.

The rules are:

`SELL Orders`: Limit Price > Last Price > Stop Price

`BUY Orders`: Limit Price < Last Price < Stop Price | | "OCO orders are not supported for this symbol" | `OCO` is not enabled on the symbol. | | "Quote order qty market orders are not support for this symbol." | `MARKET` orders using the parameter `quoteOrderQty` are not enabled on this symbol. | | "Trailing stop orders are not supported for this symbol." | Orders using `trailingDelta` are not enabled on the symbol. | | "Order cancel-replace is not supported for this symbol." | `POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is on enabled the symbol. | | "This symbol is not permitted for this account." | Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) | | "This symbol is restricted for this account." | Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) | | "Order was not canceled due to cancel restrictions." | Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW`
or
`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. | ## Errors regarding POST /api/v3/order/cancelReplace ### -2021 Order cancel-replace partially failed This code is sent when either the cancellation of the order failed or the new order placement failed but not both. ### -2022 Order cancel-replace failed. This code is sent when both the cancellation of the order failed and the new order placement failed. --- ## Document: /products/rebate/change-log URL: /en/dev-docs/products/rebate/change-log # Change Log ## 2025-12-26 ### Time-sensitive Notice - **The following change to REST API will occur at approximately 2026-01-15 07:00 UTC:**
When calling endpoints that require signatures, percent-encode payloads before computing signatures. Requests that do not follow this order will be rejected with [`-1022 INVALID_SIGNATURE`](./error-code.md#-1022-invalid_signature). Please review and update your signing logic accordingly. ### REST API - Updated documentation for REST API regarding [Signed Endpoints examples for placing an order](./general-info.md#signed-endpoint-examples-for-post-apiv3order). --- ## 2021-12-03 - New endpoints for Rebate: - `GET /sapi/v1/rebate/taxQuery` to support user query spot rebate history records --- ## Document: /products/rebate/Introduction URL: /en/dev-docs/products/rebate/Introduction # Introduction Binance Spot Rebate. --- ## Document: /products/pay/quick-start URL: /en/dev-docs/products/pay/quick-start # Quick Start ## API Key Setup - Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/articles/360002502072) regarding API key creation. - Once API key is created, it is recommended to set IP restrictions on the key for security reasons. - **Never share your API key/secret key to ANYONE.** ## API Key Restrictions - After creating the API key, the default restrictions is `Enable Reading`. - To **enable withdrawals via the API**, the API key restriction needs to be modified through the Binance UI. ## Enabling Accounts ### Spot Account A `SPOT` account is provided by default upon creation of a Binance Account. ### Margin Account To enable a `MARGIN` account for Margin Trading, please refer to the [Margin Trading Guide](https://www.binance.vision/tutorials/binance-margin-trading-guide) ## API Library ### Python connector This is a lightweight library that works as a connector to Binance public API, written in Python. [https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python) ### Javascript connector This is a lightweight library that works as a connector to Binance public API, written for JavaScript users. [https://github.com/binance/binance-connector-js](https://github.com/binance/binance-connector-js) ### Ruby connector This is a lightweight library that works as a connector to Binance public API, written for Ruby users. [https://github.com/binance/binance-connector-ruby](https://github.com/binance/binance-connector-ruby) ### DotNET connector This is a lightweight library that works as a connector to Binance public API, written for C# users. [https://github.com/binance/binance-connector-dotnet](https://github.com/binance/binance-connector-dotnet) ### Java connector This is a lightweight library that works as a connector to Binance public API, written for Java users. [https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java) ### Postman Collections There is now a Postman collection containing the API endpoints for quick and easy use. This is recommended for new users who want to get a quick-start into using the API. For more information please refer to this page: [Binance API Postman](https://github.com/binance/binance-api-postman) ### Swagger A YAML file with OpenAPI specification on the RESTful API is available to be used, as well as a Swagger UI page for the consulting. [https://github.com/binance/binance-api-swagger](https://github.com/binance/binance-api-swagger) --- ## Document: /products/pay/general-info URL: /en/dev-docs/products/pay/general-info # General Info ## General API Information - The following base endpoints are available: - **https://api.binance.com** - **https://api-gcp.binance.com** - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** - The last 4 endpoints in the point above (`api1`-`api4`) might give better performance but have less stability. Please use whichever works best for your setup. - All endpoints return either a JSON object or array. - Data is returned in **ascending** order. Oldest first, newest last. - All time and timestamp related fields are in **milliseconds**. ### HTTP Return Codes - HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. - HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP `409` return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.) - HTTP `429` return code is used when breaking a request rate limit. - HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. - HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. ### Error Codes and Messages - If there is an error, the API will return an error with a message of the reason. > The error payload on API and SAPI is as follows: ```json { "code": -1121, "msg": "Invalid symbol." } ``` - Specific error codes and messages defined in [Error Codes](./error-code). ### General Information on Endpoints - For `GET` endpoints, parameters must be sent as a `query string`. - For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. - Parameters may be sent in any order. - If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. --- ## LIMITS ### General Info on Limits - The following `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". - The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. - A 429 will be returned when either request rate limit or order rate limit is violated. ### IP Limits - Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. - When a 429 is received, it's your obligation as an API to back off and not spam the API. - **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** - IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. - A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - **The limits on the API are based on the IPs, not the API keys.** ### Order Rate Limits - Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. - When the order count exceeds the limit, you will receive a 429 error without the `Retry-After` header. Please check the Order Rate Limit rules using `GET api/v3/exchangeInfo` and wait for reactivation accordingly. - Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - **The order rate limit is counted against each account**. - To monitor order count usage, refer to GET `api/v3/rateLimit/order` ### Websocket Limits - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON controlled message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. - There is a limit of **300 connections per attempt every 5 minutes per IP**. ### /api/ and /sapi/ Limit Introduction The `/api/*` and `/sapi/*` endpoints adopt either of two access limiting rules, IP limits or UID (account) limits. - Endpoints related to `/api/*`: - According to the two modes of IP and UID (account) limit, each are independent. - Endpoints share the 6000 per minute limit based on IP. - Responses contain the header `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)`, defining the weight used by the current IP. - Successful order responses contain the header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`, defining the order limit used by the UID. - Endpoints related to `/sapi/*`: - Endpoints are marked according to IP or UID limit and their corresponding weight value. - Each endpoint with IP limits has an independent 12000 per minute limit. - Each endpoint with UID limits has an independent 180000 per minute limit. - Responses from endpoints with IP limits contain the header `X-SAPI-USED-IP-WEIGHT-1M`, defining the weight used by the current IP. - Responses from endpoints with UID limits contain the header `X-SAPI-USED-UID-WEIGHT-1M`, defining the weight used by the current UID. --- ## Data Sources - The API system is asynchronous, so some delay in the response is normal and expected. - Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates. - **Matching Engine** - the data is from the matching Engine - **Memory** - the data is from a server's local or external memory - **Database** - the data is taken directly from a database ## Request Security - Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](#place-new-order-trade)). - If unspecified, the security type is `NONE`. - Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](#user-data-stream-requests). - Secure endpoints require a valid API key to be specified and authenticated. - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. - API keys can be configured to allow access only to certain types of secure endpoints. - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. | Security Type | Description | | ------------- | -------------------------------------------------------- | | NONE | Endpoint can be accessed freely. | | TRADE | Endpoint requires sending a valid API-Key and signature. | | MARGIN | Endpoint requires sending a valid API-Key and signature. | | USER_DATA | Endpoint requires sending a valid API-Key and signature. | | USER_STREAM | Endpoint requires sending a valid API-Key. | | MARKET_DATA | Endpoint requires sending a valid API-Key. | - `TRADE`, `MARGIN` and `USER_DATA` endpoints are `SIGNED` endpoints. ### SIGNED Endpoint security - `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. #### Signature Case Sensitivity - **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. - **RSA:** Signatures generated using RSA are **case-sensitive**. - **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** Please consult [SIGNED request example (HMAC)](#hmac-keys), [SIGNED request example (RSA)](#rsa-keys), and [SIGNED request example (Ed25519)](#ed25519-keys) on how to compute signature, depending on which API key type you are using. ### Timing security - `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](#general-api-information)) - An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. - Maximum `recvWindow` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` **Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. **It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** ### SIGNED Endpoint Examples for POST /api/v3/order #### HMAC Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. Example API key and secret key: | Key | Value | | ----------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `secretKey` | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j | **WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | LTCBTC | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` **Step 2: Compute the signature** 1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. 2. Sign the signature payload constructed in Step 1. 3. Encode the HMAC-SHA-256 output as a hex string. Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. **Example commands** For the first set of example parameters (ASCII only): ```console $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" ``` For the second set of example parameters (some non-ASCII characters) ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" ``` Here is a sample Bash script performing all the steps above: ```bash apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" # Sign the request signature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey") signature=${signature#*= } # Keep only the part after the "= " # Send the request curl -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?$payload&signature=$signature" ``` #### RSA Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. Only `PKCS#8` keys are supported. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. These examples assume the private key is stored in the file `./test-prv-key.pem`. | Key | Value | | -------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | BTCUSDT | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` **Step 2: Compute the signature** 1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function. 2. Encode the output in base64. Note that the payload and the resulting `signature` are **case-sensitive**. For the first set of example parameters (ASCII only): ```console $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== ``` 3. Percent-encode the base64 string. For the first set of example parameters (ASCII only): ```console HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D ``` For the second set of example parameters (some non-ASCII characters): ```console qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' ``` For the second set of example parameters (some non-ASCII characters): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' ``` Here is a sample Bash script performing all the steps above: ```bash function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos The error JSON payload: ```javascript { "code":-1121, "msg":"Invalid symbol." } ``` Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. ## 10xx - General Server or Network issues ### -1000 UNKNOWN - An unknown error occurred while processing the request. - An unknown error occurred while processing the request.[%s] ### -1001 DISCONNECTED - Internal error; unable to process your request. Please try again. ### -1002 UNAUTHORIZED - You are not authorized to execute this request. ### -1003 TOO_MANY_REQUESTS - Too many requests queued. - Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. - Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. ### -1004 SERVER_BUSY - Server is busy, please wait and try again ### -1006 UNEXPECTED_RESP - An unexpected response was received from the message bus. Execution status unknown. ### -1007 TIMEOUT - Timeout waiting for response from backend server. Send status unknown; execution status unknown. ### -1008 SERVER_BUSY - Spot server is currently overloaded with other requests. Please try again in a few minutes. ### -1014 UNKNOWN_ORDER_COMPOSITION - Unsupported order combination. ### -1015 TOO_MANY_ORDERS - Too many new orders. - Too many new orders; current limit is %s orders per %s. ### -1016 SERVICE_SHUTTING_DOWN - This service is no longer available. ### -1020 UNSUPPORTED_OPERATION - This operation is not supported. ### -1021 INVALID_TIMESTAMP - Timestamp for this request is outside of the recvWindow. - Timestamp for this request was 1000ms ahead of the server's time. ### -1022 INVALID_SIGNATURE - Signature for this request is not valid. ### -1099 Not found, authenticated, or authorized - This replaces error code -1999 ## 11xx - 2xxx Request issues ### -1100 ILLEGAL_CHARS - Illegal characters found in a parameter. - Illegal characters found in a parameter. %s - Illegal characters found in parameter `%s`; legal range is `%s`. ### -1101 TOO_MANY_PARAMETERS - Too many parameters sent for this endpoint. - Too many parameters; expected `%s` and received `%s`. - Duplicate values for a parameter detected. ### -1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED - A mandatory parameter was not sent, was empty/null, or malformed. - Mandatory parameter `%s` was not sent, was empty/null, or malformed. - Param `%s` or `%s` must be sent, but both were empty/null! ### -1103 UNKNOWN_PARAM - An unknown parameter was sent. ### -1104 UNREAD_PARAMETERS - Not all sent parameters were read. - Not all sent parameters were read; read `%s` parameter(s) but was sent `%s`. ### -1105 PARAM_EMPTY - A parameter was empty. - Parameter `%s` was empty. ### -1106 PARAM_NOT_REQUIRED - A parameter was sent when not required. - Parameter `%s` sent when not required. ### -1111 BAD_PRECISION - Precision is over the maximum defined for this asset. ### -1112 NO_DEPTH - No orders on book for symbol. ### -1114 TIF_NOT_REQUIRED - TimeInForce parameter sent when not required. ### -1115 INVALID_TIF - Invalid timeInForce. ### -1116 INVALID_ORDER_TYPE - Invalid orderType. ### -1117 INVALID_SIDE - Invalid side. ### -1118 EMPTY_NEW_CL_ORD_ID - New client order ID was empty. ### -1119 EMPTY_ORG_CL_ORD_ID - Original client order ID was empty. ### -1120 BAD_INTERVAL - Invalid interval. ### -1121 BAD_SYMBOL - Invalid symbol. ### -1125 INVALID_LISTEN_KEY - This listenKey does not exist. ### -1127 MORE_THAN_XX_HOURS - Lookup interval is too big. - More than %s hours between startTime and endTime. ### -1128 OPTIONAL_PARAMS_BAD_COMBO - Combination of optional parameters invalid. ### -1130 INVALID_PARAMETER - Invalid data sent for a parameter. - Data sent for parameter `%s` is not valid. ### -1131 BAD_RECV_WINDOW - recvWindow must be less than 60000 ### -1134 BAD_STRATEGY_TYPE - `strategyType` was less than 1000000. #### -1145 INVALID_CANCEL_RESTRICTIONS - `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. #### -1151 DUPLICATE_SYMBOLS - Symbol is present multiple times in the list. ### -2010 NEW_ORDER_REJECTED - NEW_ORDER_REJECTED ### -2011 CANCEL_REJECTED - CANCEL_REJECTED ### -2013 NO_SUCH_ORDER - Order does not exist. ### -2014 BAD_API_KEY_FMT - API-key format invalid. ### -2015 REJECTED_MBX_KEY - Invalid API-key, IP, or permissions for action. ### -2016 NO_TRADING_WINDOW - No trading window could be found for the symbol. Try ticker/24hrs instead. #### -2026 ORDER_ARCHIVED - Order was canceled or expired with no executed qty over 90 days ago and has been archived. ## 3xxx-5xxx SAPI-specific issues ### -3000 INNER_FAILURE - Internal server error. ### -3001 NEED_ENABLE_2FA - Please enable 2FA first. ### -3002 ASSET_DEFICIENCY - We don't have this asset. ### -3003 NO_OPENED_MARGIN_ACCOUNT - Margin account does not exist. ### -3004 TRADE_NOT_ALLOWED - Trade not allowed. ### -3005 TRANSFER_OUT_NOT_ALLOWED - Transferring out not allowed. ### -3006 EXCEED_MAX_BORROWABLE - Your borrow amount has exceed maximum borrow amount. ### -3007 HAS_PENDING_TRANSACTION - You have pending transaction, please try again later. ### -3008 BORROW_NOT_ALLOWED - Borrow not allowed. ### -3009 ASSET_NOT_MORTGAGEABLE - This asset are not allowed to transfer into margin account currently. ### -3010 REPAY_NOT_ALLOWED - Repay not allowed. ### -3011 BAD_DATE_RANGE - Your input date is invalid. ### -3012 ASSET_ADMIN_BAN_BORROW - Borrow is banned for this asset. ### -3013 LT_MIN_BORROWABLE - Borrow amount less than minimum borrow amount. ### -3014 ACCOUNT_BAN_BORROW - Borrow is banned for this account. ### -3015 REPAY_EXCEED_LIABILITY - Repay amount exceeds borrow amount. ### -3016 LT_MIN_REPAY - Repay amount less than minimum repay amount. ### -3017 ASSET_ADMIN_BAN_MORTGAGE - This asset are not allowed to transfer into margin account currently. ### -3018 ACCOUNT_BAN_MORTGAGE - Transferring in has been banned for this account. ### -3019 ACCOUNT_BAN_ROLLOUT - Transferring out has been banned for this account. ### -3020 EXCEED_MAX_ROLLOUT - Transfer out amount exceeds max amount. ### -3021 PAIR_ADMIN_BAN_TRADE - Margin account are not allowed to trade this trading pair. ### -3022 ACCOUNT_BAN_TRADE - You account's trading is banned. ### -3023 WARNING_MARGIN_LEVEL - You can't transfer out/place order under current margin level. ### -3024 FEW_LIABILITY_LEFT - The unpaid debt is too small after this repayment. ### -3025 INVALID_EFFECTIVE_TIME - Your input date is invalid. ### -3026 VALIDATION_FAILED - Your input param is invalid. ### -3027 NOT_VALID_MARGIN_ASSET - Not a valid margin asset. ### -3028 NOT_VALID_MARGIN_PAIR - Not a valid margin pair. ### -3029 TRANSFER_FAILED - Transfer failed. ### -3036 ACCOUNT_BAN_REPAY - This account is not allowed to repay. ### -3037 PNL_CLEARING - PNL is clearing. Wait a second. ### -3038 LISTEN_KEY_NOT_FOUND - Listen key not found. ### -3041 BALANCE_NOT_CLEARED - Balance is not enough ### -3042 PRICE_INDEX_NOT_FOUND - PriceIndex not available for this margin pair. ### -3043 TRANSFER_IN_NOT_ALLOWED - Transferring in not allowed. ### -3044 SYSTEM_BUSY - System busy. ### -3045 SYSTEM - The system doesn't have enough asset now. ### -3999 NOT_WHITELIST_USER - This function is only available for invited users. ### -4001 CAPITAL_INVALID - Invalid operation. ### -4002 CAPITAL_IG - Invalid get. ### -4003 CAPITAL_IEV - Your input email is invalid. ### -4004 CAPITAL_UA - You don't login or auth. ### -4005 CAPAITAL_TOO_MANY_REQUEST - Too many new requests. ### -4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT - Support main account only. ### -4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS - Address validation is not passed. ### -4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS - Address tag validation is not passed. ### -4010 CAPITAL_WHITELIST_EMAIL_CONFIRM - White list mail has been confirmed. ### -4011 CAPITAL_WHITELIST_EMAIL_EXPIRED - White list mail is invalid. ### -4012 CAPITAL_WHITELIST_CLOSE - White list is not opened. ### -4013 CAPITAL_WITHDRAW_2FA_VERIFY - 2FA is not opened. ### -4014 CAPITAL_WITHDRAW_LOGIN_DELAY - Withdraw is not allowed within 2 min login. ### -4015 CAPITAL_WITHDRAW_RESTRICTED_MINUTE - Withdraw is limited. ### -4016 CAPITAL_WITHDRAW_RESTRICTED_PASSWORD - Within 24 hours after password modification, withdrawal is prohibited. ### -4017 CAPITAL_WITHDRAW_RESTRICTED_UNBIND_2FA - Within 24 hours after the release of 2FA, withdrawal is prohibited. ### -4018 CAPITAL_WITHDRAW_ASSET_NOT_EXIST - We don't have this asset. ### -4019 CAPITAL_WITHDRAW_ASSET_PROHIBIT - Current asset is not open for withdrawal. ### -4021 CAPITAL_WITHDRAW_AMOUNT_MULTIPLE - Asset withdrawal must be an %s multiple of %s. ### -4022 CAPITAL_WITHDRAW_MIN_AMOUNT - Not less than the minimum pick-up quantity %s. ### -4023 CAPITAL_WITHDRAW_MAX_AMOUNT - Within 24 hours, the withdrawal exceeds the maximum amount. ### -4024 CAPITAL_WITHDRAW_USER_NO_ASSET - You don't have this asset. ### -4025 CAPITAL_WITHDRAW_USER_ASSET_LESS_THAN_ZERO - The number of hold asset is less than zero. ### -4026 CAPITAL_WITHDRAW_USER_ASSET_NOT_ENOUGH - You have insufficient balance. ### -4027 CAPITAL_WITHDRAW_GET_TRAN_ID_FAILURE - Failed to obtain tranId. ### -4028 CAPITAL_WITHDRAW_MORE_THAN_FEE - The amount of withdrawal must be greater than the Commission. ### -4029 CAPITAL_WITHDRAW_NOT_EXIST - The withdrawal record does not exist. ### -4030 CAPITAL_WITHDRAW_CONFIRM_SUCCESS - Confirmation of successful asset withdrawal. ### -4031 CAPITAL_WITHDRAW_CANCEL_FAILURE - Cancellation failed. ### -4032 CAPITAL_WITHDRAW_CHECKSUM_VERIFY_FAILURE - Withdraw verification exception. ### -4033 CAPITAL_WITHDRAW_ILLEGAL_ADDRESS - Illegal address. ### -4034 CAPITAL_WITHDRAW_ADDRESS_CHEAT - The address is suspected of fake. ### -4035 CAPITAL_WITHDRAW_NOT_WHITE_ADDRESS - This address is not on the whitelist. Please join and try again. ### -4036 CAPITAL_WITHDRAW_NEW_ADDRESS - The new address needs to be withdrawn in {0} hours. ### -4037 CAPITAL_WITHDRAW_RESEND_EMAIL_FAIL - Re-sending Mail failed. ### -4038 CAPITAL_WITHDRAW_RESEND_EMAIL_TIME_OUT - Please try again in 5 minutes. ### -4039 CAPITAL_USER_EMPTY - The user does not exist. ### -4040 CAPITAL_NO_CHARGE - This address not charged. ### -4041 CAPITAL_MINUTE_TOO_SMALL - Please try again in one minute. ### -4042 CAPITAL_CHARGE_NOT_RESET - This asset cannot get deposit address again. ### -4043 CAPITAL_ADDRESS_TOO_MUCH - More than 100 recharge addresses were used in 24 hours. ### -4044 CAPITAL_BLACKLIST_COUNTRY_GET_ADDRESS - This is a blacklist country. ### -4045 CAPITAL_GET_ASSET_ERROR - Failure to acquire assets. ### -4046 CAPITAL_AGREEMENT_NOT_CONFIRMED - Agreement not confirmed. ### -4047 CAPITAL_DATE_INTERVAL_LIMIT - Time interval must be within 0-90 days ### -4060 CAPITAL_WITHDRAW_USER_ASSET_LOCK_DEPOSIT - As your deposit has not reached the required block confirmations, we have temporarily locked {0} asset ### -4106 TAG_NOT_SUPPORTED_FOR_NETWORK - This network does not support memo/tag. Please remove the `addressTag` field and try again. ### -5001 ASSET_DRIBBLET_CONVERT_SWITCH_OFF - Don't allow transfer to micro assets. ### -5002 ASSET_ASSET_NOT_ENOUGH - You have insufficient balance. ### -5003 ASSET_USER_HAVE_NO_ASSET - You don't have this asset. ### -5004 USER_OUT_OF_TRANSFER_FLOAT - The residual balances have exceeded 0.001BTC, Please re-choose. - The residual balances of %s have exceeded 0.001BTC, Please re-choose. ### -5005 USER_ASSET_AMOUNT_IS_TOO_LOW - The residual balances of the BTC is too low - The residual balances of %s is too low, Please re-choose. ### -5006 USER_CAN_NOT_REQUEST_IN_24_HOURS - Only transfer once in 24 hours. ### -5007 AMOUNT_OVER_ZERO - Quantity must be greater than zero. ### -5008 ASSET_WITHDRAW_WITHDRAWING_NOT_ENOUGH - Insufficient amount of returnable assets. ### -5009 PRODUCT_NOT_EXIST - Product does not exist. ### -5010 TRANSFER_FAIL - Asset transfer fail. ### -5011 FUTURE_ACCT_NOT_EXIST - future account not exists. ### -5012 TRANSFER_PENDING - Asset transfer is in pending. ### -5021 PARENT_SUB_HAVE_NO_RELATION - This parent sub have no relation ### -5012 FUTURE_ACCT_OR_SUBRELATION_NOT_EXIST - future account or sub relation not exists. ## 6XXX - Savings Issues ### -6001 DAILY_PRODUCT_NOT_EXIST - Daily product not exists. ### -6003 DAILY_PRODUCT_NOT_ACCESSIBLE - Product not exist or you don't have permission ### -6004 DAILY_PRODUCT_NOT_PURCHASABLE - Product not in purchase status ### -6005 DAILY_LOWER_THAN_MIN_PURCHASE_LIMIT - Smaller than min purchase limit ### -6006 DAILY_REDEEM_AMOUNT_ERROR - Redeem amount error ### -6007 DAILY_REDEEM_TIME_ERROR - Not in redeem time ### -6008 DAILY_PRODUCT_NOT_REDEEMABLE - Product not in redeem status ### -6009 REQUEST_FREQUENCY_TOO_HIGH - Request frequency too high ### -6011 EXCEEDED_USER_PURCHASE_LIMIT - Exceeding the maximum num allowed to purchase per user ### -6012 BALANCE_NOT_ENOUGH - Balance not enough ### -6013 PURCHASING_FAILED - Purchasing failed ### -6014 UPDATE_FAILED - Exceed up-limit allowed to purchased ### -6015 EMPTY_REQUEST_BODY - Empty request body ### -6016 PARAMS_ERR - Parameter err ### -6017 NOT_IN_WHITELIST - Not in whitelist ### -6018 ASSET_NOT_ENOUGH - Asset not enough ### -6019 PENDING - Need confirm ### -6020 PROJECT_NOT_EXISTS - Project not exists ## 70xx - Futures ### -7001 FUTURES_BAD_DATE_RANGE - Date range is not supported. ### -7002 FUTURES_BAD_TYPE - Data request type is not supported. ## 20xxx - Futures/Spot Algo ### -20121 - Invalid symbol. ### -20124 - Invalid algo id or it has been completed. ### -20130 - Invalid data sent for a parameter. ### -20132 - The client algo id is duplicated. ### -20194 - Duration is too short to execute all required quantity. ### -20195 - The total size is too small. ### -20196 - The total size is too large. ### -20198 - Reach the max open orders allowed. ### -20204 - The notional of USD is less or more than the limit. ## Filter failures | Error message | Description | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | "Filter failure: PRICE_FILTER" | `price` is too high, too low, and/or not following the tick size rule for the symbol. | | "Filter failure: PERCENT_PRICE" | `price` is X% too high or X% too low from the average weighted price over the last Y minutes. | | "Filter failure: PERCENT_PRICE_BY_SIDE" | `price` is X% too high or Y% too low from the `lastPrice` on that side (i.e. BUY/SELL) | | "Filter failure: LOT_SIZE" | `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MIN_NOTIONAL" | `price` \* `quantity` is too low to be a valid order for the symbol. | | "Filter failure: ICEBERG_PARTS" | `ICEBERG` order would break into too many parts; icebergQty is too small. | | "Filter failure: MARKET_LOT_SIZE" | `MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MAX_POSITION" | The account's position has reached the maximum defined limit.

This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY`orders. | | "Filter failure: MAX_NUM_ORDERS" | Account has too many open orders on the symbol. | | "Filter failure: MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the symbol. | | "Filter failure: MAX_NUM_ICEBERG_ORDERS" | Account has too many open iceberg orders on the symbol. | | "Filter failure: TRAILING_DELTA" | `trailingDelta` is not within the defined range of the filter for that order type. | | "Filter failure: EXCHANGE_MAX_NUM_ORDERS" | Account has too many open orders on the exchange. | | "Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the exchange. | ## 10xxx - Crypto Loans ### -10001 SYSTEM_MAINTENANCE - The system is under maintenance, please try again later. ### -10002 INVALID_INPUT - Invalid input parameters. ### -10005 NO_RECORDS - No records found. ### -10007 COIN_NOT_LOANABLE - This coin is not loanable. ### -10008 COIN_NOT_LOANABLE - This coin is not loanable ### -10009 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10010 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10011 INSUFFICIENT_ASSET - Insufficient spot assets. ### -10012 INVALID_AMOUNT - Invalid repayment amount. ### -10013 INSUFFICIENT_AMOUNT - Insufficient collateral amount. ### -10015 DEDUCTION_FAILED - Collateral deduction failed. ### -10016 LOAN_FAILED - Failed to provide loan. ### -10017 REPAY_EXCEED_DEBT - Repayment amount exceeds debt. ### -10018 INVALID_AMOUNT - Invalid repayment amount. ### -10019 CONFIG_NOT_EXIST - Configuration does not exists. ### -10020 UID_NOT_EXIST - User ID does not exist. ### -10021 ORDER_NOT_EXIST - Order does not exist. ### -10022 INVALID_AMOUNT - Invalid adjustment amount. ### -10023 ADJUST_LTV_FAILED - Failed to adjust LTV. ### -10024 ADJUST_LTV_NOT_SUPPORTED - LTV adjustment not supported. ### -10025 REPAY_FAILED - Repayment failed. ### -10026 INVALID_PARAMETER - Invalid parameter. ### -10028 INVALID_PARAMETER - Invalid parameter. ### -10029 AMOUNT_TOO_SMALL - Loan amount is too small. ### -10030 AMOUNT_TOO_LARGE - Loan amount is too much. ### -10031 QUOTA_REACHED - Individual loan quota reached. ### -10032 REPAY_NOT_AVAILABLE - Repayment is temporarily unavailable. ### -10034 REPAY_NOT_AVAILABLE - Repay with collateral is not available currently, please try to repay with borrowed coin. ### -10039 AMOUNT_TOO_SMALL - Repayment amount is too small. ### -10040 AMOUNT_TOO_LARGE - Repayment amount is too large. ### -10041 INSUFFICIENT_AMOUNT - Due to high demand, there are currently insufficient loanable assets for {0}. Please adjust your borrow amount or try again tomorrow. ### -10042 ASSET_NOT_SUPPORTED - asset %s is not supported ### -10043 ASSET_NOT_SUPPORTED - {0} borrowing is currently not supported. ### -10044 QUOTA_REACHED - Collateral amount has reached the limit. Please reduce your collateral amount or try with other collaterals. ### -10045 COLLTERAL_REPAY_NOT_SUPPORTED - The loan coin does not support collateral repayment. Please try again later. ### -10046 EXCEED_MAX_ADJUSTMENT - Collateral Adjustment exceeds the maximum limit. Please try again. ### -10047 REGION_NOT_SUPPORTED - This coin is currently not supported in your location due to local regulations. ## 13xxx - BLVT ### -13000 BLVT_FORBID_REDEEM - Redeption of the token is forbiden now ### -13001 BLVT_EXCEED_DAILY_LIMIT - Exceeds individual 24h redemption limit of the token ### -13002 BLVT_EXCEED_TOKEN_DAILY_LIMIT - Exceeds total 24h redemption limit of the token ### -13003 BLVT_FORBID_PURCHASE - Subscription of the token is forbiden now ### -13004 BLVT_EXCEED_DAILY_PURCHASE_LIMIT - Exceeds individual 24h subscription limit of the token ### -13005 BLVT_EXCEED_TOKEN_DAILY_PURCHASE_LIMIT - Exceeds total 24h subscription limit of the token ### -13006 BLVT_PURCHASE_LESS_MIN_AMOUNT - Subscription amount is too small ### -13007 BLVT_PURCHASE_AGREEMENT_NOT_SIGN - The Agreement is not signed ## 12xxx - Liquid Swap ### -12014 TOO MANY REQUESTS - More than 1 request in 2 seconds ## 18xxx - Binance Code ### -18002 - The total amount of codes you created has exceeded the 24-hour limit, please try again after UTC 0 ### -18003 - Too many codes created in 24 hours, please try again after UTC 0 ### -18004 - Too many invalid redeem attempts in 24 hours, please try again after UTC 0 ### -18005 - Too many invalid verify attempts, please try later ### -18006 - The amount is too small, please re-enter ### -18007 - This token is not currently supported, please re-enter ## 21xxx - Portfolio Margin Account ### -21001 USER_IS_NOT_UNIACCOUNT - Request ID is not a Portfolio Margin Account. ### -21002 UNI_ACCOUNT_CANT_TRANSFER_FUTURE - Portfolio Margin Account doesn't support transfer from margin to futures. ### -21003 NET_ASSET_MUST_LTE_RATIO - Fail to retrieve margin assets. ### -21004 USER_NO_LIABILITY - User doesn’t have portfolio margin bankruptcy loan ### -21005 NO_ENOUGH_ASSET - User’s spot wallet doesn’t have enough BUSD to repay portfolio margin bankruptcy loan ### -21006 HAD_IN_PROCESS_REPAY - User had portfolio margin bankruptcy loan repayment in process ### -21007 IN_FORCE_LIQUIDATION - User failed to repay portfolio margin bankruptcy loan since liquidation was in process ## Order Rejection Issues Error messages like these are indicated when the error is coming specifically from the matching engine: - `-1010 ERROR_MSG_RECEIVED` - `-2010 NEW_ORDER_REJECTED` - `-2011 CANCEL_REJECTED` The following messages which will indicate the specific error: | Error message | Description | | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | "Unknown order sent." | The order (by either `orderId`, `clientOrderId`, `origClientOrderId`) could not be found. | | "Duplicate order sent." | The `clientOrderId` is already in use. | | "Market is closed." | The symbol is not trading. | | "Account has insufficient balance for requested action." | Not enough funds to complete the action. | | "Market orders are not supported for this symbol." | `MARKET` is not enabled on the symbol. | | "Iceberg orders are not supported for this symbol." | `icebergQty` is not enabled on the symbol | | "Stop loss orders are not supported for this symbol." | `STOP_LOSS` is not enabled on the symbol | | "Stop loss limit orders are not supported for this symbol." | `STOP_LOSS_LIMIT` is not enabled on the symbol | | "Take profit orders are not supported for this symbol." | `TAKE_PROFIT` is not enabled on the symbol | | "Take profit limit orders are not supported for this symbol." | `TAKE_PROFIT_LIMIT` is not enabled on the symbol | | "Price \* QTY is zero or less." | `price` \* `quantity` is too low | | "IcebergQty exceeds QTY." | `icebergQty` must be less than the order quantity | | "This action is disabled on this account." | Contact customer support; some actions have been disabled on the account. | | "This account may not place or cancel orders." | Contact customer support; the account has trading ability disabled. | | "Unsupported order combination" | The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. | | "Order would trigger immediately." | The order's stop price is not valid when compared to the last traded price. | | "Cancel order is invalid. Check origClientOrderId and orderId." | No `origClientOrderId` or `orderId` was sent in. | | "Order would immediately match and take." | `LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. | | "The relationship of the prices for the orders is not correct." | The prices set in the `OCO` is breaking the Price rules.

The rules are:

`SELL Orders`: Limit Price > Last Price > Stop Price

`BUY Orders`: Limit Price < Last Price < Stop Price | | "OCO orders are not supported for this symbol" | `OCO` is not enabled on the symbol. | | "Quote order qty market orders are not support for this symbol." | `MARKET` orders using the parameter `quoteOrderQty` are not enabled on this symbol. | | "Trailing stop orders are not supported for this symbol." | Orders using `trailingDelta` are not enabled on the symbol. | | "Order cancel-replace is not supported for this symbol." | `POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is on enabled the symbol. | | "This symbol is not permitted for this account." | Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) | | "This symbol is restricted for this account." | Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) | | "Order was not canceled due to cancel restrictions." | Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW`
or
`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. | ## Errors regarding POST /api/v3/order/cancelReplace ### -2021 Order cancel-replace partially failed This code is sent when either the cancellation of the order failed or the new order placement failed but not both. ### -2022 Order cancel-replace failed. This code is sent when both the cancellation of the order failed and the new order placement failed. --- ## Document: /products/pay/change-log URL: /en/dev-docs/products/pay/change-log # Change Log ## 2025-12-26 ### Time-sensitive Notice - **The following change to REST API will occur at approximately 2026-01-15 07:00 UTC:**
When calling endpoints that require signatures, percent-encode payloads before computing signatures. Requests that do not follow this order will be rejected with [`-1022 INVALID_SIGNATURE`](./error-code.md#-1022-invalid_signature). Please review and update your signing logic accordingly. ### REST API - Updated documentation for REST API regarding [Signed Endpoints examples for placing an order](./general-info.md#signed-endpoint-examples-for-post-apiv3order). --- ## 2021-11-19 - New endpoint: - `GET /sapi/v1/pay/transactions` support user query Pay trade history --- ## Document: /products/pay/Introduction URL: /en/dev-docs/products/pay/Introduction # Introduction Binance Pay is a growing payment solution that offers generous crypto rewards to users for paying and getting paid in crypto. --- ## Document: DApp Self-Testing Manual URL: /en/dev-docs/products/open-platform/self-testing-op # DApp Self-Testing Manual _SDK integration, DApps listing are independent. Well-tested DApps will help to reduce partly campaign workload._ ## Summary For all parties interested in cooperating with Binance Web3 Wallet, this manual contains all relevant information, including [integrating the Binance Web3 Connect SDK](/products/web3-connect/introduction) and **joining the Binance Web3 Wallet Dapp Zone**. **Self-testing** by the project party is essential. The Binance Web3 Wallet team strongly recommends that all projects complete self-testing according to the provided instructions to maximize user experience. Binance reserves the right to reject applications from projects that demonstrate low testing quality. Please read the following information carefully. ## How to test dApp 1. Type your url in the latest Binance Web3 wallet browser. 2. Test all the features in DApps. You could refer to the following test case checklist for guidance. ![browser-entry](/img/web3-dapp/browser-entry.png) ## Frequent Problems ### Error Code : ‘Network not supported for this wallet’ Project website should detect and change to the corresponding chain when users connect. For BEVM, check the `window.ethereum` chainId to change to the correct chain. ### IOS/Android Login Problem Check SDK status and Internet/VPN connection. ### RPC problem When testing on chain actions, projects might find the gas fee abnormally high. In this situation, projects could try the test with Trust Wallet and other Wallets like Metamask. If it only happens in Trust Wallet and Binance Wallet, it would be Binance’s RPC issue. Please contact Jasmine G @P0kEjasmine if this happens. ### Mobile Login Issue Ensure that the Binance App version for both IOS and Android is updated to the **latest version**. ## Test Case Checklist ### SDK | Category | Feature (Web, IOS and Android) | | ---------------- | -------------------------------------------------------------------------------------------------------------------- | | Connect Wallet | Can get wallet address and chainID. | | Send Transaction | The whole transaction process should be successful and can be checked on the chain. | | Sign message | The signature value should be valid | | Logo exposure | E.g.
| ### dApps | Category | Feature (IOS and Android) | | ---------------- | ------------------------------------------------------------------------------------- | | Connect Wallet | Wallet connects successfully and stably. (Without page redirection) | | | Binance Logo Exposure Success (Web & App) | | Send Transaction | All send transaction cases are successful. (e.g. Swap, Approve, etc.) | | | The gas fee is in the normal range. | | User Experience | The font size and icons are displayed appropriately. | | | All the URLs in the dApp can be opened in Binance directly. | | | The project will automatically switch to the user's current chain if it is supported. | | | All cases should be checked in both IOS and Android | --- ## Document: DApp Self-Listing Manual URL: /en/dev-docs/products/open-platform/self-listing-op # DApp Self-Listing Manual ## Introduction This manual is intended as a guide for any dApp team looking to include their dApp in Binance's Web3 wallet dApp Zone. All project parties who want to cooperate with Binance Web3 wallet must have approval for all the dApps they intend to work with. Therefore, all the teams will need to go through a self-testing process to ensure that the dApps and **Binance Web3 Wallet SDK integration functions** are implemented in both Binance Web3 Wallet on Binance App and PC as scheduled. Only dApps that pass the quality control process will be allowed to enter the review process. ![dApp Zone](/img/web3-dapp/dapp-zone.png) **Please Notice:** 1. All submitted applications are expected to receive review results within 7 business days. 2. Applicants are allowed to check the approval process in [Binance Web3 Wallet Open Platform](https://www.binance.com/en/web3-wallet-open-platform). ## How to apply? 1. Log in Binance Binance Web3 Wallet Open Platform : https://www.binance.com/en/web3-wallet-open-platform 2. Read the Open Platform Vendor Agreement: https://public.bnbstatic.com/static/pdf/open_platform_vendor_terms_180924.pdf 3. Click [dApp],then click [Apply] in the subpage. ![dapp-in-op](/img/web3-dapp/dapp-in-op.png) 4. Fill in the [application form](https://www.binance.com/en/web3-wallet-open-platform/project/dapp/application). ![apply-in-op](/img/web3-dapp/apply-in-op.png) 5. After completing the application form, the status in the Application Management page will change to ‘in Review’. ![review-in-op](/img/web3-dapp/review-in-op.png) 6. Binance will conduct a quality control test using the [self-test checklist](/products/web3-dapp/self-testing#test-case-checklist) within 7 business days of application approval. A full self-test is a prerequisite for self-listing. Binance will only list the DApps that have completed the [Binance Web3 wallet integration](/products/web3-connect/introduction) (including Binance Logo exposure) and pass all items in the [self-test checklist](/products/web3-dapp/self-testing#test-case-checklist). --- ## Document: How to Create an Airdrop Campaign on Binance Web3 Open Platform? URL: /en/dev-docs/products/open-platform/airdrop-creation # How to Create an Airdrop Campaign on Binance Web3 Open Platform? ## Airdrop Campaign Overview | **Owner** | **Step** | **Description** | | --------- | ---------------------- | ------------------------------------------------ | | Project | Campaign preparation | List your dApp and develop your API | | | Campaign configuration | Set up airdrop campaign | | | Funds deposit | Deposit campaign reward | | | Submit campaign | Submit the campaign to Binance | | Binance | Campaign review | Binance reviews the campaign setting and approve | | | Campaign launch | Binance list campaign on Web3 Wallet | ## Airdrop Campaign Tutorial ### Campaign preparation - Develop API for the on-chain tasks, and register the API on Open Platform > Airdrop Campaign > Task Verification API - API specifications: [Doc](/products/web3-task-verification/apis) - API registration: - Click on the “+ Create New API” button ![create-new-api](/img/web3-dapp/create-new-api.png) - Input the API Name and the API Pre-fix.
API Name: Give your API an arbitrary name. It is an unused variable.
API Pre-Fix: Initial segment of your API URL path. Please contact your dev in charge of the API development to get the API Pre-Fix. ![create-popup](/img/web3-dapp/create-popup.png) ### Campaign configuration - **Start to create a new Airdrop:** - Click on the “+ Create Airdrop” button to create a new airdrop campaign. - Note: All settings can not be changed after you submit the airdrop campaign, so please make sure and re-check after you finish the configuration. ![create-airdrop](/img/web3-dapp/create-airdrop.png) - **Step1: Basic information setting** - Airdrop Name: the title of this airdrop campaign which can be seen by users. E.g.: Binance 1M$ BNB Airdrop! - Airdrop Period(UTC): the airdrop campaign start date and time, and end date and time\ Please set up a test campaign with an immediate start date first for Binance Wallet team to test and sign off for you to set up the official campaign again for the launch. The test campaign should have everything else ready and equal to your formal campaign but the actual launch date and the reward amount. - Airdrop Rules Link: the page links to a page to introduce the campaign rules. - Airdrop Rules Highlight: the highlights of this airdrop campaign mechanism. In the campaign rules link, the project should include the general background of this campaign, the pre-requirement for users to participate, the task design with as precise as possible details for example on which chain for how many tokens etc, and the eligibility criteria for users to receive reward. A tutorial is recommended as the last section of this page to increase the task completion rate. - Campaign chain: the campaign chain, and rewards claim chain. Please note these two chains will have to be the same so that your users can successfully claim the reward later. - Total rewards: the total reward description in the sum of this airdrop campaign. - Campaign rewards type: 2 types supported - Token (Pending TGE): applicable for tokens has not launched now. - Token (Completed TGE): applicable for tokens launched already. ![campaign-form](/img/web3-dapp/campaign-form.png) - Token (Pending TGE) application flow: - This process is only needed when you select the Token (Pending TGE) type of reward. - Click on the “Contact” button and fill in the necessary information. And then wait for Binance’s approval. Alternatively, you can directly reach out and share your Campaign ID with your POC at Binance Wallet to whitelist your Campaign ID and thus you can proceed for the next step. ![campaign-form-2-1](/img/web3-dapp/campaign-form-2-1.png) - **Step2: Eligibility setting** - Anti-Sybil Level setting: - Level 1: 1 wallet address can join the campaign once, and claim rewards once (once the wallet address completes tasks). - Level 2: 1 Binance user (identified by Binance account UID) can join the campaign once, and claim rewards once. - Level 3: 1 real users (identified by Binance account UID, and excluded batch registration user) can join the campaign once, and claim rewards once. - Please make sure to have a consistent description in your rules page regarding campaign participation eligibility. - Restricted Countries / Regions for Participants - Users from the countries/regions you selected will be blocked when they try to join your airdrop campaign. - Please select based on your product’s geo-blocking rules. ![campaign-form-2-2](/img/web3-dapp/campaign-form-2-2.png) - **Step3: Task/Reward setting** - Select templates: - Select an option based on how many dApps will be included in this campaign: - Single dApp: you will only ask users to interact with one dApp to complete the on-chain tasks - Multiple dApps: you will ask users to interact with multiple dApps to complete different on-chain tasks ![campaign-form-3-1](/img/web3-dapp/campaign-form-3-1.png) - Select your Dapp: - Click the “Add dApp” button to select your dApp - _Note: you only can select dApps listed on Binance. If you can not find your dApp, please submit your dApp listing application first._ ![campaign-form-3-2](/img/web3-dapp/campaign-form-3-2.png) - Add task - 2 Task Type:  - On-chain task: requires users to execute some on-chain actions. - Social task: require users to follow X account / Repost X post. * On-chain task:  - Task Title: a summary text for the task. E.g., Stake task - Task Tutorial Link: a page link redirects to the task tutorials. It is highly recommended to add a tutorial for on-chain tasks. - Please input the full URL including “https\://” - dApp URL for the task: the link user can finish the task.  - Please input the full URL including “https\://” - Task description: a detailed description of the task content. Please make sure your task description contains precise details: on which chain, for how many tokens and avoid confusions regarding the token number and values etc. A detailed and precise will greatly help you avoid unnecessary customer support pressure. - A good example: Swap 2 $BNB token on BSC chain. (Assume the current price is $700/BNB) - A bad example: Swap 1400 $BNB. - No instruction on which chain - Confusion about 1400 dollar worth of BNB or 1400 BNB - Token price is often fluctuating. To insure your API can successfully verify the task completion status over the campaign period, we require projects to specify the number of tokens instead of dollar value of tokens. - Task verification: select your API registered and input your task ID.  - If you can not find your API, please go to Open Platform > Airdrop Campaign > Task Verify API to register your API first. - Please ensure the task ID you use is provided and confirmed by your dev. Task ID is a string identifier used to represent a specific task within the `task` parameter of the API. ![new-task](/img/web3-dapp/new-task.png) - Social task - Social Channel: now only X is supported. - Task Content:  - Follow an X account: require users to follow an X account. - Need to input X username. Please don’t include @ in the username. - Repost an X post: require users to repost an X post.  - Need to input the X post link. Please make sure to include https :// in the link. - The repost content is required to be related with Binance Wallet and please do have your POC at Binance Wallet preview and approve the content in advance. - If your project would like to have users to repost about the on-going campaign announcement, please reach out to your POC at Binance Wallet and synchronize the timeline and to-dos in advance so that your link can be updated in time once your post and campaign are live. ![social-task](/img/web3-dapp/social-task.png) - **Reward:** - **3 Reward Type:** - Task Reward: for users who complete the task. - Enable the reward by toggling on the “Enable Task Reward” toggle. ![reward-type](/img/web3-dapp/reward-type.png) - DApp Completion Reward: for users who complete all tasks under a dApp. Only available when the “Multiple DApps” template is selected. - Enable the reward by toggling on the “DApp Completion Reward” toggle. ![reward-toggle](/img/web3-dapp/reward-toggle.png) - Airdrop Completion Reward: for users who complete all tasks under a dApp.  - Enable the reward by toggling on the “Airdrop Completion Reward” toggle. ![completion-reward](/img/web3-dapp/completion-reward.png) - **Reward Setting:**  - All the 3 Reward types share the same setting. The setting is different based on the Rewards Mechanism you selected. | Rewards Mechanism | Description | Settings | | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | FCFS (First come first serve) | Users who complete the task first to get a share of the reward, which is a fixed amount. | • Rewards Type: Only can select Token (Completed TGE)
• Chain: the same with your Campaign chain
• Number of Winners: the reward share amount
• Token Name:
- If the token is a native token, then select from the dropdown list
- If the token is not a native token, then input the token smart contract address
• Reward per Winner: the amount of tokens for each winner
• Please do not ask all the users to verify their task completion status at once - e.g. verify your holding status on January 1 23:59 UTC - to avoid unnecessary API queries crash from your side | | Shared | Users who completed the task split the reward pool equally, the reward amount is the Total Reward / User who completed the task. | • Rewards Type: Can select both of the 2 token types
• Chain: same with FCFS
• Number of Winners: the maximum number of users who can share the reward pool
• Token Name: same with FCFS
• Total Reward: the total reward amount | | Lucky Draw | Select a certain amount of users from all users who complete the task | • Rewards Type: can select both of the 2 token types
• Chain: same with FCFS
• Number of Winners: the number of users will be selected
• Token Name: same with FCFS
• Reward per Winner: the reward amount for each user | ![edit-dapp-reward](/img/web3-dapp/edit-dapp-reward.png) - After you finish the setting, click on the “Submit” button and notify your campaign POC at Binance Wallet to check your submission and kick off review and testing process. ![submit-campaign](/img/web3-dapp/submit-campaign.png) - **Step4: Deposit the rewards** - For campaigns including Token (Completed TGE), click the “Deposit” button to finish the reward deposit. Please do note that incompletion of deposit will lead to failure of campaign submission and thus potential delays of your campaign launch, so please do align with your finance team in advance. - For campaigns only with Token (Pending TGE), you don’t need to deposit. ![deposit-reward](/img/web3-dapp/deposit-reward.png) - **Step5: Submit airdrop campaign** - Click on the submit button to submit the campaign for Binance review. - Usually, Binance needs 7 working days to finish the campaign review. - If the campaign is approved: you can find the campaign status in Waiting Online/ Online status. After that, your campaign will be listed on Web3 Wallet. - If the campaign is rejected: you’ll see the campaign in rejected status. And you can modify the campaign and resubmit. ![campaign-submit](/img/web3-dapp/campaign-submit.png) --- ## Document: /products/onchainpay-x402/quick-start URL: /en/dev-docs/products/onchainpay-x402/quick-start # Quick Start Follow these steps to integrate x402 into your application. ### 1. Apply for an Account Register as a partner and obtain your API credentials (`clientId` and `accessToken`). **[Apply here](https://forms.gle/aUQvxUETfGMzyTky5).** See [Apply partner developer account](basics/6.apply-developer-account.md) for the full onboarding process and required materials. ### 2. Understand the Basics Before coding, review these foundation documents: - [Common API request headers](basics/1.common-request-headers.md) - [Common API response](basics/2.common-response.md) - [API request signing](basics/3.request-signing.md) - [Environments and API base URLs](basics/4.base-urls.md) ### 3. Query Supported Configurations Call **POST** `{BASE_URL}/papi/v2/b402/supported` to retrieve the supported payment kinds, networks, tokens, and signer addresses. Cache the response — this data changes infrequently and should be refreshed periodically rather than on every request. See [Get Supported Configurations (V2)](open-apis-v2/1.get-supported-configurations.md). #### Your first signed request Once you have your `clientId`, `accessToken`, and Base64 PKCS#8 private key, the snippet below makes a signed `/supported` call end-to-end. Substitute `{BASE_URL}` with the value provided to you during onboarding (see [basics/4.base-urls.md](basics/4.base-urls.md)). `PRIV_KEY_B64` is the contents of `private_key.base64` produced in [API request signing — Step 1](basics/3.request-signing.md). ```python # Dep: pip install pycryptodome import base64, json, time, urllib.request from Crypto.PublicKey import RSA from Crypto.Signature import pkcs1_15 from Crypto.Hash import SHA256 BASE_URL = "" CLIENT_ID = "" ACCESS_TOKEN = "" PRIV_KEY_B64 = "" body = "{}" timestamp = str(int(time.time() * 1000)) to_sign = (body + timestamp).encode("utf-8") priv = RSA.import_key(base64.b64decode(PRIV_KEY_B64)) signature = base64.b64encode( pkcs1_15.new(priv).sign(SHA256.new(to_sign)) ).decode() req = urllib.request.Request( f"{BASE_URL}/papi/v2/b402/supported", data=body.encode(), method="POST", headers={ "Content-Type": "application/json", "X-Tesla-ClientId": CLIENT_ID, "X-Tesla-SignAccessToken": ACCESS_TOKEN, "X-Tesla-Timestamp": timestamp, "X-Tesla-Signature": signature, }, ) with urllib.request.urlopen(req) as r: print(r.status, json.dumps(json.loads(r.read()), indent=2)) ``` A successful call returns `200` and a JSON body with `kinds`, `extensions`, and `signers` — confirming your signing flow works end-to-end. ### 4. Return HTTP 402 to Buyers When a client requests a paid resource, respond with HTTP **402 Payment Required** and include payment requirements in the response. Use the data from `/supported` to populate the `X-PAYMENT-REQUIREMENTS` header with the accepted token, network, amount, and recipient address. > ⚠️ **Echo the full `extra` object from `/supported` verbatim.** Your 402 response must copy the > entire `kinds[].extra` object into `paymentRequirements.extra` — `name`, `version`, > `assetTransferMethod`, `signerAddress`, and (for `permit2-*`) `spenderAddress`. Buyers do not have > access to `/supported` — they rely entirely on what you send in the 402 response to build the > EIP-712 typed-data domain and a valid Permit2 signature. See > [Forwarding Addresses to Buyers (V2)](open-apis-v2/1.get-supported-configurations.md#forwarding-addresses-to-buyers-merchant-responsibility). ### 5. Verify Payment When a client resubmits the request with a signed payment payload, call **POST** `{BASE_URL}/papi/v2/b402/verify` to validate the buyer's EIP-712 signature off-chain before proceeding to submission. See [Verify Payment (V2)](open-apis-v2/2.verify-payment.md). ### 6. Submit Payment If verification passes, call **POST** `{BASE_URL}/papi/v2/b402/settle` to execute the on-chain token transfer. Gas is sponsored — funds move directly from the buyer's wallet to your wallet. See [Settle Payment (V2)](open-apis-v2/3.settle-payment.md). --- > **Note:** It is recommended to start with the **Sandbox (Testnet)** environment first. Refer to > [Environments and API base URLs](basics/4.base-urls.md) for Sandbox and Production base URLs. --- ## Document: /products/onchainpay-x402/introduction URL: /en/dev-docs/products/onchainpay-x402/introduction # B402 B402 is Binance's implementation of the [x402 payment protocol](https://github.com/coinbase/x402) on BNB Smart Chain. It enables instant, automatic stablecoin payments directly over HTTP — services charge buyers (human users or autonomous AI agents) per request, settled on-chain in seconds, with gas sponsored by B402. The recommended `/papi/v2/b402/*` API conforms to the [x402 v2 specification](https://github.com/coinbase/x402/blob/main/specs/x402-specification-v2.md); a V1 API (`/papi/v1/b402/*`) is also available for legacy clients. ### Who B402 is for - **Sellers** — API providers, paywall operators, AI tool authors, and microservice owners who want to monetize HTTP endpoints per request without building wallets, billing, or subscription infrastructure. - **Buyers** — AI agents, dApps, and HTTP clients that pay for resources autonomously by signing EIP-712 authorizations. Buyers do not run wallets or hold gas — they sign off-chain and B402 executes the on-chain transfer. ### Use cases - **Per-request API billing** — charge fractions of a cent per call without managing API keys or invoices. - **AI agent payments** — let autonomous agents pay for tools, data, and inference without human-in-the-loop credentials. - **Paywalled content** — gate articles, downloads, or premium endpoints with HTTP 402. - **Microservice metering** — charge internal or external consumers per call against a shared contract. - **Discovery of paid endpoints** — be found by AI agents via [B402 Bazaar](b402-bazaar.md) without manual onboarding. ### How It Works The x402 protocol leverages the HTTP `402 Payment Required` status code to create a standardized payment flow for web resources: 1. A client requests a paid resource from the seller. 2. The seller responds with HTTP **402** and includes payment requirements (token, amount, recipient address, and the addresses needed to construct an EIP-712 signature) in the response body. 3. The buyer signs an EIP-712 authorization off-chain (no on-chain transaction needed from the buyer). 4. The buyer resubmits the request with the signed payment attached. 5. The seller calls B402 to **verify** the signature and then **settle** the payment on-chain. 6. B402 sponsors the gas and executes the token transfer directly from buyer to seller. 7. The seller delivers the paid resource. For the full sequence diagram and step-by-step walkthrough, see [Typical integration flow](basics/8.typical-integration-flow.md). ### Key roles | Role | Description | | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Buyer** (AI agent / user) | The payer who signs an EIP-712 authorization off-chain to approve the token transfer. Can be a human user or an autonomous AI agent. | | **Seller** (merchant / developer) | Provides paid APIs or services. Integrates B402 via HTTP. Forwards the buyer's signed payment to the B402 facilitator for verification and execution. | | **Facilitator** (B402) | Verifies signatures off-chain (`/verify`), then sponsors gas and executes the on-chain token transfer (`/settle`). All token transfers occur strictly peer-to-peer on the public blockchain from the buyer's wallet directly to the merchant's wallet. | ### Key features - **Stateless** — no sessions, accounts, or held balances. Each request is its own transaction. - **HTTP-native** — payments flow through standard request/response with the `402` status code. Works with any HTTP server, framework, or client. - **Gas-sponsored** — sellers don't need BNB to operate. B402 pays the gas for every settle. - **Multiple payment methods** — `eip3009` for native EIP-3009 tokens (U, USD1) and `permit2-exact` / `permit2-upto` for any ERC-20 (USDC, USDT, etc.). - **Discoverable** — opt your endpoints into [B402 Bazaar](b402-bazaar.md) for AI-agent discovery simply by attaching metadata on settle. - **CDP wire-shape compatible** — the V2 `PaymentPayload` and Bazaar metadata blob match Coinbase's x402 spec field-for-field, so client libraries built for CDP work against B402 with one URL change. ### Supported payment methods | Token | Contract (BSC Mainnet) | `eip3009` | `permit2-exact` | `permit2-upto` | | -------- | -------------------------------------------- | :-------: | :-------------: | :------------: | | **U** | `0xcE24439F2D9C6a2289F741120FE202248B666666` | ✅ | ✅ | ✅ | | **USD1** | `0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d` | ✅ | ✅ | ✅ | | **USDT** | `0x55d398326f99059fF775485246999027B3197955` | — | ✅ | ✅ | | **USDC** | `0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d` | — | ✅ | ✅ | | Method | Description | | --------------- | ---------------------------------------------------------------------------------------------------------------- | | `eip3009` | EIP-3009 native `transferWithAuthorization`. Only available for tokens with built-in EIP-3009 support (U, USD1). | | `permit2-exact` | Permit2 exact-amount transfer. Works with any ERC-20 token. | | `permit2-upto` | Permit2 up-to-amount transfer (pay-as-you-go). Works with any ERC-20 token. | ### Current status B402 is **live on BNB Smart Chain (BSC) Testnet** for external partner onboarding. Production (BSC Mainnet) access is granted on request — [apply here](https://forms.gle/aUQvxUETfGMzyTky5) to get your API credentials. See [Environments and API base URLs](basics/4.base-urls.md) for endpoint details. Expansion to other EVM-compatible networks is planned. ### What to read next - [Quick Start](quick-start.md) — step-by-step guide to your first integration. - [Typical integration flow](basics/8.typical-integration-flow.md) — full sequence diagram and per-step explanation of the protocol. - [Integration Guideline](integration-guideline.md) — production prerequisites, rate limits, and security best practices. - [B402 Bazaar](b402-bazaar.md) — make your endpoint discoverable to AI agents. - [Open APIs V2](open-apis-v2/1.get-supported-configurations.md) — detailed API reference for `/supported`, `/verify`, and `/settle` (x402 v2 spec-conformant). - [Permit2 Signing Guide](open-apis-v2/4.permit2-signing.md) — the EIP-712 typed data shape for Permit2 signatures, with viem and ethers.js v6 reference implementations. --- ### Disclaimer This documentation describes Binance x402 (B402), a developer-facing technical service that supports verification of user-signed x402-compatible payment payloads and submission of corresponding on-chain transactions on supported blockchain networks. Binance x402 (B402) is provided as technical infrastructure and software tooling only. It is not intended to constitute, and should not be construed as, any of the following: - a bank account, deposit, stored-value facility, e-money product, or custodial wallet; - a payment account, payment instrument, remittance, money transmission, or funds transfer service; - brokerage, exchange, dealing, clearing, settlement assurance, or other regulated financial service; - investment, legal, tax, accounting, or regulatory advice; - an offer, invitation, solicitation, recommendation, or endorsement to buy, sell, hold, transfer, or use any digital asset, token, or network. B402 does not take possession, custody, or control of user funds or payment tokens as part of the standard flow described in this documentation. In the supported integration model, digital assets move directly on-chain between addresses designated by the user and the merchant or service provider. B402's role is limited to technical functions such as message validation, signature verification, transaction submission, and related API support on supported networks. Use of B402 does not relieve any developer, merchant, integrator, application provider, or other participant of its own responsibility to assess and comply with all applicable laws, rules, regulations, licensing, sanctions, tax, consumer protection, data protection, and disclosure obligations in each relevant jurisdiction. Each integrator remains solely responsible for: - determining whether and how B402 may be used in its product or service; - ensuring that all required notices, disclosures, consents, and terms are provided to end users; - evaluating whether any activity involving digital assets, blockchain-based transfers, or service monetization may be regulated in applicable jurisdictions; - implementing its own compliance, fraud prevention, transaction monitoring, screening, risk management, and customer support processes as required. Blockchain networks, smart contracts, token standards, third-party wallets, signatures, RPC infrastructure, and related software involve operational, technical, and legal risks, including failed transactions, reversibility limitations, network congestion, software bugs, forks, validator or sequencer issues, smart contract vulnerabilities, signature misuse, incorrect addressing, and asset loss. On-chain transactions may be irreversible once confirmed. Binance x402 (B402) does not guarantee transaction success, network availability, confirmation times, compatibility, merchant outcomes, user solvency, or continued support for any blockchain, token, standard, or integration. This documentation is provided for general informational and integration purposes only and may be updated, suspended, or withdrawn at any time. Access to or use of B402 may be subject to separate eligibility requirements, onboarding, contractual terms, technical restrictions, and jurisdictional limitations. Availability may differ by entity, user type, product configuration, and region. To the extent permitted by applicable law, Binance x402 (B402) and its providers disclaim liability for indirect, incidental, consequential, special, exemplary, or punitive damages, and for losses arising from third-party acts or omissions, blockchain events, token issuer actions, smart contract behavior, wallet compromise, configuration errors, unsupported use cases, or user/integrator non-compliance. You should obtain independent legal, regulatory, tax, and technical advice before deploying Binance x402 (B402) in production. --- ## Document: /products/onchainpay-x402/integration-guideline URL: /en/dev-docs/products/onchainpay-x402/integration-guideline # Integration Guideline This guide covers production-readiness considerations for a B402 integration: security, rate limits, and settlement response timing. For the step-by-step integration flow, see [Quick Start](quick-start.md). ### Prerequisites Before you begin, ensure you have completed the partner onboarding and obtained your API credentials (`clientId` and `accessToken`). See [Apply partner developer account](basics/6.apply-developer-account.md) for the full list of required materials and onboarding steps. ### Security Best Practices - **Forward the full `extra` object to buyers in every 402 response.** When returning HTTP `402 Payment Required`, copy the entire `kinds[].extra` from the cached `/supported` response into `paymentRequirements.extra` — `name`, `version`, `assetTransferMethod`, `signerAddress`, and (for `permit2-*`) `spenderAddress`. Buyers cannot call `/supported` themselves (it requires merchant credentials) and need these to build the EIP-712 typed-data domain and a valid Permit2 signature. Do not hardcode — `/supported` is the single source of truth; missing or stale values cause buyer signatures to be rejected. - **Store your private key securely.** Never expose your RSA private key in client-side code, public repositories, or logs. - **Always verify before settling.** Call `/verify` to validate the buyer's EIP-712 signature before calling `/settle`. Never settle an unverified payment. - **Use IP whitelisting.** Restrict API access to your registered server IPs to prevent unauthorized calls. - **Validate settlement responses.** Check the `success` field and on-chain `transaction` hash in the settlement response to confirm the transfer completed successfully. See [Payment status](basics/7.payment-status.md). - **Guard against duplicate settlements.** Track payment identifiers to prevent settling the same payment more than once. B402 enforces idempotency on `(nonce, network, payer)`, but merchants should guard at their application layer as well. ### Rate Limits | Endpoint | Limit | | ---------------------- | ----------------------------- | | `/papi/v2/b402/verify` | 100 requests/sec per merchant | | `/papi/v2/b402/settle` | 20 requests/sec per merchant | Exceeding the rate limit returns HTTP `429 Too Many Requests`. Implement exponential backoff and retry logic on the client side. ### Settlement Response Times | Transaction Amount | Estimated Response Time | | ------------------ | ----------------------- | | Small amounts | ~10 seconds | | Medium amounts | ~25 seconds | | Large amounts | ~45 seconds | > **Note:** These are estimates. Actual response times depend on network congestion and are adjusted > dynamically. For large transactions, consider an asynchronous callback or polling pattern rather > than blocking on the settlement response. --- ## Document: /products/onchainpay-x402/change-log URL: /en/dev-docs/products/onchainpay-x402/change-log # Change Log | Date | Description | | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 2026-06-24 | Corrected the B402 Bazaar BAPI envelope description on [Environments and API base URLs](basics/4.base-urls.md) — `messageDetail` was missing from the prose summary `{code, message, data, success}`. Live responses always carry `messageDetail` (it's `null` on success, populated on some errors). The full JSON example on [B402 Bazaar — Verifying your listing](b402-bazaar.md#verifying-your-listing) was already correct; this fixes the prose-only mention. No API behavior change. | | 2026-06-23 | Published the public B402 Bazaar discovery base URL (`https://www.binance.com/bapi/ramp/v1/public/ramp/b402`) and corrected the discovery endpoint paths (`/bazaar/{resources, search, merchant}`) on the [B402 Bazaar](b402-bazaar.md) page — previously placeholder-only. Restructured [Environments and API base URLs](basics/4.base-urls.md) into two tables (authenticated `/papi/v2/b402/*` vs. public discovery) so the discovery URL is hardcodable and the auth-gated URLs remain handed-out at onboarding. Documented the BAPI envelope wrapping discovery responses (`{code, message, messageDetail, data, success}`) with the CDP-shape catalog inside `data`, plus the full `/search` filter set (`network` / `asset` / `scheme` / `payTo` / `maxUsdPrice`). Refreshed the [Introduction](introduction.md) to lead with audience, use cases, and a key-features list — same legal disclaimer, no API behavior changes. | | 2026-06-04 | Added [B402 Bazaar](b402-bazaar.md) merchant guide. Documents the opt-in discovery flow: attach `extensions.bazaar = {info, schema, routeTemplate?, description?}` on V2 settle (CDP wire-shape compatible) to make a paid endpoint discoverable to AI agents via the upcoming `/v1/b402/discovery/*` API. Updated the `paymentPayload.extensions` field description on `/papi/v2/b402/verify` to point at the new page. | | 2026-05-29 | Re-introduced `invalidMessage` (verify) and `errorMessage` (settle) debug fields on the V2 wire, gated to structural-error codes only — `invalidMessage` for `invalid_payload` / `invalid_payment_requirements`; `errorMessage` for `invalid_payload`. Spec-strict codes (signature/authorization failures, on-chain reverts, `insufficient_funds`) remain message-free; debug context for those is retained in server logs only. `confirmations` remains dropped. Driven by integrator feedback that an opaque `invalid_payload` on the V2 wire left no path to self-diagnose payload-shape mistakes. Also corrected two prose mentions of `invalid_exact_evm_permit2_payload_spender` to `invalid_payload` — the internal code is collapsed to `invalid_payload` on the wire and the original string is never emitted. | | 2026-05-19 | Corrected `decimals` column in `Supported payment methods`. All four BSC mainnet tokens (U, USD1, USDC, USDT) and BSC testnet USDT were listed as 6 decimals; on-chain `decimals()` returns 18 for each. Merchants who priced API calls assuming 6 decimals (e.g. `amount: "10000"` for $0.01) were charging 1e-14 of a token instead — re-encode amounts against 18 decimals before going to production. Added a note on the page reminding integrators to verify decimals on chain when in doubt. | | 2026-05-14 | Added Permit2 signing guide (`open-apis-v2/4.permit2-signing.md`) covering the EIP-712 typed data shape (`PermitWitnessTransferFrom` + `TokenPermissions` + `Witness`), field semantics, viem and ethers.js v6 TypeScript reference implementations, wire envelope format, common pitfalls, and end-to-end walkthrough. Aimed at merchants integrating `permit2-exact` for assets without EIP-3009 support (e.g. USDT on BSC), where the stock `@x402/evm` client ships no Permit2 signer. Cross-linked from `/verify` page. | | 2026-05-11 | V2-first merchant onboarding pass: restructured `API request signing` into Overview → Step 1 keygen (OpenSSL only, PKCS#8) → Step 2 sign (Python default, Node.js + Java alternates) → Step 3 headers → Postman (optional) → Troubleshooting. Swapped Quick Start and Integration Guideline to V2 endpoints; added runnable signed-`/supported` Python snippet to Quick Start using `{BASE_URL}` placeholder; dropped "Deliver the Resource" step. Promoted "Open APIs V2" above "Open APIs V1" in the nav and added a V2-recommendation note on V1 pages. Updated `Payment status` for the V2 settle response shape (`transaction` always-present string). Fixed factual bug in `Supported payment methods` (`eip3009` supports U and USD1, not USDC). Fixed `GET /supported` → `POST /supported` in typical-integration-flow. | | 2026-05-07 | V2 spec-alignment patch: `paymentPayload.resource` is now a `ResourceInfo` object `{url, description, mimeType}` at the top level of `PaymentPayload` per x402 v2 §5.1. Removed `resource` / `description` / `mimeType` / `outputSchema` from `paymentRequirements`. Settle response now always emits `transaction` and `network` (empty string `""` on pre-broadcast failure) — spec-Required per §5.3.2. New **Deviations from x402 v2 spec** section on the `/verify` page explicitly lists b402 extensions that remain unchanged (`POST /supported`, `upto` scheme, Permit2 methods, `settleAmount`, `extra` fields, `unexpected_*_error` codes). Breaking wire change — coordinate with integrators. V1 endpoints unchanged. | | 2026-05-05 | Added B402 V2 API (`/papi/v2/b402/*`): CAIP-2 signers wildcard namespace, x402 v2 `PaymentPayload` shape with top-level `accepted` + `resource`, split `extra.signerAddress` + `extra.spenderAddress` replacing the overloaded `extra.facilitatorAddress`, `scheme: "upto"` introduced for `permit2-upto`. `invalidMessage` / `confirmations` / `errorMessage` dropped from wire in favour of x402 v2 spec-strict conformance. V1 endpoints remain frozen and unchanged. | | 2026-04-22 | Added U and USD1 token support; restructured Supported Payment Methods into token×method matrix; `eip3009` now limited to U and USD1 (USDC/USDT use permit2 only); expanded `/supported` response example with all 10 kinds; updated `/verify` and `/settle` EIP-3009 examples to use U token; updated token contracts reference table; updated service description and added Disclaimer section | | 2026-04-13 | Initial release of B402 Open API documentation | --- ## Document: /products/onchainpay-x402/b402-bazaar URL: /en/dev-docs/products/onchainpay-x402/b402-bazaar # B402 Bazaar B402 Bazaar is the discovery layer for B402-registered paid endpoints. AI agents (and any other client) can search the Bazaar to find HTTP APIs and MCP tools that accept x402 payments — without anyone pre-configuring a list. As a merchant, you opt your endpoint in by attaching a metadata blob to your normal V2 settle call. Bazaar indexes you within ~30 seconds of the first confirmed settle carrying that blob. > **Status: opt-in and free.** No separate registration, no contract, no back-office signup. You > declare metadata on your V2 settle, Bazaar picks it up. > **Coinbase CDP wire-shape compatible.** The blob shape matches > [CDP's x402 Bazaar extension spec](https://github.com/coinbase/x402/blob/main/specs/extensions/bazaar.md) > field-for-field. If your code already produces a CDP-compatible bazaar blob (e.g. via > `@coinbase/x402-fetch` or the Python SDK), the same blob works against B402 — just point at our > settle endpoint. ### How It Works ``` Your endpoint ─▶ V2 settle (with bazaar blob) ─▶ B402 ─▶ on-chain confirm │ ▼ Bazaar indexer (30s tick) │ ▼ /bazaar/* (public discovery catalog) ``` 1. A buyer (usually an AI agent) calls your paid endpoint with an x402 V2 payment header. 2. You forward the payment to B402's `/papi/v2/b402/settle` with `paymentPayload.extensions.bazaar` populated. 3. B402 confirms the on-chain settle and stores the blob. 4. Bazaar's indexer picks up the row on its next 30-second tick and upserts your resource into the catalog. 5. Agents searching the Bazaar see your endpoint in the results. **First appearance:** typically within 30–60 seconds of the first confirmed V2 settle. Failed or timed-out settles do not count toward indexing. **Updating metadata:** subsequent settles with a different blob overwrite the stored row's metadata (keyed on `(merchantId, resourceUrl)`). You can update your `description` or `schema` just by shipping an updated blob on your next settle. **Multi-chain:** if you settle the same URL on multiple chains, B402 appends each chain to your resource's `accepts[]` array rather than overwriting. Agents see all your payment options. ### TL;DR — attach `extensions.bazaar` on every V2 settle Minimum HTTP-GET example. The `extensions.bazaar` object goes inside the `paymentPayload` you send to [`/papi/v2/b402/settle`](open-apis-v2/3.settle-payment.md): ```jsonc { "x402Version": 2, "paymentPayload": { "x402Version": 2, "resource": { "url": "https://api.example.com/btc-price", "description": "Real-time BTC spot price aggregated from 20 exchanges.", "mimeType": "application/json", }, "accepted": { /* your PaymentRequirements */ }, "payload": { /* signed authorization */ }, "extensions": { "bazaar": { "info": { "input": { "type": "http", "method": "GET", "queryParams": { "symbol": "BTC" }, }, "output": { "type": "json", "example": { "symbol": "BTC", "price": 67000, "ts": 1700000000 }, }, }, "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "input": { "type": "object", "properties": { "type": { "const": "http" }, "method": { "enum": ["GET"] }, }, "required": ["type", "method"], }, }, "required": ["input"], }, "description": "Real-time BTC spot price aggregated from 20 exchanges.", }, }, }, "paymentRequirements": { /* same as /verify */ }, } ``` That's the whole integration. No other endpoints to call, no API keys to rotate. ### The bazaar blob — field reference | Field | Required | Type | Purpose | | --------------- | -------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `info` | **yes** | object | Discovery payload — describes the resource's input / output. Shape depends on variant (see below). | | `schema` | **yes** | JSON Schema (Draft 2020-12) object | Validates the shape of `info`. Must define `input` (required) and optionally `output`. Invalid blobs are skipped by the indexer. | | `routeTemplate` | no | string like `/users/:userId` | For parameterized HTTP routes. Lets B402 collapse `/users/1` and `/users/2` into a single catalog entry. Omit for static routes. | | `description` | no (but recommended) | string | Human-readable resource description. Surfaced on the API's resource-level `description` field. If omitted, B402 derives one from the URL. | ### `info` variants The shape of `info.input` depends on what kind of resource you're listing. The discriminator is `info.input.type` plus, for HTTP, `info.input.method`. #### Variant A — HTTP query method (`GET`, `HEAD`, `DELETE`) ```json { "input": { "type": "http", "method": "GET", "queryParams": { "symbol": "BTC" }, "headers": { "X-Client-Version": "1" } }, "output": { "type": "json", "example": { "price": 67000 } } } ``` | Sub-field | Required | Notes | | ------------------- | ------------------------- | ----------------------------------------------------- | | `input.type` | yes | Always `"http"` | | `input.method` | yes | `"GET"`, `"HEAD"`, or `"DELETE"` | | `input.queryParams` | no | Example query params | | `input.headers` | no | Example headers (agents may use these to shape calls) | | `output.type` | yes (if `output` present) | e.g. `"json"`, `"text"` | | `output.example` | no | An example payload the endpoint returns | #### Variant B — HTTP body method (`POST`, `PUT`, `PATCH`) Same as Variant A, plus `input.bodyType` (`"json"` / `"form-data"` / `"text"`) and `input.body` (example request body — required for body methods). ```json { "input": { "type": "http", "method": "POST", "bodyType": "json", "body": { "ticker": "AAPL", "depth": "full" } }, "output": { "type": "json", "example": { "result": "..." } } } ``` #### Variant C — MCP tool ```json { "input": { "type": "mcp", "tool": "financial_analysis", "description": "Deep-dive financial analysis for a single ticker.", "inputSchema": { "type": "object", "properties": { "ticker": { "type": "string" }, "depth": { "type": "string", "enum": ["summary", "deep"] } }, "required": ["ticker"] }, "example": { "ticker": "AAPL", "depth": "deep" } }, "output": { "type": "json", "example": { "summary": "...", "score": 8.5 } } } ``` For MCP tools the unique resource identifier is the tuple `(resource.url, info.input.tool)` — multiple tools on the same URL produce distinct listings. ### `routeTemplate` — parameterized routes If your endpoint has path parameters like `/users/123` and `/users/456`, set `routeTemplate` so Bazaar collapses them into a single catalog entry: ```jsonc { "info": { "input": { "type": "http", "method": "GET", "pathParams": { "userId": "123" } } }, "schema": { /* ... */ }, "routeTemplate": "/users/:userId", } ``` Rules (per CDP spec): must start with `/`, match `^/[a-zA-Z0-9_/:.\-~%]+$`, no `..`, no `://`. Static routes must omit `routeTemplate`. ### Example: TypeScript ```ts const PRICE_FEED_BLOB = { info: { input: { type: "http" as const, method: "GET" as const, queryParams: { symbol: "BTC" }, }, output: { type: "json" as const, example: { symbol: "BTC", price: 67000 }, }, }, schema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { input: { type: "object", properties: { type: { const: "http" }, method: { enum: ["GET"] }, }, required: ["type", "method"], }, }, required: ["input"], }, description: "Real-time BTC spot price aggregated from 20 exchanges.", }; // When building the V2 payment payload for /papi/v2/b402/settle: const paymentPayload = { x402Version: 2, resource: { url: "https://api.example.com/btc-price", description: PRICE_FEED_BLOB.description, mimeType: "application/json", }, accepted: paymentRequirements, payload: { signature, authorization }, extensions: { bazaar: PRICE_FEED_BLOB }, }; ``` ### Example: Python ```python PRICE_FEED_BLOB = { "info": { "input": { "type": "http", "method": "GET", "queryParams": {"symbol": "BTC"}, }, "output": {"type": "json", "example": {"symbol": "BTC", "price": 67000}}, }, "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "input": { "type": "object", "properties": { "type": {"const": "http"}, "method": {"enum": ["GET"]}, }, "required": ["type", "method"], } }, "required": ["input"], }, "description": "Real-time BTC spot price aggregated from 20 exchanges.", } payment_payload = { "x402Version": 2, "resource": { "url": "https://api.example.com/btc-price", "description": PRICE_FEED_BLOB["description"], "mimeType": "application/json", }, "accepted": payment_requirements, "payload": {"signature": signature, "authorization": authorization}, "extensions": {"bazaar": PRICE_FEED_BLOB}, } ``` ### Verifying your listing After your first confirmed V2 settle with the blob, hit any of the discovery endpoints. **No authentication required** — discovery is public read-only. Production base URL is `https://www.binance.com/bapi/ramp/v1/public/ramp/b402`; see [Environments and API base URLs](basics/4.base-urls.md) for sandbox. ```bash # Paginated catalog (response data key: items[]) curl https://www.binance.com/bapi/ramp/v1/public/ramp/b402/bazaar/resources # Your listings only (response data key: resources[]) curl "https://www.binance.com/bapi/ramp/v1/public/ramp/b402/bazaar/merchant?payTo=" # Keyword search (response data key: resources[]) curl "https://www.binance.com/bapi/ramp/v1/public/ramp/b402/bazaar/search?query=BTC+price" ``` A response wraps the CDP-shape catalog in Binance's standard BAPI envelope — the discovery payload is in `data`: ```jsonc { "code": "000000", "message": null, "messageDetail": null, "data": { "items": [ { "resource": "https://api.example.com/btc-price", "type": "http", "x402Version": 2, "description": "Real-time BTC spot price aggregated from 20 exchanges.", "accepts": [ { "scheme": "permit2-exact", "network": "eip155:56", "asset": "0x55d398326f99059fF775485246999027B3197955", "maxAmountRequired": "1000", "payTo": "0xabc...", }, ], "lastUpdated": 1780476191702, "quality": { "l30DaysTotalCalls": 1543, "l30DaysUniquePayers": 87, "lastCalledAt": 1780476131000, }, }, ], "pagination": { "limit": 25, "offset": 0, "total": 1 }, "x402Version": 2, }, "success": true, } ``` #### Discovery endpoint reference | Endpoint | Method | Query parameters | Default / max `limit` | `data` array key | | ------------------- | ------ | ---------------------------------------------------------------------- | --------------------- | ---------------- | | `/bazaar/resources` | GET | `limit`, `offset` | 25 / 100 | `items[]` | | `/bazaar/merchant` | GET | **`payTo`** (required, 0x-prefixed EVM address), `limit`, `offset` | 25 / 100 | `resources[]` | | `/bazaar/search` | GET | `query`, `network`, `asset`, `scheme`, `payTo`, `maxUsdPrice`, `limit` | 20 / 20 (no `offset`) | `resources[]` | `/search` filter notes: - `query` — free-text search over resource description and synthesized name; max 400 chars. - `network` / `asset` / `scheme` / `payTo` — narrow to a specific payment option; max 200 chars each. - `maxUsdPrice` — filter to resources whose primary `accepts[]` entry charges at most this many USD per call. Decimal string. - Search has no `offset`/cursor pagination — refine the query with the filters above to surface more results. ### How agents find you AI agents integrate with Bazaar in one of two ways: 1. **REST.** The agent queries `/bazaar/search` directly and picks resources from the result. 2. **MCP.** The agent uses the `search_resources` tool on Bazaar's hosted MCP endpoint. This is the path for agents built on Claude Desktop, OpenAI function-calling frameworks, and similar. Once they've found your resource, they invoke it through their existing x402 client stack. Bazaar doesn't proxy the call — it's pure discovery. ### Ranking & visibility Discovery results are ranked by a composite score combining four signals: - **Text relevance** — your `description` and synthesized internal name are matched against the agent's search query. - **Recent activity** — resources that haven't seen a settle in 30 days sink in the rankings. - **Buyer diversity** — a resource with 1,000 settles from 3 wallets ranks below one with 500 settles from 200 wallets. - **Fail rate** — resources whose recent settles frequently fail are demoted; resources with `fail_rate_24h > 50%` are filtered from results entirely. A minimum-amount threshold (USD $0.01-equivalent per settle) filters out micro-settles from the activity signal, and the diversity cap weights buyers more than raw settle count. Together these mean it's more expensive to fake activity than to build a genuinely-useful endpoint. ### FAQ **Do I have to opt in on every settle, or once is enough?** Every V2 settle. Bazaar treats the blob as "re-advertise my listing with this metadata." It's cheap on your side (it rides on an already-happening request), and lets you update metadata without a side-channel. **What if I have more than one endpoint?** Send a different blob for each endpoint's settles. Each `(payTo, resourceUrl)` pair is a separate listing. **Can I support multiple chains on the same URL?** Yes — settle on each chain separately with the same `resource.url`. B402 merges the `accepts[]` array so agents see all your chains on the same resource. Dedup key is `(scheme, network, asset)` — the latest settle on a given tuple overwrites that entry. **What if the same endpoint has multiple pricing tiers (e.g. basic / pro)?** Bazaar treats them as one listing per `(merchantId, resourceUrl)` — the last settle's `maxAmountRequired` wins for that `(network, asset, scheme)` entry. Multi-tier listings are on the roadmap. **Can I submit a listing without settling?** Not in v0 — listing is strictly opt-in via successful V2 settle. Marketing-only listings are deferred to a future version. **How do I get removed?** Stop including the blob on new settles and your listing's recency signal will decay until it sinks below the visible results. For an active takedown (e.g. leaked API key, compromised endpoint), reach out via the [application form](https://forms.gle/aUQvxUETfGMzyTky5) and we'll hide the listing. ### Next Steps - [Settle Payment (V2)](open-apis-v2/3.settle-payment.md) — the wire shape that carries the bazaar blob. - [Environments and API base URLs](basics/4.base-urls.md) — where to call settle, and the public Bazaar discovery base URL. - [Integration Guideline](integration-guideline.md) — prerequisites, checklist, and best practices for B402 generally. --- ## Document: /products/mining/quick-start URL: /en/dev-docs/products/mining/quick-start # Quick Start ## API Key Setup - Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/articles/360002502072) regarding API key creation. - Once API key is created, it is recommended to set IP restrictions on the key for security reasons. - **Never share your API key/secret key to ANYONE.** ## API Key Restrictions - After creating the API key, the default restrictions is `Enable Reading`. - To **enable withdrawals via the API**, the API key restriction needs to be modified through the Binance UI. ## Enabling Accounts ### Spot Account A `SPOT` account is provided by default upon creation of a Binance Account. ### Margin Account To enable a `MARGIN` account for Margin Trading, please refer to the [Margin Trading Guide](https://www.binance.vision/tutorials/binance-margin-trading-guide) ## API Library ### Python connector This is a lightweight library that works as a connector to Binance public API, written in Python. [https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python) ### Javascript connector This is a lightweight library that works as a connector to Binance public API, written for JavaScript users. [https://github.com/binance/binance-connector-js](https://github.com/binance/binance-connector-js) ### Ruby connector This is a lightweight library that works as a connector to Binance public API, written for Ruby users. [https://github.com/binance/binance-connector-ruby](https://github.com/binance/binance-connector-ruby) ### DotNET connector This is a lightweight library that works as a connector to Binance public API, written for C# users. [https://github.com/binance/binance-connector-dotnet](https://github.com/binance/binance-connector-dotnet) ### Java connector This is a lightweight library that works as a connector to Binance public API, written for Java users. [https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java) ### Postman Collections There is now a Postman collection containing the API endpoints for quick and easy use. This is recommended for new users who want to get a quick-start into using the API. For more information please refer to this page: [Binance API Postman](https://github.com/binance/binance-api-postman) ### Swagger A YAML file with OpenAPI specification on the RESTful API is available to be used, as well as a Swagger UI page for the consulting. [https://github.com/binance/binance-api-swagger](https://github.com/binance/binance-api-swagger) --- ## Document: /products/mining/general-info URL: /en/dev-docs/products/mining/general-info # General Info ## General API Information - The following base endpoints are available: - **https://api.binance.com** - **https://api-gcp.binance.com** - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** - The last 4 endpoints in the point above (`api1`-`api4`) might give better performance but have less stability. Please use whichever works best for your setup. - All endpoints return either a JSON object or array. - Data is returned in **ascending** order. Oldest first, newest last. - All time and timestamp related fields are in **milliseconds**. ### HTTP Return Codes - HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. - HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP `409` return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.) - HTTP `429` return code is used when breaking a request rate limit. - HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. - HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. ### Error Codes and Messages - If there is an error, the API will return an error with a message of the reason. > The error payload on API and SAPI is as follows: ```json { "code": -1121, "msg": "Invalid symbol." } ``` - Specific error codes and messages defined in [Error Codes](./error-code). ### General Information on Endpoints - For `GET` endpoints, parameters must be sent as a `query string`. - For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. - Parameters may be sent in any order. - If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. --- ## LIMITS ### General Info on Limits - The following `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". - The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. - A 429 will be returned when either request rate limit or order rate limit is violated. ### IP Limits - Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. - When a 429 is received, it's your obligation as an API to back off and not spam the API. - **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** - IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. - A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - **The limits on the API are based on the IPs, not the API keys.** ### Order Rate Limits - Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. - When the order count exceeds the limit, you will receive a 429 error without the `Retry-After` header. Please check the Order Rate Limit rules using `GET api/v3/exchangeInfo` and wait for reactivation accordingly. - Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - **The order rate limit is counted against each account**. - To monitor order count usage, refer to GET `api/v3/rateLimit/order` ### Websocket Limits - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON controlled message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. - There is a limit of **300 connections per attempt every 5 minutes per IP**. ### /api/ and /sapi/ Limit Introduction The `/api/*` and `/sapi/*` endpoints adopt either of two access limiting rules, IP limits or UID (account) limits. - Endpoints related to `/api/*`: - According to the two modes of IP and UID (account) limit, each are independent. - Endpoints share the 6000 per minute limit based on IP. - Responses contain the header `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)`, defining the weight used by the current IP. - Successful order responses contain the header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`, defining the order limit used by the UID. - Endpoints related to `/sapi/*`: - Endpoints are marked according to IP or UID limit and their corresponding weight value. - Each endpoint with IP limits has an independent 12000 per minute limit. - Each endpoint with UID limits has an independent 180000 per minute limit. - Responses from endpoints with IP limits contain the header `X-SAPI-USED-IP-WEIGHT-1M`, defining the weight used by the current IP. - Responses from endpoints with UID limits contain the header `X-SAPI-USED-UID-WEIGHT-1M`, defining the weight used by the current UID. --- ## Data Sources - The API system is asynchronous, so some delay in the response is normal and expected. - Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates. - **Matching Engine** - the data is from the matching Engine - **Memory** - the data is from a server's local or external memory - **Database** - the data is taken directly from a database ## Request Security - Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](#place-new-order-trade)). - If unspecified, the security type is `NONE`. - Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](#user-data-stream-requests). - Secure endpoints require a valid API key to be specified and authenticated. - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. - API keys can be configured to allow access only to certain types of secure endpoints. - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. | Security Type | Description | | ------------- | -------------------------------------------------------- | | NONE | Endpoint can be accessed freely. | | TRADE | Endpoint requires sending a valid API-Key and signature. | | MARGIN | Endpoint requires sending a valid API-Key and signature. | | USER_DATA | Endpoint requires sending a valid API-Key and signature. | | USER_STREAM | Endpoint requires sending a valid API-Key. | | MARKET_DATA | Endpoint requires sending a valid API-Key. | - `TRADE`, `MARGIN` and `USER_DATA` endpoints are `SIGNED` endpoints. ### SIGNED Endpoint security - `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. #### Signature Case Sensitivity - **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. - **RSA:** Signatures generated using RSA are **case-sensitive**. - **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** Please consult [SIGNED request example (HMAC)](#hmac-keys), [SIGNED request example (RSA)](#rsa-keys), and [SIGNED request example (Ed25519)](#ed25519-keys) on how to compute signature, depending on which API key type you are using. ### Timing security - `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](#general-api-information)) - An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. - Maximum `recvWindow` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` **Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. **It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** ### SIGNED Endpoint Examples for POST /api/v3/order #### HMAC Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. Example API key and secret key: | Key | Value | | ----------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `secretKey` | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j | **WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | LTCBTC | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` **Step 2: Compute the signature** 1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. 2. Sign the signature payload constructed in Step 1. 3. Encode the HMAC-SHA-256 output as a hex string. Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. **Example commands** For the first set of example parameters (ASCII only): ```console $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" ``` For the second set of example parameters (some non-ASCII characters) ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" ``` Here is a sample Bash script performing all the steps above: ```bash apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" # Sign the request signature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey") signature=${signature#*= } # Keep only the part after the "= " # Send the request curl -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?$payload&signature=$signature" ``` #### RSA Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. Only `PKCS#8` keys are supported. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. These examples assume the private key is stored in the file `./test-prv-key.pem`. | Key | Value | | -------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | BTCUSDT | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` **Step 2: Compute the signature** 1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function. 2. Encode the output in base64. Note that the payload and the resulting `signature` are **case-sensitive**. For the first set of example parameters (ASCII only): ```console $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== ``` 3. Percent-encode the base64 string. For the first set of example parameters (ASCII only): ```console HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D ``` For the second set of example parameters (some non-ASCII characters): ```console qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' ``` For the second set of example parameters (some non-ASCII characters): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' ``` Here is a sample Bash script performing all the steps above: ```bash function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos The error JSON payload: ```javascript { "code":-1121, "msg":"Invalid symbol." } ``` Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. ## 10xx - General Server or Network issues ### -1000 UNKNOWN - An unknown error occurred while processing the request. - An unknown error occurred while processing the request.[%s] ### -1001 DISCONNECTED - Internal error; unable to process your request. Please try again. ### -1002 UNAUTHORIZED - You are not authorized to execute this request. ### -1003 TOO_MANY_REQUESTS - Too many requests queued. - Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. - Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. ### -1004 SERVER_BUSY - Server is busy, please wait and try again ### -1006 UNEXPECTED_RESP - An unexpected response was received from the message bus. Execution status unknown. ### -1007 TIMEOUT - Timeout waiting for response from backend server. Send status unknown; execution status unknown. ### -1008 SERVER_BUSY - Spot server is currently overloaded with other requests. Please try again in a few minutes. ### -1014 UNKNOWN_ORDER_COMPOSITION - Unsupported order combination. ### -1015 TOO_MANY_ORDERS - Too many new orders. - Too many new orders; current limit is %s orders per %s. ### -1016 SERVICE_SHUTTING_DOWN - This service is no longer available. ### -1020 UNSUPPORTED_OPERATION - This operation is not supported. ### -1021 INVALID_TIMESTAMP - Timestamp for this request is outside of the recvWindow. - Timestamp for this request was 1000ms ahead of the server's time. ### -1022 INVALID_SIGNATURE - Signature for this request is not valid. ### -1099 Not found, authenticated, or authorized - This replaces error code -1999 ## 11xx - 2xxx Request issues ### -1100 ILLEGAL_CHARS - Illegal characters found in a parameter. - Illegal characters found in a parameter. %s - Illegal characters found in parameter `%s`; legal range is `%s`. ### -1101 TOO_MANY_PARAMETERS - Too many parameters sent for this endpoint. - Too many parameters; expected `%s` and received `%s`. - Duplicate values for a parameter detected. ### -1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED - A mandatory parameter was not sent, was empty/null, or malformed. - Mandatory parameter `%s` was not sent, was empty/null, or malformed. - Param `%s` or `%s` must be sent, but both were empty/null! ### -1103 UNKNOWN_PARAM - An unknown parameter was sent. ### -1104 UNREAD_PARAMETERS - Not all sent parameters were read. - Not all sent parameters were read; read `%s` parameter(s) but was sent `%s`. ### -1105 PARAM_EMPTY - A parameter was empty. - Parameter `%s` was empty. ### -1106 PARAM_NOT_REQUIRED - A parameter was sent when not required. - Parameter `%s` sent when not required. ### -1111 BAD_PRECISION - Precision is over the maximum defined for this asset. ### -1112 NO_DEPTH - No orders on book for symbol. ### -1114 TIF_NOT_REQUIRED - TimeInForce parameter sent when not required. ### -1115 INVALID_TIF - Invalid timeInForce. ### -1116 INVALID_ORDER_TYPE - Invalid orderType. ### -1117 INVALID_SIDE - Invalid side. ### -1118 EMPTY_NEW_CL_ORD_ID - New client order ID was empty. ### -1119 EMPTY_ORG_CL_ORD_ID - Original client order ID was empty. ### -1120 BAD_INTERVAL - Invalid interval. ### -1121 BAD_SYMBOL - Invalid symbol. ### -1125 INVALID_LISTEN_KEY - This listenKey does not exist. ### -1127 MORE_THAN_XX_HOURS - Lookup interval is too big. - More than %s hours between startTime and endTime. ### -1128 OPTIONAL_PARAMS_BAD_COMBO - Combination of optional parameters invalid. ### -1130 INVALID_PARAMETER - Invalid data sent for a parameter. - Data sent for parameter `%s` is not valid. ### -1131 BAD_RECV_WINDOW - recvWindow must be less than 60000 ### -1134 BAD_STRATEGY_TYPE - `strategyType` was less than 1000000. #### -1145 INVALID_CANCEL_RESTRICTIONS - `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. #### -1151 DUPLICATE_SYMBOLS - Symbol is present multiple times in the list. ### -2010 NEW_ORDER_REJECTED - NEW_ORDER_REJECTED ### -2011 CANCEL_REJECTED - CANCEL_REJECTED ### -2013 NO_SUCH_ORDER - Order does not exist. ### -2014 BAD_API_KEY_FMT - API-key format invalid. ### -2015 REJECTED_MBX_KEY - Invalid API-key, IP, or permissions for action. ### -2016 NO_TRADING_WINDOW - No trading window could be found for the symbol. Try ticker/24hrs instead. #### -2026 ORDER_ARCHIVED - Order was canceled or expired with no executed qty over 90 days ago and has been archived. ## 3xxx-5xxx SAPI-specific issues ### -3000 INNER_FAILURE - Internal server error. ### -3001 NEED_ENABLE_2FA - Please enable 2FA first. ### -3002 ASSET_DEFICIENCY - We don't have this asset. ### -3003 NO_OPENED_MARGIN_ACCOUNT - Margin account does not exist. ### -3004 TRADE_NOT_ALLOWED - Trade not allowed. ### -3005 TRANSFER_OUT_NOT_ALLOWED - Transferring out not allowed. ### -3006 EXCEED_MAX_BORROWABLE - Your borrow amount has exceed maximum borrow amount. ### -3007 HAS_PENDING_TRANSACTION - You have pending transaction, please try again later. ### -3008 BORROW_NOT_ALLOWED - Borrow not allowed. ### -3009 ASSET_NOT_MORTGAGEABLE - This asset are not allowed to transfer into margin account currently. ### -3010 REPAY_NOT_ALLOWED - Repay not allowed. ### -3011 BAD_DATE_RANGE - Your input date is invalid. ### -3012 ASSET_ADMIN_BAN_BORROW - Borrow is banned for this asset. ### -3013 LT_MIN_BORROWABLE - Borrow amount less than minimum borrow amount. ### -3014 ACCOUNT_BAN_BORROW - Borrow is banned for this account. ### -3015 REPAY_EXCEED_LIABILITY - Repay amount exceeds borrow amount. ### -3016 LT_MIN_REPAY - Repay amount less than minimum repay amount. ### -3017 ASSET_ADMIN_BAN_MORTGAGE - This asset are not allowed to transfer into margin account currently. ### -3018 ACCOUNT_BAN_MORTGAGE - Transferring in has been banned for this account. ### -3019 ACCOUNT_BAN_ROLLOUT - Transferring out has been banned for this account. ### -3020 EXCEED_MAX_ROLLOUT - Transfer out amount exceeds max amount. ### -3021 PAIR_ADMIN_BAN_TRADE - Margin account are not allowed to trade this trading pair. ### -3022 ACCOUNT_BAN_TRADE - You account's trading is banned. ### -3023 WARNING_MARGIN_LEVEL - You can't transfer out/place order under current margin level. ### -3024 FEW_LIABILITY_LEFT - The unpaid debt is too small after this repayment. ### -3025 INVALID_EFFECTIVE_TIME - Your input date is invalid. ### -3026 VALIDATION_FAILED - Your input param is invalid. ### -3027 NOT_VALID_MARGIN_ASSET - Not a valid margin asset. ### -3028 NOT_VALID_MARGIN_PAIR - Not a valid margin pair. ### -3029 TRANSFER_FAILED - Transfer failed. ### -3036 ACCOUNT_BAN_REPAY - This account is not allowed to repay. ### -3037 PNL_CLEARING - PNL is clearing. Wait a second. ### -3038 LISTEN_KEY_NOT_FOUND - Listen key not found. ### -3041 BALANCE_NOT_CLEARED - Balance is not enough ### -3042 PRICE_INDEX_NOT_FOUND - PriceIndex not available for this margin pair. ### -3043 TRANSFER_IN_NOT_ALLOWED - Transferring in not allowed. ### -3044 SYSTEM_BUSY - System busy. ### -3045 SYSTEM - The system doesn't have enough asset now. ### -3999 NOT_WHITELIST_USER - This function is only available for invited users. ### -4001 CAPITAL_INVALID - Invalid operation. ### -4002 CAPITAL_IG - Invalid get. ### -4003 CAPITAL_IEV - Your input email is invalid. ### -4004 CAPITAL_UA - You don't login or auth. ### -4005 CAPAITAL_TOO_MANY_REQUEST - Too many new requests. ### -4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT - Support main account only. ### -4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS - Address validation is not passed. ### -4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS - Address tag validation is not passed. ### -4010 CAPITAL_WHITELIST_EMAIL_CONFIRM - White list mail has been confirmed. ### -4011 CAPITAL_WHITELIST_EMAIL_EXPIRED - White list mail is invalid. ### -4012 CAPITAL_WHITELIST_CLOSE - White list is not opened. ### -4013 CAPITAL_WITHDRAW_2FA_VERIFY - 2FA is not opened. ### -4014 CAPITAL_WITHDRAW_LOGIN_DELAY - Withdraw is not allowed within 2 min login. ### -4015 CAPITAL_WITHDRAW_RESTRICTED_MINUTE - Withdraw is limited. ### -4016 CAPITAL_WITHDRAW_RESTRICTED_PASSWORD - Within 24 hours after password modification, withdrawal is prohibited. ### -4017 CAPITAL_WITHDRAW_RESTRICTED_UNBIND_2FA - Within 24 hours after the release of 2FA, withdrawal is prohibited. ### -4018 CAPITAL_WITHDRAW_ASSET_NOT_EXIST - We don't have this asset. ### -4019 CAPITAL_WITHDRAW_ASSET_PROHIBIT - Current asset is not open for withdrawal. ### -4021 CAPITAL_WITHDRAW_AMOUNT_MULTIPLE - Asset withdrawal must be an %s multiple of %s. ### -4022 CAPITAL_WITHDRAW_MIN_AMOUNT - Not less than the minimum pick-up quantity %s. ### -4023 CAPITAL_WITHDRAW_MAX_AMOUNT - Within 24 hours, the withdrawal exceeds the maximum amount. ### -4024 CAPITAL_WITHDRAW_USER_NO_ASSET - You don't have this asset. ### -4025 CAPITAL_WITHDRAW_USER_ASSET_LESS_THAN_ZERO - The number of hold asset is less than zero. ### -4026 CAPITAL_WITHDRAW_USER_ASSET_NOT_ENOUGH - You have insufficient balance. ### -4027 CAPITAL_WITHDRAW_GET_TRAN_ID_FAILURE - Failed to obtain tranId. ### -4028 CAPITAL_WITHDRAW_MORE_THAN_FEE - The amount of withdrawal must be greater than the Commission. ### -4029 CAPITAL_WITHDRAW_NOT_EXIST - The withdrawal record does not exist. ### -4030 CAPITAL_WITHDRAW_CONFIRM_SUCCESS - Confirmation of successful asset withdrawal. ### -4031 CAPITAL_WITHDRAW_CANCEL_FAILURE - Cancellation failed. ### -4032 CAPITAL_WITHDRAW_CHECKSUM_VERIFY_FAILURE - Withdraw verification exception. ### -4033 CAPITAL_WITHDRAW_ILLEGAL_ADDRESS - Illegal address. ### -4034 CAPITAL_WITHDRAW_ADDRESS_CHEAT - The address is suspected of fake. ### -4035 CAPITAL_WITHDRAW_NOT_WHITE_ADDRESS - This address is not on the whitelist. Please join and try again. ### -4036 CAPITAL_WITHDRAW_NEW_ADDRESS - The new address needs to be withdrawn in {0} hours. ### -4037 CAPITAL_WITHDRAW_RESEND_EMAIL_FAIL - Re-sending Mail failed. ### -4038 CAPITAL_WITHDRAW_RESEND_EMAIL_TIME_OUT - Please try again in 5 minutes. ### -4039 CAPITAL_USER_EMPTY - The user does not exist. ### -4040 CAPITAL_NO_CHARGE - This address not charged. ### -4041 CAPITAL_MINUTE_TOO_SMALL - Please try again in one minute. ### -4042 CAPITAL_CHARGE_NOT_RESET - This asset cannot get deposit address again. ### -4043 CAPITAL_ADDRESS_TOO_MUCH - More than 100 recharge addresses were used in 24 hours. ### -4044 CAPITAL_BLACKLIST_COUNTRY_GET_ADDRESS - This is a blacklist country. ### -4045 CAPITAL_GET_ASSET_ERROR - Failure to acquire assets. ### -4046 CAPITAL_AGREEMENT_NOT_CONFIRMED - Agreement not confirmed. ### -4047 CAPITAL_DATE_INTERVAL_LIMIT - Time interval must be within 0-90 days ### -4060 CAPITAL_WITHDRAW_USER_ASSET_LOCK_DEPOSIT - As your deposit has not reached the required block confirmations, we have temporarily locked {0} asset ### -4106 TAG_NOT_SUPPORTED_FOR_NETWORK - This network does not support memo/tag. Please remove the `addressTag` field and try again. ### -5001 ASSET_DRIBBLET_CONVERT_SWITCH_OFF - Don't allow transfer to micro assets. ### -5002 ASSET_ASSET_NOT_ENOUGH - You have insufficient balance. ### -5003 ASSET_USER_HAVE_NO_ASSET - You don't have this asset. ### -5004 USER_OUT_OF_TRANSFER_FLOAT - The residual balances have exceeded 0.001BTC, Please re-choose. - The residual balances of %s have exceeded 0.001BTC, Please re-choose. ### -5005 USER_ASSET_AMOUNT_IS_TOO_LOW - The residual balances of the BTC is too low - The residual balances of %s is too low, Please re-choose. ### -5006 USER_CAN_NOT_REQUEST_IN_24_HOURS - Only transfer once in 24 hours. ### -5007 AMOUNT_OVER_ZERO - Quantity must be greater than zero. ### -5008 ASSET_WITHDRAW_WITHDRAWING_NOT_ENOUGH - Insufficient amount of returnable assets. ### -5009 PRODUCT_NOT_EXIST - Product does not exist. ### -5010 TRANSFER_FAIL - Asset transfer fail. ### -5011 FUTURE_ACCT_NOT_EXIST - future account not exists. ### -5012 TRANSFER_PENDING - Asset transfer is in pending. ### -5021 PARENT_SUB_HAVE_NO_RELATION - This parent sub have no relation ### -5012 FUTURE_ACCT_OR_SUBRELATION_NOT_EXIST - future account or sub relation not exists. ## 6XXX - Savings Issues ### -6001 DAILY_PRODUCT_NOT_EXIST - Daily product not exists. ### -6003 DAILY_PRODUCT_NOT_ACCESSIBLE - Product not exist or you don't have permission ### -6004 DAILY_PRODUCT_NOT_PURCHASABLE - Product not in purchase status ### -6005 DAILY_LOWER_THAN_MIN_PURCHASE_LIMIT - Smaller than min purchase limit ### -6006 DAILY_REDEEM_AMOUNT_ERROR - Redeem amount error ### -6007 DAILY_REDEEM_TIME_ERROR - Not in redeem time ### -6008 DAILY_PRODUCT_NOT_REDEEMABLE - Product not in redeem status ### -6009 REQUEST_FREQUENCY_TOO_HIGH - Request frequency too high ### -6011 EXCEEDED_USER_PURCHASE_LIMIT - Exceeding the maximum num allowed to purchase per user ### -6012 BALANCE_NOT_ENOUGH - Balance not enough ### -6013 PURCHASING_FAILED - Purchasing failed ### -6014 UPDATE_FAILED - Exceed up-limit allowed to purchased ### -6015 EMPTY_REQUEST_BODY - Empty request body ### -6016 PARAMS_ERR - Parameter err ### -6017 NOT_IN_WHITELIST - Not in whitelist ### -6018 ASSET_NOT_ENOUGH - Asset not enough ### -6019 PENDING - Need confirm ### -6020 PROJECT_NOT_EXISTS - Project not exists ## 70xx - Futures ### -7001 FUTURES_BAD_DATE_RANGE - Date range is not supported. ### -7002 FUTURES_BAD_TYPE - Data request type is not supported. ## 20xxx - Futures/Spot Algo ### -20121 - Invalid symbol. ### -20124 - Invalid algo id or it has been completed. ### -20130 - Invalid data sent for a parameter. ### -20132 - The client algo id is duplicated. ### -20194 - Duration is too short to execute all required quantity. ### -20195 - The total size is too small. ### -20196 - The total size is too large. ### -20198 - Reach the max open orders allowed. ### -20204 - The notional of USD is less or more than the limit. ## Filter failures | Error message | Description | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | "Filter failure: PRICE_FILTER" | `price` is too high, too low, and/or not following the tick size rule for the symbol. | | "Filter failure: PERCENT_PRICE" | `price` is X% too high or X% too low from the average weighted price over the last Y minutes. | | "Filter failure: PERCENT_PRICE_BY_SIDE" | `price` is X% too high or Y% too low from the `lastPrice` on that side (i.e. BUY/SELL) | | "Filter failure: LOT_SIZE" | `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MIN_NOTIONAL" | `price` \* `quantity` is too low to be a valid order for the symbol. | | "Filter failure: ICEBERG_PARTS" | `ICEBERG` order would break into too many parts; icebergQty is too small. | | "Filter failure: MARKET_LOT_SIZE" | `MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MAX_POSITION" | The account's position has reached the maximum defined limit.

This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY`orders. | | "Filter failure: MAX_NUM_ORDERS" | Account has too many open orders on the symbol. | | "Filter failure: MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the symbol. | | "Filter failure: MAX_NUM_ICEBERG_ORDERS" | Account has too many open iceberg orders on the symbol. | | "Filter failure: TRAILING_DELTA" | `trailingDelta` is not within the defined range of the filter for that order type. | | "Filter failure: EXCHANGE_MAX_NUM_ORDERS" | Account has too many open orders on the exchange. | | "Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the exchange. | ## 10xxx - Crypto Loans ### -10001 SYSTEM_MAINTENANCE - The system is under maintenance, please try again later. ### -10002 INVALID_INPUT - Invalid input parameters. ### -10005 NO_RECORDS - No records found. ### -10007 COIN_NOT_LOANABLE - This coin is not loanable. ### -10008 COIN_NOT_LOANABLE - This coin is not loanable ### -10009 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10010 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10011 INSUFFICIENT_ASSET - Insufficient spot assets. ### -10012 INVALID_AMOUNT - Invalid repayment amount. ### -10013 INSUFFICIENT_AMOUNT - Insufficient collateral amount. ### -10015 DEDUCTION_FAILED - Collateral deduction failed. ### -10016 LOAN_FAILED - Failed to provide loan. ### -10017 REPAY_EXCEED_DEBT - Repayment amount exceeds debt. ### -10018 INVALID_AMOUNT - Invalid repayment amount. ### -10019 CONFIG_NOT_EXIST - Configuration does not exists. ### -10020 UID_NOT_EXIST - User ID does not exist. ### -10021 ORDER_NOT_EXIST - Order does not exist. ### -10022 INVALID_AMOUNT - Invalid adjustment amount. ### -10023 ADJUST_LTV_FAILED - Failed to adjust LTV. ### -10024 ADJUST_LTV_NOT_SUPPORTED - LTV adjustment not supported. ### -10025 REPAY_FAILED - Repayment failed. ### -10026 INVALID_PARAMETER - Invalid parameter. ### -10028 INVALID_PARAMETER - Invalid parameter. ### -10029 AMOUNT_TOO_SMALL - Loan amount is too small. ### -10030 AMOUNT_TOO_LARGE - Loan amount is too much. ### -10031 QUOTA_REACHED - Individual loan quota reached. ### -10032 REPAY_NOT_AVAILABLE - Repayment is temporarily unavailable. ### -10034 REPAY_NOT_AVAILABLE - Repay with collateral is not available currently, please try to repay with borrowed coin. ### -10039 AMOUNT_TOO_SMALL - Repayment amount is too small. ### -10040 AMOUNT_TOO_LARGE - Repayment amount is too large. ### -10041 INSUFFICIENT_AMOUNT - Due to high demand, there are currently insufficient loanable assets for {0}. Please adjust your borrow amount or try again tomorrow. ### -10042 ASSET_NOT_SUPPORTED - asset %s is not supported ### -10043 ASSET_NOT_SUPPORTED - {0} borrowing is currently not supported. ### -10044 QUOTA_REACHED - Collateral amount has reached the limit. Please reduce your collateral amount or try with other collaterals. ### -10045 COLLTERAL_REPAY_NOT_SUPPORTED - The loan coin does not support collateral repayment. Please try again later. ### -10046 EXCEED_MAX_ADJUSTMENT - Collateral Adjustment exceeds the maximum limit. Please try again. ### -10047 REGION_NOT_SUPPORTED - This coin is currently not supported in your location due to local regulations. ## 13xxx - BLVT ### -13000 BLVT_FORBID_REDEEM - Redeption of the token is forbiden now ### -13001 BLVT_EXCEED_DAILY_LIMIT - Exceeds individual 24h redemption limit of the token ### -13002 BLVT_EXCEED_TOKEN_DAILY_LIMIT - Exceeds total 24h redemption limit of the token ### -13003 BLVT_FORBID_PURCHASE - Subscription of the token is forbiden now ### -13004 BLVT_EXCEED_DAILY_PURCHASE_LIMIT - Exceeds individual 24h subscription limit of the token ### -13005 BLVT_EXCEED_TOKEN_DAILY_PURCHASE_LIMIT - Exceeds total 24h subscription limit of the token ### -13006 BLVT_PURCHASE_LESS_MIN_AMOUNT - Subscription amount is too small ### -13007 BLVT_PURCHASE_AGREEMENT_NOT_SIGN - The Agreement is not signed ## 12xxx - Liquid Swap ### -12014 TOO MANY REQUESTS - More than 1 request in 2 seconds ## 18xxx - Binance Code ### -18002 - The total amount of codes you created has exceeded the 24-hour limit, please try again after UTC 0 ### -18003 - Too many codes created in 24 hours, please try again after UTC 0 ### -18004 - Too many invalid redeem attempts in 24 hours, please try again after UTC 0 ### -18005 - Too many invalid verify attempts, please try later ### -18006 - The amount is too small, please re-enter ### -18007 - This token is not currently supported, please re-enter ## 21xxx - Portfolio Margin Account ### -21001 USER_IS_NOT_UNIACCOUNT - Request ID is not a Portfolio Margin Account. ### -21002 UNI_ACCOUNT_CANT_TRANSFER_FUTURE - Portfolio Margin Account doesn't support transfer from margin to futures. ### -21003 NET_ASSET_MUST_LTE_RATIO - Fail to retrieve margin assets. ### -21004 USER_NO_LIABILITY - User doesn’t have portfolio margin bankruptcy loan ### -21005 NO_ENOUGH_ASSET - User’s spot wallet doesn’t have enough BUSD to repay portfolio margin bankruptcy loan ### -21006 HAD_IN_PROCESS_REPAY - User had portfolio margin bankruptcy loan repayment in process ### -21007 IN_FORCE_LIQUIDATION - User failed to repay portfolio margin bankruptcy loan since liquidation was in process ## Order Rejection Issues Error messages like these are indicated when the error is coming specifically from the matching engine: - `-1010 ERROR_MSG_RECEIVED` - `-2010 NEW_ORDER_REJECTED` - `-2011 CANCEL_REJECTED` The following messages which will indicate the specific error: | Error message | Description | | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | "Unknown order sent." | The order (by either `orderId`, `clientOrderId`, `origClientOrderId`) could not be found. | | "Duplicate order sent." | The `clientOrderId` is already in use. | | "Market is closed." | The symbol is not trading. | | "Account has insufficient balance for requested action." | Not enough funds to complete the action. | | "Market orders are not supported for this symbol." | `MARKET` is not enabled on the symbol. | | "Iceberg orders are not supported for this symbol." | `icebergQty` is not enabled on the symbol | | "Stop loss orders are not supported for this symbol." | `STOP_LOSS` is not enabled on the symbol | | "Stop loss limit orders are not supported for this symbol." | `STOP_LOSS_LIMIT` is not enabled on the symbol | | "Take profit orders are not supported for this symbol." | `TAKE_PROFIT` is not enabled on the symbol | | "Take profit limit orders are not supported for this symbol." | `TAKE_PROFIT_LIMIT` is not enabled on the symbol | | "Price \* QTY is zero or less." | `price` \* `quantity` is too low | | "IcebergQty exceeds QTY." | `icebergQty` must be less than the order quantity | | "This action is disabled on this account." | Contact customer support; some actions have been disabled on the account. | | "This account may not place or cancel orders." | Contact customer support; the account has trading ability disabled. | | "Unsupported order combination" | The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. | | "Order would trigger immediately." | The order's stop price is not valid when compared to the last traded price. | | "Cancel order is invalid. Check origClientOrderId and orderId." | No `origClientOrderId` or `orderId` was sent in. | | "Order would immediately match and take." | `LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. | | "The relationship of the prices for the orders is not correct." | The prices set in the `OCO` is breaking the Price rules.

The rules are:

`SELL Orders`: Limit Price > Last Price > Stop Price

`BUY Orders`: Limit Price < Last Price < Stop Price | | "OCO orders are not supported for this symbol" | `OCO` is not enabled on the symbol. | | "Quote order qty market orders are not support for this symbol." | `MARKET` orders using the parameter `quoteOrderQty` are not enabled on this symbol. | | "Trailing stop orders are not supported for this symbol." | Orders using `trailingDelta` are not enabled on the symbol. | | "Order cancel-replace is not supported for this symbol." | `POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is on enabled the symbol. | | "This symbol is not permitted for this account." | Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) | | "This symbol is restricted for this account." | Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) | | "Order was not canceled due to cancel restrictions." | Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW`
or
`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. | ## Errors regarding POST /api/v3/order/cancelReplace ### -2021 Order cancel-replace partially failed This code is sent when either the cancellation of the order failed or the new order placement failed but not both. ### -2022 Order cancel-replace failed. This code is sent when both the cancellation of the order failed and the new order placement failed. --- ## Document: /products/mining/change-log URL: /en/dev-docs/products/mining/change-log # Change Log ## 2022-05-19 - Update endpoint for Mining: - `GET /sapi/v1/mining/pub/algoList` and `GET /sapi/v1/mining/pub/coinList`: Need no paramter. --- ## 2022-01-04 - New endpoint for Mining: - `GET /sapi/v1/mining/payment/uid` to get Mining account earning. --- ## 2021-01-10 - New parameter `pageSize` for Mining endpoint `GET /sapi/v1/mining/payment/list` - New fields in response to Mining endpoint `GET /sapi/v1/mining/payment/list`: - "type" for income type - "hashTransfer" for resale Hashrate - "transferAmount" for transferred Income - New Mining endpoints: - `GET /sapi/v1/mining/payment/other` - `GET /sapi/v1/mining/hash-transfer/config/details` - `GET /sapi/v1/mining/hash-transfer/config/details/list` - `GET /sapi/v1/mining/hash-transfer/profit/details` - `POST /sapi/v1/mining/hash-transfer/config` - `POST /sapi/v1/mining/hash-transfer/config/cancel` --- ## 2020-05-06 - New endpoints for Mining: - `GET /sapi/v1/mining/pub/algoList` - `GET /sapi/v1/mining/pub/coinList` - `GET /sapi/v1/mining/worker/detail` - `GET /sapi/v1/mining/worker/list` - `GET /sapi/v1/mining/payment/list` - `GET /sapi/v1/mining/statistics/user/status` - `GET /sapi/v1/mining/statistics/user/list` --- ## Document: /products/mining/Introduction URL: /en/dev-docs/products/mining/Introduction # Introduction The endpoints below allow to interact with Binance Pool. For more information on this, please refer to the [Binance Pool page](https://pool.binance.com/en) --- ## Document: TypeScript Support URL: /en/dev-docs/products/mini-program/typescript # TypeScript Support This guide offers a detailed walkthrough on how to proficiently develop MiniPrograms employing TypeScript. ## Inclusion of DevDependencies Embark by installing the necessary devDependencies: ```bash # Optional # Set npm to default to @binance registry # npm config set @binance:registry https://npm.binance.com # Install devDependencies $ npm install @binance/mp-service @binance/mp-components --dev ``` Following the successful installation of devDependencies, proceed to import them as illustrated below: ```ts import mpService from "@binance/mp-service"; import { View, Text, Button } from "@binance/mp-components"; ``` Equipped with these devDependencies and their rightful Import methods, you're now well-prepared to venture further into the realm of MiniProgram development with TypeScript! --- ## Document: Tutorial: Create a weather app by mini program URL: /en/dev-docs/products/mini-program/tutorial # Tutorial: Create a weather app by mini program # Crafting a Dynamic Weather Mini-Program from Scratch This comprehensive tutorial offers a step-by-step guide to building a dynamic weather mini-program. The aim is to create a multi-page program that leverages the Amap's weather API, displaying weather conditions for a user-selected city. ## Setting the Project Foundation Start by [following the guide to create your mini program](quick-start#generate-your-mini-program). The result? A new project built within the current directory, following this directory structure: ``` 📦demo-app ┣ 📂pages ┃ ┣ 📂index ┃ ┃ ┣ 📜index.bxml ┃ ┃ ┣ 📜index.bxss ┃ ┃ ┣ 📜index.js ┃ ┃ ┗ 📜index.json ┃ ┗ 📂logs ┃ ┃ ┣ 📜logs.bxml ┃ ┃ ┣ 📜logs.bxss ┃ ┃ ┣ 📜logs.js ┃ ┃ ┗ 📜logs.json ┣ 📂utils ┃ ┗ 📜util.js ┣ 📜app.bxss ┣ 📜app.js ┣ 📜app.json ┗ 📜project.config.json ``` ## Building the List Page Next, update the file code as follows: ┣ 📂index ┃ ┣ 📜index.bxml ┃ ┣ 📜index.js ```html Cities List Beijing Shanghai Guangzhou Shenzhen ``` ```js Page({ // Triggered when the page is brought to the foreground. onShow() {}, // Triggered when the page is hidden in the background. onHide() {}, }); ``` In the code above, we are using the view, text, and navigator components to layout our page. The mini program is equipped with a large collection of built-in components you can learn more about from [Components](framework/components). Page components also provide several lifecycle hooks, like `onShow()` and `onHide()`. These two callbacks are triggered when the mini program toggles between the foreground and background of the app. Learn more about lifecycle from [LifeCycle](framework/lifecycle). We are transitioning between pages using the navigator component, which uses a 'url' parameter to route us to the detail page. You can learn about routing and parameter passing from [Router](framework/router). ## Creating the Details Page Start by creating a 'detail' folder within `pages`, and generating the required files: ``` 📦pages ┣ 📂detail ┃ ┣ 📜index.bxml ┃ ┣ 📜index.bxss ┃ ┣ 📜index.js ┃ ┗ 📜index.json ``` Add this new page to `src/app.config.json`: ```json { "entryPage": "pages/index/index", "pages": [ "pages/index/index", "pages/detail/index" // <- Add this line ], "window": { "backgroundTextStyle": "light", "navigationBarBackgroundColor": "#fff", "navigationBarTitleText": "Title", "navigationBarTextStyle": "black" } } ``` Now you can begin drafting the code for the details page. You can do this by making some adjustments to: ┣ 📂detail ┃ ┣ 📜index.bxml ┃ ┣ 📜index.js ## Developing the Details Page Let's get started by setting up the code for the details page. We will need to update the following: ┣ 📂detail ┃ ┣ 📜index.bxml ┃ ┣ 📜index.js ```HTML {{city}} Weather Temperature: {{temperature}}°C Description: {{weatherDescription}} ``` ```js Page({ // Variables defined here are observable and can be used in templates. data: { city: "", temperature: "", weatherDescription: "", }, // Triggered when the page is loaded. onLoad(query) { this.setData({ city: query.city, }); this.updateWeather(); }, async updateWeather() { // Obtain and parse the weather data... const weatherData = await fetchWeatherData(this.data.city); this.setData({ temperature: weatherData.temperature, weatherDescription: weatherData.description, }); }, }); ``` The `onLoad(query)` function in the above code will be triggered when the page loads. `query` contains the parameters passed from the previous page, which we then access to grab the city value. It is also worth noting the `fetchWeatherData(city)` function. This function fetches and parses the weather data. However, the specifics of this action are not detailed here for simplicity. ## Conclusion This tutorial has guided you through the process of creating a simple and dynamic weather mini-program. If you followed along, congratulations on your new program! Not only did you learn the basic development process, but we hope it also inspired you to explore more about mini-program development, such as using APIs and working with real-time data. Happy coding! --- ## Document: Quick Start URL: /en/dev-docs/products/mini-program/quick-start # Quick Start import Mermaid from "../../../components/Mermaid";

Initiate your thriving business journey with us right here »

Welcome aboard the Binance Mini Program, an avant-garde development framework expressly conceived for Binance. Our dynamic platform equips developers with the capability to rapidly concoct mini program applications harnessing web-based technology. These applications are tailored to function impeccably with the Binance app. Furthermore, our Mini Program unfolds a wide array of APIs and services designed to facilitate developers with swift access to the abundance of Binance's offerings, thereby accelerating the growth of their business ventures. This guide is your swift-start navigator, providing a clear path within the Mini Program. ## Overall Development Process B(Write codes) B --> C(Debug with DevServer) B --> E(Upload to Management) E --> F(Set as Experience Version) E --> G(Submit for review) G -->|Pass review|H(Run on Binance app) F --> H I(Register and login on Management) --> J(Create a new App) J --> E;`} /> ## Download The Binance DevTools Before diving into development, equip yourself with Binance Devtools. Jump to [download](download) to get our streamlined installer. Post installation, you can login the Binance Devtools with your Binance credentials. ## Generate Your Mini Program Post login to the Binance Devtools, select the '+' icon, fill in your innovative mini program's name and project path, and press 'Create'. Voila! Your new mini program is ready for exploration! ![new-mp](/img/mini-program/new-mp.png) ![new-mp-form](/img/mini-program/new-mp-form.png) Zero in on your freshly created mini program, double click to open it. Welcome to the interactive interface of Binance Devtools! ![ide-main-interface](/img/mini-program/ide-main-interface.png) ## Showcasing the App in Merchant Workspace The mini program created by the skilled Binance Devtools comes with a default AppID. You need to register and login to our efficient [Merchant Workspace](management/management) to further your development experience. Here, you can apply for a mini program, obtain the AppID, and fill in the relevant details. We extend the feature of version control in the Merchant Workspace for you to either release the beta version or submit the final edition for our expert review. ## Compile and preview Press 'Compile' on our toolbar to view the real-time rendition of your ambitious mini program on the Binance Devtools simulator. Fancy experiencing the mini program on your personal device? Simply replace the default AppID with the one you've successfully applied for. Click 'Preview' to generate an exclusive QR code, and voila! Use your Binance app to scan the QR code and immerse yourself in the mini program experience. ![ide-update-appid](/img/mini-program/ide-update-appid.png) ## Showcase Your App Upload the mini-program files using [Binance Devtools](../mp-ide-docs/docs/public/download-stable). The minute upload is successful, your current version details will pop up in the backend. ![ide-upload-mp](/img/mini-program/ide-upload-mp.png) ## Bring Your App to the Spotlight Prod your app for meticulous review using the merchant workspace. Once the review is cleared, your visionary app will become searchable on the prestigious Binance app and users across the globe will be able to open and use it directly. --- ## Document: Mini Program Platform Operation Rules URL: /en/dev-docs/products/mini-program/operation-rules # Mini Program Platform Operation Rules ## 1. Principles and Explanations The Binance mini program platform provides developers with rich technical capabilities and traffic scenarios, and is committed to providing users with the most valuable information and services. We hope to guide developers to discover business opportunities that meet their needs while ensuring the relevance of Binance mini program to content and providing core value to users, and to generate sustainable corporate revenue while continuing to provide value to users. Mini Program developers should carefully read the Mini Programs Design Rules, and [Mini Programs Development Guide](quick-start) before developing a Mini Program. ## 2. Operation Rules ### 2.1 Rules for Registration and Submission 2.1.1 The developer should provide true and valid contact information and entity certification information. It is necessary to ensure that the entity actually providing services through the mini program must be consistent with the entity information, and the entity shall also be consistent with the payment entity. 2.1.2 The mini program submitted by the developer shall be associated with websites, applications, products or services that have complete legal rights or complete authorization. 2.1.3 To ensure the security and stability of the platform that users can access safely, the platform may require that the developer upload appropriate documents or make certain additions or adjustments to the Mini Program when submitting or operating the Mini Program. Be sure to provide such assistance based on our requirements or the submission may be rejected. 2.1.4 The services provided by the Mini Program shall match the category and tags the developer chooses as well as the services that the Mini Program provides. Additionally, they shall not fall outside the scope of the Mini Program platform's category library. Note that once the developer opts for a game as the category of your Mini Program, it will no longer be able to change it. 2.1.5 Bulk registration and repeated submission of numerous similar Mini Programs are prohibited. ### 2.2 Rules for Basic Information The name, logo, and brief description of a Mini Program constitutes its account's basic information, which shall accurately describe its features and content, help users easily understand it, and be consistent with users' expectations of its features and services. 2.2.1 The basic information of Mini Program accounts shall not contain politically sensitive issues, lewd content, gory violence, terror-related, offensive, disgusting, vulgar, inflammatory, defamatory content or in violation of local laws and regulations. 2.2.2 Basic information of Mini Program accounts: The name, logo and brief description of a Mini Program shall be interrelated to avoid user confusion over the range of features or services offered by this Mini Program. 2.2.3 The basic information of Mini Program accounts shall not contain commercial advertising dictions, names of popular Official Accounts or Mini Programs, popular app names, internet slang, piling up popular search terms, words that are not recognizable, or content that is not related to the function or content to counter the search and ranking system. 2.2.4 The basic information of Mini Program accounts shall not make unauthorized use of trademarks or brand logos to which third parties enjoy the legal rights to, or other content, information or special superscripts/subscripts similar to these trademarks or brand logos. Developers shall not infringe upon third parties' intellectual property rights or other legal rights. 2.2.5 The basic information of the Mini Program accounts shall not have attraction click and distribution related content, and shall not contain official website, invitation code, URL, telephone, address, social account and other related contact information of attraction behavior, interfering with the use of users. 2.2.6 The basic information of the Mini Program accounts: The name, logo, description and other specific audit standards refer to the [Mini Program Naming Audit Rules](audit-rules#2-naming-audit-rules), [Mini Program Icon Audit Rules](audit-rules#audit-rules#4-logo-audit-rules), [Mini Program Description Audit Rules](audit-rules#3-description-audit-rules). ### 2.3 Rules for Feature Settings 2.3.1 The services and content provided by a Mini Program shall conform to its brief description and no hidden services or content are allowed. 2.3.2 The core features of Mini Programs must be showcased on their homepages. 2.3.3 The Mini Programs provide users with basic feature guidelines, which shall incorporate descriptions of features or relevant screenshots thereof. 2.3.4 Developers shall not incorporate features identical or similar to those offered by the Binance app. 2.3.5 The access to any Mini Program features shall not be dependent on any other Mini Programs or apps. That is, the access to the features shall not be conditional upon the use of other Mini Programs or apps. Additionally, without the prior consent of or authorization from the platform, a Mini Program interface shall not display or recommend other Mini Programs or Official Accounts. 2.3.6 According to the local laws and regulations, and as required by mobile operating systems, app stores or the market, Mini Programs shall remind users when they access content or services that may not be appropriate for minors or remove the content or services in order to protect minors' physical and mental health as well as to safeguard their legal rights. ### 2.4 Rules for Entities 2.4.1 The development and operation of Mini Programs shall comply with local laws, regulations, and standards. The platform will reject any submission which is reasonably believed to be illegal or non-compliant. 2.4.2 The documents submitted by the developer must be genuine, legal, and valid. The platform will review the release of the Mini Program within the bounds of its authority and the applicable law. 2.4.3 Any Mini Program that can be reasonably believed to involve or assist in unlawful activities will be rejected. ## 3. Contents Rules ## 3.1 Rules for Page Contents 3.1.1 There can be no defamatory, discriminatory or malicious content, including references or comments about religion, race, sexual orientation, gender, nationality, ethnic origin or other target groups. 3.1.2 There can be no realistic depictions of humans or animals being killed, maimed, tortured, abused, or encouraging violence. In the game, "enemies" cannot be singled out against a specific race, culture, real government or corporation, or any other real entity. 3.1.3 There can be no descriptions that encourage the illegal use or irresponsible use of weapons and dangerous goods, or that promote the purchase of arms or ammunition. 3.1.4 There must not be material promoting pornographic or erotic content (i.e. material intended to arouse eroticism, explicit descriptions or displays of sexual organs or acts, and not related to aesthetics), or material suspected of promoting the dissemination of information on obscene or erotic content, including revealing images, provocative content, etc., or contents that facilitate prostitution. 3.1.5 Cannot contain inflammatory religious commentary or make false or misleading references to religious texts 3.1.6 The Mini Program must not have suspected of fraudulent user behavior or false advertising content, including false or impersonation type content 3.1.7 The Mini Program must provide meaningful contents ### 3.2 Rules for User-Generated Content 3.2.1 The service provider of Mini Programs shall not publish content on behalf of the user without the user's permission 3.2.2 The service provider of Mini Programs should set up mechanisms to filter pornographic, violent, offensive, discriminatory and other inappropriate information content, to ensure that user-generated content in line with the provisions of the information content 3.2.3 When there is a complaint about inappropriate content in the Mini Program, the service provider needs to provide a mechanism for timely response 3.2.4 The service provider of Mini Programs is responsible for the safety of the content, to ensure that the external display of content compliance, reliable, for other links that may generate content should also be strictly gate-keeping, to prevent the appearance of the above-mentioned violations. ### 3.3 Disallowed Mini Program Types Please refer to [Disallowed Mini Program Types](audit-rules#1-disallowed-mini-program-types) ### 3.4 Rules for Embedding Web Pages in Mini Programs 3.4.1 The Mini Program can only open the web page through the embedded web-view, and is not allowed to embed the web page directly on the homepage of the Mini Program as its primary content. 3.4.2 The services provided on the web pages embedded in the Mini Program shall match the category and tags you choose as well as the services that the Mini Program provides. 3.4.3 Developers shall not bypass or evade the Mini Program platform rules by use of embedded web pages in Mini Programs. 3.4.4 Developers should not use embedded web-views to provide games to users. 3.4.5 Once a developer is found in violation of this rule, the platform is entitled to restrict the features or disable the account of their Mini Program, and reserves the right to refuse to provide any services to the Mini Program entity. ## 4. Rules for Technology Implementation ### 4.1 Use of APIs 4.1.1 Non-public API programs shall not be used. 4.1.2 The platform reserves the right to reclaim the APIs if the API program is used under internal testing. 4.1.3 The developer may not use APIs for third-party apps in a manner that violates the inter-entity rule. 4.1.4 Mini Program Framework's codes, APIs, or tools shall not be sold, transferred, or licensed to others without Binance’s authorization. 4.1.5 Neither SDK nor its related components shall be modified, translated or reverse engineered, nor shall they be used to make derivative products. ### 4.2 OAuth Login 4.2.1 Users must log in to the Mini Program via Binance OAuth Login when an account system is used within the Mini Program. 4.2.2 If the user chooses to reject authorization, the developer may remind them again when the user shows the intention to grant the authorization. 4.2.3 A functional "Exit" option must be provided at a noticeable position. 4.2.4 After the user has rejected authorization, the developer is obligated to remove and stop using the user's email, phone number and other data. ### 4.3 Binance Pay 4.3.1 If a Mini Program processes payments, clear instructions shall be provided in the introduction of the Mini Program. 4.3.2 The user should receive a clear prompt on the screen before executing the payment action. 4.3.3 Payment via the Mini Program platform shall be made in compliance with applicable local laws and regulations. ### 4.4 Sharing Service Developers shall not abuse the sharing feature in the services offered by their Mini Programs. Examples are forcing users to share, and inducing users to share with incentives, either express or implied. ### 4.5 Message Service ( unreleased ) The Mini Program should not induce users in bad faith to trigger the operation that distributes templates to users, should not send maliciously harass users or distribute templates that may harass users, or distributes promotion templates for malicious marketing purposes. ## 5. Code of Conduct ### 5.1 Bypassing, circumventing or countering platform auditing and regulation The version of the Mini Program submitted for review and approval should be consistent with the version of the Mini Program actually published and operated online. Developers shall not bypass, circumvent or confront the audit and supervision rules of the Mini Program platform through technical or other means, including but not limited to: displaying content under different service categories for different user groups, or falsifying qualifications, or adopting false or imitation complaint portals or flashing and splash screens to intercept user complaints, and other malicious acts to bypass, circumvent or confront the audit and supervision of the platform. Penalties: - Once found, the mini program will be taken down or be blocked depending on the degree of violation. - If there is malicious publication of such content, all Mini Programs under the same developer account will be restricted in their functions until the platform refuses to provide services to the account any more, depending on the degree of violation. ### 5.2 Collection of users' private information 5.2.1 The developer shall acquire the consent of the user before collecting their information, and shall truthfully notify the user of the purpose and scope of use. 5.2.2 The illegal collection or theft of user passwords or other personal data is not permitted. 5.2.3 Access to devices including, but not limited to, the user's geolocation, photo albums, camera, etc. is not permitted without the user's authorisation. 5.2.4 Data related to the user should be removed from the Mini Program upon the user's request. 5.2.5 The developer must immediately delete all user data collected via Mini Programs if he / she stops using Mini Program Platform. 5.2.6 The developers are not authorized to disclose users' information, including their name, mobile number, email address, wallet address to any other Mini Program users or to any other third parties. 5.2.7 The developers are not authorized to use users' information, including their name, mobile number, email address, or wallet address, for any purposes that either they or the platform have not authorized. 5.2.8 The developers are not authorized to reverse lookup, track, link, mine, or obtain any user's name, mobile number, email address,wallet address, or other information to engage in acts unrelated to Mini Programs. 5.2.9 The developers are not authorized to copy, store, use, or transfer any user data without the user's expressed consent and without the truthful disclosure of applicable information such as how such data is used and the scope of its use. 5.2.10 Any data received via Mini Program Platform should be kept up to date and used to improve Mini Program user experience. 5.2.11 The developer may not add any Mini Program data into search engines or web directories, or add a search feature into the Mini Program without approval or authorization from the Binance. 5.2.12 The developer may not use any data received by Mini Programs to make any decisions regarding eligibility, including without limitation whether to approve or reject an application or how much interest to be charged on a loan without approval or authorization from Binance 5.2.13 Any data you have received via Mini Programs must only be used in your Mini Program in the event that the entity operating the Mini Program is acquired or merged by a third party. 5.2.14 Please take care of the developer's personal account, password and secret. 5.2.15 After collecting users' data, the Mini Program shall take necessary, reasonable and effective security protection measures to prevent any form of theft, leakage or disclosure of users' data. 5.2.16 If any form of theft, leakage or disclosure of user data occurs after the Mini Program has collected the user's data, it should immediately take lawful and effective measures to prevent the expansion of the damage results and report to the relevant authorities in accordance with the law. Penalties: - Once found, the Mini Program will be taken down. - If found again, the app will be taken down or be blocked depending on the degree of violation. - If there is malicious publication of such content, all Mini Programs under the same developer account will be restricted in their functions until the platform refuses to provide services to the account any more, depending on the degree of violation. ### 5.3 Malicious disruption of the platform 5.3.1 For personal or other reasons, maliciously posting undesirable information, insulting reviewers or attacking the platform in the context of the review, posting, email, community, etc. 5.3.2 The Mini Program has malicious non-revision and repeated submission of the same problematic content after being rejected for non-compliant content or non-conformity with the specification in audit sessions including but not limited to basic information, version iteration, traffic configuration, etc. Penalties: - Once found, the auditing will be rejected. And the Mini Program will be taken down, or banned. - If there is malicious publication of such content, all Mini Programs under the same developer account will be restricted in their functions until the platform refuses to provide services to the account any more, depending on the degree of violation. ### 5.4 Trading disputes Transaction disputes in the Mini Program should be dealt with promptly. Transaction dispute behaviour includes the inability to give the appropriate service or goods after payment by the user, the inability to apply for returns or other after-sales services, etc. Penalties: - Once found, the Mini Program will be required to complete the rectification within a certain period of time. - If found again, the app will be taken down or be blocked depending on the degree of violation. - If there is malicious publication of such content, all Mini Programs under the same developer account will be restricted in their functions until the platform refuses to provide services to the account any more, depending on the degree of violation. ### 5.5 Reciprocal promotions All the developers shall not recommend, promote, rank, incorporate an inter-program jump feature into, or add platform services to Mini Programs independently or together with any third parties by virtue of Binance’s services, nor help facilitate these actions. Penalties: - Once found, the Mini Program will be taken down. - If found again, the app will be taken down or be blocked depending on the degree of violation. - If there is malicious publication of such content, all Mini Programs under the same developer account will be restricted in their functions until the platform refuses to provide services to the account any more, depending on the degree of violation. ### 5.6 Fraud Fraud includes but is not limited to fake Red Packets, fake promotional campaigns, false advertising, as well as counterfeiting Binane’s or other entities' services. Penalties: - Once found, the Mini Program will be banned. - If there is malicious publication of such content, all Mini Programs under the same developer account will be restricted in their functions until the platform refuses to provide services to the account any more, depending on the degree of violation. ### 5.7 Deceptive Practices When using a Mini Program's information, such as name, icon, introduction, description, and features, that does not match its entity's information, you must avoid causing the following deception, misunderstanding, association, or influence to users. For example: 5.7.1 Deception related to Binance’s official features; 5.7.2 Deceiving users into believing that a Mini Program has been developed or is operated by certain government agencies, public institutions, and social organizations (regardless of whether such organizations exist or not). Penalties: - Once found, the Mini Program will be banned. - If there is malicious publication of such content, all Mini Programs under the same developer account will be restricted in their functions until the platform refuses to provide services to the account any more, depending on the degree of violation. ### 5.8 Abuse of API capability Mini Programs must use the various features, APIs, and capabilities provided by Binance in a lawful, compliant, proper, and good faith manner pursuant to the applicable Mini Program agreements and guidelines so as to protect the rights and interests of Binance users and other third parties. Developers may not help others or independently abuse, inappropriately use, or in bad faith use the above features, APIs, and capabilities, including without limitation, using an API, feature, or capacity to assist a third party in the violation of the applicable Mini Program agreements and guidelines. Penalties - Depending on the severity of the violation, the Mini Program's non-compliant template will be deleted, its API capability will be suspended, or its account will be banned. ### 5.9 No discretionary suspension or termination of operations If the Mini Program developer has to suspend or terminate the operation of the Mini Program under special circumstances, the developer must handle the aftercare work such as transactions in transit and unresolved disputes/complaints, and must not damage the legitimate rights and interests of users; and at the same time, display the suspension or termination announcement prominently on the home page of its Mini Program and notify the Mini Program Platform in advance before suspending or terminating the operation. If the developer arbitrarily suspends or terminates the operation of the Mini Program, resulting in complaints from users or causing losses to users, the corresponding responsibility will not be reduced or exempted due to the suspension or termination of the operation of the Mini Program. The platform will pursue the responsibility of the developer according to the severity of the circumstances. ### 5.10 Malicious traffic/transaction scraping Developers should make reasonable use of self-operating tools for Mini Programs based on their own service advantages, and guide users to continuously and repeatedly use their services or guide them to make objective evaluations through proper means, and should not maliciously brush transaction volume or traffic through improper methods. ### 5.11 Other violations of the platform operation rules The content of the Mini Program must also not contain information that violates the rules of the platform as follows. 5.11.1 Content that is primarily for marketing or advertising purposes (e.g. contains blank advertising space, investment advertisements, etc.), or appears directly as floating advertisements, or appears as false and exaggerated advertising information. 5.11.2 Rumour-based content that is misleading to users, seriously disrupts the user experience and harms the interests of users. 5.11.3 Content that violates any form of service agreement, platform agreement or function agreement signed with Binance. 5.11.4 Any content that violates the management, operation specifications and rules set by Binance for the relevant software, services and functions. 5.11.5 Any other content that involves violation of local laws or violation of relevant rules of the platform. ## 6. Rules for Availability and Completeness 6.1 The Mini Program submitted shall be a finished product, which can be opened and used, and shall not be a test version. 6.2 The Mini Program should not cause the Binance app to crash or the program itself to crash. 6.3 There should be no major bugs (such as inability to add, open, return to the previous pages and exit, and serious stutter) in the Mini Program. 6.4 Developers shall ensure the Mini Programs they release are stable and secure, and run smoothly. If the service provided to users is interrupted due to the Mini Program itself and cannot be restored within the platform’s required reasonable period of time, the platform is entitled to take action to maintain a good user experience, including, but not limited to, temporarily suspending the account. 6.5 If there are related accounts or paid content in the Mini Program, a test account, including account ID and password, shall be provided to Binance to ensure that the internal reviewer can experience all features. ## 7. Rules for Mini Program's UI 7.1 The UI should comply with Mini Program Design Specifications. 7.2 The UI should be in line with the Binance appearance and features, and should not provide a user experience that changes the appearance and features of Binance. 7.3 The ability to close the flyouts and pop-up windows in the Mini Program should be ensured. 7.4 The Mini Program UI shall not contain any elements that imitate system notifications or warnings to induce tapping. ## 8. Roles for User Service 8.1 The developer should establish convenient and effective user service and complaint channels for users, and provide effective dispute handling methods and contact information. User feedback flowing to the developer's platform should be handled in a timely manner, and complaints should be handled within 24 hours. 8.2 If there is too much feedback from users on the same day, some entrances will be dsiabled or taken down depending on the severity of the problem. 8.3 If the developer has formulated a user service agreement or terms and conditions with equivalent legal effect for the Mini Program, the relevant agreement and terms and conditions shall not be contrary to the Mini Program Platform Operation Rules and related documents, rules and specifications, otherwise the relevant agreement and terms and conditions shall be invalid and the platform shall have the right to handle disputes between the developer and the user in accordance with the platform specifications. ## 9. Local Law Compliance The developer shall comply with local laws, and respect local social norms throughout the course of use of Mini Program platform services. The developer shall be held solely liable if any of his / her actions are in violation of laws or social norms. Mini Program developers shall refrain from using this service in a way that would implicate Binance in political or public incidents. Otherwise, Binance is entitled to suspend or terminate your use of such service. ## 10. Disclaimer of Mini Program Platform Operation Rules Mini Program developers clearly understand and agree that Binance does not provide any kind of express or implied warranties or conditions regarding Mini Program services, including without limitation commercial and specific applicability. The use of Mini Programs shall be at the developer’s own risk. ## 11. Documentation Updates This is a document that will be regularly updated. We will revise and update it and set forth new rules based on new problems, applicable laws, or current product operation requirements to ensure Binance users' experience. Please check this document for updates and review it regularly to ensure that you know about the latest updates. --- ## Document: Mini Program Platform Merchant Enrollment URL: /en/dev-docs/products/mini-program/merchant-enrollment # Mini Program Platform Merchant Enrollment # How to Become a Binance Marketplace Merchant? ## Stage 1 Assessment: Business Case Approval Reach out to the Binance Marketplace team (merchant@binance.com) to initiate the business assessment of your mini program. Please note that this assessment is a mandatory step prior to development. Upon successful assessment, you will need to sign a Binance Mini Program Agreement (contact Binance Marketplace team) and register for a Binance Mini Program [here](https://developers.binance.com/en/mpp/login) (ensure you are logged into your Binance corporate account). ## Stage 2 Assessment: Store Approval (SKUs, UI/UX, etc.) You may kickstart development once all steps above are completed and approved. If you start development before the business review, please be aware that this will be at your own risk and resource allocation. The testing and launch of your mini app are subject to Binance’s review and approval. Please note that Binance reserves the right to decline access to the Binance Marketplace services. ## Stage 3: Launch & Post-Launch Marketing --- ## Document: CLI URL: /en/dev-docs/products/mini-program/cli # CLI This document is a comprehensive guide on how to utilize the bmp Command Line Interface (CLI). ## CLI Download Let's start by installing the CLI. ```bash # optional # Set the Binance npm registry (if not set already) # npm config set @binance:registry https://npm.binance.com # Install the CLI globally $ npm install -g @binance/mp-cli ``` ## CLI Usage Breeze through the following commands to get used to the bmp CLI: ### Creating a New Project ```bash $ bmp init [project-name] ``` Running the above command will conjure an initialized mini-program project brimming with potential! For instance: ```bash $ bmp init magnificent-mini-program ``` ### Adding Support to an Existing React Project ```bash # Navigate to the project root directory $ cd [path-to-desirable-project-root] # Run bmp bootstrap $ bmp bootstrap ``` The above commands spin off a `.bmp` directory and add essential configurations to the existing `tsconfig.json` file. This ensures support for importing @binance/\*, thereby enabling TypeScript syntax support. ### Kicking Off with devServer ```bash # Navigate to the project root directory $ cd [path-to-project-root] # Run bmp dev $ npx bmp dev ``` Introducing the command that compiles your project and spins up `devServer`, listening on `locahost:3000` by default. As you hop into the project and select the `dist` project, you will be greeted by your running mini-program. With `liveReload` enabled on `devServer`, any changes to your code will trigger an automatic rebuild and refreshes the page. ### Build and Compile ```bash # Navigate to the project root directory $ cd [path-to-project-root] # Run bmp build $ npx bmp build ``` Compiling the project code has never been easier! The above command renders mini-program files in the project directory. With [Binance Devtools](download), developers can smoothly upload these files to the management portal for release or swift online testing. --- ## Document: Mini Programs Audit Rules URL: /en/dev-docs/products/mini-program/audit-rules # Mini Programs Audit Rules ## 1. Disallowed Mini Program Types - Advertising and promotion - Game aggregation platform - Information aggregation platform - Lending Information Intermediary - Spot/Futures Trading - Services for Enterprise - Services that conflict with the Binance business model ## 2. Naming Audit Rules ### 2.1 Rules for Naming Settings #### 2.1.1. Composition and Word Limit The name of a Mini Program should be between 3 and 30 characters long, and an unicode character is equal to 3 characters. The Mini Program should try its best to set the internationalization of the name. #### 2.1.2. Unique The name of the Mini Program should be unique. The Mini Program of different entities cannot have the same name. #### 2.1.3. Recognizable The name of the Mini Program must be relevant and recognizable to the description and the services provided in the Mini Program, and is not allowed to be duplicated, highly similar or confusing with the name of the Mini Program already online. The recommended name is a brand, trademark or a short word with recognizable characteristics. ### 2.2 Prohibitions and Restrictions #### 2.2.1. Name is too broad The name of the Mini Program shall not be too broad, thus causing confusion to users, and shall not be named directly or in combination with generic words without different attributes such as nouns, industry category words, product names, activity names, function words, local domain names, marketing words, etc. #### 2.2.2. Illegal or Unlawful Content 2.2.2.1 The name shall not involve pornography, violence and other illegal and unlawful content, shall not involve politics, shall not contain politically sensitive, pornographic, violent and bloody, terrorist content, racial discrimination or content contrary to local laws. 2.2.2.2 Shall not involve intellectual property infringement: in the absence of trademark or brand authorization, the name shall not infringe upon the legitimate intellectual property rights of others, and shall not use without authorization the trademarks, brand logos and other content of third parties enjoying legitimate rights and interests or content, information or special corner markings similar to them. 2.2.2.3 Shall not infringe on the legitimate rights and interests of others: shall not infringe on the legitimate rights and interests of others such as privacy, reputation, portrait and name rights. #### 2.2.3. Inconsistent with the Main Business Content If the name points to specific categories/categories and other industry information, the service content in the Mini Program must contain the category/category content corresponding to the name. #### 2.2.4. Deception related to Binance’s official For non-official accounts, it is forbidden to have the same content in the account name as the existing intellectual property content of Binance, and other content that is easily confused with the theme and appearance of the existing Binance product design. ## 3. Description Audit Rules 3.1 The description length of the Mini Program is between 100-300 characters, the Tagline length is within 60 characters, and an unicode character is equal to 3 characters. The Mini Program should try to complete the internationalization setting of the description. 3.2 The core function points of the Mini Program must be introduced accurately, no false introduction, no description with too broad content, ambiguous semantics, or garbled code without actual semantics and no relevance to the Mini Program. 3.3 Avoid the complete repetition or basic repetition of the name of the Mini Program, and introduce the core function points of the Mini Program to users as precisely as possible, so that users can understand it quickly and intuitively. 3.4 There’s no politically sensitive, pornographic, violent and bloody, terrorist content and other illegal content prohibited by local laws and regulations. It is not allowed to violate the privacy, reputation, portrait rights, intellectual property rights, trade secrets and other legal rights of others. 3.5 There’s no content in the description to be identical or similar to the existing intellectual property content of Binance, or confusing with the theme and appearance of existing Binance products. 3.6 There’s no information that leads users to download or to join other platforms (including but not limited to links to induce download of APP, information of other platform accounts, etc.). ## 4. Logo Audit Rules ### 4.1 Rules for the Developer Logo 4.1.1 The developer logo should be clear, with 144\*144 pixels, and the text and graphics inside the logo should be clearly visible and not cropped by the circular container. 4.1.2 The developer logo is not allowed to involve pornography, violence and other illegal and illegal contents, and is not allowed to involve politics. 4.1.3 The developer logo is not allowed to violate the privacy, reputation, portrait rights, intellectual property rights, trade secrets and other legal rights of others. 4.1.4 The developer logo is not allowed to be duplicated or confused with existing accounts (suspected of infringement). 4.1.5 The developer's logo is not allowed to contain advertising information that is not related to the account's operational content. 4.1.6 The developer logo is not allowed to contain QR code of any platform. 4.1.7 The developer logo is not allowed to contain information that leads users to download or join other platforms (including but not limited to links to induce download of APP, information of other platform accounts, etc.). 4.1.8 The developer's logo is not allowed to contain words that are identical or similar to the content of the existing intellectual property rights of Binance, or content that is easily confused with the theme and appearance of the existing Binance product design. ### 4.2 Rules for Mini Program icon 4.2.1 The Mini Program icon should be clear, with 96x96 pixels and the core logo graphic recommended to be around 72x72. The text and graphics inside the logo should be clearly visible and not cropped by the circular container. 4.2.2 Do not use QR code as a Mini Program icon. If you use a portrait as a Mini Program icon, please make sure you have got authorization from the portrait right holder. 4.2.3 The Mini Program icons are not allowed to have prohibited, vulgar or offensive characters and patterns, and cannot have political tendency or political color. 4.2.4 The Mini Program icons cannot use intellectual property rights such as trademarks that have been registered or have legal rights by others. 4.2.5 No red dots, NEW, HOT, or logos imitating the Label of the Mini Program are allowed to appear on the Mini Program icons. 4.2.5 The Mini Program icon is not allowed to contain words that are identical or similar to the content of the existing intellectual property rights of Binance, or content that is easily confused with the theme and appearance of the existing Binance product design. ## 5. Content Audit Rules ### 5.1 Rules for Page Contents 5.1.1 There can be no defamatory, discriminatory or malicious content, including references or comments about religion, race, sexual orientation, gender, nationality, ethnic origin or other target groups. 5.1.2 There can be no realistic depictions of humans or animals being killed, maimed, tortured, abused, or encouraging violence. In the game, "enemies" cannot be singled out against a specific race, culture, real government or corporation, or any other real entity. 5.1.3 There can be no descriptions that encourage the illegal use or irresponsible use of weapons and dangerous goods, or that promote the purchase of arms or ammunition. 5.1.4 There must not be material promoting pornographic or erotic content (i.e. material intended to arouse eroticism, explicit descriptions or displays of sexual organs or acts, and not related to aesthetics), or material suspected of promoting the dissemination of information on obscene or erotic content, including revealing images, provocative content, etc., or contents that facilitate prostitution. 5.1.5 Cannot contain inflammatory religious commentary or make false or misleading references to religious texts 5.1.6 The Mini Program must not have suspected of fraudulent user behavior or false advertising content, including false or impersonation type content 5.1.7 There must not be any content on the page of the Mini Program that misleadingly and incorrectly implies that there is any cooperation, investment or endorsement relationship between Binance and the Mini Program, such as misleadingly and incorrectly implying that Binance is the operator of the Mini Program, or misleadingly and incorrectly implying that Binance endorses its quality, service or cooperation with it in any form when the Mini Program is not in fact operated by Binance. ### 5.2 User Privacy and Data Security 5.2.1 When collecting and using any user data, the user must be clearly informed of the purpose of the data, ensure that it is explicitly agreed and authorized by the user, and should make reasonable use within the scope of the user's agreement and authorization. The relevant data shall be deleted after the user cancels the account. 5.2.2 The Mini Program must obtain the user's explicit consent and authorization before publishing, sending or forwarding any content instead of the user. 5.2.3 The Mini Program should request users to enter Binance username or password on any pages. 5.2.4 The Mini Program should not display users’ related data, such as: avatar, nickname and other information without their authorized consent. 5.2.5 The Mini Program cannot directly pop up the authorization page when users enter the first screen. 5.2.6 The Mini Program is not allowed to force authorization; the service is still available after the user cancels authorization. 5.2.7 The Mini Program should not request for users’ authorization on multiple pages and for the multiple categories. ### 5.3 Sensitive Content Filtering 5.3.1 There’s no irrelevant, or sensitive or offensive content in the dynamic content such as search boxes and search results. 5.3.2 The Mini Program which contains an user-definable input, needs to have a sensitive content filtering mechanism 5.3.3 The Mini Program which contains an user-definable image uploading, needs to have a sensitive image filtering mechanism ## 6. Quality and Audit ### 6.1 Rules for Functional audit #### 6.1.1 Page Display 6.1.1.1 There’s no sensitive and illegal information in the titles, context and images. 6.1.1.2 There’s no abnormal size, distortion or blurring images on the page. 6.1.1.3 When there is no image or loading failure, there must be a default image as the placeholder. 6.1.1.4 There’s no text and links that lead users to download third party apps. 6.1.1.5 There’s no no blank pages. 6.1.1.6 Sensitive information must be desensitized for display (ID, phone, email, etc.). 6.1.1.7 The customer service email must be accessible. 6.1.1.8 The embedded web page must be adapted according to the mobile layout. 6.1.1.9 The title of the page must be relevant to the current operation. #### 6.1.2 Pop-ups 6.1.2.1 The pop-up must have a close button, and the user must not be forced to click on the pop-up to enter the next step. 6.1.2.2 The pop-up cannot be cycled after the user closes it, and the user must be able to continue using the normal service after closing the pop-up with a button. 6.1.2.3 The pop-up cannot overlap/repeat, and the same pop-up cannot be popped up repeatedly on different pages within the Mini Program. 6.1.2.4 The Developer cannot display exaggerated content on the pop-up to coerce users to click. #### 6.1.3 Reliability The Mini Program should give the user a corresponding prompt in case of network abnormality, loading timeout, system error, etc., and no other errors such as crashes. #### 6.1.4 API The Mini Program should ensure that each API call is functionally correct, including Binance Pay, Binance OAuth Login, etc. #### 6.1.5 Categories 6.1.5.1 The Mini Program category is consistent with the content provided on the page. 6.1.5.2 The core content in the Mini Program page must be consistent with the category selected for that Mini Program. 6.1.5.3 The user can use the service category on the page. The service must not hide it or need multiple navigation. 6.1.5.4 The core functions provided by the Mini Program must be displayed on the home page. #### 6.1.6 Accounts 6.1.6.1 If the Mini Program has an account system, it must provide an "logout" option for users. 6.1.6.2 If the main process involves test account login, test environment configuration, the developer needs to provide the test account and test information when submitting the audit, and if there is a test report, please provide the test report at the same time. ### 6.2 Rules for Performance Audit #### 6.2.1 Runtime The Mini Program does not crash, and does not cause Binance APP to crash. There’s no javascript exceptions or business logic errors. #### 6.2.2 Interaction 6.2.2.1 The Mini Program should not spend too long time to load pages, or to respond to user actions. The Mini Program should work properly when both in the weak network ( 2G, 3G ) and good network ( LTE, wifi ). 6.2.2.2 If the page fails to load, a page prompt is required with the ability to let users retry. 6.2.2.3 If the page takes a long time to load, a loading hint is required. #### 6.2.3 Resources 6.2.3.1 The Mini Program should not load too many resources. 6.2.3.2 The Mini Program should not have too many requests when loading the pages. 6.2.3.3 No continuous, heavy CPU-consuming threads. ### 6.3 Compatibility Model Recommendations Android covers 5.x and higher iOS covers 9.x or higher ## 7. Documentation Updates This is a document that will be regularly updated. We will revise and update it and set forth new rules based on new problems, applicable laws, or current product operation requirements to ensure Binance users' experience. Please check this document for updates and review it regularly to ensure that you know about the latest updates. --- ## Document: Announcement URL: /en/dev-docs/products/mini-program/announcement # Announcement ## Mini Program Crucial Update ### Notice: Termination of Support for JS SDK <4.0 > Announcement Date: November 21, 2022 We hereby announce the cessation of support for JS SDK <4.0. Immediate action necessary: Upgrade your JS SDK to ^4.x or later versions and confirm that your Mini Program functions seamlessly with the most recent version of Native with SDK ^4.x. For any assistance required, our team is readily available. #### End Of Life (EOL) Notice Our Mini Program hereby discontinues its support for the following JS SDK versions marking their End of Life (EOL): | Most Recent Supported Native Version | Correlated JS SDK Version | EOL Status | | ------------------------------------ | ------------------------- | -------------------- | | 2.35 | JS SDK ^1.x | Ended on 2021-09-09 | | 2.46 | JS SDK ^2.x | Ended on 2022-05-19 | | 2.58 | JS SDK ^3.x | Ending on 2022-12-22 | | | JS SDK ^4.x | Continues LTS ⭐️ | #### Key Notes on Breaking Changes ##### Deprecation of Template Tags ` ``` ### 3. Add mapping of pages and skeletons in `config.json` ```json { "pages/index/index": "skeleton/page/index", "pages/list/list": "skeleton/page/index" } ``` ### 4. After page ready, using `this.removeSkeleton()` remove skeleton ```js { onLoad() { // request data getData().then((pageData) => { this.setData({ pageData }, () => { this.removeSkeleton && this.removeSkeleton(); }); }); } } ``` You can find removeSkeleton on page instance too ```js const pages = globalThis.getCurrentPages(); const current = pages[pages.length - 1]; current.removeSkeleton && current.removeSkeleton(); ``` --- ## Document: Scene Value URL: /en/dev-docs/products/mini-program/framework/scene-value # Scene Value > Beginning with SDK library version 1.2.0 The scene value describes a path in which a user enters a Mini Program. You can refer to the Scene Value List for a detailed definition of the scene value. ## Retrieve the scene value Developers have the ability to obtain the scene value using `onLaunch` and `onShow` in the App or through the `bn.getLaunchOptions` method. ## Scene Value List | Scene Value ID | Description | | -------------- | --------------------------------- | | 1000 | others | | 1001 | second floor | | 1002 | second floor - recent used | | 1003 | main entrance - home | | 1004 | main entrance - more | | 1005 | second floor - search | | 1009 | banner | | 1010 | favirote | | 1011 | qrcode | | 1014 | push notification | | 1027 | second floor - search - used apps | | 1037 | open by mini program app | | 1038 | return from mini program app | | 1054 | search, quick entrance | | 1300 | short link | | 1301 | webview bridge | | 1135 | related apps in the about page | | 1103 | Lite mode home page | --- ## Document: Router URL: /en/dev-docs/products/mini-program/framework/router # Router ## Routing API In a mini-program, default routing features are presented and don't necessitate any further configuration by the developer. You just need to declare the pages in the configuration of the entrance file, then you can jump to the destination page by utilizing the API provided by the mini-program. For example: ```javascript // Navigate to the destination page and open a new page bn.navigateTo({ url: "/pages/page/path/name", }); ``` ```javascript // Navigate to the destination page and open it on the current page bn.redirectTo({ url: "/pages/page/path/name", }); ``` For a detailed description of the API, please refer to the [API](api) documentation. ## Route Passing You can redirect by appending a query string parameter after all the jumped URLs. For example: ```javascript // Pass in the parameters id=2&type=test bn.navigateTo({ url: "/pages/page/path/name?id=2&type=test", }); ``` In this case, the passed parameters will be available in the lifecycle method of the target page once the jump is successful. This can be accessed through `getCurrentInstance().router.params`. For the above navigation action, in the `onShow()` lifecycle of the target page: ```javascript Page({ onShow() { console.log(getCurrentInstance().router.params); // output { id: 2, type: 'test' } }, }); ``` ## EventChannel When calling `navigateTo`, we can use `EventChannel` to facilitate communication between the opener page and the opened page. For instance: ```javascript // Page A bn.navigateTo({ url: "/pages/page/path/B", events: { // Add listeners to receive data from the opened page acceptDataFromOpenedPage: function (data) { console.log(data); }, someEvent: function (data) { console.log(data); }, }, }).then((res) => { // Send data to the opened page res.eventChannel.emit("acceptDataFromOpenerPage", { data: "I am the opener page" }); }); ``` ```javascript // Page B Page({ onShow() { const eventChannel = getCurrentInstance().page.getOpenerEventChannel(); // Send data to the opener page eventChannel.emit("acceptDataFromOpenedPage", { data: "I am the opened page" }); eventChannel.emit("someEvent", { data: "test" }); // Add listener to receive data from the opener page eventChannel.on("acceptDataFromOpenerPage", function (data) { console.log(data); }); }, }); ``` --- ## Document: Initial Rendering Cache URL: /en/dev-docs/products/mini-program/framework/rendering-cache # Initial Rendering Cache ### How Initial Rendering Cache Works The initialization of a mini-program page is divided into two parts: 1. Logic layer initialization: Load essential mini-program code, initialize the page `this` object (which includes all `this` objects related to custom components), and then send relevant data to the view layer. 2. View layer initialization: Load essential mini-program code, then wait for the logic layer to be initialized and receive the data sent by the logic layer, and finally render the page. During the startup of the page, especially during the cold startup of the mini-program and when entering the first page, the logic layer initialization time is relatively long. During the page initialization process, users will see the standard loading screen of the mini-program (during the cold start) or may experience slight flashes of white screen (during the page jump process). When the initial rendering cache is enabled, the view layer does not need to wait for the logic layer to be initialized, it can directly display the rendering result of the initial page `data` to the users in advance, which greatly advances the time when the page is visible to the users. Its working principle is as follows: 1. After a mini-program page is opened for the first time, the rendering result of the initial data of the page is recorded and written to a persistent cache area (the cache can be retained for a long time, but it may be cleared due to mini-program updates, basic library updates, storage space recycling, and other reasons). 2. When this page is opened for the second time, check whether there is still the rendering result of the last initial data of this page in the cache. If there is, it will directly display the rendering result. 3. If the rendering result in the cache is displayed, this page cannot temporarily respond to user events, and can only respond to user events after the logic layer is initialized. Using the initial rendering cache, you can: - Quickly display parts of the page that will never change, such as the navigation bar. - Display a skeleton page in advance to enhance the user experience. - Display custom loading tips. - Display advertisements in advance, and so on. ### Static Initial Rendering Cache The easiest way to enable initial rendering cache is to add the configuration item `"initialRenderingCache": "static"` in the page's json file: ```json { "initialRenderingCache": "static" } ``` After adding this configuration item, preview the mini-program homepage on your phone, then kill the mini-program and re-enter it, the homepage will be rendered by the initial rendering cache. Note: In this case, the initial rendering cache records the result of applying `data` to `BXML` on the page and does not include the result of any `setData` (For tarojs, it will records the result of first setData). For example, if you want to display the words "loading" on the page, these words are controlled by the `loading` data field: ```html Loading ``` In this case, `loading` should be specified in `data` as true: ```javascript // Correct way Page({ data: { loading: true, }, }); ``` And not through `setData` to set `loading` as true: ```javascript // Incorrect way! Don't do this! Page({ data: {}, onLoad: function () { this.setData({ loading: true, }); }, }); ``` ### Adding Dynamic Content to the Initial Rendering Cache In some cases, the rendering result of just the page data might be somewhat limited. Sometimes, you may want to display additional variable content, such as some advertisement. In such cases, you can use the "dynamic" initial rendering cache. Firstly, you need to configure `"initialRenderingCache": "dynamic"`: ```json { "initialRenderingCache": "dynamic" } ``` At this point, the initial rendering cache will not be automatically enabled. You still need to call `this.setInitialRenderingCache(dynamicData)` in the page to enable it. Here, `dynamicData` is a set of data, which participates in rendering the page's WXML along with `data`. ```javascript Page({ data: { loading: true }, onReady: function() { this.({ loadingHint: 'Loading' }, function() { this.setInitialRenderingCache() }) } }) ``` ```html {{loadingHint}} ``` In principle, under the approach of dynamically generating initial rendering cache, the page is re-rendered in the background using dynamic data, which can be relatively demanding in terms of resources. Therefore, it's best to avoid frequently calling `this.setInitialRenderingCache`. If you call it multiple times within a single page, only the last call will take effect. Please note: - You should not call `this.setInitialRenderingCache` earlier than the `onReady` lifecycle of Page or the `ready` lifecycle of Component as it may negatively impact performance. - If you want to disable the initial rendering cache, you can call `this.clearInitialRenderingCache()`. --- ## Document: Project Configuration File URL: /en/dev-docs/products/mini-program/framework/project-configuration # Project Configuration File You can configure your project using the `project.config.json` file found in the project's root directory. ### Configuration Options | Property | Type | Default Value | Required | Description | | --------------- | -------- | ------------- | -------- | --------------------------------------------------------------------- | | miniprogramRoot | `String` | - | Yes | Sets the directory (a relative path) for the Mini Program source code | | packOptions | `Object` | - | No | Sets the packaging configuration options | ### Packaging Options (packOptions) `packOptions` helps manage the settings for project packaging. Packaging is an essential step for previewing and uploading projects. Using `packOptions.ignore` field, you can define filter rules. Files or folders that satisfy these rules will be discarded during project packaging. They will not appear in the preview or the upload outcomes. `packOptions.ignore` is an array of objects, each containing: | Property | Type | Default Value | Required | Description | | -------- | -------- | ------------- | Yes | ------------- | | value | `String` | - | Yes | Path or value | | type | `String` | - | Yes | Type | Possible type values are `folder`, `file`, `suffix`, `prefix`, `regexp`, and `glob`, representing folders, files, suffixes, prefixes, regular expressions, and Glob rules. Value comparison is case-insensitive. > Note: If the value of the value field designates a file or a folder path, the root directory is > the Mini Program directory (`miniprogramRoot`). Here's a sample configuration: ```json // project.config.json { "miniprogramRoot": "./dist", "packOptions": { "ignore": [ { "type": "file", "value": "utils.bxs" }, { "type": "folder", "value": "image" }, { "type": "suffix", "value": ".LICENSE.txt" }, { "type": "suffix", "value": ".css" }, { "type": "prefix", "value": "rich-" }, { "type": "glob", "value": "pages/API/**/*.js" }, { "type": "regexp", "value": "index\\.js$" } ] } // ... } ``` --- ## Document: Overview URL: /en/dev-docs/products/mini-program/framework/overview # Overview ## File Architecture A mini program consists of two layers: the app and the page. The app layer describes the complete application, whereas the page layer delineates individual pages. Also, there is an optional configuration detailing the entire project. The core of a Mini Program is built on three files, which must be located in the project's root directory: | File | Required | Purpose | | -------- | -------- | --------------------------------------------------- | | app.js | yes | Houses Mini Program logic | | app.json | yes | Contains common Mini Program settings | | app.bxss | no | Serves as a common style sheet for the Mini Program | A page consists of 4 files, all of which must share a filename and be placed in the same folder. | File Type | Required | Purpose | | --------- | -------- | ------------------------ | | js | yes | Defines page logic | | bxml | Yes | Describes page structure | | json | No | Configures the page | | bxss | No | Styles the page | Below is the typical structure of a project's directory: ``` . └── src/ ├─ app.js ├── app.json ├── app.bxss └── pages/ └── detail/ ├── index.js ├── index.bxml ├── index.bxss └── index.json ``` ## Code Architecture The Mini Program framework includes two key components: the Logic Layer (App Service) and the View Layer (View). A Mini Program is equipped with its own view layer languages, BXML and BXSS, and a logic layer framework based on JavaScript. Additionally, there is a system for data transfer and event coordination between the two layers, which allows developers to concentrate on data and logic. ### Reactive Data Binding The reactive data binding system formulates the core of the framework. It offers a remarkably simple means to ensure data and view synchronization. Modifying the data requires a simple alteration on the logic layer, after which it will get updated on the view layer. Here's a simple illustration: Run a Preview with the Developer Tool ```html Hello {{name}}! ``` ```javascript // This is our data. var helloData = { name: "Binance", }; // Registration of a Page. Page({ data: helloData, changeName: function (e) { // Data change sent to the view this.setData({ name: "World", }); }, }); ``` This example demonstrates how developers can use the framework to bind the 'name' in the logic layer data to 'name' in the view layer. This ensures that 'Hello Binance!' appears when the page opens. Upon clicking the button, the view layer sends 'changeName' events to the logic layer, which identifies and executes the corresponding event handler. After triggering the callback function, the logic layer executes setData to change the name in data from 'Binance' to 'World'. As this data is bound to the view layer, 'Hello World!' automatically applies to the view layer. Note: Since the framework does not run in the browser, certain JavaScript capabilities in the web are not available, such as 'document', 'window', etc. ## Style File The style file has additional features and includes a new size unit called 'rpx'. ### Style Size Unit rpx (responsive pixel) is an adaptive size unit that adjusts according to screen width. As per standard, the screen's width is set to 750rpx. For instance, on an iPhone6, the screen's width is 375px with 750 physical pixels, therefore 750rpx = 375px = 750 physical pixels, and 1rpx = 0.5px = 1 physical pixel. | Device | rpx to px (screen's width/750) | px to rpx (750/screen's width) | | ------------ | ------------------------------ | ------------------------------ | | iPhone5 | 1rpx = 0.42px | 1px = 2.34rpx | | iPhone6 | 1rpx = 0.5px | 1px = 2rpx | | iPhone6 Plus | 1rpx = 0.552px | 1px = 1.81rpx | Suggestion: For the development of Binance Mini Programme, iPhone6 specifications could serve as a standard reference for designers. Attention: One should be aware that specific inevitable limitations may arise on exceedingly small screens. As far as possible, please endeavor to avoid such scenarios. ### Style Import By using the @import statement, external stylesheets can be incorporated. Following the @import statement, the relative path of the external stylesheet has to be mentioned and the line must conclude with a semicolon (;). Example code: ```css /** common.bxss **/ .small-p { padding: 5px; } ``` ```css /** app.bxss **/ @import "common.bxss"; .middle-p { padding: 15px; } ``` ## Incorporating Third-party NPM Modules Mini programs support the integration of third-party modules. Install the necessary module by executing the following command in the project's root directory. ```bash $ npm install i18n --save ``` Note: Please bear in mind that the third-party module's browser-related web capabilities, such as DOM operations or window.location, are unavailable. --- ## Document: Lifecycle URL: /en/dev-docs/products/mini-program/framework/lifecycle # Lifecycle Developing Mini Programs with React comes with a few differences compared to using React on the web. ## The Entry Component You have to register each mini program. You can do this by calling the App method in the file named 'app.js'. This will let the Mini Program use specific functions. These functions include: tracking the lifecycle, listening for any errors, and detecting when a page cannot be found. ```javascript //app.js App({ onLaunch(options) { // Do something initial when launch. }, onShow(options) { // Do something when show. }, onHide() { // Do something when hide. }, onError(msg) { console.log(msg); }, globalData: "I am global data", }); ``` A Mini Program has only one app instance, which is shared to all pages. Developers can obtain the globally unique app instance by using the getApp method, and then obtain data in the app or call a function registered with App by the developers. ```javascript // xxx.js const appInstance = getApp(); console.log(appInstance.globalData); // I am global data ``` ## Entry Configuration We can create a new file called 'app.json' for overall settings. The way we set up this file is based on the mini program's global configuration. ```javascript // app.json { pages: ['pages/index/index'], window: { backgroundTextStyle: 'light', navigationBarBackgroundColor: '#fff', navigationBarTitleText: 'Title', navigationBarTextStyle: 'black', }, } ``` ### onLaunch () It starts when the app launches. ### onShow () It starts when the app launches, or when it goes from the background to the front. ### onHide () It starts when the app goes from the front to the background. ### onError(err) Listens for when the Mini Program has errors. For example, these errors can be from a broken script or a problem with a function call. The 'err' is what the error is. ## Page For every page in a Mini Program, we need to register a page instance. We do this by calling the Page method in the js file that matches the page. This lets us set the page's initial data, life cycle tracking function, and event handling function. ```javascript // index.js Page({ data: { text: "This is page data.", }, onLoad: function (options) { // Do some initialize when page load. }, onReady: function () { // Do something when page ready. }, onShow: function () { // Do something when page show. }, onHide: function () { // Do something when page hide. }, onUnload: function () { // Do something when page close. }, onPullDownRefresh: function () { // Do something when pull down. }, onReachBottom: function () { // Do something when page reach bottom. }, onShareAppMessage: function () { // return custom share data when user share. }, onPageScroll: function () { // Do something when page scroll }, onTabItemTap(item) { console.log(item.index); console.log(item.pagePath); console.log(item.text); }, // Event handler. viewTap: function () { this.setData( { text: "Set some data for updating view.", }, function () { // this is setData callback }, ); }, }); ``` ### onTabItemTap This happens every time a tab item is tapped. #### Parameters ##### Object | Property | Type | Description | | -------- | ------ | ------------------------------------------- | | index | String | the position of the tab item, starting at 0 | | pagePath | String | the location of the tab item | | text | String | the written content of the tab item | ## Page Configuration For every page file (like. /pages/index/index.js), we can make a new . /pages/index/index.json file for configuring the page. ```json // file: pages/index/index.json { "navigationBarTitleText": "Home" } ``` ### onLoad (options) During this lifecycle, page navigation parameters can be obtained by calling `getCurrentInstance().router`. ### onReady () At this point in the lifecycle, the Mini Program has already transferred the DOM nodes to the rendering layer using APIs. ### onShow () This is triggered when the page is displayed or brought to the front. ### onHide () This is triggered when the page is hidden or moved to the background. ### onErr(err) This listens for Mini Program errors such as a script error or API Calls. ### onPageScroll() This listens for the user scrolling the page. **Parameter Object object:** | Property | Type | Description | | --------- | ------ | ------------------------------------------------- | | scrollTop | Number | Scroll distance in the vertical direction (in px) | **Note: Defining this method in a page should only be done when necessary to reduce potential performance impacts. Also, be cautious of repeated executions in onPageScroll, it could increase communication time.** _Example of a child component in a page_ ```js Page({ onPageScroll({ scrollTop }) { console.log("onPageScroll", scrollTop); }, }); ``` ### onReachBottom() This listens for the user scrolling to the bottom of the page. - You can set the trigger distance `onReachBottomDistance` in the `app.json` window option or in the Page Configuration. - This event only triggers once when the page scrolls within the trigger distance. _Example of a child component in a page_ ```js Page({ onReachBottom() { console.log("onPageReachBottom"); }, }); ``` ### onShareAppMessage(Object) Listen to user-initiated share actions, such as clicking on the in-page share button `open-type="share"`, the top-right menu "Share", or executing `bn.showSharePanel`, and customize the shared content. #### Parameters ##### Object | Property | Type | Description | | -------- | ------ | ----------------------------------------------------------------------------------------------------------------------- | | from | String | Share event source: `button`: in-page share button, `menu`: top-right retweet menu, `code`: Execute `bn.showSharePanel` | | target | String | If `from` value is `button`, then `target` is the triggered share `button`, otherwise `undefined` | This event handler requires a return of an Object or Promise to customize the shared content: | field | Type | Description | Default value | | :------- | :------- | :------------------------------------------------------------------------------- | :------------------------ | | title | String | Share title | Current Mini Program name | | desc | String | Description | | | imageUrl | String | Custom image path, should be a network image path. Supports PNG and JPG formats. | Uses default screenshot | | path | Function | Share path. Must be a full path starting with / | Current page path | | success | Function | Callback function when the user forwards on | | ```javascript Page({ onShareAppMessage(...args) { console.log('onShareAppMessage', args) return Promise.resolve({ title: 'my title', desc: 'mydesc', imageUrl: 'https://public.bnbstatic.com/static/images/common/ogImage.jpg', path: 'pages/extended/pages/share/share?p=1', success: res => console.log('shareResult', res.shareResult)), } }) }) ``` --- ## Document: FAQ URL: /en/dev-docs/products/mini-program/framework/faq # FAQ ## `getCurrentInstance` query is incorrect When you are using `tarojs` to develop your mini program, sometimes query is incorrect with the api `getCurrentInstance`. Make sure the getCurrentInstance is inside the useDidShow hook ```ts useDidShow(() => { const query = getCurrentInstance().router.params; }); ``` --- ## Document: Extended URL: /en/dev-docs/products/mini-program/framework/extended # Extended ## Navigators ### Navigation Navigation is the navigator component on top of the Mini Program. Using `navigationStyle: custom`, you can replace the default navigation with a custom component. ```json // page.json { "navigationStyle": "custom" } ``` With this configuration, the default navigation bar on the current page will be removed. You will need to implement a component on your own page to replace it. #### Custom Navigation Bar Example ```json //custom-navigation-bar.json { "navigationStyle": "custom" } ``` ```html {title} ``` ```javascript Page({ data: { title: "Hello world", }, }); ``` ```scss // custom-navigation-bar.bxss .cnb-container { position: relative; padding: 0 10px; height: var(--mp-navigator-height); display: flex; align-items: center; justify-content: space-between; background-color: #000000; color: white; } .custom-nav-bar { position: absolute; left: 95px; right: 95px; height: 100%; display: flex; align-items: center; justify-content: center; top: 0; display: flex; align-items: center; box-sizing: border-box; } ``` ### Tabbar - Bxml Configure `tabBar.custom: true` in `app.json` ```ts "tabBar": { "custom": true } ``` Add `custom-tab-bar` in root directory ```bash custom-tab-bar ├── index.bxml ├── index.bxss ├── index.js └── index.json ``` You will need to implement a `custom tab bar` yourself ### Disable Bounces Set `disableBounces: true` in your `{page}.json`. This prevents the page from sliding out of the screen area (only IOS) ```js export default { disableBounces: true, }; ``` --- ## Document: Download Stable Version URL: /en/dev-docs/products/mini-program/framework/download-stable # Download Stable Version ## [5.11.0] 2026-04-02 **Download: [5.11.0(2.76 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.11.0.zip)** ### Bug Fixes - Fix/mp renderjs missing - fix(sdk): add backward compatibility for ViewPager2 in SwiperView - Fix/native cli preview UI layout - Fix/type 0331 - fix(cli): bundle native-cli resources and resolve adb - fix: showErrorPage for 600402 page_not_found error - fix(sdk): mcp bin - fix(lib): fix ide cli toolbar sync api - fix(cli): ide cli node version match ### Features - feat(sdk): add QJS bytecode compilation for renderer-service-hummer - feat(sdk): support virtual appid for widget - feat(sdk): add useNewWindow parameter to previewImage API - feat(cli): native-cli & ide-cli-mcp-server recover capabilities improve - Feat/ios orba - feat(cli): mcp tool stability improve - feat(sdk): screen cast - feat(cli): ide cli mcp server sync - feat(cli): add mobile screen viewer and simulator host capture ## [5.10.0] 2026-03-12 **Download: [5.10.0(2.21 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.10.0.zip)** ### Bug Fixes - fix(sdk): fix video props type - fix(native-cli): prevent host hang on Ctrl+C ### Features - feat(cli): native cli mcp adjust - feat(native-cli): add sync mp status mcp tool - feat(sdk): support root portal to specific element - Feat/hummer lcp - feat(cli): sub mode default render path - feat(cli): native cli UI bridge - feat(cli): orba desktop mp side work - feat(cli): make get_log_files as example - feat(cli): native cli UI dev env - feat(cli): init native-cli project ## [5.9.1] 2026-02-27 **Download: [5.9.1(2.21 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.9.1.zip)** ### Bug Fixes - fix(sdk): renderer may never ready when route quickly ## [5.9.0] 2026-02-19 **Download: [5.9.0(2.21 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.9.0.zip)** ### Bug Fixes - fix(sdk): swiper autoheight child item ### Features - Feat/hummer swiper - Feat/hummer event - feat(cli): use custom ios runtime version - feat(cli): ios simulator support - feat(bundler): show error page when load module error ### Misc - Revert " fix(sdk): sortable items when height changes " (#2522) (#2541) ## [5.8.5] 2026-02-09 **Download: [5.8.5(2.21 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.8.5.zip)** ### Bug Fixes - fix(sdk): dom update lead layout size abnormal ## [5.8.4] 2026-02-09 **Download: [5.8.4(2.21 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.8.4.zip)** ### Bug Fixes - fix(sdk): routeChange type=switchTab and page isTabbarPage stack always be the rootTab ## [5.8.3] 2026-02-04 **Download: [5.8.3(2.21 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.8.3.zip)** ## [5.8.2] 2026-02-04 **Download: [5.8.2(2.21 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.8.2.zip)** ### Misc - Revert " fix(sdk): sortable items when height changes " (#2522) ## [5.8.1] 2026-01-30 **Download: [5.8.1(2.21 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.8.1.zip)** ### Bug Fixes - fix(sdk): navigate routeChanging defer ref issues ## [3.8.1] 2026-01-30 **Download: [3.8.1(2.21 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.8.1.zip)** ### Bug Fixes - fix(sdk): navigate routeChanging defer ref issues - fix(sdk): cherry pick 5.7.1 - fix(sdk): sortable items when height changes - fix(sdkl): wallet prerender failed - fix(sdk): rm geature event listener binding - fix(sdk): fix prerender inject data path - fix(sdk,bundler): init nativeScrollNegotiation/enableBackToTop config - fix(sdk): reuse page issue on ios platform - fix(sdk): text dont filter nest components - fix(sdk): chain routechange handler when receviced multiple routechange - fix(lib): add missing code back to protect web import - fix(sdk): add ut - fix(lib): add comma to avoid MFA build error - fix(sdk): cp view based sdk 5.0 issue - fix(sdk): cp tab area scroll - fix(sdk): render data and prerender data independent to resolve flutter blink - fix(sdk): ignore preload font on flutter - fix(bundler): compatibility for old android - fix(cli): version sort - fix(sdk): fix prerender measure - fix(sdk): sdk5.2 cherry pick bn.removeWidgetSkeleton - fix(sdk): inst id not exist - fix(sdk): sdk5.2 cherry pick usePageScroll - fix(sdk): sdk5.x hummer log & nezha debug flag - fix(sdk): hotfix scrollview - fix(sdk): avoid XSS attack - fix(sdk): mounted to ensure nativeComponents context ready and dom instanceId for native widget map - fix(mpp-service): ai meta info upload without widgets - fix(sdk): remove unused log - fix(sdk): fix swiper loop mode & scroll view style - fix(sdk): fix intersection observer relative info not work - fix(sdk): relaunch deeplink issue - fix(sdk): fix swiper autoplay - Fix/swiper 0708 - fix(sdk): deeplink with data loader issue - fix(sdk): exports utils - fix(sdk): export bmp component utils - fix(sdk): scroll X in scroll Y - fix(sdk): expose the error before app init - fix(sdk): hide home button api - fix(server-side-bundle): add bundler as dep - fix(sdk): set scroll top not work / request support enableCache - fix(sdk): `show-scrollbar` doesn't work - fix(sdk): flutter getAttribute polyfill - fix(sdk): fix input textarea type adjustPosition - fix(cli): missing build start callback in bundleWatch - fix(sdk): add LCP report target - fix(sdk): drawer component visible when mounted - fix(mpp-service): fix qjs build for Andriod - fix(demo): pika no longer support `independent` - fix(sdk): page frame await syntax error - fix op_line_number size increased and get_label_pos not changed on node-qjsc - fix(mp-service): fix track line and column numbers for expressions on… - fix(bundler): loadScriptSync issue on android - fix(sdk): svg data url regexp missing text wrap - fix(sdk): fix cursor flashing on devices - fix(sdk): handle non-enumerable CustomEvent properties type and detail - fix(sdk): cherry-pick virtual list hotfix - fix(sdk): clear unreachable rpc promise - fix(sdk): remove skyline sync ui command (#2058) - fix(sdk): mitigate the risk of memory leak - fix(host): loadScriptSync issue - fix(cli): change @shoelace-style/shoelace version to 2 - fix(bmp): remove requestFullscreen param - fix(sdk): flutter-video context issue - fix(sdk): adjust unload timming - fix(sdk): native input with number type issue - fix(cli): ide-cli pnpm dep package.json resolve failed - fix(sdk): widget load timeline - fix(sdk): flutter deprecated-textarea autoheight style error - fix(sdk): trigger renderEffect before componentinit to fix patch issues - fix(sdk): fix page stack update timing - fix(sdk): run setdata callback after vue nexttick - fix(bmp): update type `BnInputProps&BnTextareaProps` - fix(sdk): change handlePaste defaultValue - fix(sdk): remove native component background color - fix(sdk): flutter-image remove eventListener - fix(sdk): support inlineLayout for skyline - fix(sdk): flutter scroll refresher background color - fix(sdk): android quickjs unsupport Unicode Property Escapes - fix(sdk): cherry pick webview message issue - fix(sdk): re-publish @mp/runtime-plugin-enable-sheet-gesture - fix(sdk): fix cursor issue - fix(runtime): premature return issue in ide enviroment's show-modal api - fix(sdk): editor pos nodeBefore return real textContent if node is nonTextNode - fix(sdk): `deprecated-textarea` support force update - fix(sdk): deprecated input does not update when is composing - fix(sdk): jarvis input does not update correctly - fix(sdk): fix webview message action not work - fix(sdk): native list view conflict with sliver style - fix(automator): add timeout when run automator - fix(sdk): fix catchmove not work - fix(sdk):add textarea placeholder class prop - fix(sdk): fix component patch error messsage - fix(sdk): fix drawer error and support accelaration - fix(lib): fix event channel type - fix(bundler): bundle watch mode should copy ignore files - fix(sdk): scroll y on scrollView is not works - fix(sdk): fix textarea props and type - fix(sdk): vnode patch issues - fix(sdk): navigate to type - fix(sdk): delay page set to make sure buforeRouteChange done - fix(bundler): disable sourcemap to reduce memory - fix: add worker plugin - fix(lib): fix bmp component types - fix(bundler): fix expression bundler - fix(sdk): native component webview message - fix(sdk): native event in worker - fix(sdk): fix webview component - fix(sdk): intersectionObserver margin - fix(sdk): eventhandler of chart component - fix(extended-lib): ethers Event identifier duplicated and getGlobal function error - fix(sdk): webview sdk only send invoke message - fix(sdk): image to figure will insert a new paragraph before the figure - fix(sdk): cursor is wired when editor tap keyboard enter - fix: update render cache doc id - fix(extended-lib): resolve path not a module - fix(sdk): image should not add appid for bn protocal src in widget - fix(sdk): page query not ready when onload - fix(extended-lib): postpublish script throw error - fix(host): support webassembly on host - fix(sdk): hover class not disappear - fix(sdk): create webview support widget - fix(host): widget ref not works and webview size not correct - fix(sdk): chart component need delay to setOptions - fix(extended-lib): add missing deps - fix(sdk): fix createwebview node-bridge issu - fix(sdk): fix bmp-component type - fix(sdk): revert readfile issue on ios - fix(sdk): hotfix ios doesn't use native fs - fix(sdk): when user delete all content web input may act unexpected - fix(sdk): remote-debug env update - fix(sdk): remote debugger resend ready to IDE - fix(demo): icon size demo - fix(sdk): label trigger itemClick event for radio and checkbox - fix(sdk): flutter gradient issue - fix(bundler): using prettier as formatter - fix(bundler): fix IDE can not reload - fix(sdk): fix webview sdk to compatible with node bridget - fix(cli): fix scroll-speed-limit default value - fix(cli): fix scroll-speed-limit default value - fix(sdk): support input focus and blur action by developers - fix(sdk): END_FIRSTPAGE_APPLAUNCH send pid - fix(sdk): clone data avoid reuse data object when reopen page - fix(sdk): cherry pick 4.16.2 + try catch instance update - fix(sdk): using show-scrollbar disable scrollbar - fix(sdk): iOS cursor always at the edge of the word, selection update event not trigger - fix(sdk): revert swiper located to wrong child when children updated - fix(demo): component-demo use built-in chart - fix(sdk): decode extra data without appid - fix(sdk): swiper located to wrong child when children updated - fix(bundler): fix expression not work on tag in `bn:for` - fix(demo): independent package config - fix(demo): private-close-app require shouldClose payload - fix(bundler): decompress replace unzipper - fix(bundler): bundler watch has 60s cache - fix(sdk): enbale flutter qjs - fix(sdk): swiper may throw error when disable indicatorDots - fix(sdk): widget props can get in worker - fix(sdk): cursor always jump to the first position when value change from an empty string - fix(sdk): check demo page ci - fix(bundler): source-map issue of swc-loader - fix(sdk): reset transform when refresher unmount - fix(sdk): create webview api in mp cannot message - fix(sdk): customize component data not update when return a data getter - fix(cli): webview component onmessage event - fix(sdk): cherry-pick fix web input seqId - fix(sdk): cherry-pick editor remove link and style recover (#1515) - fix(sdk): cherry-pick editor split figure bugs - fix(sdk): object spread syntax error - fix(cli): add webview component, webpack chain error - fix(bundler): lock unzipper version cause new version may lost file - fix(host): block TextEncoder prop - fix(demo): intersection observer usage - fix(sdk): bundler remove touchmove prevent modifer - fix(demo): editor toolbar bottom 0 when platform is not iOS - fix(sdk): iOS native component created failed when container is not visible - fix: cherry-pick from 4.12.1 - fix(sdk): cancel load-script when redirect - fix(lib): add type of removeSkeleton - fix(sdk): font-family should go with system font-family - fix(sdk): domtoimage svg base64 not have datatype - fix(sdk): add export type - fix(demo): fix canvas toTempFilePath - fix(server-side-bundle): remove subpackage prefix of sourceURL - fix(server-side-bundle): sourceURL issue of qjs - fix(sdk): domtoImage local image support for android - fix(demo): fix share demo - fix(sdk): video fullscreenchange on IOS - fix(cli): hack taro catch event - fix(demo): update prefetch image path - fix(mpp-service): newVersionFromServer might be null issue - fix(demo): reset zoom ref when toggle camera position - fix(sdk): dom to image support private static server images - fix(sdk): editorContext insertCoin not works - fix(mpp-service): min versoin should not replace the input version - fix(mpp-service): set min upload version as 0.0.1 - fix(automator): read route of undefined issue - fix(mpp-service): disable contentType when getUploadFileKey - fix(demo): websocket url not work - fix(mpp-service): set maxBodyLength & maxContentLength as Infinity wh… - fix(sdk): canIUseCustom support string params - fix(cli): support catch touchend - fix(sdk): fix ths issue about get appConfig & getPage - fix(sdk): callbackify error no stack - fix(sdk): load page frame after load base.bxml success - fix(mpp-service): add contentType filed when upload for security - fix(host): download support put - fix(demo): add private send transaction demo - fix(cli): webview injected not work - fix(demo): webview page not found - fix(sdk): figure scrollIntoView should focus on the figure caption - fix(demo): production convertToMPUrl usage - fix(sdk): editor caption selection and image keyboard handler - fix(host): definitions for bn.env - fix(sdk): unhandleRejection support polyfilled promise - fix(sdk): fix edtior editing image error - fix(sdk): init performance observer after worker ready - fix(sdk): editor delete image event stopropagation - fix(sdk): fix load page.js error to report 603505 when webview is des… - fix(demo): fix event-channel demo - fix(demo): on/off pairs - fix(sdk): editor image selection and focus - fix(mpp-service): print the old and new version - fix(demo): bug in navigation demo - fix(sdk): editor image cursor position and delete use touchend event - fix(sdk): update report data object & cancel startupTimeout when load resources - fix(sdk): editor image support update and deletable, hashtag keyboard key unexpected issue - fix(sdk): update load-script payload to ensure the cache is loaded - fix(sdk): update event channel if page init before eventChannel - fix(sdk): fix native input color issues on ios13 - fix(demo): update pika to fix input issue - fix(sdk): update dom to image scale impl and fix image / font issues - fix(sdk): rename getUserOpenId & doc-api - getUserOpenId/getUserKycStatus - fix(host): get-image-info is broken on IDE - fix(host): bn.request support arraybuffer body - fix(demo): radio page issue - fix(sdk): add native-send-appLuanch timer - fix(bundler): css variables rpx to rem align with wechat - fix(sdk): mini game view port size - fix(sdk): getChildrenNode util function - fix(sdk): rendererId zero issue in native ui - fix(bundler): catchmove value should be an exp - fix(sdk): swiper Item blank - fix(demo):fix custom demo textarea maxlength - fix(lib): remove optional chaining from bmp-react - fix(sdk): fix requestBinanceCardInfo error response & cicd - fix(bundler): compile optional chaining when using latest caniuse-lite - fix(sdk): android css transition native component - fix(sdk): fit audio platform api getters/setters on Andriod - fix(sdk): add RootPortal type - fix(sdk): mpc method - fix(lib): update types of bmp-react - fix(sdk): types of bn.call & add RootPortal to bmp-components - fix(demo): caret-color - fix(lib): virtual-list use new bmp packages - fix(sdk): update canIuse info - fix(sdk): cherry pick fix picker view component - fix(lib): @binance/mp-components don't import @tarojs/components - fix(sdk): image reload after src changes - fix(sdk): mini game keyboard event - fix(demo): fix demo navigation bar page - fix(bundler): fix babel env target - fix(demo): api navigation bar input element - fix(sdk): cherry-pick from release/3.14 - fix(runtime): network service setupServices multiple times - fix(automator): update @binance/mp-web for fix some issue and add `sdkPath` option - fix(bundler): launch MP with page of independent subpackage - fix(sdk): Image widthfix/heightFix mode can update size automatically - fix(demo): fix universal-share css - fix(bundler): reorder files in pkg - renderer files first - fix(sdk): fix web canvas width and height - fix(automator): replace parcel with http server to fix the installation issue from BIDS - fix(sdk): selectorQuery return empty when error - fix(runtime): remove BXML spaces - fix(bundler): remove setImmediate polyfill to fix pika MP white screen on iOS - fix(automator): fix some bugs & add `.waitFor` - fix(sdk): native component css - fix(sdk): (cherry-pick) reduce the blank page - fix(runtime): no need to add webview when open new page - fix(demo): input style of storage pages & update privatePrefetchRules - fix(sdk): cherry pick - load-script-progress event when mp background event to lead blank screen - fix(sdk): cherry pick fix location plugin - fix(cli): skip generation of unmatched tags - fix(demo): request pages issue of component-demo - fix(sdk): load \_\_app.js after $ready - fix(sdk): remove generating worker-service-game.qjs - fix(runtime): vibrate shifting bug - fix(demo): show isPrefetch in request pages - fix(cli): mpService should support both function api and object api - fix(mp-web): support absolute path - fix(changelog): changelog bug: 3.14.5-dev.1 & 4.0.2-dev.1 - fix(sdk): add readme for deprecated usage - fix(sdk): cherry pick - await load appJs - fix(sdk): fix image style not work - fix(cli): remove .npmrc and add npm token - fix(cli): duplicate resolve issue of ConditionNamesPlugin - fix(sdk): network service - fix(sdk): ready replace uirenderserviceready - fix(host): create webview files issue - fix(host): support private-request command - fix(runtime): download-file not work - fix(sdk): env undefined - fix(sdk): revoke native buffer issue - fix(mp-web): fix sw.js ready timeline issue - fix(sdk): native-image onload and image bug - fix(runtime): width of scroll-bar should be zero - fix(automator): support download-package rpc - fix(cli): update web host cli - fix(demo): update webgl demo with rgba - fix(demo): payment request use success callback instead - fix(sdk): useNativeImage - fix(mpp-service): copy source-code ignore node_module & hidden files - fix(sdk): fix image and keep **MP_WARN_DEPRECATED** - fix(sdk): gcanvas toDataURL and audio time update event - fix(server-side-bundle): upload bytecode pkg issue - fix(sdk): getUserProfile mini game doesn't need check tap event - fix(demo): native input width zero in android when container is a flex box - fix(sdk): reuqest text no response - fix(bundler): update dependencies to fix pkg-cli - fix(bundler): support error stack link jump of dev mode page.worker.js - fix(demo): fix benchmark - fix(sdk, demo): check promise polyfill by using \_\_\_mp_polyfill - fix(demo): public demo read file - fix(sdk): native-cover-view not work when using taro - fix(demo): two-fa demo scene data is undefined - fix(demo): pull down refresh not works - fix(sdk): cache promise online with polyfill - fix(sdk): mini game audio adapter - fix: disable ed and add @deprecated flag - fix(sdk): changelog issue - fix(sdk): callbackId could be zero - fix(sdk): input scrollbar css issue on android - fix(sdk): isCache undefined issue - fix(mpp-service): fix status api empty fail message - fix(sdk): add properties on webgl context - fix(sdk): fix timeOrigin 0 issues on IOS14 - fix(runtime): cannot resolve the font with url "bnshare://" - fix(sdk): fix getperformance firstRender - fix: cherry-pick cachePromise of getSystemInfo - fix(sdk): use promise polyfill fix promise task order in ios12 - ios14 - fix(sdk): error code detection of remote debug - fix(sdk): requestAnimationFrame NaN - fix(automator): web cli core apis - fix: add dependency to pass build job - fix(sdk): performance init appLaunch payload - fix: getPerformance first-render - fix(sdk): delete useless report - fix(sdk): loading when expect route-change type - fix(sdk): remove cachePromise to fix ios 13 eventloop issue - fix(sdk): fix: fix to signature error when include specific data struct issue - fix(sdk): remove type check in wallet-connect plugin - fix(sdk): gcanvas texImage2D flushnative - fix(sdk): fix taskify cache fail - fix(sdk): remove canvas service code - fix(sdk): fix applaunch-getPerformance - fix(sdk): fix webview sdk - fix(mpp-service): publish issue - fix(sdk): fix mg api host register - fix(sdk): navigateBackMiniProgram extra data should transform to string - fix(sdk): fix blank screen issue when relaunch because of taskify - fix(demo): public demo - fix(sdk): getCurrentPages error handler - fix(demo): textarea confirm-type - fix(sdk): fetch remote tags with force arg when tag conflict - fix(demo): textarea maxlength caused display issue - fix(sdk): access methods defined within methods property - fix(sdk): fix this problem for '\_setDataMaxSize' of undefined - fix(cli & runtime): useExtendedLib issue - fix(demo): public-demo textarea bug - fix(bundler): if directive not work as non-first attribute - fix(sdk): revert removing of setTimeout hack because of useDidShow issues on IOS - fix(server-side-bundle): set default value of versionSetting - fix(runtime): plainText body not supported - fix(demo): fix crash caused by private request demo - fix(sdk): bug in OnOffManager and add test - fix(sdk): revert changes of performance entry name - fix(demo): callback should not inside function component - fix(bundler): nested component with directive "for" - fix(runtime): set different left for title on different lefticon - fix(mpp-service): remove request body of getApplicationVersions - fix(sdk): request-timeout - fix: webstudio qa test - fix(sdk): tmpl_0_undefined bug lead to a blank page - fix(sdk): remove 120ms timeout of page show, make sure onShow is before onReady - fix(sdk): use logger to enable warn log visible - fix(bundler): disable autoloading postcss config of MP project - fix(sdk): tmpl_0_undefined issue - fix(demo): component-demo-public head component click fix - fix(demo): get appid from systemInfo - fix(runtime): set title when route-changed - fix(sdk): add missing @mp/runtime-plugin-sensor-orientation depenedncies - fix(sdk): page instance option property update - fix(sdk): from render to worker UIRendererServiceReady - fix(sdk): use log.error instead of filter text nest component - fix(demo): route query parameter different handler with encode64 - fix(runtime): load extended lib of specific version - fix(bundler): require relative path for cocos game - fix(sdk): reject the previous defer when reLaunch too early - fix(sdk): adjust MPRunTimeLogger - fix(sdk): routing api should wait app launched - fix(automator): api is undefined during first lauch of e2e(#NEZ-5634) - fix(sdk): share-panel not working (#542) - fix(bundler): copy non-existent files issue - fix(demo): how to use custom tabbar - fix(cli): resolve path of react - fix(sdk): rename package - fix(runtime): add getBridgeCode to files array - fix(runtime): remove dependency cycle - fix(runtime): align fail behaviour of request plugin with wechat - fix(sdk): cherry pick - timeline check app & hotfix 3.8.2 - fix(bundler): common.bxss is imported twice & release factory after jsModule is required - fix(sdk): empty subpackages force download action - fix(runtime): add service.d.ts to npm pack - fix(cli): update vendors to support node 16 - fix: catch downloadFile fail and remove --unhandled-rejections=warn - fix(sdk): mg add devicePixelRatio into getSystemInfo api - fix(sdk): mp canvastouche event payload - fix(bundler): add globalThis polyfill to page-frame - fix(sdk): setData in onLoad not working - fix(cli): fix tarojs version can not found in yarn global action ### Features - feat(sdk): hummer gcanvas - feat(sdk): load appjs when reload worker - feat(sdk): enhance native event channel for CustomNativeComponent - feat(cli): miniprogram mcp server - feat(cli): more function in devtool - feat(sdk): hummer button functions - feat(sdk): support createContext with customNativeComponent widget rendererId - feat(sdk): add internal doc site - feat(cli): auto perf - feat(sdk): add extra type - feat(sdk): support debug prefetch configuration - feat(sdk): lottie comp support animationData props - feat(bundler): update terser avoid bugs of old ver - feat(sdk): support closest AnchorElement tap - feat(sdk): add private api getVisibilityState - feat(sdk): input support force-decimal-dot - feat(sdk): fliter standalone chunk js for bytecode pkg - feat(sdk): support webview markdown list style - feat(cli): release 1.0.0 stable version - feat(cli): dx improve - feat(sdk): page timeline add check point - feat(sdk): editor chart UI revamp - feat(sdk,bundler): customize renderer components - feat(sdk): add debug - feat(sdk): b8 widget custom lifecycle - feat(extendedLib): extended lib ci and checksum - feat(sdk): update value for input - feat(script): add dev tag for publish-dev - feat(sdk): add scrollOffset for pageScrollTo - feat(sdk): support access node in SelectQuery - feat(sdk): flutterToImage and nativeComponent for iOS webview renderer - feat(sdk): remove root style 100% - feat(mpp-service): use label as rev - feat(sdk): call all api - feat(sdk): preload font - feat(mpp-service): add widget qrcode request logic - feat(bundler): update widgetConfigs - feat(cli): dynamic bundle version support - feat(sdk): video class name - feat(cli): clean code & fix no-qjs flag & fix fs-extra copy failed - feat: add preload-worker - feat(cli): use libversion - feat(bundler): support bundler version - feat(sdk): support share v2 api - feat(sdk): add formatter attribute - feat(sdk): menuBts for flutter markdown - feat(sdk): video poster - feat(sdk): support locked config for sortableitem - feat(cli): support home page widget preview - feat(mpp-service): update ai router payload - feat(mpp-service): ai router solution - feat(sdk): revert autoheight default value to false - feat(sdk): swiper autoHeight - feat(sdk): mp plugin support AbortSignal - feat(sdk): add require error log - feat(cli): bundle watch process not exiting correctly - feat(cli): add error handler for ios debug target query - feat(cli): support inspect webview/webf with native devtool protocol message - feat(sdk): support nested scroll view - feat(sdk): blank detector - feat(sdk): support typewriter effect for flutter markdown - feat(sdk): support playsinline for video - feat(sdk): use \_\_mp_runtime_config.screenWidth for set rem - feat(mpp-service): add report file size functions - feat(extended-lib): mpp runtime vendor - feat(sdk): new api bn.addPhoneCalendar & bn.addPhoneRepeatCalendar - feat(cli): add meta info indicator and every day tip - feat(sdk): add new svg component demo - feat(sdk): not set dataurl on style change - feat(sdk): w3w timeline monitor - feat(sdk): flutter svg class support - feat(sdk): add ios timeline log fit regexp - feat(sdk): virtualList support size by function - feat(sdk): remove set rem in flutter - feat(sdk): add createEventSource support for IDE - feat(sdk): add `max-lines` for text-span - feat(sdk): support page preload - feat(sdk): negotiation scroll with native on Android - feat(extended-lib): use dynamicExtendedLib for all the libs and remove upload builtIn lib - feat(sdk): suspend & resume lifecycle - feat(sdk): support keyboard accessory item - feat(sdk): remove sync api - feat(sdk): domtoimage can ignore error when image not exist or load error - feat(sdk): scrollview support enableBackToTop - feat(sdk): showErrorPage support auto detect rendererId - feat(sdk): flutter scrollView add events - feat(cli): achieve pkg stability & log process stability optimization - feat(host): support five themes - feat(cli): support mcp refresh - feat(sdk): remove hack worker patch - feat(sdk): add dark_midnight support - feat(bundler): support polyfill self and XMLHttpRequest - feat(bundler): dynamic path by env. BUNDLER_PATCH - feat(extended-lib): support extended lib uikit flow - feat(host): support midnight - feat(sdk): alpha chart for editor - feat(sdk): new component flutter markdown - feat(sdk): add `` & `` components - feat(sdk): support get prefetch data synchronous - feat: update process-md-paths - feat(cli): log process status indicator - feat: update md jobs - feat: add job to convert md path - feat(cli): filter standalone-chunks while addEntry - feat(sdk): input support max-digits-length - feat(cli): use release version devtool - feat(sdk): add runtime-plugin-create-event-source - feat(cli): chrome devtools Integration - console - feat: update llms.txt title and filter docs - feat: add upload-docs-md job - feat(cli): rebundle while refresh - feat(cli): improve achieve stability - feat(cli): adjust glob params - feat(cli): manual update qjsc version - feat(cli): add syncPackInclude flag - feat(bmp): add direction type for sortable - feat(runtime): add api `fs.removeSavedFile` - feat(demo): add more chose file or media demo - feat(sdk): add image info type - feat(sdk): init rem to avoid style issue in flutter renderer - feat(sdk): widget support selectorQuery & intersectionObserver - feat(sdk): implement lite-timeline sdk part - feat(sdk): improve virtual scrollview - feat(sdk): remove webf sync command during the initialization - feat(sdk): support disableCleanStack and cleanOtherStack - feat(sdk): increase priority of framework level message - feat(runtime): add plugin `addEventListenerToBody` - feat(server-side-bundle): add new qjs compilation - feat(sdk): add disable-ios-embed props for ios native input - feat(sdk): get static template theme from body - feat(sdk): support remove skeleton after static templete rendered - feat(sdk): drawer support teleportTo - feat(demo): add fixed page input demo - feat(sdk): flutter svg support - feat(sdk): input component can highlight the inputed content - feat(sdk): flutter deprecated textarea add `cursor-spacing` - feat(sdk): support auto zip sdk in watch mode - feat(cli): add socket status indicator - feat(bundler): support standalone-chunks - feat(sdk): add showDiagnosticPage API - feat(sdk): native-input cursor issue - feat(sdk): add flutter-chart component - feat(sdk): catch setTimeout callback error & Handle redundant `Uncaught` errors - feat(cli): support debug mode flag - feat(sdk): `MP.onError` message format & `MP.lifecycle` throw error - feat(sdk): add params in chooseFile - feat(sdk): scrollview support flex height virtual list - feat(sdk): svg inline tag performence improve - feat(bmp): `` support events - feat(sdk): `` support switching animation - feat(sdk): add `flutter-video` component - feat(sdk): throw bmp app `onError` - feat(sdk): add `` component - feat(extended-lib): update react/react-dom 18.3.1 - feat(sdk): echarts tooltip formatter support function - feat(cli): ide cli build failed not catch - feat(bmp): `PickerView` add options `maskClass|maskStyle|indicatorClass|indicatorStyle` - feat(cli): fix hot reload & change package name to ide-cli - feat(sdk): sortable support dark mode - feat: sortable component - feat(sdk): flutter-scrollview add `refresher` props - feat:(sdk): builtin svg component - feat(sdk): deprecated textarea autoHeight support - feat(ide-cli): preview functions for binance devtool - feat(sdk): create chart context support options params - feat(sdk): DeprecatedTextarea add `autocorrect` & `autocapitalize` - feat(sdk): add scrollstart scrollend to scrollview - feat(sdk): add `flutter-container` - feat(sdk): add `option.url` in applyUpdate - feat(sdk): add switch tab options in api - feat(sdk): add timeformat api - feat(sdk): add showBackButton api - feat(sdk): `native-textarea` add onPaste - feat(sdk): `native-textarea` add `alwaysEmbed` - feat(sdk): add the value of input type `decimals` - feat(sdk): flutter-deprecated-textarea add `autoFocus` - feat(sdk): new api page.updateRouteOptions - feat(sdk): `DeprecatedTextarea` support `cursor/autoFocus/selection-start/selection-end` - feat(demo): add error handler bot modal demo - feat(sdk): use tap for skyline - feat(sdk): add tab-switched api - feat(sdk): update caniuse api - feat(sdk): support multi pages in tabbar - feat(sdk): webview clearScrollStatus, invoke api - feat(sdk): add sticky-header & stick-section - feat(sdk): add `` - feat(sdk): setup markdown on flutter - feat(sdk): new api enable enableSheetGesture - feat(extended-lib): expose buildIn libs for server side bundle - feat(host): align response with native - feat(sdk): flutter text component - feat(sdk): update markdown & pika version update - feat(sdk): support readme feature - feat(sdk): add 2 components `ContextMenu` & `ContextMenuItem` - feat(sdk): add `` component & lottie-context - feat(bundler): emit handlePageBundled when skeleton build finish - feat(bundler): upgrade webpack to support Node >=18 - feat(demo): error handler demo - feat(sdk): add deeplink target type - feat(sdk): hack textarea with **BN_IGNORE_IS_COMPOSING** id - feat(extended-lib): update react qjs - feat(sdk): add component `flutter-image` - feat(demo): add style inject demo page - feat(sdk): add component flutter-scroll-view - feat(sdk): add plugin `runtime-plugin-update-page-query` - feat(sdk): add type `injected` for bmp-component - feat(sdk): add plugin `runtime-plugin-control-button` - feat(sdk): drawer component - feat(bundler): support static script, do not bundle into \_app.js and \_common.js - feat(bundler): mark build is done before send pageBundled - feat(bundler): add entry must trigger a rebuild - feat(sdk): scroll view support extra data prop - feat(sdk): performance babel plugin log format with timeline - feat(sdk): flutter scroll-view - feat(bundler): update watch page utils - feat(bundler): support ignore qjs options - feat(bundler): skeleton create style tags by script to avoid webf issues - feat(sdk): remove game script in sdk - feat(sdk): flutter scroll view - feat(sdk): add props for input - feat(bundler): update bundler for host - feat(doc): update doc - feat(demo): add input unfocuse issue - feat(sdk): lcp element timeline metrics - feat(sdk): choose image support compression threshold - feat(sdk): webview scrollChange event - feat(sdk): add logger for timeline log analyze - feat(sdk): scrollView skyline type list property support - feat(sdk): input prop disablePaste - feat(bundler): support bns in base.bxml and pika compile mode - feat(sdk): editor chart ui revamp - feat(sdk): support create worker - feat(lib): add type of Script to bmp-components - feat(sdk): webview component event api in queryselector - feat(sdk): support navigate api with animated - feat(sdk): bn.onCopy Api on Android - feat(host): export workerEnvCode for host - feat(extended-lib): upload bitcoinjs-lib & solana/web3.js - feat(extended-lib): upload ethers-5.5.4.js - feat(sdk): new api for webview component - feat(sdk): api show setting - feat(sdk): support fontFamily for native-input and native-textarea - feat(extended-lib): upload react-dom 18.2.0 - feat(sdk): remove load skeleton - feat(sdk): add onCopy event for text component - feat: mini program performance babel plugin - feat(sdk):add ut coverage 98% - feat(demo): add log for skyline debug & extended-lib should keep the built-in libs for cicd & ide - feat(extended-lib): remove built-in upload and fix getUrl data not send - feat(extended-lib): support web3 libs - feat(sdk): richtext support a href - feat(sdk): add page name to performance point - feat(sdk): widget props support functions in deeper obj - feat(sdk): webview status and invoke api - feat(sdk): add ut and increase coverage to 96.88% - feat(sdk): support dynamic rendering cache - feat(sdk): defer for taro useReady - feat(sdk): editor chart insert should focus next line - feat(sdk): api getrandomvalues - feat(sdk): widgetslot props can use functions start with 'on' - feat(plugin): sdk support w3w evm configurable - feat(sdk): add flutter input comp - feat(lib): add getWidgetId and try get ctx from current.widget - feat(sdk): widget can load base.bxml in target app - feat(sdk): api hide back button - feat(sdk): editor echart card - feat(sdk): cross app rpc support sync action - feat(sdk): bump - feat(host): support big int - feat(demo):host shell app add basebxml & preload - feat(server-side-bundle): add bytecode full - feat(sdk): api open document - feat(sdk): cross app rpc api - feat(demo): native component demo update - feat(bundler): support widget extended lib - feat(sdk): bns can work on exp - feat(sdk): cherry-pick: delay onReady for tarojs & add more error message info for appjs load - feat(cli): webf lint add new rules - feat(lib): check media query in webf - feat(sdk): taro page await app loaded - feat(extended-lib): release to prod - feat(sdk): custom native component - feat(sdk): improve doc 0325 - feat(sdk): add new prop webPreferences - feat(bundler): add solution for dynamic lib - feat(sdk): render earlier for pages with static template configuration - feat(sdk): flutter can report lcp - feat(host): support widget api - feat(sdk): add error code for widget when renderer destroy during init - feat(sdk): widget can get props without properties define - feat(sdk): webf lint adjustment - feat(sdk): add api setPageScrollable - feat(sdk): limit data point max length - feat(sdk): closeWidget can close native opend widget - feat(sdk): editor support \n inside paste content - feat(sdk): editor link paste with strick whitelist validator - feat(bundler): increase SOURCEMAP_SIZE_LIMIT to 10MB - feat(sdk): cherry-pick: add preloadflutterwebview api - feat(sdk): add error code to show error page - feat(sdk): add renderer Type in getCurrentPages api - feat(sdk): createSelectorQuery select support rootPortal options - feat(sdk): add latest version to update event - feat(sdk): editor enter event - feat(sdk): enableCursor for developers to use native cursor - feat(sdk): hold atom selection - feat(sdk): web input support inputmode and pattern - feat(bundler): merge widgetconfig to appconfig - feat(sdk): support atom selection - feat(sdk): add scrollSpeedLimit to avoid blank frame of virtual list - feat(sdk): editor support mention and hardBreak - feat(bundler): use js-beautify replace prettier as formater of qjs - feat(bundler): qjs compared from a formatted js code - feat(lib): bmp-api openWidget add support for convention path - feat(sdk): report error during renderer launching process - feat(sdk): scroll view support scrollWithAnimation and scrollIntoViewAlignment - feat(sdk): support swiper rtl props - feat(sdk): widget support open dialog - feat(tools):webf style linter - feat(sdk): report LCP only after user interacts - feat(sdk): set tab bar list api - feat(lib): refactor WidgetSlot as react component - feat(lib): bmp-react & bmp-component add support for widget - feat(sdk): echarts tooltip support basic dom - feat(sdk): widget in widgetslot support lifecycles - feat(sdk): editor internal plugin link support - feat(sdk): add more info to showErrorPage and add widget error report - feat(sdk): export standard error to developers - feat(sdk): bump version - feat(sdk): dynamic widget support props and add openWidget API - feat(sdk): sdk ut to 95% - feat(bundler): build qjs for renderer in flutter - feat(demo): enable flutter - feat(bundler): server side bundle add more files into qjs - feat(sdk): editor transform pasted content - feat(demo): pika extendedlib - feat(sdk): scroll-view supports scroll-anchor - feat(sdk): api bn.preloadWebContent to preload webview content advance - Feat/metadata - feat(sdk): editor paste event props - feat(sdk): echart component - feat(sdk): editor selectImage api - feat(mpp-service) add released pr - feat(sdk): support walletkit and init func - feat(demo): add manual to web input public demo - feat(lib): add API removeSkeleton to bmp-react - feat(sdk): control input - feat(server-side-bundle): add sentry project name and releaseid - feat(sdk): split figure into fig-caption and image - feat(server-side-bundle): use file path as sourceURL of qjs - feat(sdk): support udpsocket api - feat(sdk): 🎸 [plugin] add universal web3 provider - feat(sdk): dom to image support native canvas - feat(sdk): editor extension link - feat(sdk,bundler,demo): support skeleton - feat(sdk,bundler,demo): add camera component & createCameraContext API - feat(demo): add prefetchRules - feat(sdk): getUserOpenId return token - feat(sdk): editor coin - feat(sdk): editor image scrollIntoView - feat(sdk): editor image default spinner - feat(sdk): Mini Game touch event optimization - feat(bundler): support bxs - feat(host): set custom http headers for fetch requests - feat(sdk): ut from plugin-location to plugin-request-subscribe-message - feat(sdk): file method support put method - feat(demo): add beforeRouteChange usage to component-demo - feat(sdk,bundler): add show confirm bar for input - feat(sdk): srcollview pulldown refresher - feat(sdk): bids use monitorupload - feat(demo): editor component demo - feat(sdk): remove settimeout for page.show - feat(sdk): page-not-found - feat(sdk): add page-frame-html in sdk - feat(sdk): chooseMedia & chooseFile API - feat(sdk): editor focus and mark - feat(sdk): add startupTimeout & restore time compensation - feat(sdk): editor extension update and docs - feat(sdk): loading progress animation - feat(host): createBufferUrl support svg - feat(demo): add dom to image demo - feat(sdk): method domToImage - feat(sdk): exitMiniProgram support force close - feat(sdk): new api - getuseropenid getuserkycstatus - feat(sdk): editor component & editorContext api - feat(sdk):load resource fail or slowly - feat(demo): control picker view demo - feat(sdk): detect page timeline - feat(host): support pageReadyCallback - feat(sdk): add binance-card-info api - feat(demo): migrate to pika - feat(sdk): jssdk dashboard rename & calculate - feat(sdk): wallet connector use new wallet provider - feat(lib): add WebViewComponent to @binance/bmp-components - feat(demo): add English desc to image mode demo - feat(sdk): remove window info cache for view-base mode - feat(lib): add getCurrentInstance & getTabBar to @binance/bmp-react - feat(sdk): webview component supports message - feat(sdk): add runtime-plugin-mpc - feat(automator): impove `setupProxyMethod` & add test - feat(sdk): create buffer url supports extension option - feat(demo): add audio and write file benchemark - feat(sdk): swiper support previousMargin/nextMargin/snapToEdge - feat(automator): add mock api for automator - feat(lib): bmp-api & bmp-components & bmp-react - feat(sdk): add error log for 603114 - feat(sdk): View support prop: catchMove - feat(demo): images add mode & readFile add length & position config - feat(lib): generate types for @binance/mp-service - feat(sdk): root-portal - feat: integrate automator on CI - feat(sdk): loadFontFace - feat(sdk): file system api use platform api - feat(sdk): expose navigateBackMiniProgram, add mpModalType prop to navigateToMiniProgram - feat(sdk): webview bounce and loading bar - feat(lib): fork implement from @tarojs/components to @binance/mp-components - feat(sdk): create buffer url use platformAPI - feat(sdk): createInnerAudioContext use platform api - feat(demo): fix create buffer url demo - feat(sdk): gcanvas optimazation - feat(demo): add a rendererId 0 issue test case - feat(sdk): demo update & delete appTimeline - feat(sdk): native webview component - feat(demo): runtime benchmark add getAppBaseInfo apis - feat(sdk): (cherry-pick)support caretColor for Input and TextArea components - feat(automator): automator added headless option & refactor `.launch` & demo page - feat(demo): move sync-api-demo to component-demo & update prefetchRules - feat(sdk): api on add to favorites - feat(bundler): generate fileTree for analyzeSource - feat(sdk): first render new fields - feat(runtime): support selecting sdk - feat(sdk): web canvas component - feat(demo): mini game system info demo - feat(sdk): load gcanvas on demand - feat(sdk): add page-frame-resource points - feat(automator): refactor mp-web & inject mp-web to automator - feat(sdk): gcanvas createJSBuffer, less cpu cost - feat(automator): support plugins service to fix service undefined issue - feat(bundler): add **REPORT_POINTS** for renderer - feat(sdk): nezhaRenderPageJs point - feat(automator): allow reloading the mini-program - feat(cli): update publish yml file - feat(sdk): truncate long rpc logs limit length - feat(sdk): shareAppMessage support fallback url - feat(sdk): add debounce to navigator - feat(cli): support conditional exports bmp - feat(sdk): renderer to native page ready - feat(sdk): add param usePrefetchCache to bn.request - feat(demo): release component-demo PROD - feat(sdk): getPerformance support entryType: loadPackage downloadPackage - feat(sdk): scroll-view support showScrollbar - feat(sdk): mg keyboard api - feat(demo): taro version runtime benchmark - feat(demo): virtual list - feat(runtime): support bn.env.USER_DATA_PATH - feat(sdk): remove monitor because native didn't support the commands - feat(sdk): loadScriptSync rpc - feat(sdk): support multiple intersectionObserver - feat(sdk): navigateTo add target external - feat(sdk): update canIUse for new api - feat(runtime): downloa-package add two fields - feat(bundler): add monitor NEZHA_RENDER_PAGE_JS & update sorter of pkg - feat(host): remove canvas useless dep - feat(sdk): remove deprecated items for sdk4.0 - feat(sdk): getSystemInfo cache - feat(server-side-bundle): compile & upload worker code into bytecode when enableBytecode - feat(sdk): bump versions - feat(sdk): bump version for ide deps - feat(sdk): validate current page is tabBar page when call tabBar apis - feat(demo): update prod demo - feat(sdk): plugin createIntersectionObserver and fix selectorQuery setTimeout issue - feat(sdk): detect darkmode for appBaseInfo - feat(sdk): load app js advance after worker send $Ready - feat(sdk): generate bytecode for worker-service - feat(sdk): gcanvas buffer data optimize - feat: native image - feat(bundler): add new package node-qjsc - feat(sdk): getAppBaseInfo & getWindowInfo & getDeviceInfo - feat(runtime): expose updateBackground of create webview service for ide - feat(sdk): $renderer-ready action - feat(sdk): loadScriptSync method - feat(sdk): chainId should be number when pass to native - feat(demo): add promise polyfill demo for QA regression - feat: web host cli - feat(demo): release demo on QA env - feat(cli): cover-view support hover-class - feat(demo): improve twoFa demo - feat(demo): remove webauthn demo - feat(bundler): add statistics mode to pkg-cli & feat(mpp-service): support config msv - feat(sdk,demo): add private fps api and benchmark for render fps - feat(sdk): cache promise reject handler - feat(sdk): getperformance-evaluateScript - feat(lib): add promise polyfill source code and descreption - feat(sdk): gcanvas async method - feat(server-side-bundle): use X-Mp-Open-Api-Token to authorize - feat(sdk): add warn deprecated info for sdk 4.0 - feat(sdk): support injected prop in webview component - feat(sdk): add experimental on walletconnector - feat(bundler): support include options in project.config.json - feat(sdk): error with stack - feat(sdk): new render point NEZHA_INJECT_RENDERER_JS_END & update timeline point info - feat(lib): use body class to control theme rather than prefers-color-scheme - feat(lib): remote-debug route-change-done notify to render - feat(cli): add props to webview - feat(sdk): mpRuntimeLogger rename & add error code - feat(sdk): webgl finish api - feat(mpp-service): output version info to MPP_SERVICE_OUTPUT.json - feat(sdk): time app check after app-launch - feat(bundler): impl util-function analyzeSource & remove AddEntryAppJsPlugin - feat(mpp-service): output hostQrcode to a file - feat(sdk): sdk-loading - feat(lib): remote-debug new action & ignore native side delay error - feat(sdk): create webview sdk & demo - feat(runtime): disable click when loading display - feat(sdk): gcanvas supports cocos - feat(bundler): use zlib to compress pkg - feat(sdk): setInterval 0 with warning - feat(sdk): add api requestSubscribeMessage - feat(sdk): make-phone-call - feat(runtime): @mp/host catch error and send to parent window - feat(sdk): canvas to temp file path api and demo - feat(sdk): add FP/FCP/LCP entry for performance API - feat(demo): add readfile api to benchmark - feat(sdk): add route-change-done event to fix route entry negative duration - feat(demo): add apiBenchmark at globalThis to run customize api benchmark - feat(demo): add extended-libs page - feat(demo): demo for webgl - feat(cli): quick publish for dev & qa [NEZ-7388] - feat(sdk): add mt_start when monitorupload setdata - feat(extended-lib): integrate distribution API (test on dev env) - feat(cli): support plugins - feat(sdk): improve web3 api - feat(demo): Standard Benchmark DSL Mini Program for runtimes - feat(demo): migrate component-demo api to component-demo-public - feat(sdk): cache promise api until it resolved - feat(bundler): add file hash to pkg - feat(sdk): filesystem api - copyfile, unzip - feat(demo): update radio example code as wechat example - feat(runtime): assign path to render iframe name - feat(demo): form view media public demo components - feat(demo): release demos in QA env - feat(demo): release demos in QA env - feat(demo): release demos in QA env - feat(cli): support taro prerender - feat(mpp-service): intergate server-side-bundle - feat(sdk): open-type getEmailAddress / getPhoneNumber - feat(demo): share app demo - feat(sdk): universal link - feat(extended-lib): export libs info - feat(bundler): add analyse mode to pkg-cli - feat(extended-lib): add new package @mp/extended-lib - feat(bundler): add pkg-cli - feat(sdk): monitorupload NEZHA_RENDER_PAGE_JS with data-eb - feat(sdk): setData payload size & remove cocos - feat(sdk): check TIME_APP by heartbeat scheme - feat(lib): preload styles bug fix - feat(demo): migrate theme-context - feat(bundler): bundler-cli add disabledSubpackages - feat(mpp-service): upload pkg of mini-program - feat(sdk): refactor framework-load-script - feat(demo): update custome event demo - feat(sdk): ide clipboard plugin migrate - feat(demo): add getEmailAddress getPhoneNumber demo - feat(server-side-bundle): upload source-map & source-code - feat(lib): preload html core - feat(mpp-service): support auto increase version code & improve error… - feat(runtime): simulator navigator title left align - feat(sdk): custom event on/off - feat(sdk): open-type button support getPhoneNumber, getEmail - feat(demo): expose base64_encode method example for developers - feat(sdk): native send event to worker with time - feat(sdk): renderer send RendererReady to Native - feat(demo): standalone webview demo - feat(sdk): add create offscreen canvas api - feat(sdk): warn if developer call sync api in app & page lifecycle - feat(runtime,sdk): handle page-not-found and fix onPageNotFound not working - feat(server-side-bundle): add new package @mp/server-side-bundle - feat(demo): implement 5 api to component-demo - feat(demo): component-demo for dsl - feat(sdk): route query parameters updates - feat(demo): migrate e2e test - feat(mpp-service): submit the MiniProgram in audit step - feat(demo): enterkeyhint of search - feat(sdk): remote debug support sync rpc - feat(sdk): remove cocos runtime script from sdk package - feat(automator): replace puppeteer wiht playwright - feat(sdk): wallet-connector issue fix - feat(sdk): text component support decode and space - feat(sdk): add new rpc action RendererServiceReady - feat(sdk): add fullyDownloaded to FrameworkDownloadPackage - feat(demo): webview custom nav demo - feat(lib): host getImageInfo plugin - feat(sdk): getImageInfo support relative path - feat(sdk): add wallet-connector plugin - feat(bundler) : bxml support relative path - feat(cli): update deprecated input props - feat(demo): public demo component migrate - feat(demo): update wallet connector demo - feat(demo): include get-image-info demo image files - feat(demo): component demo public - feat(runtime): deprecated input support confirm event - feat(demo): update wallet connector demo - feat(demo): getImageInfo support absolute path and short path - feat(demo): add more cases in wallet-connector demo - feat(cli,doc): modify bundler info for useExtendedLib and update doc troubleshooting - feat(bundler & runtime): support useExtendedLib - feat(demo): update the unsupported domain test - feat: e2e-test - feat(sdk): hotfix 3.8.1 cherry pick master & restore yml - feat(sdk): redesign timeline - feat(sdk): startlocationupdate type - feat(sdk): image-info plugin - feat(demo): get-image-info demo - feat(sdk): add plugin user-info & migrate getUserProfile to action get-user-info-profile - feat(cli): support externals lib - feat(playground): add wallet-connector context api - feat(cli): upgrade tarojs to 3.4.4 - feat(sdk): expose esmoudle of plugin submodule with .mjs - feat(bundler): empty app.js for drop compatibility & fix independent … ### Performance Improvements - perf: enhance scroll performance by reduce binding getter from event target - perf: add filesystem cache - perf: app-rpc msg encoder - perf: pre-create worker - perf(sdk): use local js-sha3 ### Misc - Revert "fix(sdk): export bmp component utils" - Revert "chore: @mp/bundler dev" - Revert "fix(sdk): vnode patch issues " (#1786) (#1796) - Revert "fix(sdk): iOS native component created failed when container is not visible " - Revert "fix(sdk): env undefined" - Revert "Revert "refactor(sdk): remove locationReadyManager " (#888)" (#929) - Revert "refactor(sdk): remove locationReadyManager " (#888) - Revert "fix: cherry-pick cachePromise of getSystemInfo " (#867) - revert(sdk): revert getPhoneNumber/getEmailAddress feature because IOS not ready yet - revert(sdk): rollback to use the old get-user-profile action ## [5.8.0] 2026-01-30 **Download: [5.8.0(2.21 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.8.0.zip)** ### Bug Fixes - fix(sdk): cherry pick 5.7.1 - fix(sdk): sortable items when height changes - fix(sdkl): wallet prerender failed ### Features - feat(sdk): hummer gcanvas - feat(sdk): load appjs when reload worker - feat(sdk): enhance native event channel for CustomNativeComponent - feat(cli): miniprogram mcp server - feat(cli): more function in devtool ## [5.7.4] 2026-01-26 **Download: [5.7.4(2.21 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.7.4.zip)** ### Misc - revert: revert v5.7.2 and v5.7.3 which fix by native ## [5.7.3] 2026-01-16 **Download: [5.7.3(1.87 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.7.3.zip)** ### Bug Fixes - fix(sdk): showErrorPage when setData unordered ## [5.7.2] 2026-01-15 **Download: [5.7.2(1.87 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.7.2.zip)** ### Features - feat(sdk): showError page when node tree not matched ## [5.7.1] 2026-01-14 **Download: [5.7.1(1.87 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.7.1.zip)** ### Bug Fixes - fix(sdk): fix route pending when page.js fails ## [5.6.1] 2026-01-14 **Download: [5.6.1(1.87 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.6.1.zip)** ### Bug Fixes - fix(sdk): fix route pending when page.js fails ## [5.7.0] 2026-01-08 **Download: [5.7.0(1.87 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.7.0.zip)** ### Bug Fixes - fix(sdk): rm geature event listener binding ### Features - feat(sdk): hummer button functions - feat(sdk): support createContext with customNativeComponent widget rendererId - feat(sdk): add internal doc site - feat(cli): auto perf ## [5.5.3] 2025-12-29 **Download: [5.5.3(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.5.3.zip)** ## [5.4.2] 2025-12-29 **Download: [5.4.2(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.4.2.zip)** ## [5.2.10] 2025-12-29 **Download: [5.2.10(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.2.10.zip)** ## [5.6.0] 2025-12-19 **Download: [5.6.0(1.87 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.6.0.zip)** ### Bug Fixes - fix(sdk): fix prerender inject data path - fix(sdk,bundler): init nativeScrollNegotiation/enableBackToTop config - fix(sdk): reuse page issue on ios platform - fix(sdk): text dont filter nest components - fix(sdk): chain routechange handler when receviced multiple routechange - fix(lib): add missing code back to protect web import ### Features - feat(sdk): add extra type - feat(sdk): support debug prefetch configuration - feat(sdk): lottie comp support animationData props - feat(bundler): update terser avoid bugs of old ver ## [5.5.2] 2025-12-17 **Download: [5.5.2(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.5.2.zip)** ### Bug Fixes - fix(sdk): add ut - fix(lib): add comma to avoid MFA build error - fix(sdk): cp view based sdk 5.0 issue - fix(sdk): cp tab area scroll - fix(sdk): render data and prerender data independent to resolve flutter blink - fix(sdk): ignore preload font on flutter - fix(bundler): compatibility for old android - fix(cli): version sort - fix(sdk): fix prerender measure - fix(sdk): sdk5.2 cherry pick bn.removeWidgetSkeleton - fix(sdk): inst id not exist - fix(sdk): sdk5.2 cherry pick usePageScroll - fix(sdk): sdk5.x hummer log & nezha debug flag - fix(sdk): hotfix scrollview - fix(sdk): avoid XSS attack - fix(sdk): mounted to ensure nativeComponents context ready and dom instanceId for native widget map - fix(mpp-service): ai meta info upload without widgets - fix(sdk): remove unused log ### Features - feat(sdk): support closest AnchorElement tap - feat(sdk): add private api getVisibilityState - feat(sdk): input support force-decimal-dot - feat(sdk): fliter standalone chunk js for bytecode pkg - feat(sdk): support webview markdown list style - feat(cli): release 1.0.0 stable version - feat(cli): dx improve - feat(sdk): page timeline add check point - feat(sdk): editor chart UI revamp - feat(sdk,bundler): customize renderer components - feat(sdk): add debug - feat(sdk): b8 widget custom lifecycle - feat(extendedLib): extended lib ci and checksum - feat(sdk): update value for input - feat(script): add dev tag for publish-dev - feat(sdk): add scrollOffset for pageScrollTo - feat(sdk): support access node in SelectQuery - feat(sdk): flutterToImage and nativeComponent for iOS webview renderer - feat(sdk): remove root style 100% - feat(mpp-service): use label as rev - feat(sdk): call all api - feat(sdk): preload font - feat(mpp-service): add widget qrcode request logic - feat(bundler): update widgetConfigs - feat(cli): dynamic bundle version support - feat(sdk): video class name - feat(cli): clean code & fix no-qjs flag & fix fs-extra copy failed - feat: add preload-worker - feat(cli): use libversion ## [5.5.1] 2025-12-17 **Download: [5.5.1(1.81 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.5.1.zip)** ### Bug Fixes - fix(libs); bmp-components imported unexpectedly by web project - fix(sdk): usePageScroll hooks not work - fix(bmp): pika ci error - fix(sdk): fix resolve native comp & input update timestamp - fix(sdk): render child node directly when component need children vnode - fix(sdk): host mini app events and setData damaged by widget flow - fix: revert comment - fix(sdk): @binance/bmp-xx deps - fix(sdk): scrollViewUpdate rendererId undefined - fix(lib): define EMPTY_OBJ - fix(sdk): fix build script - fix(sdk): dep missing - fix(sdk): plugins types issue - fix(sdk): fake childnode - fix(sdk): fix no text in child text - fix(sdk): nested text node - fix(sdk): remove capture event handler - fix(cli): bundler function params missing - fix(sdk): typo error - fix(sdk): fix alias to avoid multiple event emit ### Features - feat(bundler): fix bundler config - feat(lib): support legacy dynamic widget slot - feat(lib): release prod bmp-components and bmp-react - feat(bundler): remove prerender data after build in - feat(lib): update bmp component for ts - feat(lib): support legacy widget-slot - feat(sdk): update systemInfo cache when shellapp not restart - feat(sdk): prerender remove skeleton auto - feat(sdk): prerender support combined data - feat(lib): update typo and EMPTY_OBJ - feat(sdk): update taro-bn-components - feat(lib): remove useTheme - feat(lib): use one reactMeta for context - feat(sdk): update hummer webpack with production mode - feat(sdk): update typo - feat(lib): update useEffect - feat(sdk): use pika **APPID** - feat(lib): move context to bmp-react - feat(lib): add context - feat(cli): update bundler version - feat(sdk): update widget - feat(sdk): add log - feat(sdk): add widget hummer - feat(sdk): no cache for widget open event - feat(sdk): remove global RuntimeMonitor - feat(sdk): hummer send to worker pageready - feat(sdk): track campatibility for app inst - feat(sdk): support widget slot - feat(sdk): widget plugin - feat(sdk): support event & update - feat(sdk): update widget - feat(sdk): hummer event, context, widget update - feat(sdk): add component render plugin - feat(sdk): widget slot plugin - feat(sdk): add page ready - feat(sdk): export widget component - feat(sdk): fix typo - feat(sdk): add widgetOpen handler - feat(sdk): widget plugin - feat(sdk): remove app timeline check & loadApp directly - feat(sdk): remove mg - feat(sdk): draft widget - feat(sdk): avoid event error of widget - feat(sdk): mp lite support prerender - feat(sdk): update 5.0 widget - feat(sdk): remove app instance - feat(bundler): init widget bundler - feat(sdk): export methods for widget - feat(sdk): worker not wait renderer ready - feat(sdk): use vue render - feat(sdk): add components alias - feat(sdk): remove bxml render in worker - feat(sdk): clean worker timeline - feat(sdk): clean worker timeline - feat(sdk): 5.0 add script to build renderer-service-hummer.js - feat(sdk): remove vnode and patch on worker ### Misc - Revert "Merge master" - revert: root condition in setData ## [5.4.1] 2025-12-17 **Download: [5.4.1(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.4.1.zip)** ### Features - feat(cli): release 1.0.0 stable version - feat(cli): dx improve ## [5.3.5] 2025-12-17 **Download: [5.3.5(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.3.5.zip)** ## [5.2.9] 2025-12-15 **Download: [5.2.9(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.2.9.zip)** ### Bug Fixes - fix(sdk): text dont filter nest components ## [5.5.0] 2025-11-27 **Download: [5.5.0(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.5.0.zip)** ### Features - feat(sdk): support closest AnchorElement tap - feat(sdk): add private api getVisibilityState - feat(sdk): input support force-decimal-dot - feat(sdk): fliter standalone chunk js for bytecode pkg - feat(sdk): support webview markdown list style - feat(cli): release 1.0.0 stable version - feat(cli): dx improve ## [5.4.0] 2025-11-07 **Download: [5.4.0(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.4.0.zip)** ### Bug Fixes - fix(sdk): cp view based sdk 5.0 issue - fix(sdk): cp tab area scroll - fix(sdk): render data and prerender data independent to resolve flutter blink - fix(sdk): ignore preload font on flutter - fix(bundler): compatibility for old android ### Features - feat(sdk): page timeline add check point - feat(sdk): editor chart UI revamp - feat(sdk,bundler): customize renderer components - feat(sdk): add debug - feat(sdk): b8 widget custom lifecycle - feat(extendedLib): extended lib ci and checksum ## [5.2.8] 2025-11-04 **Download: [5.2.8(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.2.8.zip)** ### Bug Fixes - fix(sdk): capacibility of document body - fix(sdk): cp tab area scroll ## [5.3.4] 2025-11-04 **Download: [5.3.4(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.3.4.zip)** ### Bug Fixes - fix(sdk): capacibility of document body - fix(sdk): cp tab area scroll ## [5.3.4] 2025-11-04 **Download: [5.3.4(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.3.4.zip)** ### Bug Fixes - fix(sdk): cp tab area scroll ## [5.2.8] 2025-11-04 **Download: [5.2.8(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.2.8.zip)** ### Bug Fixes - fix(sdk): cp tab area scroll ## [4.51.4] 2025-11-03 **Download: [4.51.4(1.85 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.51.4.zip)** ### Bug Fixes - Fix/tab move ## [5.3.3] 2025-11-02 **Download: [5.3.3(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.3.3.zip)** ### Bug Fixes - fix(sdk): render data and prerender data independent to resolve flutter blink ## [5.2.7] 2025-11-02 **Download: [5.2.7(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.2.7.zip)** ### Bug Fixes - fix(sdk): render data and prerender data independent to resolve flutter blink ## [4.51.3] 2025-10-30 **Download: [4.51.3(1.85 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.51.3.zip)** ### Features - feat(sdk): editor chart UI revamp ## [5.3.2] 2025-10-30 **Download: [5.3.2(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.3.2.zip)** ### Bug Fixes - fix(sdk): capacibility for prerender text ## [5.2.6] 2025-10-30 **Download: [5.2.6(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.2.6.zip)** ### Bug Fixes - fix(sdk): capacibility for prerender text ## [4.51.2] 2025-10-29 **Download: [4.51.2(1.85 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.51.2.zip)** ### Features - feat(sdk): support custom native component in iOS ## [5.2.5] 2025-10-28 **Download: [5.2.5(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.2.5.zip)** ## [5.2.4] 2025-10-28 **Download: [5.2.4(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.2.4.zip)** ### Bug Fixes - fix(sdk): viewbased mp issue ## [5.3.1] 2025-10-28 **Download: [5.3.1(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.3.1.zip)** ### Bug Fixes - fix(sdk): viewbased mp issue ## [5.2.4] 2025-10-28 **Download: [5.2.4(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.2.4.zip)** ### Bug Fixes - fix(sdk): viewbased mp issue ## [5.3.0] 2025-10-17 **Download: [5.3.0(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.3.0.zip)** ### Features - feat(sdk): update value for input - feat(script): add dev tag for publish-dev - feat(sdk): add scrollOffset for pageScrollTo - feat(sdk): support access node in SelectQuery - feat(sdk): flutterToImage and nativeComponent for iOS webview renderer - feat(sdk): remove root style 100% - feat(mpp-service): use label as rev ## [5.2.3] 2025-10-15 **Download: [5.2.3(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.2.3.zip)** ### Bug Fixes - fix(sdk): nested text render ### Features - feat(sdk): remove skeleton earlier to improve FCP ## [4.51.2] 2025-10-14 **Download: [4.51.2(1.85 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.51.2.zip)** ### Features - feat(sdk): support custom native component in iOS ## [4.51.1] 2025-10-13 **Download: [4.51.1(1.85 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.51.1.zip)** ### Features - feat(sdk): flutter domToImage - feat(mpp-service): update to junior ## [5.2.1] 2025-10-11 **Download: [5.2.1(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.2.1.zip)** ### Bug Fixes - fix(sdk): render full attrs & buildin alias - fix(cli): version sort ## [5.2.0] 2025-09-26 **Download: [5.2.0(1.81 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.2.0.zip)** ### Bug Fixes - fix(sdk): fix prerender measure - fix(sdk): sdk5.2 cherry pick bn.removeWidgetSkeleton - fix(sdk): inst id not exist - fix(sdk): sdk5.2 cherry pick usePageScroll - fix(sdk): sdk5.x hummer log & nezha debug flag - fix(sdk): hotfix scrollview - fix(sdk): avoid XSS attack - fix(sdk): mounted to ensure nativeComponents context ready and dom instanceId for native widget map - fix(mpp-service): ai meta info upload without widgets - fix(sdk): remove unused log ### Features - feat(sdk): call all api - feat(sdk): preload font - feat(mpp-service): add widget qrcode request logic - feat(bundler): update widgetConfigs - feat(cli): dynamic bundle version support - feat(sdk): video class name - feat(cli): clean code & fix no-qjs flag & fix fs-extra copy failed - feat: add preload-worker - feat(cli): use libversion ## [4.51.0] 2025-09-26 **Download: [4.51.0(1.85 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.51.0.zip)** ### Features - Feat call all - feat(sdk): sdk4.x support support formatter for all echart options ## [5.1.4] 2025-09-24 **Download: [5.1.4(1.81 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.1.4.zip)** ### Bug Fixes - fix(sdk): usePageScroll hooks not work - fix(sdk): hummer renderer support update single child ### Features - feat(sdk): bn.removeWidgetSkeleton ## [5.1.3] 2025-09-17 **Download: [5.1.3(1.81 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.1.3.zip)** ### Bug Fixes - fix(sdk): hummer render support update dom - fix(sdk): fix hummer event not work because eventId not exist - fix(sdk): comment log & debug log flag - fix(sdk): remove duplicate worker module while hot-reload - fix(sdk): fix render native webview ## [5.1.2] 2025-09-12 **Download: [5.1.2(1.81 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.1.2.zip)** ### Features - feat(sdk): renderer mount do not wait worker rpc response ## [5.1.1] 2025-09-12 **Download: [5.1.1(1.81 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.1.1.zip)** ### Bug Fixes - fix(sdk): fix widget FCP & LCP report - fix(sdk): hotfix scrollview ### Features - feat(sdk): sdk5.1 support formatter for all echart options ## [4.50.1] 2025-09-12 **Download: [4.50.1(1.85 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.50.1.zip)** ### Bug Fixes - fix(sdk): hotfix scrollview ## [4.50.0] 2025-09-04 **Download: [4.50.0(1.85 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.50.0.zip)** ### Bug Fixes - fix(sdk): mounted to ensure nativeComponents context ready and dom instanceId for native widget map - fix(mpp-service): ai meta info upload without widgets - fix(sdk): remove unused log ### Features - feat(sdk): video class name - feat(cli): clean code & fix no-qjs flag & fix fs-extra copy failed - feat: add preload-worker - feat(cli): use libversion - feat(bundler): support bundler version ## [5.1.0] 2025-09-04 **Download: [5.1.0(1.81 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.1.0.zip)** ### Bug Fixes - fix(bmp): pika ci error - fix(sdk): fix resolve native comp & input update timestamp - fix(sdk): render child node directly when component need children vnode - fix(sdk): host mini app events and setData damaged by widget flow - fix: revert comment - fix(sdk): @binance/bmp-xx deps - fix(sdk): scrollViewUpdate rendererId undefined - fix(lib): define EMPTY_OBJ ### Features - feat(lib): support legacy dynamic widget slot - feat(lib): release prod bmp-components and bmp-react - feat(bundler): remove prerender data after build in - feat(lib): update bmp component for ts - feat(lib): support legacy widget-slot - feat(sdk): update systemInfo cache when shellapp not restart - feat(sdk): prerender remove skeleton auto - feat(sdk): prerender support combined data - feat(lib): update typo and EMPTY_OBJ - feat(sdk): update taro-bn-components - feat(lib): remove useTheme - feat(bundler): support bundler version ### Misc - Revert "Merge master" - revert: root condition in setData ## [4.49.1] 2025-08-22 **Download: [4.49.1(1.85 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.49.1.zip)** ### Bug Fixes - fix(sdk): nested scroll not work - fix(sdk): menuBts props ## [5.0.0] 2025-08-15 **Download: [5.0.0(1.90 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-5.0.0.zip)** ### Bug Fixes - fix(sdk): fix build script - fix(sdk): dep missing - fix(sdk): plugins types issue - fix(sdk): fake childnode - fix(sdk): fix no text in child text - fix(sdk): nested text node - fix(sdk): fix swiper loop mode & scroll view style - fix(sdk): fix intersection observer relative info not work - fix(sdk): remove capture event handler - fix(cli): bundler function params missing - fix(sdk): typo error - fix(sdk): relaunch deeplink issue - fix(sdk): fix swiper autoplay - fix(sdk): fix alias to avoid multiple event emit - Fix/swiper 0708 - fix(sdk): deeplink with data loader issue - fix(sdk): exports utils - fix(sdk): export bmp component utils - fix(sdk): scroll X in scroll Y - fix(sdk): expose the error before app init - fix(sdk): hide home button api - fix(server-side-bundle): add bundler as dep ### Features - feat(lib): use one reactMeta for context - feat(sdk): update hummer webpack with production mode - feat(sdk): update typo - feat(lib): update useEffect - feat(sdk): use pika **APPID** - feat(lib): move context to bmp-react - feat(lib): add context - feat(cli): update bundler version - feat(sdk): support share v2 api - feat(sdk): update widget - feat(sdk): add formatter attribute - feat(sdk): menuBts for flutter markdown - feat(sdk): video poster - feat(sdk): support locked config for sortableitem - feat(sdk): add log - feat(sdk): add widget hummer - feat(sdk): no cache for widget open event - feat(sdk): remove global RuntimeMonitor - feat(sdk): hummer send to worker pageready - feat(sdk): track campatibility for app inst - feat(sdk): support widget slot - feat(sdk): widget plugin - feat(sdk): support event & update - feat(sdk): update widget - feat(sdk): hummer event, context, widget update - feat(cli): support home page widget preview - feat(sdk): add component render plugin - feat(sdk): widget slot plugin - feat(sdk): add page ready - feat(sdk): export widget component - feat(sdk): fix typo - feat(sdk): add widgetOpen handler - feat(sdk): widget plugin - feat(sdk): remove app timeline check & loadApp directly - feat(mpp-service): update ai router payload - feat(sdk): remove mg - feat(sdk): draft widget - feat(mpp-service): ai router solution - feat(sdk): revert autoheight default value to false - feat(sdk): swiper autoHeight - feat(sdk): mp plugin support AbortSignal - feat(sdk): add require error log - feat(sdk): avoid event error of widget - feat(cli): bundle watch process not exiting correctly - feat(sdk): mp lite support prerender - feat(sdk): update 5.0 widget - feat(sdk): remove app instance - feat(bundler): init widget bundler - feat(sdk): export methods for widget - feat(cli): add error handler for ios debug target query - feat(cli): support inspect webview/webf with native devtool protocol message - feat(sdk): worker not wait renderer ready - feat(sdk): use vue render - feat(sdk): add components alias - feat(sdk): remove bxml render in worker - feat(sdk): clean worker timeline - feat(sdk): clean worker timeline - feat(sdk): 5.0 add script to build renderer-service-hummer.js - feat(sdk): remove vnode and patch on worker - feat(sdk): support nested scroll view - feat(sdk): blank detector - feat(sdk): support typewriter effect for flutter markdown - feat(sdk): support playsinline for video - feat(sdk): use \_\_mp_runtime_config.screenWidth for set rem - feat(mpp-service): add report file size functions - feat(extended-lib): mpp runtime vendor - feat(sdk): new api bn.addPhoneCalendar & bn.addPhoneRepeatCalendar - feat(cli): add meta info indicator and every day tip - feat(sdk): add new svg component demo - feat(sdk): not set dataurl on style change - feat(sdk): w3w timeline monitor - feat(sdk): flutter svg class support - feat(sdk): add ios timeline log fit regexp - feat(sdk): virtualList support size by function - feat(sdk): remove set rem in flutter - feat(sdk): add createEventSource support for IDE - feat(sdk): add `max-lines` for text-span - feat(sdk): support page preload - feat(sdk): negotiation scroll with native on Android - feat(extended-lib): use dynamicExtendedLib for all the libs and remove upload builtIn lib - feat(sdk): suspend & resume lifecycle ### Misc - Revert "fix(sdk): export bmp component utils" ## [4.49.0] 2025-08-14 **Download: [4.49.0(1.85 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.49.0.zip)** ### Bug Fixes - fix(sdk): fix swiper loop mode & scroll view style - fix(sdk): fix intersection observer relative info not work ### Features - feat(sdk): support share v2 api - feat(sdk): add formatter attribute - feat(sdk): menuBts for flutter markdown - feat(sdk): video poster - feat(sdk): support locked config for sortableitem - feat(cli): support home page widget preview - feat(mpp-service): update ai router payload - feat(mpp-service): ai router solution ## [4.48.1] 2025-08-04 **Download: [4.48.1(1.85 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.48.1.zip)** ### Bug Fixes - fix(sdk): fix swiper loop mode & scroll view style ## [4.48.0] 2025-07-25 **Download: [4.48.0(1.85 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.48.0.zip)** ### Bug Fixes - fix(sdk): relaunch deeplink issue - fix(sdk): fix swiper autoplay - Fix/swiper 0708 - fix(sdk): deeplink with data loader issue - fix(sdk): exports utils - fix(sdk): export bmp component utils - fix(sdk): scroll X in scroll Y ### Features - feat(sdk): revert autoheight default value to false - feat(sdk): swiper autoHeight - feat(sdk): mp plugin support AbortSignal - feat(sdk): add require error log - feat(cli): bundle watch process not exiting correctly - feat(cli): add error handler for ios debug target query - feat(cli): support inspect webview/webf with native devtool protocol message ### Misc - Revert "fix(sdk): export bmp component utils" ## [4.47.1] 2025-07-21 **Download: [4.47.1(1.84 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.47.1.zip)** ### Bug Fixes - fix(sdk): scroll X in scroll Y (#2251) ## [4.47.0] 2025-07-07 **Download: [4.47.0(1.84 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.47.0.zip)** ### Bug Fixes - fix(sdk): expose the error before app init ### Features - feat(sdk): support nested scroll view - feat(sdk): blank detector - feat(sdk): support typewriter effect for flutter markdown - feat(sdk): support playsinline for video - feat(sdk): use \_\_mp_runtime_config.screenWidth for set rem - feat(mpp-service): add report file size functions - feat(extended-lib): mpp runtime vendor - feat(sdk): new api bn.addPhoneCalendar & bn.addPhoneRepeatCalendar - feat(cli): add meta info indicator and every day tip - feat(sdk): add new svg component demo ## [4.46.0] 2025-06-13 **Download: [4.46.0(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.46.0.zip)** ### Bug Fixes - fix(sdk): hide home button api - fix(server-side-bundle): add bundler as dep ### Features - feat(sdk): not set dataurl on style change - feat(sdk): w3w timeline monitor - feat(sdk): flutter svg class support - feat(sdk): add ios timeline log fit regexp - feat(sdk): virtualList support size by function - feat(sdk): remove set rem in flutter - feat(sdk): add createEventSource support for IDE - feat(sdk): add `max-lines` for text-span - feat(sdk): support page preload - feat(sdk): negotiation scroll with native on Android - feat(extended-lib): use dynamicExtendedLib for all the libs and remove upload builtIn lib ## [4.45.5] 2025-06-12 **Download: [4.45.5(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.45.5.zip)** ### Misc - Revert "feat(sdk): remove set rem in flutter" ## [4.45.4] 2025-05-26 **Download: [4.45.4(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.45.4.zip)** ### Bug Fixes - fix(sdk): add svg style filter - fix(sdk): fix page-frame ### Features - feat(sdk): remove set rem in flutter ## [4.45.3] 2025-05-23 **Download: [4.45.3(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.45.3.zip)** ### Bug Fixes - fix(server-side-bundle): add bundler as dep ### Features - feat(sdk): support page preload - feat(sdk): negotiation scroll with native on Android - feat(extended-lib): use dynamicExtendedLib for all the libs and remove upload builtIn lib ## [4.45.3] 2025-05-23 **Download: [4.45.3(1.80 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.45.3.zip)** ### Features - feat(sdk): remove set rem in flutter ## [4.45.2] 2025-05-21 **Download: [4.45.2(1.73 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.45.2.zip)** ### Bug Fixes - fix(sdk): add svg style filter ## [4.45.1] 2025-05-19 **Download: [4.45.1(1.73 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.45.1.zip)** ### Bug Fixes - fix(sdk): fix page-frame ## [4.44.4] 2025-05-19 **Download: [4.44.4(1.73 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.44.4.zip)** ### Bug Fixes - fix(sdk): fix page-frame ## [4.45.1] 2025-05-19 **Download: [4.45.1(1.73 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.45.1.zip)** ### Bug Fixes - fix(sdk): fix page-frame ## [4.44.3] 2025-05-16 **Download: [4.44.3(1.73 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.44.3.zip)** ## [4.45.0] 2025-05-15 **Download: [4.45.0(1.73 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.45.0.zip)** ### Features - feat(sdk): suspend & resume lifecycle ## [4.1043.1] 2025-05-12 **Download: [4.1043.1(1.73 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.1043.1.zip)** ### Bug Fixes - fix(sdk): support multiple chart instances with same chart id when work with swiper - fix(sdk): observer doesn't work - fix(sdk): set scroll top not work / request support enableCache - fix(sdk): `show-scrollbar` doesn't work ### Features - feat(sdk): support keyboard accessory item - feat(sdk): remove sync api - feat(sdk): domtoimage can ignore error when image not exist or load error - feat(sdk): scrollview support enableBackToTop - feat(sdk): showErrorPage support auto detect rendererId - feat(sdk): flutter scrollView add events - feat(cli): achieve pkg stability & log process stability optimization - feat(host): support five themes - feat(cli): support mcp refresh - feat(sdk): remove hack worker patch - feat(sdk): add dark_midnight support - feat(bundler): support polyfill self and XMLHttpRequest - feat(bundler): dynamic path by env. BUNDLER_PATCH - feat(extended-lib): support extended lib uikit flow - feat(host): support midnight ## [4.44.2] 2025-05-12 **Download: [4.44.2(1.73 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.44.2.zip)** ### Bug Fixes - fix(sdk): support multiple chart instances with same chart id when work with swiper ## [4.44.1] 2025-05-07 **Download: [4.44.1(1.73 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.44.1.zip)** ### Bug Fixes - fix(sdk): observer doesn't work ## [4.44.0] 2025-05-02 **Download: [4.44.0(1.73 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.44.0.zip)** ### Bug Fixes - fix(sdk): set scroll top not work / request support enableCache - fix(sdk): `show-scrollbar` doesn't work ### Features - feat(sdk): support keyboard accessory item - feat(sdk): remove sync api - feat(sdk): domtoimage can ignore error when image not exist or load error - feat(sdk): scrollview support enableBackToTop - feat(sdk): showErrorPage support auto detect rendererId - feat(sdk): flutter scrollView add events - feat(cli): achieve pkg stability & log process stability optimization - feat(host): support five themes - feat(cli): support mcp refresh - feat(sdk): remove hack worker patch - feat(sdk): add dark_midnight support - feat(bundler): support polyfill self and XMLHttpRequest - feat(bundler): dynamic path by env. BUNDLER_PATCH - feat(extended-lib): support extended lib uikit flow - feat(host): support midnight ## [4.1043.0] 2025-04-18 **Download: [4.1043.0(1.72 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.1043.0.zip)** ## [4.43.1] 2025-04-16 **Download: [4.43.1(1.72 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.43.1.zip)** ### Bug Fixes - fix(sdk): domtoimage image url corner cases ### Features - feat(sdk): add dark_midnight support for prerender ## [4.43.0] 2025-04-10 **Download: [4.43.0(1.72 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.43.0.zip)** ### Bug Fixes - fix(sdk): flutter getAttribute polyfill - fix(sdk): fix input textarea type adjustPosition ### Features - feat(sdk): alpha chart for editor - feat(sdk): new component flutter markdown - feat(sdk): add `` & `` components - feat(sdk): support get prefetch data synchronous - feat: update process-md-paths - feat(cli): log process status indicator - feat: update md jobs - feat: add job to convert md path - feat(cli): filter standalone-chunks while addEntry - feat(sdk): input support max-digits-length - feat(cli): use release version devtool - feat(sdk): add runtime-plugin-create-event-source - feat(cli): chrome devtools Integration - console - feat: update llms.txt title and filter docs - feat: add upload-docs-md job ## [4.42.2] 2025-04-02 **Download: [4.42.2(1.72 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.42.2.zip)** ## [4.42.1] 2025-03-25 **Download: [4.42.1(1.72 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.42.1.zip)** ### Bug Fixes - fix(sdk): flutter getAttribute polyfill ## [4.42.0] 2025-03-21 **Download: [4.42.0(1.72 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.42.0.zip)** ### Bug Fixes - fix(cli): missing build start callback in bundleWatch - fix(sdk): add LCP report target - fix(sdk): drawer component visible when mounted - fix(mpp-service): fix qjs build for Andriod - fix(demo): pika no longer support `independent` ### Features - feat(cli): rebundle while refresh - feat(cli): improve achieve stability - feat(cli): adjust glob params - feat(cli): manual update qjsc version - feat(cli): add syncPackInclude flag - feat(bmp): add direction type for sortable - feat(runtime): add api `fs.removeSavedFile` - feat(demo): add more chose file or media demo ## [4.41.7] 2025-03-20 **Download: [4.41.7(1.71 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.41.7.zip)** ### Bug Fixes - fix(sdk): duplicated route change ## [4.41.6] 2025-03-19 **Download: [4.41.6(1.71 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.41.6.zip)** ### Bug Fixes - fix(sdk): fix modal navigate on android 2.97(no cherry pick to master) ## [4.41.5] 2025-03-17 **Download: [4.41.5(1.71 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.41.5.zip)** ## [4.41.4] 2025-03-14 **Download: [4.41.4(1.71 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.41.4.zip)** ### Features - feat(sdk): improve drag & sort behaviour ## [4.41.3] 2025-03-10 **Download: [4.41.3(1.71 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.41.3.zip)** ### Performance Improvements - perf: optimize performance by remove rpc log - perf: remove logger to fast lcp metric ## [4.41.3] 2025-03-10 **Download: [4.41.3(1.72 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.41.3.zip)** ### Performance Improvements - perf: remove logger to fast lcp metric ## [4.41.2] 2025-03-07 **Download: [4.41.2(1.72 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.41.2.zip)** ### Bug Fixes - fix(sdk): intersection Observer component undefined issue ## [4.41.1] 2025-03-06 **Download: [4.41.1(1.72 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.41.1.zip)** ### Bug Fixes - fix(sdk): free mode sortable and highlight input rtl issue ## [4.41.0] 2025-03-03 **Download: [4.41.0(1.72 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.41.0.zip)** ### Bug Fixes - fix(sdk): page frame await syntax error - fix op_line_number size increased and get_label_pos not changed on node-qjsc - fix(mp-service): fix track line and column numbers for expressions on… ### Features - feat(sdk): add image info type - feat(sdk): init rem to avoid style issue in flutter renderer - feat(sdk): widget support selectorQuery & intersectionObserver - feat(sdk): implement lite-timeline sdk part - feat(sdk): improve virtual scrollview - feat(sdk): remove webf sync command during the initialization - feat(sdk): support disableCleanStack and cleanOtherStack - feat(sdk): increase priority of framework level message - feat(runtime): add plugin `addEventListenerToBody` - feat(server-side-bundle): add new qjs compilation ## [4.41.0] 2025-02-28 **Download: [4.41.0(1.72 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.41.0.zip)** ### Bug Fixes - fix op_line_number size increased and get_label_pos not changed on node-qjsc - fix(mp-service): fix track line and column numbers for expressions on… ### Features - feat(sdk): add image info type - feat(sdk): init rem to avoid style issue in flutter renderer - feat(sdk): widget support selectorQuery & intersectionObserver - feat(sdk): implement lite-timeline sdk part - feat(sdk): improve virtual scrollview - feat(sdk): remove webf sync command during the initialization - feat(sdk): support disableCleanStack and cleanOtherStack - feat(sdk): increase priority of framework level message - feat(runtime): add plugin `addEventListenerToBody` - feat(server-side-bundle): add new qjs compilation ## [4.40.2] 2025-02-21 **Download: [4.40.2(2.48 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.40.2.zip)** ### Bug Fixes - fix(sdk): domToImage only disabled in flutter ## [4.40.1] 2025-02-19 **Download: [4.40.1(2.48 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.40.1.zip)** ### Bug Fixes - fix(sdk): flutterTarget can not be converted directly ## [4.40.0] 2025-02-10 **Download: [4.40.0(2.48 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.40.0.zip)** ### Bug Fixes - fix(bundler): loadScriptSync issue on android - fix(sdk): svg data url regexp missing text wrap - fix(sdk): fix cursor flashing on devices - fix(sdk): handle non-enumerable CustomEvent properties type and detail - fix(sdk): cherry-pick virtual list hotfix - fix(sdk): clear unreachable rpc promise - fix(sdk): remove skyline sync ui command (#2058) - fix(sdk): mitigate the risk of memory leak - fix(host): loadScriptSync issue - fix(cli): change @shoelace-style/shoelace version to 2 ### Features - feat(sdk): add disable-ios-embed props for ios native input - feat(sdk): get static template theme from body - feat(sdk): support remove skeleton after static templete rendered - feat(sdk): drawer support teleportTo - feat(demo): add fixed page input demo - feat(sdk): flutter svg support - feat(sdk): input component can highlight the inputed content - feat(sdk): flutter deprecated textarea add `cursor-spacing` - feat(sdk): support auto zip sdk in watch mode - feat(cli): add socket status indicator - feat(bundler): support standalone-chunks ## [4.39.8] 2025-01-29 **Download: [4.39.8(2.57 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.39.8.zip)** ### Bug Fixes - fix(sdk): changelog script ## [4.39.7] 2025-01-27 **Download: [4.39.7(2.47 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.39.7.zip)** ### Bug Fixes - fix(sdk): remove skyline sync ui command ## [4.38.7] 2025-01-24 **Download: [4.38.7(2.57 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.38.7.zip)** ### Bug Fixes - fix(sdk): disable scrolling when scroll into view ## [4.37.11] 2025-01-24 **Download: [4.37.11(2.56 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.11.zip)** ### Bug Fixes - fix(sdk): disable scrolling when scroll into view ## [4.39.6] 2025-01-24 **Download: [4.39.6(2.57 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.39.6.zip)** ### Features - feat(sdk): disable scrolling when scroll into viewe ## [4.38.6] 2025-01-23 **Download: [4.38.6(2.57 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.38.6.zip)** ### Bug Fixes - fix(sdk): clear unreachable rpc promise ### Features - feat(sdk): native-input cursor issue ## [4.37.10] 2025-01-23 **Download: [4.37.10(2.56 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.10.zip)** ### Bug Fixes - fix(sdk): clear unreachable rpc promise ### Features - feat(sdk): native-input cursor issue ## [4.37.10] 2025-01-23 **Download: [4.37.10(2.56 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.10.zip)** ### Bug Fixes - fix(sdk): clear unreachable rpc promise ## [4.38.6] 2025-01-23 **Download: [4.38.6(2.57 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.38.6.zip)** ### Bug Fixes - fix(sdk): clear unreachable rpc promise ## [4.39.5] 2025-01-23 **Download: [4.39.5(2.57 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.39.5.zip)** ### Bug Fixes - fix(sdk): clear unreachable rpc promise ## [4.39.4] 2025-01-21 **Download: [4.39.4(2.57 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.39.4.zip)** ### Bug Fixes - fix(sdk): mitigate the risk of memory leak ## [4.38.5] 2025-01-21 **Download: [4.38.5(2.57 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.38.5.zip)** ### Bug Fixes - fix(sdk): mitigate the risk of memory leak ## [4.37.9] 2025-01-21 **Download: [4.37.9(2.56 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.9.zip)** ### Bug Fixes - fix(sdk): mitigate the risk of memory leak ## [4.38.4] 2025-01-21 **Download: [4.38.4(2.57 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.38.4.zip)** ### Bug Fixes - fix(sdk): 438 virtual list hotfix 0120 ## [4.37.8] 2025-01-21 **Download: [4.37.8(2.56 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.8.zip)** ### Bug Fixes - fix(sdk): virtual list hotfix 0120 ## [4.39.3] 2025-01-20 **Download: [4.39.3(2.57 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.39.3.zip)** ### Bug Fixes - fix(sdk): 439 virtual list hotfix 0120 ## [4.38.4] 2025-01-20 **Download: [4.38.4(2.57 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.38.4.zip)** ### Bug Fixes - fix(sdk): 438 virtual list hotfix 0120 ## [4.37.8] 2025-01-20 **Download: [4.37.8(2.56 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.8.zip)** ### Bug Fixes - fix(sdk): virtual list hotfix 0120 ## [4.39.2] 2025-01-17 **Download: [4.39.2(2.50 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.39.2.zip)** ### Features - feat(sdk): view component add events `onAppear&onIntersectionChange&o… ## [4.39.1] 2025-01-17 **Download: [4.39.1(2.50 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.39.1.zip)** ### Bug Fixes - fix(sdk): 4.39 virtual list hotfix ## [4.38.3] 2025-01-17 **Download: [4.38.3(2.50 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.38.3.zip)** ## [4.37.7] 2025-01-17 **Download: [4.37.7(2.49 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.7.zip)** ## [4.39.0] 2025-01-16 **Download: [4.39.0(2.50 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.39.0.zip)** ### Bug Fixes - fix(bmp): remove requestFullscreen param - fix(sdk): flutter-video context issue ### Features - feat(sdk): add showDiagnosticPage API - feat(sdk): native-input cursor issue - feat(sdk): add flutter-chart component - feat(sdk): catch setTimeout callback error & Handle redundant `Uncaught` errors - feat(cli): support debug mode flag ## [4.38.2] 2025-01-09 **Download: [4.38.2(2.50 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.38.2.zip)** ### Bug Fixes - fix(sdk): flutter-video context issue - fix(sdk): chart should be destroy after unmounted - fix(sdk): enable placeholder for flutter ## [4.38.1] 2025-01-03 **Download: [4.38.1(2.50 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.38.1.zip)** ### Bug Fixes - fix(sdk): chartActionQueue cache with id and monitor LCPElement payload ### Performance Improvements - perf: remove getBoundingClientRect in flutter widget and nativeComp ## [4.38.0] 2024-12-26 **Download: [4.38.0(2.50 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.38.0.zip)** ### Bug Fixes - fix(sdk): adjust unload timming - fix(sdk): native input with number type issue - fix(cli): ide-cli pnpm dep package.json resolve failed ### Features - feat(sdk): `MP.onError` message format & `MP.lifecycle` throw error - feat(sdk): add params in chooseFile - feat(sdk): scrollview support flex height virtual list - feat(sdk): svg inline tag performence improve - feat(bmp): `` support events - feat(sdk): `` support switching animation - feat(sdk): add `flutter-video` component - feat(sdk): throw bmp app `onError` - feat(sdk): add `` component - feat(extended-lib): update react/react-dom 18.3.1 - feat(sdk): echarts tooltip formatter support function - feat(cli): ide cli build failed not catch - feat(bmp): `PickerView` add options `maskClass|maskStyle|indicatorClass|indicatorStyle` - feat(cli): fix hot reload & change package name to ide-cli ## [4.37.6] 2024-12-19 **Download: [4.37.6(2.48 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.6.zip)** ## [4.37.5] 2024-12-19 **Download: [4.37.5(2.48 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.5.zip)** ### Bug Fixes - fix(sdk): svg object.hasown not found ## [4.37.4] 2024-12-17 **Download: [4.37.4(2.48 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.4.zip)** ### Features - feat(sdk): svg improve inline tag support ## [4.37.3] 2024-12-12 **Download: [4.37.3(2.48 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.3.zip)** ### Bug Fixes - fix(sdk): remove repeat effect when worker data update ## [4.36.3] 2024-12-12 **Download: [4.36.3(2.43 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.36.3.zip)** ### Features - feat(sdk): add skeleton remove point ## [4.36.3] 2024-12-11 **Download: [4.36.3(2.48 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.36.3.zip)** ### Bug Fixes - fix(sdk): trigger renderEffect before componentinit to fix patch issues - fix(sdk): fix page stack update timing - fix(sdk): run setdata callback after vue nexttick - fix(bmp): update type `BnInputProps&BnTextareaProps` ### Features - feat(sdk): add remove skeleton point - feat: sortable component - feat(sdk): flutter-scrollview add `refresher` props - feat:(sdk): builtin svg component - feat(sdk): deprecated textarea autoHeight support - feat(ide-cli): preview functions for binance devtool - feat(sdk): create chart context support options params - feat(sdk): DeprecatedTextarea add `autocorrect` & `autocapitalize` - feat(sdk): add scrollstart scrollend to scrollview - feat(sdk): add `flutter-container` - feat(sdk): add `option.url` in applyUpdate ### Performance Improvements - perf: enhance scroll performance by reduce binding getter from event target ### Misc - Revert "chore: @mp/bundler dev" ## [4.37.2] 2024-12-10 **Download: [4.37.2(2.48 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.2.zip)** ### Bug Fixes - fix(sdk): hotfix 4.37.2 ## [4.37.1] 2024-12-09 **Download: [4.37.1(2.48 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.1.zip)** ### Bug Fixes - fix(sdk): refresher event detail not provide the flutterTarget as expect ## [4.37.0] 2024-12-05 **Download: [4.37.0(2.48 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.37.0.zip)** ### Bug Fixes - fix(sdk): widget load timeline - fix(sdk): flutter deprecated-textarea autoheight style error - fix(sdk): trigger renderEffect before componentinit to fix patch issues - fix(sdk): fix page stack update timing - fix(sdk): run setdata callback after vue nexttick - fix(bmp): update type `BnInputProps&BnTextareaProps` ### Features - feat(sdk): sortable support dark mode - feat: sortable component - feat(sdk): flutter-scrollview add `refresher` props - feat:(sdk): builtin svg component - feat(sdk): deprecated textarea autoHeight support - feat(ide-cli): preview functions for binance devtool - feat(sdk): create chart context support options params - feat(sdk): DeprecatedTextarea add `autocorrect` & `autocapitalize` - feat(sdk): add scrollstart scrollend to scrollview - feat(sdk): add `flutter-container` - feat(sdk): add `option.url` in applyUpdate ### Performance Improvements - perf: enhance scroll performance by reduce binding getter from event target ### Misc - Revert "chore: @mp/bundler dev" ## [4.36.2] 2024-11-27 **Download: [4.36.2(2.43 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.36.2.zip)** ### Bug Fixes - fix(sdk): resolve IntersectionObserver is undefined issue ### Features - feat(sdk): expose response for native component ## [4.36.1] 2024-11-20 **Download: [4.36.1(2.43 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.36.1.zip)** ### Bug Fixes - fix(sdk): webview instance id should not repeat ## [4.36.0] 2024-11-15 **Download: [4.36.0(2.43 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.36.0.zip)** ### Bug Fixes - fix(sdk): change handlePaste defaultValue - fix(sdk): remove native component background color - fix(sdk): flutter-image remove eventListener ### Features - feat(sdk): add switch tab options in api - feat(sdk): add timeformat api - feat(sdk): add showBackButton api - feat(sdk): `native-textarea` add onPaste - feat(sdk): `native-textarea` add `alwaysEmbed` - feat(sdk): add the value of input type `decimals` - feat(sdk): flutter-deprecated-textarea add `autoFocus` ## [4.35.2] 2024-11-08 **Download: [4.35.2(2.43 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.35.2.zip)** ### Bug Fixes - fix(sdk): check whether to use patch - fix(sdk): release flutter image load - fix(sdk): wrap inline element with bn-span for bn-markdown ### Misc - Revert "chore: revert ui command" ## [4.35.1] 2024-10-31 **Download: [4.35.1(2.43 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.35.1.zip)** ### Bug Fixes - fix(sdk): markdown paragraph use bn-view, strong/em use bn-text ## [4.35.0] 2024-10-25 **Download: [4.35.0(2.43 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.35.0.zip)** ### Bug Fixes - fix(sdk): support inlineLayout for skyline - fix(sdk): flutter scroll refresher background color - fix(sdk): android quickjs unsupport Unicode Property Escapes - fix(sdk): cherry pick webview message issue - fix(sdk): re-publish @mp/runtime-plugin-enable-sheet-gesture - fix(sdk): fix cursor issue - fix(runtime): premature return issue in ide enviroment's show-modal api - fix(sdk): editor pos nodeBefore return real textContent if node is nonTextNode - fix(sdk): `deprecated-textarea` support force update - fix(sdk): deprecated input does not update when is composing - fix(sdk): jarvis input does not update correctly ### Features - feat(sdk): new api page.updateRouteOptions - feat(sdk): `DeprecatedTextarea` support `cursor/autoFocus/selection-start/selection-end` - feat(demo): add error handler bot modal demo - feat(sdk): use tap for skyline - feat(sdk): add tab-switched api - feat(sdk): update caniuse api - feat(sdk): support multi pages in tabbar - feat(sdk): webview clearScrollStatus, invoke api - feat(sdk): add sticky-header & stick-section - feat(sdk): add `` - feat(sdk): setup markdown on flutter - feat(sdk): new api enable enableSheetGesture - feat(extended-lib): expose buildIn libs for server side bundle ## [4.34.7] 2024-10-25 **Download: [4.34.7(2.42 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.34.7.zip)** ### Bug Fixes - fix(sdk): support tap and inlineLayout for skyline ## [4.34.6] 2024-10-22 **Download: [4.34.6(2.42 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.34.6.zip)** ### Bug Fixes - fix(sdk): android 7 quickjs not support Unicode Property Escapes ## [4.34.5] 2024-10-15 **Download: [4.34.5(2.42 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.34.5.zip)** ### Bug Fixes - fix(sdk): `deprecated-textarea` support force update ## [4.34.4] 2024-10-11 **Download: [4.34.4(2.42 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.34.4.zip)** ### Features - feat(sdk): web-view-post-message event handler ## [4.34.3] 2024-10-10 **Download: [4.34.3(2.42 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.34.3.zip)** ### Features - feat(sdk): setup markdown on flutter ## [4.34.2] 2024-10-09 **Download: [4.34.2(2.38 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.34.2.zip)** ### Bug Fixes - fix(sdk): message for createwebview api instance ## [4.33.3] 2024-10-09 **Download: [4.33.3(2.20 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.33.3.zip)** ### Bug Fixes - fix(sdk): hotfix 4.33.3 deprecated textarea ## [4.34.1] 2024-10-09 **Download: [4.34.1(2.38 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.34.1.zip)** ### Bug Fixes - fix(sdk): flutter deprecated textarea when composing - fix(sdk): flutter deprecated textarea ## [4.34.0] 2024-10-07 **Download: [4.34.0(2.38 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.34.0.zip)** ### Bug Fixes - fix(sdk): fix webview message action not work - fix(sdk): native list view conflict with sliver style - fix(automator): add timeout when run automator ### Features - feat(host): align response with native - feat(sdk): flutter text component - feat(sdk): update markdown & pika version update - feat(sdk): support readme feature - feat(sdk): add 2 components `ContextMenu` & `ContextMenuItem` - feat(sdk): add `` component & lottie-context - feat(bundler): emit handlePageBundled when skeleton build finish - feat(bundler): upgrade webpack to support Node >=18 ## [4.33.2] 2024-09-19 **Download: [4.33.2(2.20 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.33.2.zip)** ### Bug Fixes - fix: add FlutterImage switch and remove FlutterSrollView type=list props ## [4.33.2] 2024-09-19 **Download: [4.33.2(2.38 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.33.2.zip)** ### Bug Fixes - fix(sdk): native list view conflict with sliver style - fix(automator): add timeout when run automator ### Features - feat(sdk): add `` component & lottie-context - feat(bundler): emit handlePageBundled when skeleton build finish - feat(bundler): upgrade webpack to support Node >=18 ## [4.33.1] 2024-09-17 **Download: [4.33.1(2.20 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.33.1.zip)** ## [4.33.0] 2024-09-13 **Download: [4.33.0(2.20 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.33.0.zip)** ### Bug Fixes - fix(sdk): fix catchmove not work - fix(sdk):add textarea placeholder class prop - fix(sdk): fix component patch error messsage - fix(sdk): fix drawer error and support accelaration - fix(lib): fix event channel type - fix(bundler): bundle watch mode should copy ignore files - fix(sdk): scroll y on scrollView is not works - fix(sdk): fix textarea props and type ### Features - feat(demo): error handler demo - feat(sdk): add deeplink target type - feat(sdk): hack textarea with **BN_IGNORE_IS_COMPOSING** id - feat(extended-lib): update react qjs - feat(sdk): add component `flutter-image` - feat(demo): add style inject demo page - feat(sdk): add component flutter-scroll-view - feat(sdk): add plugin `runtime-plugin-update-page-query` - feat(sdk): add type `injected` for bmp-component - feat(sdk): add plugin `runtime-plugin-control-button` ### Misc - Revert "fix(sdk): vnode patch issues " (#1786) (#1796) ## [4.32.1] 2024-08-30 **Download: [4.32.1(2.20 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.32.1.zip)** ### Misc - Revert "fix(sdk): vnode patch issues " (#1786) ## [4.32.0] 2024-08-23 **Download: [4.32.0(2.20 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.32.0.zip)** ### Bug Fixes - fix(sdk): vnode patch issues - fix(sdk): navigate to type - fix(sdk): delay page set to make sure buforeRouteChange done - fix(bundler): disable sourcemap to reduce memory ### Features - feat(sdk): drawer component - feat(bundler): support static script, do not bundle into \_app.js and \_common.js - feat(bundler): mark build is done before send pageBundled - feat(bundler): add entry must trigger a rebuild - feat(sdk): scroll view support extra data prop - feat(sdk): performance babel plugin log format with timeline - feat(sdk): flutter scroll-view - feat(bundler): update watch page utils - feat(bundler): support ignore qjs options - feat(bundler): skeleton create style tags by script to avoid webf issues - feat(sdk): remove game script in sdk - feat(sdk): flutter scroll view - feat(sdk): add props for input - feat(bundler): update bundler for host - feat(doc): update doc - feat(demo): add input unfocuse issue - feat(sdk): lcp element timeline metrics ## [4.31.1] 2024-08-02 **Download: [4.31.1(2.42 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.31.1.zip)** ### Bug Fixes - fix: add worker plugin ## [4.31.0] 2024-08-02 **Download: [4.31.0(2.42 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.31.0.zip)** ### Bug Fixes - fix(lib): fix bmp component types - fix(bundler): fix expression bundler ### Features - feat(sdk): choose image support compression threshold - feat(sdk): webview scrollChange event - feat(sdk): add logger for timeline log analyze - feat(sdk): scrollView skyline type list property support - feat(sdk): input prop disablePaste - feat(bundler): support bns in base.bxml and pika compile mode - feat(sdk): editor chart ui revamp - feat(sdk): support create worker - feat(lib): add type of Script to bmp-components ## [4.30.0] 2024-07-12 **Download: [4.30.0(2.42 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.30.0.zip)** ### Bug Fixes - fix(sdk): native component webview message - fix(sdk): native event in worker - fix(sdk): fix webview component - fix(sdk): intersectionObserver margin - fix(sdk): eventhandler of chart component - fix(extended-lib): ethers Event identifier duplicated and getGlobal function error ### Features - feat(sdk): webview component event api in queryselector - feat(sdk): support navigate api with animated - feat(sdk): bn.onCopy Api on Android - feat(host): export workerEnvCode for host - feat(extended-lib): upload bitcoinjs-lib & solana/web3.js - feat(extended-lib): upload ethers-5.5.4.js ## [4.29.0] 2024-06-24 **Download: [4.29.0(2.42 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.29.0.zip)** ### Bug Fixes - fix(sdk): webview sdk only send invoke message - fix(sdk): image to figure will insert a new paragraph before the figure - fix(sdk): cursor is wired when editor tap keyboard enter ### Features - feat(sdk): new api for webview component - feat(sdk): api show setting - feat(sdk): support fontFamily for native-input and native-textarea - feat(extended-lib): upload react-dom 18.2.0 - feat(sdk): remove load skeleton - feat(sdk): add onCopy event for text component - feat: mini program performance babel plugin - feat(sdk):add ut coverage 98% ## [4.28.0] 2024-05-31 **Download: [4.28.0(2.42 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.28.0.zip)** ### Bug Fixes - fix: update render cache doc id - fix(extended-lib): resolve path not a module ### Features - feat(demo): add log for skyline debug & extended-lib should keep the built-in libs for cicd & ide - feat(extended-lib): remove built-in upload and fix getUrl data not send - feat(extended-lib): support web3 libs - feat(sdk): richtext support a href - feat(sdk): add page name to performance point - feat(sdk): widget props support functions in deeper obj - feat(sdk): webview status and invoke api - feat(sdk): add ut and increase coverage to 96.88% - feat(sdk): support dynamic rendering cache - feat(sdk): defer for taro useReady - feat(sdk): editor chart insert should focus next line ## [4.27.0] 2024-05-10 **Download: [4.27.0(2.42 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.27.0.zip)** ### Bug Fixes - fix(sdk): image should not add appid for bn protocal src in widget - fix(sdk): page query not ready when onload - fix(extended-lib): postpublish script throw error ### Features - feat(sdk): api getrandomvalues - feat(sdk): widgetslot props can use functions start with 'on' - feat(plugin): sdk support w3w evm configurable - feat(sdk): add flutter input comp - feat(lib): add getWidgetId and try get ctx from current.widget - feat(sdk): widget can load base.bxml in target app - feat(sdk): api hide back button - feat(sdk): editor echart card - feat(sdk): cross app rpc support sync action - feat(sdk): bump - feat(host): support big int ## [4.26.2] 2024-04-23 **Download: [4.26.2(2.41 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.26.2.zip)** ### Bug Fixes - fix(sdk): wsw call id ## [4.26.1] 2024-04-22 **Download: [4.26.1(2.41 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.26.1.zip)** ### Features - feat(sdk): web3 plugin use shell app (#1687) ## [4.26.0] 2024-04-19 **Download: [4.26.0(2.41 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.26.0.zip)** ### Bug Fixes - fix(host): support webassembly on host - fix(sdk): hover class not disappear - fix(sdk): create webview support widget - fix(host): widget ref not works and webview size not correct - fix(sdk): chart component need delay to setOptions ### Features - feat(demo):host shell app add basebxml & preload - feat(server-side-bundle): add bytecode full - feat(sdk): api open document - feat(sdk): cross app rpc api - feat(demo): native component demo update - feat(bundler): support widget extended lib - feat(sdk): bns can work on exp - feat(sdk): cherry-pick: delay onReady for tarojs & add more error message info for appjs load - feat(cli): webf lint add new rules - feat(lib): check media query in webf - feat(sdk): taro page await app loaded ## [4.25.1] 2024-04-10 **Download: [4.25.1(2.40 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.25.1.zip)** ### Bug Fixes - fix(sdk): echart no need delay - fix(sdk): delay onReady for tarojs ### Features - feat(sdk): add more error message info for appjs load ## [4.25.0] 2024-03-29 **Download: [4.25.0(2.40 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.25.0.zip)** ### Bug Fixes - fix(extended-lib): add missing deps - fix(sdk): fix createwebview node-bridge issu - fix(sdk): fix bmp-component type ### Features - feat(extended-lib): release to prod - feat(sdk): custom native component - feat(sdk): improve doc 0325 - feat(sdk): add new prop webPreferences - feat(bundler): add solution for dynamic lib - feat(sdk): render earlier for pages with static template configuration ## [4.23.1] 2024-02-21 **Download: [4.23.1(2.40 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.23.1.zip)** ### Bug Fixes - fix(sdk): cherry-pick for hotfix ## [4.23.0] 2024-02-19 **Download: [4.23.0(2.40 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.23.0.zip)** ### Bug Fixes - fix(sdk): when user delete all content web input may act unexpected - fix(sdk): remote-debug env update - fix(sdk): remote debugger resend ready to IDE ### Features - feat(sdk): add error code for widget when renderer destroy during init - feat(sdk): widget can get props without properties define ## [4.22.0] 2024-01-26 **Download: [4.22.0(2.39 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.22.0.zip)** ### Bug Fixes - fix(demo): icon size demo - fix(sdk): label trigger itemClick event for radio and checkbox ### Features - feat(sdk): webf lint adjustment - feat(sdk): add api setPageScrollable - feat(sdk): limit data point max length - feat(sdk): closeWidget can close native opend widget - feat(sdk): editor support \n inside paste content ## [4.21.0] 2024-01-09 **Download: [4.21.0(2.39 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.21.0.zip)** ### Features - feat(sdk): editor link paste with strick whitelist validator - feat(bundler): increase SOURCEMAP_SIZE_LIMIT to 10MB ## [4.20.0] 2023-12-15 **Download: [4.20.0(2.39 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.20.0.zip)** ### Bug Fixes - fix(sdk): flutter gradient issue - fix(bundler): using prettier as formatter ## [4.19.0] 2023-11-24 **Download: [4.19.0(2.39 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.19.0.zip)** ### Bug Fixes - fix(bundler): fix IDE can not reload ### Features - feat(sdk): cherry-pick: add preloadflutterwebview api - feat(sdk): add error code to show error page - feat(sdk): add renderer Type in getCurrentPages api - feat(sdk): createSelectorQuery select support rootPortal options - feat(sdk): add latest version to update event - feat(sdk): editor enter event - feat(sdk): enableCursor for developers to use native cursor ## [4.18.1] 2023-11-22 **Download: [4.18.1(2.39 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.18.1.zip)** ### Features - feat(sdk): add preloadflutterwebview api ## [4.18.0] 2023-11-03 **Download: [4.18.0(2.39 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.18.0.zip)** ### Bug Fixes - fix(sdk): fix webview sdk to compatible with node bridget - fix(cli): fix scroll-speed-limit default value - fix(cli): fix scroll-speed-limit default value - fix(sdk): support input focus and blur action by developers ### Features - feat(sdk): hold atom selection - feat(sdk): web input support inputmode and pattern - feat(bundler): merge widgetconfig to appconfig - feat(sdk): support atom selection - feat(sdk): add scrollSpeedLimit to avoid blank frame of virtual list - feat(sdk): editor support mention and hardBreak ## [4.17.2] 2023-10-23 **Download: [4.17.2(2.39 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.17.2.zip)** ### Bug Fixes - fix(sdk): support input focus and blur action by developers ## [4.17.1] 2023-10-18 **Download: [4.17.1(2.39 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.17.1.zip)** ### Bug Fixes - fix(sdk): END_FIRSTPAGE_APPLAUNCH send pid ### Features - feat(bundler): use js-beautify replace prettier as formater of qjs ## [4.16.3] 2023-10-13 **Download: [4.16.3(2.39 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.16.3.zip)** ### Bug Fixes - fix(sdk): clone data avoid reuse data object when reopen page ## [4.17.0] 2023-10-13 **Download: [4.17.0(2.39 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.17.0.zip)** ### Bug Fixes - fix(sdk): clone data avoid reuse data object when reopen page - fix(sdk): cherry pick 4.16.2 + try catch instance update - fix(sdk): using show-scrollbar disable scrollbar - fix(sdk): iOS cursor always at the edge of the word, selection update event not trigger ### Features - feat(bundler): qjs compared from a formatted js code - feat(lib): bmp-api openWidget add support for convention path - feat(sdk): report error during renderer launching process - feat(sdk): scroll view support scrollWithAnimation and scrollIntoViewAlignment - feat(sdk): support swiper rtl props - feat(sdk): widget support open dialog - feat(tools):webf style linter - feat(sdk): report LCP only after user interacts - feat(sdk): set tab bar list api - feat(lib): refactor WidgetSlot as react component - feat(lib): bmp-react & bmp-component add support for widget ## [4.16.3] 2023-10-13 **Download: [4.16.3(2.39 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.16.3.zip)** ### Bug Fixes - fix(sdk): clone data avoid reuse data object when reopen page ## [4.16.2] 2023-09-27 **Download: [4.16.2(2.38 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.16.2.zip)** ### Bug Fixes - fix(sdk): avoid crash when worker receive invalid tags ## [4.16.1] 2023-09-25 **Download: [4.16.1(2.38 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.16.1.zip)** ### Bug Fixes - fix(sdk): editor link node ## [4.16.0] 2023-09-22 **Download: [4.16.0(2.38 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.16.0.zip)** ### Bug Fixes - fix(sdk): revert swiper located to wrong child when children updated - fix(demo): component-demo use built-in chart - fix(sdk): decode extra data without appid - fix(sdk): swiper located to wrong child when children updated - fix(bundler): fix expression not work on tag in `bn:for` - fix(demo): independent package config - fix(demo): private-close-app require shouldClose payload - fix(bundler): decompress replace unzipper - fix(bundler): bundler watch has 60s cache ### Features - feat(sdk): echarts tooltip support basic dom - feat(sdk): widget in widgetslot support lifecycles - feat(sdk): editor internal plugin link support ## [4.15.1] 2023-09-07 **Download: [4.15.1(2.34 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.15.1.zip)** ### Bug Fixes - fix(sdk): fix call plugin error code ## [4.15.0] 2023-08-31 **Download: [4.15.0(2.34 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.15.0.zip)** ### Bug Fixes - fix(sdk): enbale flutter qjs - fix(sdk): swiper may throw error when disable indicatorDots - fix(sdk): widget props can get in worker - fix(sdk): cursor always jump to the first position when value change from an empty string - fix(sdk): check demo page ci - fix(bundler): source-map issue of swc-loader - fix(sdk): reset transform when refresher unmount ### Features - feat(sdk): add more info to showErrorPage and add widget error report - feat(sdk): export standard error to developers - feat(sdk): bump version - feat(sdk): dynamic widget support props and add openWidget API - feat(sdk): sdk ut to 95% - feat(bundler): build qjs for renderer in flutter - feat(demo): enable flutter - feat(bundler): server side bundle add more files into qjs ## [4.14.0] 2023-08-11 **Download: [4.14.0(1.45 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.14.0.zip)** ### Bug Fixes - fix(sdk): create webview api in mp cannot message - fix(sdk): customize component data not update when return a data getter - fix(cli): webview component onmessage event - fix(sdk): cherry-pick fix web input seqId - fix(sdk): cherry-pick editor remove link and style recover (#1515) - fix(sdk): cherry-pick editor split figure bugs - fix(sdk): object spread syntax error - fix(cli): add webview component, webpack chain error - fix(bundler): lock unzipper version cause new version may lost file - fix(host): block TextEncoder prop ### Features - feat(sdk): editor transform pasted content - feat(demo): pika extendedlib - feat(sdk): scroll-view supports scroll-anchor - feat(sdk): api bn.preloadWebContent to preload webview content advance - Feat/metadata - feat(sdk): editor paste event props - feat(sdk): echart component ## [4.13.1] 2023-07-28 **Download: [4.13.1(1.13 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.13.1.zip)** ### Bug Fixes - fix(sdk): unicode regex issue - fix(sdk): editor remove link and style recover - fix(sdk): object spread syntax error - fix(sdk): editor split figure bugs - fix(sdk): object spread sytax error - fix(sdk): add seqId to web input event ## [4.13.0] 2023-07-26 **Download: [4.13.0(1.14 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.13.0.zip)** ### Bug Fixes - fix(demo): intersection observer usage - fix(sdk): bundler remove touchmove prevent modifer - fix(demo): editor toolbar bottom 0 when platform is not iOS - fix(sdk): iOS native component created failed when container is not visible - fix: cherry-pick from 4.12.1 - fix(sdk): cancel load-script when redirect - fix(lib): add type of removeSkeleton ### Features - feat(sdk): editor selectImage api - feat(mpp-service) add released pr - feat(sdk): support walletkit and init func - feat(demo): add manual to web input public demo ### Misc - Revert "fix(sdk): iOS native component created failed when container is not visible " ## [4.12.1] 2023-07-07 **Download: [4.12.1(1.13 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.12.1.zip)** ### Features - feat: add mamual prop to web input ## [4.12.0] 2023-06-30 **Download: [4.12.0(1.13 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.12.0.zip)** ### Bug Fixes - fix(sdk): font-family should go with system font-family - fix(sdk): domtoimage svg base64 not have datatype - fix(sdk): add export type - fix(demo): fix canvas toTempFilePath - fix(server-side-bundle): remove subpackage prefix of sourceURL - fix(server-side-bundle): sourceURL issue of qjs ### Features - feat(lib): add API removeSkeleton to bmp-react - feat(sdk): control input - feat(server-side-bundle): add sentry project name and releaseid - feat(sdk): split figure into fig-caption and image ### Performance Improvements - perf: add filesystem cache ## [4.11.1] 2023-06-27 **Download: [4.11.1(1.13 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.11.1.zip)** ### Bug Fixes - fix(sdk): domtoimage svg base64 not have datatype (4.11) ## [4.11.0] 2023-06-16 **Download: [4.11.0(1.13 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.11.0.zip)** ### Bug Fixes - fix(sdk): domtoImage local image support for android - fix(demo): fix share demo - fix(sdk): video fullscreenchange on IOS - fix(cli): hack taro catch event - fix(demo): update prefetch image path - fix(mpp-service): newVersionFromServer might be null issue - fix(demo): reset zoom ref when toggle camera position - fix(sdk): dom to image support private static server images - fix(sdk): editorContext insertCoin not works - fix(mpp-service): min versoin should not replace the input version - fix(mpp-service): set min upload version as 0.0.1 - fix(automator): read route of undefined issue - fix(mpp-service): disable contentType when getUploadFileKey - fix(demo): websocket url not work ### Features - feat(server-side-bundle): use file path as sourceURL of qjs - feat(sdk): support udpsocket api - feat(sdk): 🎸 [plugin] add universal web3 provider - feat(sdk): dom to image support native canvas - feat(sdk): editor extension link - feat(sdk,bundler,demo): support skeleton - feat(sdk,bundler,demo): add camera component & createCameraContext API ## [4.10.2] 2023-06-08 **Download: [4.10.2(1.14 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.10.2.zip)** ### Bug Fixes - fix(sdk): fix startCheckPageTimeline error ## [4.10.1] 2023-05-25 **Download: [4.10.1(1.14 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.10.1.zip)** ### Bug Fixes - fix(sdk): renderer service compatitable with es5 ## [4.10.0] 2023-05-23 **Download: [4.10.0(1.10 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.10.0.zip)** ### Bug Fixes - fix(mpp-service): set maxBodyLength & maxContentLength as Infinity wh… - fix(sdk): canIUseCustom support string params - fix(cli): support catch touchend - fix(sdk): fix ths issue about get appConfig & getPage - fix(sdk): callbackify error no stack - fix(sdk): load page frame after load base.bxml success - fix(mpp-service): add contentType filed when upload for security - fix(host): download support put - fix(demo): add private send transaction demo - fix(cli): webview injected not work - fix(demo): webview page not found ### Features - feat(demo): add prefetchRules - feat(sdk): getUserOpenId return token - feat(sdk): editor coin - feat(sdk): editor image scrollIntoView - feat(sdk): editor image default spinner - feat(sdk): Mini Game touch event optimization - feat(bundler): support bxs ## [4.9.2] 2023-05-19 **Download: [4.9.2(1.09 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.9.2.zip)** ### Bug Fixes - fix(sdk): canIUseCustom support string params ## [4.9.1] 2023-05-17 **Download: [4.9.1(1.09 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.9.1.zip)** ### Bug Fixes - fix(sdk): update load script error code ### Features - feat(sdk): use appConfig after init appConfig & add appConfig detection & syncGetPage or asyncGetPage - feat(host): set custom http headers for fetch requests ## [4.9.0] 2023-04-28 **Download: [4.9.0(1.09 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.9.0.zip)** ### Bug Fixes - fix(sdk): figure scrollIntoView should focus on the figure caption - fix(demo): production convertToMPUrl usage - fix(sdk): editor caption selection and image keyboard handler - fix(host): definitions for bn.env - fix(sdk): unhandleRejection support polyfilled promise - fix(sdk): fix edtior editing image error - fix(sdk): init performance observer after worker ready - fix(sdk): editor delete image event stopropagation - fix(sdk): fix load page.js error to report 603505 when webview is des… - fix(demo): fix event-channel demo - fix(demo): on/off pairs - fix(sdk): editor image selection and focus - fix(mpp-service): print the old and new version - fix(demo): bug in navigation demo - fix(sdk): editor image cursor position and delete use touchend event - fix(sdk): update report data object & cancel startupTimeout when load resources - fix(sdk): editor image support update and deletable, hashtag keyboard key unexpected issue - fix(sdk): update load-script payload to ensure the cache is loaded - fix(sdk): update event channel if page init before eventChannel - fix(sdk): fix native input color issues on ios13 - fix(demo): update pika to fix input issue - fix(sdk): update dom to image scale impl and fix image / font issues - fix(sdk): rename getUserOpenId & doc-api - getUserOpenId/getUserKycStatus - fix(host): get-image-info is broken on IDE - fix(host): bn.request support arraybuffer body - fix(demo): radio page issue - fix(sdk): add native-send-appLuanch timer - fix(bundler): css variables rpx to rem align with wechat - fix(sdk): mini game view port size - fix(sdk): getChildrenNode util function - fix(sdk): rendererId zero issue in native ui - fix(bundler): catchmove value should be an exp - fix(sdk): swiper Item blank - fix(demo):fix custom demo textarea maxlength - fix(lib): remove optional chaining from bmp-react - fix(sdk): fix requestBinanceCardInfo error response & cicd - fix(bundler): compile optional chaining when using latest caniuse-lite - fix(sdk): android css transition native component - fix(sdk): fit audio platform api getters/setters on Andriod - fix(sdk): add RootPortal type - fix(sdk): mpc method - fix(lib): update types of bmp-react - fix(sdk): types of bn.call & add RootPortal to bmp-components - fix(demo): caret-color - fix(lib): virtual-list use new bmp packages - fix(sdk): update canIuse info - fix(sdk): cherry pick fix picker view component - fix(lib): @binance/mp-components don't import @tarojs/components - fix(sdk): image reload after src changes - fix(sdk): mini game keyboard event - fix(demo): fix demo navigation bar page - fix(bundler): fix babel env target - fix(demo): api navigation bar input element - fix(sdk): cherry-pick from release/3.14 - fix(runtime): network service setupServices multiple times - fix(automator): update @binance/mp-web for fix some issue and add `sdkPath` option - fix(bundler): launch MP with page of independent subpackage - fix(sdk): Image widthfix/heightFix mode can update size automatically - fix(demo): fix universal-share css - fix(bundler): reorder files in pkg - renderer files first - fix(sdk): fix web canvas width and height - fix(automator): replace parcel with http server to fix the installation issue from BIDS - fix(sdk): selectorQuery return empty when error - fix(runtime): remove BXML spaces - fix(bundler): remove setImmediate polyfill to fix pika MP white screen on iOS - fix(automator): fix some bugs & add `.waitFor` - fix(sdk): native component css - fix(sdk): (cherry-pick) reduce the blank page - fix(runtime): no need to add webview when open new page - fix(demo): input style of storage pages & update privatePrefetchRules - fix(sdk): cherry pick - load-script-progress event when mp background event to lead blank screen - fix(sdk): cherry pick fix location plugin - fix(cli): skip generation of unmatched tags - fix(demo): request pages issue of component-demo - fix(sdk): load \_\_app.js after $ready - fix(sdk): remove generating worker-service-game.qjs - fix(runtime): vibrate shifting bug - fix(demo): show isPrefetch in request pages - fix(cli): mpService should support both function api and object api - fix(mp-web): support absolute path - fix(changelog): changelog bug: 3.14.5-dev.1 & 4.0.2-dev.1 - fix(sdk): add readme for deprecated usage - fix(sdk): cherry pick - await load appJs - fix(sdk): fix image style not work - fix(cli): remove .npmrc and add npm token - fix(cli): duplicate resolve issue of ConditionNamesPlugin - fix(sdk): network service - fix(sdk): ready replace uirenderserviceready - fix(host): create webview files issue - fix(host): support private-request command - fix(runtime): download-file not work - fix(sdk): env undefined - fix(sdk): revoke native buffer issue - fix(mp-web): fix sw.js ready timeline issue - fix(sdk): native-image onload and image bug - fix(runtime): width of scroll-bar should be zero - fix(automator): support download-package rpc - fix(cli): update web host cli - fix(demo): update webgl demo with rgba - fix(demo): payment request use success callback instead - fix(sdk): useNativeImage - fix(mpp-service): copy source-code ignore node_module & hidden files - fix(sdk): fix image and keep **MP_WARN_DEPRECATED** - fix(sdk): gcanvas toDataURL and audio time update event - fix(server-side-bundle): upload bytecode pkg issue - fix(sdk): getUserProfile mini game doesn't need check tap event - fix(demo): native input width zero in android when container is a flex box - fix(sdk): reuqest text no response - fix(bundler): update dependencies to fix pkg-cli - fix(bundler): support error stack link jump of dev mode page.worker.js ### Features - feat(sdk): ut from plugin-location to plugin-request-subscribe-message - feat(sdk): file method support put method - feat(demo): add beforeRouteChange usage to component-demo - feat(sdk,bundler): add show confirm bar for input - feat(sdk): srcollview pulldown refresher - feat(sdk): bids use monitorupload - feat(demo): editor component demo - feat(sdk): remove settimeout for page.show - feat(sdk): page-not-found - feat(sdk): add page-frame-html in sdk - feat(sdk): chooseMedia & chooseFile API - feat(sdk): editor focus and mark - feat(sdk): add startupTimeout & restore time compensation - feat(sdk): editor extension update and docs - feat(sdk): loading progress animation - feat(host): createBufferUrl support svg - feat(demo): add dom to image demo - feat(sdk): method domToImage - feat(sdk): exitMiniProgram support force close - feat(sdk): new api - getuseropenid getuserkycstatus - feat(sdk): editor component & editorContext api - feat(sdk):load resource fail or slowly - feat(demo): control picker view demo - feat(sdk): detect page timeline - feat(host): support pageReadyCallback - feat(sdk): add binance-card-info api - feat(demo): migrate to pika - feat(sdk): jssdk dashboard rename & calculate - feat(sdk): wallet connector use new wallet provider - feat(lib): add WebViewComponent to @binance/bmp-components - feat(demo): add English desc to image mode demo - feat(sdk): remove window info cache for view-base mode - feat(lib): add getCurrentInstance & getTabBar to @binance/bmp-react - feat(sdk): webview component supports message - feat(sdk): add runtime-plugin-mpc - feat(automator): impove `setupProxyMethod` & add test - feat(sdk): create buffer url supports extension option - feat(demo): add audio and write file benchemark - feat(sdk): swiper support previousMargin/nextMargin/snapToEdge - feat(automator): add mock api for automator - feat(lib): bmp-api & bmp-components & bmp-react - feat(sdk): add error log for 603114 - feat(sdk): View support prop: catchMove - feat(demo): images add mode & readFile add length & position config - feat(lib): generate types for @binance/mp-service - feat(sdk): root-portal - feat: integrate automator on CI - feat(sdk): loadFontFace - feat(sdk): file system api use platform api - feat(sdk): expose navigateBackMiniProgram, add mpModalType prop to navigateToMiniProgram - feat(sdk): webview bounce and loading bar - feat(lib): fork implement from @tarojs/components to @binance/mp-components - feat(sdk): create buffer url use platformAPI - feat(sdk): createInnerAudioContext use platform api - feat(demo): fix create buffer url demo - feat(sdk): gcanvas optimazation - feat(demo): add a rendererId 0 issue test case - feat(sdk): demo update & delete appTimeline - feat(sdk): native webview component - feat(demo): runtime benchmark add getAppBaseInfo apis - feat(sdk): (cherry-pick)support caretColor for Input and TextArea components - feat(automator): automator added headless option & refactor `.launch` & demo page - feat(demo): move sync-api-demo to component-demo & update prefetchRules - feat(sdk): api on add to favorites - feat(bundler): generate fileTree for analyzeSource - feat(sdk): first render new fields - feat(runtime): support selecting sdk - feat(sdk): web canvas component - feat(demo): mini game system info demo - feat(sdk): load gcanvas on demand - feat(sdk): add page-frame-resource points - feat(automator): refactor mp-web & inject mp-web to automator - feat(sdk): gcanvas createJSBuffer, less cpu cost - feat(automator): support plugins service to fix service undefined issue - feat(bundler): add **REPORT_POINTS** for renderer - feat(sdk): nezhaRenderPageJs point - feat(automator): allow reloading the mini-program - feat(cli): update publish yml file - feat(sdk): truncate long rpc logs limit length - feat(sdk): shareAppMessage support fallback url - feat(sdk): add debounce to navigator - feat(cli): support conditional exports bmp - feat(sdk): renderer to native page ready - feat(sdk): add param usePrefetchCache to bn.request - feat(demo): release component-demo PROD - feat(sdk): getPerformance support entryType: loadPackage downloadPackage - feat(sdk): scroll-view support showScrollbar - feat(sdk): mg keyboard api - feat(demo): taro version runtime benchmark - feat(demo): virtual list - feat(runtime): support bn.env.USER_DATA_PATH - feat(sdk): remove monitor because native didn't support the commands - feat(sdk): loadScriptSync rpc - feat(sdk): support multiple intersectionObserver - feat(sdk): navigateTo add target external - feat(sdk): update canIUse for new api - feat(runtime): downloa-package add two fields - feat(bundler): add monitor NEZHA_RENDER_PAGE_JS & update sorter of pkg - feat(host): remove canvas useless dep - feat(sdk): remove deprecated items for sdk4.0 - feat(sdk): getSystemInfo cache - feat(server-side-bundle): compile & upload worker code into bytecode when enableBytecode - feat(sdk): bump versions - feat(sdk): bump version for ide deps - feat(sdk): validate current page is tabBar page when call tabBar apis - feat(demo): update prod demo - feat(sdk): plugin createIntersectionObserver and fix selectorQuery setTimeout issue - feat(sdk): detect darkmode for appBaseInfo - feat(sdk): load app js advance after worker send $Ready - feat(sdk): generate bytecode for worker-service - feat(sdk): gcanvas buffer data optimize - feat: native image - feat(bundler): add new package node-qjsc - feat(sdk): getAppBaseInfo & getWindowInfo & getDeviceInfo - feat(runtime): expose updateBackground of create webview service for ide - feat(sdk): $renderer-ready action - feat(sdk): loadScriptSync method ### Misc - Revert "fix(sdk): env undefined" - Revert "Revert "refactor(sdk): remove locationReadyManager " (#888)" (#929) ## [4.8.1] 2023-04-13 **Download: [4.8.1(1.09 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.8.1.zip)** ### Bug Fixes - fix(sdk): fix load page.js error to report 603505 when webview is destroyed ## [4.8.0] 2023-04-07 **Download: [4.8.0(1.09 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.8.0.zip)** ### Bug Fixes - fix(sdk): editor image selection and focus - fix(mpp-service): print the old and new version ### Features - feat(sdk): bids use monitorupload - feat(demo): editor component demo - feat(sdk): remove settimeout for page.show - feat(sdk): page-not-found - feat(sdk): add page-frame-html in sdk - feat(sdk): chooseMedia & chooseFile API ## [4.7.1] 2023-03-23 **Download: [4.7.1(NaN MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.7.1.zip)** ### Bug Fixes - fix(sdk): startuptimeout & try catch getpage & add get page info - fix(demo): bug in navigation demo ### Features - feat(sdk): catch html - feat(sdk): figure ## [4.7.0] 2023-03-17 **Download: [4.7.0(1.1 MB)](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.7.0.zip)** ### Bug Fixes - fix(sdk): editor image cursor position and delete use touchend event - fix(sdk): update report data object & cancel startupTimeout when load resources - fix(sdk): editor image support update and deletable, hashtag keyboard key unexpected issue - fix(sdk): update load-script payload to ensure the cache is loaded - fix(sdk): update event channel if page init before eventChannel - fix(sdk): fix native input color issues on ios13 - fix(demo): update pika to fix input issue - fix(sdk): update dom to image scale impl and fix image / font issues - fix(sdk): rename getUserOpenId & doc-api - getUserOpenId/getUserKycStatus - fix(host): get-image-info is broken on IDE - fix(host): bn.request support arraybuffer body - fix(demo): radio page issue ### Features - feat(sdk): editor focus and mark - feat(sdk): add startupTimeout & restore time compensation - feat(sdk): editor extension update and docs - feat(sdk): loading progress animation - feat(host): createBufferUrl support svg - feat(demo): add dom to image demo - feat(sdk): method domToImage - feat(sdk): exitMiniProgram support force close - feat(sdk): new api - getuseropenid getuserkycstatus - feat(sdk): editor component & editorContext api - feat(sdk):load resource fail or slowly ## [3.14.16] 2023-02-24 **Download: [SDK-3.14.16](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.16.zip)** ### Bug Fixes - fix(sdk): cherry-pick - picker view control mode ([d9a10d59](https://git.toolsfdg.net/fe/mini-program/commit/d9a10d599fb2ab6d7c222c2204917dcd7511a888)) by lawrence.w@binance.com ## [4.6.0] 2023-02-24 **Download: [SDK-4.6.0](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.6.0.zip)** ### Bug Fixes - fix(sdk): add native-send-appLuanch timer ([532dde2e](https://git.toolsfdg.net/fe/mini-program/commit/532dde2e37e8c3ff48cbf655238b88a9a1ff0dcd)) by finley.x@binance.com - fix(bundler): css variables rpx to rem align with wechat ([5fcfd131](https://git.toolsfdg.net/fe/mini-program/commit/5fcfd1319437e3fd52389083be12f459cb53d243)) by dylan.z@binance.com - fix(sdk): mini game view port size ([fc6048f0](https://git.toolsfdg.net/fe/mini-program/commit/fc6048f03ed5b9cb7357654e8a5699124fa38898)) by henry.w@binance.com - fix(sdk): getChildrenNode util function ([7c5764b6](https://git.toolsfdg.net/fe/mini-program/commit/7c5764b60831fa1c194490a907a1ad10e7ded92b)) by henry.w@binance.com - fix(sdk): rendererId zero issue in native ui ([c3d9020b](https://git.toolsfdg.net/fe/mini-program/commit/c3d9020b10630ac6c12f71595fb3c80cd3e7d2cf)) by dylan.z@binance.com - fix(bundler): catchmove value should be an exp ([dc53e87f](https://git.toolsfdg.net/fe/mini-program/commit/dc53e87f6ccb59b859b0eb13171f5038c98910da)) by lawrence.w@binance.com - fix(sdk): swiper Item blank ([7981ff89](https://git.toolsfdg.net/fe/mini-program/commit/7981ff894557f9145b619a68c823252654826014)) by finley.x@binance.com - fix(demo):fix custom demo textarea maxlength ([c28c58aa](https://git.toolsfdg.net/fe/mini-program/commit/c28c58aa2556d9e8eb21ef3b46269461bcf308c4)) by henry.w@binance.com - fix(sdk): controlled picker view ([661aa89a](https://git.toolsfdg.net/fe/mini-program/commit/661aa89ad9c3289ce614f2b77995d4ebf6d08bfa)) by lawrence.w@binance.com ### Features - feat(demo): control picker view demo ([b80c088c](https://git.toolsfdg.net/fe/mini-program/commit/b80c088cd6307f659af3fba713787becc824479c)) by lawrence.w@binance.com - feat(sdk): detect page timeline ([0b1381a4](https://git.toolsfdg.net/fe/mini-program/commit/0b1381a4406d0767f736836a8418aede38ccd44f)) by finley.x@binance.com - feat(host): support pageReadyCallback ([1339544e](https://git.toolsfdg.net/fe/mini-program/commit/1339544ec010a520efab2e822bfe15d4249fdc66)) by dylan.z@binance.com ### Refactor - refactor: remove any type in AppCommandMap ([9b2411bd](https://git.toolsfdg.net/fe/mini-program/commit/9b2411bde6250820403082572e38070d9c9fc443)) by lucifer.l@binance.com ### Internal - chore: bump commit after write files ([9378fed1](https://git.toolsfdg.net/fe/mini-program/commit/9378fed122a9613f50aac333ff8543d12893bbbc)) by dylan.z@binance.com - docs: add api comment for documentation ([7993a741](https://git.toolsfdg.net/fe/mini-program/commit/7993a741307a4049768fcfe771cfbb3ad6231723)) by dylan.z@binance.com - chore: update bump with git auto push ([e25b674f](https://git.toolsfdg.net/fe/mini-program/commit/e25b674f8ed8fd0638bc25122a9d8c6efb223d6d)) by dylan.z@binance.com - chore: change UT coverage scope and threshold ([50820980](https://git.toolsfdg.net/fe/mini-program/commit/50820980c6a0d517e0a19df8d2ed740965c36f40)) by lucifer.l@binance.com - docs: format issue ([05c3cc6e](https://git.toolsfdg.net/fe/mini-program/commit/05c3cc6e632ea84fc316a8db27fa7c9337d2ca24)) by dylan.z@binance.com - docs: update config ([aaae5561](https://git.toolsfdg.net/fe/mini-program/commit/aaae556164f3bd260fbed971c490f090b6327a25)) by dylan.z@binance.com - docs: excited features of the JSCore team 202302 ([1b38cbfe](https://git.toolsfdg.net/fe/mini-program/commit/1b38cbfe6c2344120f532eed76bda7a6990a7fc8)) by dylan.z@binance.com - mpp service support binance us host app ([fb8edeb8](https://git.toolsfdg.net/fe/mini-program/commit/fb8edeb8c6840cc84ef840c6ca84dcfc3a51fd72)) by leo.cc@binance.com ## [4.5.0] 2023-02-03 **Download: [SDK-4.5.0](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.5.0.zip)** ### Bug Fixes - fix(lib): remove optional chaining from bmp-react - fix(sdk): fix requestBinanceCardInfo error response & cicd - fix(bundler): compile optional chaining when using latest caniuse-lite - fix(sdk): android css transition native component ### Features - feat(sdk): add binance-card-info api - feat(demo): migrate to pika - feat(sdk): jssdk dashboard rename & calculate - feat(sdk): wallet connector use new wallet provider - feat(lib): add WebViewComponent to @binance/bmp-components - feat(demo): add English desc to image mode demo - feat(sdk): remove window info cache for view-base mode - feat(lib): add getCurrentInstance & getTabBar to @binance/bmp-react ### Refactor - refactor: throw error for the non-supported apis in IDE ### Internal - chore: update component demo - docs: remove the app.config.json issue since pika will support it - docs: getCurrentInstance query incorrect ## [4.4.0] 2023-01-13 **Download: [SDK-4.4.0](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.4.0.zip)** ### Bug Fixes - fix(sdk): fit audio platform api getters/setters on Andriod - fix(sdk): add RootPortal type - fix(sdk): mpc method - fix(lib): update types of bmp-react - fix(sdk): types of bn.call & add RootPortal to bmp-components - fix(demo): caret-color - fix(lib): virtual-list use new bmp packages - fix(sdk): update canIuse info - fix(sdk): cherry pick fix picker view component - fix(lib): @binance/mp-components don't import @tarojs/components - fix(sdk): image reload after src changes ### Features - feat(sdk): webview component supports message - feat(sdk): add runtime-plugin-mpc - feat(automator): impove `setupProxyMethod` & add test - feat(sdk): create buffer url supports extension option - feat(demo): add audio and write file benchemark - feat(sdk): swiper support previousMargin/nextMargin/snapToEdge - feat(automator): add mock api for automator - feat(lib): bmp-api & bmp-components & bmp-react - feat(sdk): add error log for 603114 - feat(sdk): View support prop: catchMove - feat(demo): images add mode & readFile add length & position config - feat(lib): generate types for @binance/mp-service - feat(sdk): root-portal ### Internal - chore: update config for FAQ - docs: faq about app.config.json - docs(sdk): darkmode - chore(sdk): cherry pick update sdk loading - test: add more unit tests for host ## [3.14.15] 2023-01-10 **Download: [SDK-3.14.15](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.15.zip)** ### Bug Fixes - fix(sdk): cherry pick from native component css ### Internal - cherry-pick(sdk): swiper ## [3.14.14] 2023-01-04 **Download: [SDK-3.14.14](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.14.zip)** ### Bug Fixes - fix(sdk): picker view component ### Features - feat(sdk): add applaunch pid & new point from pageJsEnd to pageReady - feat(sdk): cherry-pick - add error log for 603114 ## [3.14.13] 2022-12-29 **Download: [SDK-3.14.13](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.13.zip)** ### Bug Fixes - fix(sdk): image style not work when set mode to aspectFill ## [3.14.12] 2022-12-26 **Download: [SDK-3.14.12](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.12.zip)** ### Bug Fixes - fix(sdk): update sdk loading ## [4.3.0] 2022-12-22 **Download: [SDK-4.3.0](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.3.0.zip)** ### Bug Fixes - fix(sdk): mini game keyboard event - fix(demo): fix demo navigation bar page - fix(bundler): fix babel env target - fix(demo): api navigation bar input element - fix(sdk): cherry-pick from release/3.14 - fix(runtime): network service setupServices multiple times - fix(automator): update @binance/mp-web for fix some issue and add `sdkPath` option - fix(bundler): launch MP with page of independent subpackage - fix(sdk): Image widthfix/heightFix mode can update size automatically - fix(demo): fix universal-share css ### Features - feat: integrate automator on CI - feat(sdk): loadFontFace - feat(sdk): file system api use platform api - feat(sdk): expose navigateBackMiniProgram, add mpModalType prop to navigateToMiniProgram - feat(sdk): webview bounce and loading bar - feat(lib): fork implement from @tarojs/components to @binance/mp-components - feat(sdk): create buffer url use platformAPI - feat(sdk): createInnerAudioContext use platform api - feat(demo): fix create buffer url demo ### Refactor - refactor: rename host-mp-ide to host-ide ### Internal - chore: remove `yarn playwright install --with-deps` - docs(sdk): integrate with doc-system - chore(package.json): fix installing sqllite3 in macos - chore(package.json): add packageManager field - chore: replace resolve with join - chore(sdk): cherry-pick from 4.2.1 - chore: update version remote and pwd alias - chore: bump local - chore: update prefetch rule of component demo - docs: demos readme ## [3.14.11] 2022-12-19 **Download: [SDK-3.14.11](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.11.zip)** ### Bug Fixes - fix(sdk): appConfig bug in ios while open worker pool ## [4.2.1] 2022-12-15 **Download: [SDK-4.2.1](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.2.1.zip)** ### Features - feat(sdk): add mg page-ready ## [3.14.10] 2022-12-07 **Download: [SDK-3.14.10](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.10.zip)** ### Bug Fixes - fix(sdk): fix renderer-defer lead to blank screen ## [4.2.0] 2022-12-02 **Download: [SDK-4.2.0](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.2.0.zip)** ### Bug Fixes - fix(bundler): reorder files in pkg - renderer files first - fix(sdk): fix web canvas width and height - fix(automator): replace parcel with http server to fix the installation issue from BIDS - fix(sdk): selectorQuery return empty when error - fix(runtime): remove BXML spaces - fix(bundler): remove setImmediate polyfill to fix pika MP white screen on iOS - fix(automator): fix some bugs & add `.waitFor` - fix(sdk): native component css - fix(sdk): (cherry-pick) reduce the blank page - fix(runtime): no need to add webview when open new page - fix(demo): input style of storage pages & update privatePrefetchRules - fix(sdk): cherry pick - load-script-progress event when mp background event to lead blank screen - fix(sdk): cherry pick fix location plugin - fix(cli): skip generation of unmatched tags - fix(demo): request pages issue of component-demo - fix(sdk): load \_\_app.js after $ready - fix(sdk): remove generating worker-service-game.qjs - fix(runtime): vibrate shifting bug - fix(demo): show isPrefetch in request pages ### Features - feat(sdk): gcanvas optimazation - feat(demo): add a rendererId 0 issue test case - feat(sdk): demo update & delete appTimeline - feat(sdk): native webview component - feat(demo): runtime benchmark add getAppBaseInfo apis - feat(sdk): (cherry-pick)support caretColor for Input and TextArea components - feat(automator): automator added headless option & refactor `.launch` & demo page - feat(demo): move sync-api-demo to component-demo & update prefetchRules - feat(sdk): api on add to favorites - feat(bundler): generate fileTree for analyzeSource - feat(sdk): first render new fields - feat(runtime): support selecting sdk ### Refactor - refactor(sdk): plugins including show-leaderboard, storage and tab-bar - refactor(sdk): native ui plugin - refactor(sdk): replace enum with union type - refactor(host): plugin user-info - refactor(host): plugin & remove twoFA demo ### Internal - chore: remove useless message in changelog.md by 'bot' - chore: redirect blank page issue - ci: fix git push tag one by one - chore: add caretColor demo - chore: gen-sdk local ## [3.14.9] 2022-12-01 **Download: [SDK-3.14.9](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.9.zip)** ### Features - feat(sdk): support navigateTo an external link - cherry pick ## [3.14.8] 2022-11-22 **Download: [SDK-3.14.8](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.8.zip)** ### Bug Fixes - fix(sdk): fix native delay app-launch after background and load \_\_app.js fail to lead blank screen ### Features - feat(sdk): nezha render js point ## [4.0.3] 2022-11-18 **Download: [SDK-4.0.3](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.0.3.zip)** ### Bug Fixes - fix(sdk): rendererId start with zero - fix(sdk): cherry pick - fix image style not work - fix(sdk): await load appJs - fix(sdk): env undefined - fix(demo): update webgl demo with rgba - fix(demo): payment request use success callback instead - fix(sdk): useNativeImage - fix(mpp-service): copy source-code ignore node_module & hidden files - fix(sdk): fix image and keep **MP_WARN_DEPRECATED** - fix(sdk): gcanvas toDataURL and audio time update event - fix(server-side-bundle): upload bytecode pkg issue - fix(sdk): getUserProfile mini game doesn't need check tap event - fix(demo): native input width zero in android when container is a flex box - fix(sdk): reuqest text no response - fix(bundler): update dependencies to fix pkg-cli - fix(bundler): support error stack link jump of dev mode page.worker.js ### Features - feat(sdk): support multiple intersectionObserver - feat(sdk): navigateTo add target external - feat(sdk): update canIUse for new api - feat(runtime): downloa-package add two fields - feat(bundler): add monitor NEZHA_RENDER_PAGE_JS & update sorter of pkg - feat(host): remove canvas useless dep - feat(sdk): remove deprecated items for sdk4.0 - feat(sdk): getSystemInfo cache - feat(server-side-bundle): compile & upload worker code into bytecode when enableBytecode - feat(sdk): bump versions - feat(sdk): bump version for ide deps - feat(sdk): validate current page is tabBar page when call tabBar apis - feat(demo): update prod demo - feat(sdk): plugin createIntersectionObserver and fix selectorQuery setTimeout issue - feat(sdk): detect darkmode for appBaseInfo - feat(sdk): load app js advance after worker send $Ready - feat(sdk): generate bytecode for worker-service - feat(sdk): gcanvas buffer data optimize - feat: native image - feat(bundler): add new package node-qjsc - feat(sdk): getAppBaseInfo & getWindowInfo & getDeviceInfo - feat(runtime): expose updateBackground of create webview service for ide - feat(sdk): $renderer-ready action - feat(sdk): loadScriptSync method ### Misc - Revert "Revert "refactor(sdk): remove locationReadyManager " (#888)" (#929) ### Internal - chore(cicd): yaml files - chore(changelog): update changelog for version v3.14.3 - chore(changelog): update changelog for version v4.0.0-dev.3 - chore(runtime): add currentSize filed - chore: update public demo - chore(sdk): automator package rename - chore(changelog): update changelog for version v4.0.0-dev.2 - chore(changelog): update changelog for version v3.14.2 - chore: update public demo - chore: component-demo - chore: bump npm versions - chore(changelog): update changelog for version v4.0.0-dev.1 - chore(changelog): update changelog for version v3.14.1 ## [3.14.7] 2022-11-17 **Download: [SDK-3.14.7](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.7.zip)** ### Features - feat(sdk): add support caretColor style for Input and TextArea components ## [3.14.6] 2022-11-16 **Download: [SDK-3.14.6](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.6.zip)** ### Bug Fixes - fix(sdk): load-script-progress event when mp background event to lead blank screen - fix(sdk): remove generating worker-service-game.qjs ### Internal - chore: add checker for 3.14 - chore: gen-sdk script - chore: update changelog.js ## [4.1.0] 2022-11-16 **Download: [SDK-4.1.0](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.1.0.zip)** ### Bug Fixes - fix(cli): skip generation of unmatched tags - fix(sdk): read-file demo, location api - fix(cli): mpService should support both function api and object api - fix(mp-web): support absolute path - fix(changelog): changelog bug: 3.14.5-dev.1 & 4.0.2-dev.1 - fix(sdk): add readme for deprecated usage - fix(sdk): cherry pick - await load appJs - fix(sdk): fix image style not work - fix(cli): remove .npmrc and add npm token - fix(cli): duplicate resolve issue of ConditionNamesPlugin - fix(sdk): network service - fix(sdk): ready replace uirenderserviceready - fix(host): create webview files issue - fix(host): support private-request command - fix(runtime): download-file not work - fix(sdk): env undefined - fix(sdk): revoke native buffer issue - fix(mp-web): fix sw.js ready timeline issue - fix(sdk): native-image onload and image bug - fix(runtime): width of scroll-bar should be zero - fix(automator): support download-package rpc - fix(cli): update web host cli ### Features - feat(sdk): web canvas component - feat(demo): mini game system info demo - feat(sdk): load gcanvas on demand - feat(sdk): add page-frame-resource points - feat(automator): refactor mp-web & inject mp-web to automator - feat(sdk): gcanvas createJSBuffer, less cpu cost - feat(automator): support plugins service to fix service undefined issue - feat(bundler): add **REPORT_POINTS** for renderer - feat(sdk): nezhaRenderPageJs point - feat(automator): allow reloading the mini-program - feat(cli): update publish yml file - feat(sdk): truncate long rpc logs limit length - feat(sdk): shareAppMessage support fallback url - feat(sdk): add debounce to navigator - feat(cli): support conditional exports bmp - feat(sdk): renderer to native page ready - feat(sdk): add param usePrefetchCache to bn.request - feat(demo): release component-demo PROD - feat(sdk): getPerformance support entryType: loadPackage downloadPackage - feat(sdk): scroll-view support showScrollbar - feat(sdk): mg keyboard api - feat(demo): taro version runtime benchmark - feat(demo): virtual list - feat(runtime): support bn.env.USER_DATA_PATH - feat(sdk): remove monitor because native didn't support the commands - feat(sdk): loadScriptSync rpc ### Refactor - refactor(sdk): migrate wallet-connector plugin - refactor(host): share-menu(sdk & host)and network - refactor(sdk): migrate toast plugin - refactor(host): update manager and webview plugin - refactor(sdk): migrate web3 plugin ### Misc - Revert "fix(sdk): env undefined" ### Internal - chore: 4.1 pr checker - chore(changelog): @binance/mp-cli@2.4.26 - chore(changelog): @binance/mp-automator@1.0.7 - chore(changelog): @binance/mp-web@0.0.21 - chore(mp-web): update start script - chore(changelog): update changelog for version v3.14.5 - chore(changelog): @binance/mp-cli@2.4.25 - chore: fix changelog.md - chore(changelog): update changelog for version v4.1.0-dev.2 - chore(changelog): @binance/mp-cli@2.4.24 - chore(demo): update prefetchRules of component-demo - chore(changelog): @binance/mp-cli@2.4.23 - ci: fix bump exclude checked cache files - chore(changelog): @mp/gen-sdk@1.0.12 - ci: fix wrong git tag versions for manifest and changelog - chore(changelog): update changelog for version v3.14.5 - ci: pass the job if there is nothing to be validated - chore(changelog): @binance/mp-web@0.0.18 - chore(changelog): @binance/mp-web@0.0.17 - docs: update how to fixed log when version validate failed - chore(changelog): update changelog for version v3.14.5-dev.1 - docs(sdk): add docs about yarn bump - chore(changelog): update changelog for version v4.0.2-dev.1 - chore: fix submodule error by removing temp file - chore(changelog): @binance/mp-cli@2.4.22 - chore: bump version issue cause by cicd - chore: local auto bump support - chore(changelog): @binance/mp-cli@2.4.21 - chore: update ci - chore(changelog): update changelog for version v4.0.1 - chore: version validate - chore: rename pipeline name - chore: update npm-publish job - ci: fix release job for git fetch failed on CI - chore: test new job success - chore(changelog): update changelog for version v3.14.4 - chore: bump host deps chain - chore(changelog): update changelog for version v4.0.1-dev.1 - ci: setup ci changelog & release automatically - chore(sdk): bump plugins version - chore(sdk): plugin bump version - chore(sdk): bump versions - chore(sdk): add mg adapter file - chore(changelog): update changelog for version v4.1.0-dev.1 - chore(cicd): migrate prowjobs - chore(changelog): update changelog for version v4.0.0 - chore: noopify commands ## [4.1.0] 2022-11-16 **Download: [SDK-4.1.0](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.1.0.zip)** ### Bug Fixes - fix(sdk): read-file demo, location api - fix(cli): mpService should support both function api and object api - fix(mp-web): support absolute path - fix(changelog): changelog bug: 3.14.5-dev.1 & 4.0.2-dev.1 - fix(sdk): add readme for deprecated usage - fix(sdk): cherry pick - await load appJs - fix(sdk): fix image style not work - fix(cli): remove .npmrc and add npm token - fix(cli): duplicate resolve issue of ConditionNamesPlugin - fix(sdk): network service - fix(sdk): ready replace uirenderserviceready - fix(host): create webview files issue - fix(host): support private-request command - fix(runtime): download-file not work - fix(sdk): env undefined - fix(sdk): revoke native buffer issue - fix(mp-web): fix sw.js ready timeline issue - fix(sdk): native-image onload and image bug - fix(runtime): width of scroll-bar should be zero - fix(automator): support download-package rpc - fix(cli): update web host cli ### Features - feat(sdk): web canvas component - feat(demo): mini game system info demo - feat(sdk): load gcanvas on demand - feat(sdk): add page-frame-resource points - feat(automator): refactor mp-web & inject mp-web to automator - feat(sdk): gcanvas createJSBuffer, less cpu cost - feat(automator): support plugins service to fix service undefined issue - feat(bundler): add **REPORT_POINTS** for renderer - feat(sdk): nezhaRenderPageJs point - feat(automator): allow reloading the mini-program - feat(cli): update publish yml file - feat(sdk): truncate long rpc logs limit length - feat(sdk): shareAppMessage support fallback url - feat(sdk): add debounce to navigator - feat(cli): support conditional exports bmp - feat(sdk): renderer to native page ready - feat(sdk): add param usePrefetchCache to bn.request - feat(demo): release component-demo PROD - feat(sdk): getPerformance support entryType: loadPackage downloadPackage - feat(sdk): scroll-view support showScrollbar - feat(sdk): mg keyboard api - feat(demo): taro version runtime benchmark - feat(demo): virtual list - feat(runtime): support bn.env.USER_DATA_PATH - feat(sdk): remove monitor because native didn't support the commands - feat(sdk): loadScriptSync rpc ### Refactor - refactor(sdk): migrate wallet-connector plugin - refactor(host): share-menu(sdk & host)and network - refactor(sdk): migrate toast plugin - refactor(host): update manager and webview plugin - refactor(sdk): migrate web3 plugin ### Misc - Revert "fix(sdk): env undefined" ### Internal - chore: 4.1 pr checker - chore(changelog): @binance/mp-cli@2.4.26 - chore(changelog): @binance/mp-automator@1.0.7 - chore(changelog): @binance/mp-web@0.0.21 - chore(mp-web): update start script - chore(changelog): update changelog for version v3.14.5 - chore(changelog): @binance/mp-cli@2.4.25 - chore: fix changelog.md - chore(changelog): update changelog for version v4.1.0-dev.2 - chore(changelog): @binance/mp-cli@2.4.24 - chore(demo): update prefetchRules of component-demo - chore(changelog): @binance/mp-cli@2.4.23 - ci: fix bump exclude checked cache files - chore(changelog): @mp/gen-sdk@1.0.12 - ci: fix wrong git tag versions for manifest and changelog - chore(changelog): update changelog for version v3.14.5 - ci: pass the job if there is nothing to be validated - chore(changelog): @binance/mp-web@0.0.18 - chore(changelog): @binance/mp-web@0.0.17 - docs: update how to fixed log when version validate failed - chore(changelog): update changelog for version v3.14.5-dev.1 - docs(sdk): add docs about yarn bump - chore(changelog): update changelog for version v4.0.2-dev.1 - chore: fix submodule error by removing temp file - chore(changelog): @binance/mp-cli@2.4.22 - chore: bump version issue cause by cicd - chore: local auto bump support - chore(changelog): @binance/mp-cli@2.4.21 - chore: update ci - chore(changelog): update changelog for version v4.0.1 - chore: version validate - chore: rename pipeline name - chore: update npm-publish job - ci: fix release job for git fetch failed on CI - chore: test new job success - chore(changelog): update changelog for version v3.14.4 - chore: bump host deps chain - chore(changelog): update changelog for version v4.0.1-dev.1 - ci: setup ci changelog & release automatically - chore(sdk): bump plugins version - chore(sdk): plugin bump version - chore(sdk): bump versions - chore(sdk): add mg adapter file - chore(changelog): update changelog for version v4.1.0-dev.1 - chore(cicd): migrate prowjobs - chore(changelog): update changelog for version v4.0.0 - chore: noopify commands ## [4.0.2] 2022-11-14) **Download: [SDK-4.0.2](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.0.2.zip)** ### Bug Fixes - fix(sdk): cherry pick - fix image style not work - fix(sdk): await load appJs - fix(sdk): env undefined - fix(demo): update webgl demo with rgba - fix(demo): payment request use success callback instead - fix(sdk): useNativeImage - fix(mpp-service): copy source-code ignore node_module & hidden files - fix(sdk): fix image and keep **MP_WARN_DEPRECATED** - fix(sdk): gcanvas toDataURL and audio time update event - fix(server-side-bundle): upload bytecode pkg issue - fix(sdk): getUserProfile mini game doesn't need check tap event - fix(demo): native input width zero in android when container is a flex box - fix(sdk): reuqest text no response - fix(bundler): update dependencies to fix pkg-cli - fix(bundler): support error stack link jump of dev mode page.worker.js - fix(demo): fix benchmark - fix(sdk, demo): check promise polyfill by using \_\_\_mp_polyfill - fix(demo): public demo read file - fix(sdk): native-cover-view not work when using taro - fix(demo): two-fa demo scene data is undefined - fix(demo): pull down refresh not works - fix(sdk): cache promise online with polyfill - fix(sdk): mini game audio adapter - fix: disable ed and add @deprecated flag - fix(sdk): changelog issue - fix(sdk): callbackId could be zero - fix(sdk): input scrollbar css issue on android - fix(sdk): isCache undefined issue - fix(mpp-service): fix status api empty fail message - fix(sdk): add properties on webgl context - fix(sdk): fix timeOrigin 0 issues on IOS14 - fix(runtime): cannot resolve the font with url "bnshare://" - fix(sdk): fix getperformance firstRender - fix: cherry-pick cachePromise of getSystemInfo - fix(sdk): use promise polyfill fix promise task order in ios12 - ios14 - fix(sdk): error code detection of remote debug - fix(sdk): requestAnimationFrame NaN - fix(automator): web cli core apis - fix: add dependency to pass build job - fix(sdk): performance init appLaunch payload - fix: getPerformance first-render - fix(sdk): delete useless report - fix(sdk): loading when expect route-change type - fix(sdk): remove cachePromise to fix ios 13 eventloop issue - fix(sdk): fix: fix to signature error when include specific data struct issue - fix(sdk): remove type check in wallet-connect plugin - fix(sdk): gcanvas texImage2D flushnative - fix(sdk): fix taskify cache fail - fix(sdk): remove canvas service code - fix(sdk): fix applaunch-getPerformance - fix(sdk): fix webview sdk - fix(mpp-service): publish issue - fix(sdk): fix mg api host register - fix(sdk): navigateBackMiniProgram extra data should transform to string - fix(sdk): fix blank screen issue when relaunch because of taskify - fix(demo): public demo - fix(sdk): getCurrentPages error handler - fix(demo): textarea confirm-type - fix(sdk): fetch remote tags with force arg when tag conflict - fix(demo): textarea maxlength caused display issue - fix(sdk): access methods defined within methods property - fix(sdk): fix this problem for '\_setDataMaxSize' of undefined - fix(cli & runtime): useExtendedLib issue - fix(demo): public-demo textarea bug - fix(bundler): if directive not work as non-first attribute - fix(sdk): revert removing of setTimeout hack because of useDidShow issues on IOS - fix(server-side-bundle): set default value of versionSetting - fix(runtime): plainText body not supported - fix(demo): fix crash caused by private request demo - fix(sdk): bug in OnOffManager and add test - fix(sdk): revert changes of performance entry name - fix(demo): callback should not inside function component - fix(bundler): nested component with directive "for" - fix(runtime): set different left for title on different lefticon - fix(mpp-service): remove request body of getApplicationVersions - fix(sdk): request-timeout - fix: webstudio qa test - fix(sdk): tmpl_0_undefined bug lead to a blank page - fix(sdk): remove 120ms timeout of page show, make sure onShow is before onReady - fix(sdk): use logger to enable warn log visible - fix(bundler): disable autoloading postcss config of MP project - fix(sdk): tmpl_0_undefined issue - fix(demo): component-demo-public head component click fix - fix(demo): get appid from systemInfo - fix(runtime): set title when route-changed - fix(sdk): add missing @mp/runtime-plugin-sensor-orientation depenedncies - fix(sdk): page instance option property update - fix(sdk): from render to worker UIRendererServiceReady - fix(sdk): use log.error instead of filter text nest component - fix(demo): route query parameter different handler with encode64 - fix(runtime): load extended lib of specific version - fix(bundler): require relative path for cocos game - fix(sdk): reject the previous defer when reLaunch too early - fix(sdk): adjust MPRunTimeLogger - fix(sdk): routing api should wait app launched - fix(automator): api is undefined during first lauch of e2e - fix(sdk): share-panel not working - fix(bundler): copy non-existent files issue - fix(demo): how to use custom tabbar - fix(cli): resolve path of react - fix(sdk): rename package - fix(runtime): add getBridgeCode to files array - fix(runtime): remove dependency cycle - fix(runtime): align fail behaviour of request plugin with wechat - fix(sdk): cherry pick - timeline check app & hotfix 3.8.2 - fix(bundler): common.bxss is imported twice & release factory after jsModule is required - fix(sdk): empty subpackages force download action - fix(runtime): add service.d.ts to npm pack - fix(cli): update vendors to support node 16 - fix: catch downloadFile fail and remove --unhandled-rejections=warn - fix(sdk): mg add devicePixelRatio into getSystemInfo api - fix(sdk): mp canvastouche event payload - fix(bundler): add globalThis polyfill to page-frame - fix(sdk): setData in onLoad not working - fix(cli): fix tarojs version can not found in yarn global action - fix(sdk): fix timeline order error - fix(sdk): remove global wx, fix getOpenDataContext placeholder - fix(sdk): timeline appJs error - fix(sdk): timeline-update - fix(cli): debugReact with react-reconciler not works - fix(sdk): increase gas limit when estiamte gas failed - fix(runtime): postMessage should wait for ready - fix(cli): resolve taro presets from installation dir of bmp - fix(cli): support node 15 - fix(sdk): can-i-use types & injectPrivateApi - fix(rumtime): support tmp/store/usr http request - fix(bundler): source-map OOM & repeated refresh in watch mode issues - fix(sdk): fix onOffManager memory leak for task-style apis - fix(demo): fix demo for fileSystemManager - fix(runtime): add Math.ceil when populate gas - fix(sdk): canvas plugin - fix(bundler): adjust the order of loading script in page-frame - fix(bundler): load base.bxml.js earlier than renderer-service.js - fix(sdk): plugin write file - fix(sdk): blank page when relaunch in old ios device - fix(sdk): support cocos - fix(sdk): app-rpc-logger judge from or to & delete extra log - fix(sdk): monitor d change to dt & update RuntimeLogger monitor-upload - fix(sdk): webview not working for the webview using node-bridge - fix(bundler): load base.bxml.js in head element of page-frame - fix(sdk): plugin-private-request command - fix(sdk): add dataset to MPEventTarget - fix(runtime): onNativeApiRequest able to listen all actions - fix(sdk): radio and checkbox components - fix(sdk): ios not support bigint 64 - fix(sdk): sentry + vconsole cause oom - fix(sdk): fix Android need to tap input twice to focus - fix(sdk): fix the issue that slider wrap with position: relative container - fix(mp): fix request cookie setting - fix(sdk): fix reportEvent with keyword to error - fix(sdk): timeline startup del loadAppJs - fix(sdk): DeprecatedInput auto-fill not emit input event - fix(sdk): fix native input color with autoFocus props - fix(runtime): storage plugin api not work - fix(sdk): fix Image style width:100% - fix(sdk): remove header filed with null value - fix: add defer for webview context in the node-bridge demo - fix: create a empty webview if src not provied - fix(mp): fix tab bar css, red dot api error message - fix(sdk): fix Image style being overridden and comments using English - fix(sdk): image can not use width/height:auto with div-bgImg - fix(sdk): onAppShow not working - fix(sdk): remove the error of webivew-sdk Unknown Action $ready - fix(sdk): update image component from img to div with background-image - fix: framework-load-script has been registed - fix(sdk): fix View component touchstart twice (#295) - fix(lib,sdk): fix deprecated-input onInput not working - fix(runtime): show & hide ToastContainer - fix(sdk): plugin create native buffer - fix(sdk): Image and IDECoverImage onload & onerror - fix(sdk): timelogger error add time - fix(sdk): debounce update state for native input - fix(sdk): fix re-launch page not found issue - fix(runtime): fix storage plugin - fix(sdk): disable the JS timer for blank page detection - fix(lib): make bundler generate component code that not override comp… - fix(runtime): prevent app.js load twice - fix(sdk): polyfill IntersectionObserver for iOS 12.1 (#237) - fix:add commit hash to branch name - Fix: release script - fix: unexport subscribeLocationChange - fix: sdk build - fix the problem that bundler still work when in h5 mode - fix some dependencies of project template - fix: use path.resolve - fix: make form component soft controlled & add missing component map - fix: use -o - fix the problem after last commit which make bundle script not work - fix: normalize page url - fix: 🐛 overwrite template files - fix for debugger - fix: 🐛 add http-proxy-middleware@0.19 in runtime-render - Fix/fix the request with correct parameters and all other things for mvp2 - fix: send body only for post and put method - fix: prevent user from scaling view - fix: remove useless code - fix(runtime-renderer): fix multiple event binding on same event - fix: get props and data from parent & rename api - fix: typo - fix: use Object.assign - fix: reduce payload size - fix: Resolve events from attrs and separate two rpc events - fix: use eventNames to tell the different if it is a event name or a normal props name - fix: watch $props - fix: rename - fix: watch all props changed - fix: remove bind props interface - fix: remove useless code - fix the problem invoked by packange name changed of taro plugin - fix: prevent capture event trigger twice - fix: 🐛 use e.currentTarget - fix: 🐛 renderTaro and updateData - fix: 🐛 renderTaro - fix: keep compatible with taro - fix: add tapCapture - fix: add capture event - fix: update props naming - fix: remove console.log - fix: Non-function value encountered for default slot. Prefer function slots for better performance. - fix: remove console.log - fix: types - fix: update sdk - fix: response.data typing - fix: 🐛 enableCSSModule - fix: call ready before navigation-push - fix: typo - fix: typo - fix: typo - fix: change data type - fix: 🐛 back to list page - fix: rpc - fix(runner): rpc message format - fix(runner): rpc message format - fix: pass query to page.oLoad - fix: fix ready and push action order - fix: page component created twice - fix: fix page hooks - fix: 🐛 support page-hide and page-show - fix: 🐛 not parse querystring when method is GET or HEAD - fix: 🐛 createAndSavePage params - fix: 🐛 init lifecycle and method - fix: 🐛 only create page when \_\_pageConfig exist - fix: 🐛 create page on worker runtime - fix: build - fix: disable webpack-dev-server host check - fix: improve js compatibility - fix: improve js compatibility - fix: prefix component instance id with page id - fix(rpc): change rpc interface - fix: 🐛 add recordInstanceBoundEffect - fix: 🐛 remove effect - fix: 🐛 computed bind to ctx - fix: change defualt build format to esm-bundler - fix: change defualt build format to esm-bundler - fix(project): fix default format - fix(project): format package.json - fix(project): rm .gitkeep & fix deps - fix: typo - fix: COMPONENT_TYPE_ID is undefined - fix: 🐛 build script ### Features - feat(sdk): support multiple intersectionObserver - feat(sdk): navigateTo add target external - feat(sdk): update canIUse for new api - feat(runtime): downloa-package add two fields - feat(bundler): add monitor NEZHA_RENDER_PAGE_JS & update sorter of pkg - feat(host): remove canvas useless dep - feat(sdk): remove deprecated items for sdk4.0 - feat(sdk): getSystemInfo cache - feat(server-side-bundle): compile & upload worker code into bytecode when enableBytecode - feat(sdk): bump versions - feat(sdk): bump version for ide deps - feat(sdk): validate current page is tabBar page when call tabBar apis - feat(demo): update prod demo - feat(sdk): plugin createIntersectionObserver and fix selectorQuery setTimeout issue - feat(sdk): detect darkmode for appBaseInfo - feat(sdk): load app js advance after worker send $Ready - feat(sdk): generate bytecode for worker-service - feat(sdk): gcanvas buffer data optimize - feat: native image - feat(bundler): add new package node-qjsc - feat(sdk): getAppBaseInfo & getWindowInfo & getDeviceInfo - feat(runtime): expose updateBackground of create webview service for ide - feat(sdk): $renderer-ready action - feat(sdk): loadScriptSync method - feat(sdk): chainId should be number when pass to native - feat(demo): add promise polyfill demo for QA regression - feat: web host cli - feat(demo): release demo on QA env - feat(cli): cover-view support hover-class - feat(demo): improve twoFa demo - feat(demo): remove webauthn demo - feat(bundler): add statistics mode to pkg-cli & feat(mpp-service): support config msv - feat(sdk,demo): add private fps api and benchmark for render fps - feat(sdk): cache promise reject handler - feat(sdk): getperformance-evaluateScript - feat(lib): add promise polyfill source code and descreption - feat(sdk): gcanvas async method - feat(server-side-bundle): use X-Mp-Open-Api-Token to authorize - feat(sdk): add warn deprecated info for sdk 4.0 - feat(sdk): support injected prop in webview component - feat(sdk): add experimental on walletconnector - feat(bundler): support include options in project.config.json - feat(sdk): error with stack - feat(sdk): new render point NEZHA_INJECT_RENDERER_JS_END & update timeline point info - feat(lib): use body class to control theme rather than prefers-color-scheme - feat(lib): remote-debug route-change-done notify to render - feat(cli): add props to webview - feat(sdk): mpRuntimeLogger rename & add error code - feat(sdk): webgl finish api - feat(mpp-service): output version info to MPP_SERVICE_OUTPUT.json - feat(sdk): time app check after app-launch - feat(bundler): impl util-function analyzeSource & remove AddEntryAppJsPlugin - feat(mpp-service): output hostQrcode to a file - feat(sdk): sdk-loading - feat(lib): remote-debug new action & ignore native side delay error - feat(sdk): create webview sdk & demo - feat(runtime): disable click when loading display - feat(sdk): gcanvas supports cocos - feat(bundler): use zlib to compress pkg - feat(sdk): setInterval 0 with warning - feat(sdk): add api requestSubscribeMessage - feat(sdk): make-phone-call - feat(runtime): @mp/host catch error and send to parent window - feat(sdk): canvas to temp file path api and demo - feat(sdk): add FP/FCP/LCP entry for performance API - feat(demo): add readfile api to benchmark - feat(sdk): add route-change-done event to fix route entry negative duration - feat(demo): add apiBenchmark at globalThis to run customize api benchmark - feat(demo): add extended-libs page - feat(demo): demo for webgl - feat(cli): quick publish for dev & qa - feat(sdk): add mt_start when monitorupload setdata - feat(extended-lib): integrate distribution API (test on dev env) - feat(cli): support plugins - feat(sdk): improve web3 api - feat(demo): Standard Benchmark DSL Mini Program for runtimes - feat(demo): migrate component-demo api to component-demo-public - feat(sdk): cache promise api until it resolved - feat(bundler): add file hash to pkg - feat(sdk): filesystem api - copyfile, unzip - feat(demo): update radio example code as wechat example - feat(runtime): assign path to render iframe name - feat(demo): form view media public demo components - feat(demo): release demos in QA env - feat(demo): release demos in QA env - feat(demo): release demos in QA env - feat(cli): support taro prerender - feat(mpp-service): intergate server-side-bundle - feat(sdk): open-type getEmailAddress / getPhoneNumber - feat(demo): share app demo - feat(sdk): universal link - feat(extended-lib): export libs info - feat(bundler): add analyse mode to pkg-cli - feat(extended-lib): add new package @mp/extended-lib - feat(bundler): add pkg-cli - feat(sdk): monitorupload NEZHA_RENDER_PAGE_JS with data-eb - feat(sdk): setData payload size & remove cocos - feat(sdk): check TIME_APP by heartbeat scheme - feat(lib): preload styles bug fix - feat(demo): migrate theme-context - feat(bundler): bundler-cli add disabledSubpackages - feat(mpp-service): upload pkg of mini-program - feat(sdk): refactor framework-load-script - feat(demo): update custome event demo - feat(sdk): ide clipboard plugin migrate - feat(demo): add getEmailAddress getPhoneNumber demo - feat(server-side-bundle): upload source-map & source-code - feat(lib): preload html core - feat(mpp-service): support auto increase version code & improve error… - feat(runtime): simulator navigator title left align - feat(sdk): custom event on/off - feat(sdk): open-type button support getPhoneNumber, getEmail - feat(demo): expose base64_encode method example for developers - feat(sdk): native send event to worker with time - feat(sdk): renderer send RendererReady to Native - feat(demo): standalone webview demo - feat(sdk): add create offscreen canvas api - feat(sdk): warn if developer call sync api in app & page lifecycle - feat(runtime,sdk): handle page-not-found and fix onPageNotFound not working - feat(server-side-bundle): add new package @mp/server-side-bundle - feat(demo): implement 5 api to component-demo - feat(demo): component-demo for dsl - feat(sdk): route query parameters updates - feat(demo): migrate e2e test - feat(mpp-service): submit the MiniProgram in audit step - feat(demo): enterkeyhint of search - feat(sdk): remote debug support sync rpc - feat(sdk): remove cocos runtime script from sdk package - feat(automator): replace puppeteer wiht playwright - feat(sdk): wallet-connector issue fix - feat(sdk): text component support decode and space - feat(sdk): add new rpc action RendererServiceReady - feat(sdk): add fullyDownloaded to FrameworkDownloadPackage - feat(demo): webview custom nav demo - feat(lib): host getImageInfo plugin - feat(sdk): getImageInfo support relative path - feat(sdk): add wallet-connector plugin - feat(bundler) : bxml support relative path - feat(cli): update deprecated input props - feat(demo): public demo component migrate - feat(demo): update wallet connector demo - feat(demo): include get-image-info demo image files - feat(demo): component demo public - feat(runtime): deprecated input support confirm event - feat(demo): update wallet connector demo - feat(demo): getImageInfo support absolute path and short path - feat(demo): add more cases in wallet-connector demo - feat(cli,doc): modify bundler info for useExtendedLib and update doc troubleshooting - feat(bundler & runtime): support useExtendedLib - feat(demo): update the unsupported domain test - feat: e2e-test - feat(sdk): hotfix 3.8.1 cherry pick master & restore yml - feat(sdk): redesign timeline - feat(sdk): startlocationupdate type - feat(sdk): image-info plugin - feat(demo): get-image-info demo - feat(sdk): add plugin user-info & migrate getUserProfile to action get-user-info-profile - feat(cli): support externals lib - feat(playground): add wallet-connector context api - feat(cli): upgrade tarojs to 3.4.4 - feat(sdk): expose esmoudle of plugin submodule with .mjs - feat(bundler): empty app.js for drop compatibility & fix independent … - feat(bundler & mpp-service): add bundler-cli & support output .pkg files - feat(sdk): clear detection when hidden - feat(demo): update runtime-web-host bundleAll params - feat(sdk): hotfix-3.7.6-cherry-pick-to-master timeline update - feat(sdk): hotfix-3.7.6-cherry-pick-to-master timeline update - feat(sdk): add more info about AppLaunch in runtimeloger - feat(sdk): framework-storage plugin - feat(bundler,cli): update bundler log info - feat(mpp-service): add package mpp-service to tools - feat(sdk): hotfix-3.7.3-onerror-monitor-upload - feat(sdk): try catch error in App lifecycle - feat(sdk): add load pageJS info in timeline logger - feat(sdk): add more info about AppLaunch in runtimeloger - feat(bundler): move page logic to page.worker.js - feat(sdk): add startAppLaunch handleAppLaunchCallback in runtimeloger - feat(demo): preloadRule demo app - feat(sdk,runtime): file system manger access api sdk,runtime,demo - feat(cli): add button open-type getUserProfile & getEmailAddress - feat(sdk): canIUse plugin - feat(demo): handle error demo - feat(runtime): remove native-ui - feat(sdk): add Button open-type attribute getUserProfile - feat(sdk): add Button open-type attribute openSetting - feat(sdk): add wallet-connector plugin - feat(lib): add binary-pkg to bundler - feat(sdk): add API isLoggedIn & add custom plugin ensure-logged-in - feat(demo): private-request demo - feat(runtime): filesystem permission - feat(sdk): plugin device-orientation-change - feat: add disableBounces page to demo app - feat(mp,sdk): file system plugins - feat: private-request plugin - feat(sdk): app-rpc logger add event - feat(mp): buffer-url mp plugin - feat(sdk): timeLogger-startup add loadAppJs and appLoad - feat(sdk): native-rpc-logger supprot event - feat(cli): add support autocomplete feature for DeprecatedInput - feat(sdk): support confirm event for web input - feat(sdk,mp): mp,sdk plugin tab bar red dot - feat(cli & bundler): provide source-map in prod mode - feat: update blank-page demo with navigate to a new page - feat: update blank page demo with input - feat(runtime): on-off plugin - feat(sdk): add system log label - feat(sdk): plugins show-leaderboard, cloud-storage - feat(mp): plugin background-fetch - feat(runtime): save image to photos album plugin - feat(bundler): extract base.bxml - feat(sdk): plugin beforeAppClose api and demo - feat: add blank-page demo - feat(sdk): add direction RTL support for native components include native-input - feat(runtime): clipboard plugin - feat(sdk): optimize vconsole, lazy load, split log and system panel - feat(sdk): report plugin - feat(mp-runtime): add webview plugin - feat: sync with mono 3.5.0 - feat: test([32d06ace](https://git.toolsfdg.net/fe/mini-program/commit/32d06aceb8d95036bc2f28bd72ea4f7347db3db2)) by ka - feat: test - feat: trigger - feat: failed trigger and do it one more time - feat: test publish - feat: modify release script - feat(Slider): add mp-slider component - feat: add fallback action handler - feat: add bn.login - feat(cli): archive bundle to zip file - feat(cli): do bundle after taro build - feat: add downloadFile and requestPayment - feat: add base component Radio and RadioGroup & fix wrong onChange target id - feat: add dist -d option - feat: add bn apis - feat(taro-plugin): 🎸 add bn typings for taro - feat(build): add build command in @mp/cli - feat: 🎸 add cli-init react template - feat: implement WorkerService with iframe - feat: add mp-checkbox & mp-checkbox-group - feat: add action defintions - feat: 🎸 add options to dev cli - feat: 🎸 init @mp/cli - feat: support api cors - feat: expose rpcworker on dev - feat: add toast action - feat: 🎸 change page in app.json from object to array - feat: enhance request taro - feat: enhance request taro - feat: enhance request taro - feat: 🎸 add set method - Feature/bundler - feat(runtime-render): connect mp event to taro event - feat: enhance request - feat: add icon - feat: add mp-text & fix input event - feat: 🎸 add entry html and update taro plugin - feat: 🎸 add **cid and **pageConfig to Page function - feature/bundle - feat: 🎸 remove isPage logic and add test cases - feat: 🎸 defineApp and defineComponent - feat: 🎸 _.config.json => _.json - feat: 🎸 add \_\_cid to components - feat: 🎸 add bundleAll method - feat: 🎸 add merge-page-config-plugin - feat: 🎸 return empty style and import pages - feat: 🎸 add bundleApp function - feat: export renderTaro - feat: output sdk manifest - feat: 🎸 add mp-tpl-loader and complete mp-bjs-loader - feat: 🎸 use mp-bjs-loader - feat: add mp-switch - feat: add mp-textarea - feat: add mp-label - feat: runner-web-cli - feat: add onTap - feat: add mp-input - feat: 🎸 add @babel/runtime - feat: 🎸 support css module and scss - feat: 🎸 clean memfs dir before run each test - feat: 🎸 set config.optimization and add test cases - feat: 🎸 extract css files - feat: 🎸 add webpack-chain and support css files - feat: 🎸 bundle single page - feat: 🎸 invoke AppShow before first page loaded - feat: 🎸 runner: support app-hide & app-show - feat: 🎸 bn.api - feat: 🎸 `runner` support navigate-pop and navigate-redirect - feat: add navigator.redirect - feat(public-api): init bn - feat(rpc): add callback error - feat: add app.js - feat: 🎸 add multi pages and remove app-launch / page-load event - feat: 🎸 add page2 and import worker.js on demand - feat: 🎸 set navigation bar title - feat: 🎸 add bn.request function - feat: 🎸 mock native functions - feat: navigator - feat: add App and Page - feat: navigator - feat(runtime-render): add mp- prefix - feat(runtime-render): add comments - feat(runtime-render): update text - feat(runtime-render): add tap event - feat: add load and unload method - feat: 🎸 support tsconfig.json in packages - feat: 🎸 add @vue/compiler - feat: multipage runner - feat: 🎸 compiler init - feat: add cmd typings - feat: add runner-web - feat: queue msg before ready - feat(event): add event support - feat: desctroy component when unmounted - feat: add build watch option and add methods and computed function - feat: 🎸 support methods and computed functionality - feat(compiler): add base compile functions - feat(project): add dev:all script - feat(project): add dev:all script - feat(project): specify format - feat(project): update dev:app scripts - feat(project): add owners - feat: add dev script - feat: use single rpc implementation - feat: counter demo - feat: first commit for runtime-\* - feat: 🎸 add rollup to build runtime bundle - feat: 🎸 minify code - feat: 🎸 add rollup to build runtime bundle - feat(rpc): add webwork rpc & native rpc - feat(rpc): change names - feat(rpc): add nativeBridge - feat(rpc): add nativeBridge - feat(rpc): fix issue - feat(rpc): fix issue - feat(rpc): add createRpcFromWorkerToView - feat(rpc): add result - feat(rpc): add createRpcFromViewToWorkder for dev - feat: define rpc interface ### Refactor - refactor(sdk): remove locationReadyManager - refactor(sdk): delete gcanvas useless code - refactor(demo): move component - refactor: websocket hostplugin and text-line-height - refactor: ide plugin login, location, download-package - refactor: sensor plugin migration - refactor: move plugins to runtime-plugins - refactor(demo): mp-web - refactor: ide plugin migration(error page, preview-image) - refactor(sdk): optimize logger - refactor: ide-host plugin migration - refactor(runtime): redefine definePlugin to support service - refactor(sdk): refactor plugins - refactor: plugins migration - refactor: clean dist of @mp/host - refactor(runtime): re-export by host itself - refactor(demo): component transform page - refactor(sdk): fix plugin migration types errors - refactor: new DSL demo page - tabbar - refactor(demo): new component demo based on bxml - refactor(sdk): migrate choose-image clipboard cloud-storage - refactor(sdk): migrate plugin-canvas - refactor(runtime): migrate plugins - refactor(plugins): plugins -> runtime-plugins - refactor(sdk): rename directories & fix watch mode - refactor: remove @mp/runtime-host - refactor(runtime): migrate plugins from to runtime-plugins - refactor(sdk): plugins -> runtime-plugins - refactor(runtime): code quality - refactor(plugin): migrate internal-plugins - refactor(runtime): add new desgin for plugin service - refactor(sdk,runtime): extract internal plugins & fix types for mp-ide - refactor(sdk,runtime): colocate host plugin & extract @mp/host-core - refactor: restructure folders - refactor: unit test of mp runtime - refactor: rename deviceInfo to viewportInfo - refactor(runtime): re-export @mp/plugins-mp - refactor(sdk): add new runtime-core and move plugins to runtime-plugins - refactor(runtime): rename runtime api - refactor: runtime re-export - refactor(runtime): add watch mode - refactor(runtime): export resolvePublicAsset instead of dirs - refactor(runtime): remove jump plugin effect - refactor(runtime): jump plugin - refactor(runtime): plugin performance-test and fix a bug cause by defaultTargetId is zero - refactor(runtime): mp-runtime dev mode - refactor(sdk,runtime): remove rollup warnings and prevent it - refactor(sdk): use disableBuiltInPlugins options instead of setIsMG - refactor(mp runtime): mp runtime api - refactor(runtime): remove useless service - refactor(runtime): move service plugin to IDE - refactor(runtime): move service plugin to IDE - refactor(runtime): move service plugin to IDE - refactor(sdk): monitor-upload service and plugin - refactor: update-manager - refactor(sdk): performance plugin - refactor: extract fs - refactor(sdk): share-panel plugin for mp & mg - refactor: navigation-bar plugin - refactor: rollup build - refactor: split action and event - refactor: separate action and event - refactor: events -> listeners - refactor: use cache & proxy - refactor: bind props with relation - refactor: rename customevent -> events & emitEvents - refactor: separate component props into normal props and custom events - refactor: using async setup to init instance - refactor: 💡 add webpack utils.ts - refactor: use $emit event - refactor: 💡 addStyleRule - refactor: change action to string from object - refactor: 💡 ViewManager.\_destroyView - refactor: remove render.js suffix - refactor: change page url - refactor: 💡 change name - refactor: pass rendererId by context - refactor: change ready process - refactor: change native bridge interface - refactor: 💡 @compiler -> @mp/compiler - refactor: use single bridge - refactor: rpc init process - refactor: update rpc message struct - refactor: use two bridge to communicate - refactor: change rpc interface - refactor: change rpc interface ### Performance Improvements - perf: app-rpc msg encoder - perf: pre-create worker - perf(sdk): use local js-sha3 ### Misc - Revert "Revert "refactor(sdk): remove locationReadyManager " (#888)" (#929) - Revert "refactor(sdk): remove locationReadyManager " (#888) - Revert "fix: cherry-pick cachePromise of getSystemInfo " (#867) - revert(sdk): revert getPhoneNumber/getEmailAddress feature because IOS not ready yet - revert(sdk): rollback to use the old get-user-profile action - Revert "fix(sdk): update image component from img to div with background-image " (#309) - Revert "feat(mp-runtime): add webview plugin" - Revert "feat: 🎸 change page in app.json from object to array " (#119) - Revert "feat(project): add dev:all script " (#21) ### Internal - chore(cicd): yaml files - chore(changelog): update changelog for version v3.14.3 - chore(changelog): update changelog for version v4.0.0-dev.3 - chore(runtime): add currentSize filed - chore: update public demo - chore(sdk): automator package rename - chore(changelog): update changelog for version v4.0.0-dev.2 - chore(changelog): update changelog for version v3.14.2 - chore: update public demo - chore: component-demo - chore: bump npm versions - chore(changelog): update changelog for version v4.0.0-dev.1 - chore(changelog): update changelog for version v3.14.1 - chore(changelog): update changelog for version v3.14.0 - chore(changelog): update changelog for version v3.14.0-dev.4 - chore(changelog): update changelog for version v3.13.3 - chore(changelog): update changelog for version v3.14.0-dev.3 - chore(changelog): update changelog for version v3.14.0-dev.2 - chore(changelog): update changelog for version v3.14.0-dev.1 - chore(changelog): update changelog for version v3.13.2 - chore(tools): remove cicd - chore: fix dockerfile - chore(changelog): update changelog for version v3.13.1 - docs(demo): update automator readme - update cicd tool - update cicd tool - docs(docs): provide troubleshooting for canvas dependencies installing issue - cicd tools - docs: remove duplicated changelog for 3.13.0 - chore(changelog): update changelog for version v3.13.0 - chore(changelog): update changelog for version v3.13.0 - docs: changelog for hotfix 3.12.2 - chore(changelog): update changelog for version v3.12.3 - chore(changelog): update changelog for version v3.13.0-dev.5 - chore(changelog): update changelog for version v3.13.0-dev.4 - chore(changelog): update changelog for version v3.13.0-dev.3 - chore(changelog): update changelog for version v3.13.0-dev.2 - docs(sdk): components docs - chore: changelog automation - docs(sdk): view & text components docs - chore(sdk): getperformance update - test: taskify-unit-test - chore: deploy extended-lib to prod env - docs: add typedoc doc to generate plugin docs - chore: test publish @mp/extended-lib on QA env - chore(demo): release prod demos - chore: publish @mp/extended-lib - chore(demo): bump component-demo-public prod version - chore(demo): release improve web3 api feature with component-demo app - chore(sdk): debug log - chore(demo): bump qa demo version for radio-issue - style(demo): add style of public - docs(bundler): add how to use pkg-cli - chore: webstudio release public-demo on prod - build: sync webview demo - build: sync-demos - chore: build with bump version from hotfix or local - chore: webstudio release public-demo on prod - chore: webstudio release public demo to prod - chore: rebuild webstudio public-demo - chore: prepare demo app release - chore: webstudio test disabledSubpackage - chore: webstudio test subPackage - chore: bump version - docs: mp-host overview - chore: bump version - chore: webstudio - chore: release component-demo - chore(sdk): delete RendererReady - Chore/webstudio - chore: test-webstudio - chore: add service.ts to files field - chore(sdk): update local gen-sdk mainfest.json version - chore: webstudio - chore: hide migrated pages for testing purpose - chore: webstudio config - chore: webstudio config - chore: webstudio config - chore: bump version - chore(sdk): cherrypick 3.10.1 to master - chore(release): mp-sdk v3.10.0 - chore: bump versions - chore: image url - build: issue template - chore: test webstudio auto submit - chore: studio publish mp-sdk - chore: test webstudio - chore: webstudio demo - chore: webstudio - chore: add 1st version of issue templates - chore(lib): bump versions cause by router query parameter feature - docs: update documents about how to test plugin - chore(sdk): cherry pick - delay 30s check app temporary - chore(sdk): cherry pick 3.9.2 to master - Merge branch 'master' into release/3.9 - docs: format readme - chore(sdk): cherry pick 3.9.2 to master - chore(sdk): cherry pick 3.9.2 to master - chore: add concurrency script - chore(release): mp-sdk v3.9.0 - chore: forgot to add .cjs suffix - chore: fix yarn release script - chore(demo): migrate component-demo to use cli 2.4.9 - chore: bump npm versions - chore: add @tarojs/react to dependencies of babel-preset-bmp - chore(cli): remove useless webpack alias - docs(runtime): added migration plugin - chore: bump version - docs(demo): how to add new feature on new demo app - chore: bump npm versions - chore: bump npm versions - chore: trigger packages republish - chore(sdk): drop compatibility code isLegacyAppJsLoaded - chore(doc): update mp-runtime doc troubleshooting - chore: update automator README & puppeteer package - docs(sdk): add special cases description - docs(runtime): test host plugin - Merge pull request #471 from finley-x/release/3.8 - Merge branch 'master' into release/3.8 - chore: bump npm versions - chore(release): mp-sdk v3.8.0 - docs: plugin integrate with IDE & release - chore: add wallet created action - docs: how to development mp runtime - docs: add plugin docs - chore: set --unhandled-rejections=warn with jest to fix unit-test on node16 - chore: add @mp/mp-runtime-shared-plugins - chore: bump versions - chore: throw typescript check error - chore: bump mp-runtime version - chore: pre commit disallow empty files - Merge pull request #423 from finley-x/release/3.7.4 - chore(cli): re-trigger bump CLI v2.3.3 - chore: organize mono workspaces - chore(sdk): release/3.7.3 -> master - chore(sdk): restore yml - chore(sdk): restore yml - test(sdk): logger test update - chore(release): mp-sdk v3.7.2 - test(runtime): add inner audio unit tests - chore(sdk): canvas plugins - test(lib): improve logger unit tests - ci: commitlint allow multiple scopes - test(lib): add logger unit tests - chore(sdk): fix fs plugin demos - ci: fix commit-lint issue - chore(sdk): demo for fs and orientation plugin - chore: bump version to 1.1.0 - chore(sdk): fix Circular dependencies - chore(cli): downgrade Taro to 3.2.13 - chore(bundler & sdk): move patches to root of workspace - chore(bundler): add compiler-dom.d.ts - chore(bundler): use tsc to build bundler - build: fix cli build & render dev mode - test: remove jest errors - build(lib): update runtime-worker-common build script - test(sdk): fix report test error - test(sdk): fix report test error - chore: use tsc to build cli - chore: logger error caused by navigation-bar - build: fix validate sdk output & add runtime-worker-common as deps of MP_ONLY - chore: merge release/3.6 - chore: integrate v3.5.2 - Merge pull request #168 from kami-c/feature/test-ci-5 - Merge pull request #167 from fe/\_\_release-mp-sdk_prod_1.0.1_c7aa75d45e4516e684e941c544935c32a862b2ca_1646900584973 - release mp-sdk v1.0.1 - Merge pull request #154 from henry-w/mono-sdk-3.4.0 - moved from mono 3.4.0, add prowjob + config - Merge pull request #152 from michael-xu/feature/mp-slider - Merge pull request #151 from myron-li/dev - Merge pull request #150 from myron-li/dev - Merge pull request #148 from chengfan-lin/mp-cli-build-bundle-zip - Merge pull request #149 from myron-li/dev - Merge pull request #147 from myron-li/dev - Merge pull request #146 from michael-xu/feature/radio - update - Merge pull request #145 from myron-li/refactor-build - Merge pull request #144 from myron-li/fix-build - Merge pull request #143 from james-l/feat/patches - unit the style of module import - use cross-spwan instead of child_process - add livereload for dev server - clean up package.json of cli - added a link cmd to make it easy to install cli added cli related document - Merge pull request #142 from michael-xu/fix/origin-bundler-with-path - do patches before build - Merge pull request #139 from myron-li/work - chore: 🤖 update yarn.lock - Merge pull request #136 from myron-li/html-worker-container - Merge pull request #135 from luffy-wang/fix-for-debugger - Merge pull request #131 from myron-li/add-actions - Merge pull request #126 from myron-li/refactor-rpc - Merge pull request #125 from myron-li/MYRON-1 - Merge pull request #124 from myron-li/dev - Merge pull request #97 from michael-xu/feature/custom-event - Merge pull request #120 from james-l/Feature/watch-mode-bundler - added exception catching in bundle script of watch mode - test: 💍 add cid equal test case - complete w -> watch as watch mode argument - chore: upgrade vue - Merge pull request #121 from myron-li/toast - added the bundler usage to README.md - add watching mode for bundler - Merge pull request #117 from myron-li/action - Merge pull request #109 from luffy-wang/enhance-request - chore: 🤖 update service assets - Merge branch 'master' of https://git.toolsfdg.net/fe/mini-program into enhance-request - Merge pull request #115 from chengfan-lin/api-taro - Merge branch 'master' into feature/custom-event - Merge pull request #114 from bowen-zhu/feature/bundler - Merge branch 'master' of https://git.toolsfdg.net/fe/mini-program into enhance-request - Merge pull request #113 from myron-li/MYRON-1 - chore: fix typo - Merge pull request #111 from chengfan-lin/api-taro - Merge pull request #112 from james-l/simplify-taro-plugin - make bxss generate correct sourcemap when is in development - simplify taro plugin and make it work as an npm package - Merge pull request #108 from luffy-wang/add-icon - Merge pull request #107 from james-l/fix/yarn-command-of-build-taro-plugin - Merge pull request #106 from myron-li/batch-updated - optimize: batch setData call - Merge pull request #105 from michael-xu/feature/components - Merge pull request #104 from myron-li/optimize - chore: optimize build - Merge pull request #103 from bowen-zhu/fix/bunlder - Merge pull request #102 from james-l/fix/sourcemap-of-css - dont let bxss generate sourcemap - Merge pull request #101 from james-l/change-output-of-taro-plugin - Merge branch 'master' into change-output-of-taro-plugin - added components definitions of uikit requirements - test: 💍 add test cases - use tsc instead of rollup as the packer - Merge pull request #95 from myron-li/refactor - add sourcemap to bjs files - use a modified app loader instead of origin one - let page's code export via umd - make output of the page scripts ends with .bjs - Merge pull request #87 from bowen-zhu/feature/app-bundler - chore: 🤖 remove bundled files - chore: 🤖 add todos - chore: 🤖 rename .tpl -> .bxml - chore: 🤖 update package.json - test: 💍 update test cases - test: 💍 update test cases - Merge pull request #90 from james-l/Feature/taro-integration - add components - Merge pull request #91 from myron-li/custom-event - chore: custom component - add code to support lifecycle callback of taro for Page object - added REDME to taro plugin package - add taro platform plugin into repository - Merge pull request #89 from myron-li/bundle-demo - chore: add example - Merge pull request #88 from myron-li/rename - chore: rename - Merge pull request #84 from myron-li/taro - chore: 🤖 build bundler by tsc - Merge pull request #79 from michael-xu/feature/mp-components - chore: 🤖 split bundler - Merge pull request #77 from bowen-zhu/feature/bundler - test: 💍 remove useless test fixtures - test: 💍 add basic fixtures - Merge pull request #78 from myron-li/runner - chore: 🤖 remove unused example - Merge pull request #74 from bowen-zhu/feature/loader - test: 💍 add runInDom test function - chore: 🤖 rename and remove useless code - Merge branch 'master' of https://git.toolsfdg.net/fe/mini-program - chore: 🤖 setup bundler - chore: 🤖 add compiler example - merge upstream master - chore: update example - Merge branch 'master' of https://git.toolsfdg.net/fe/mini-program - add weather app demo - Merge pull request #71 from myron-li/fix-page-hooks - chore: 🤖 rename types - Merge pull request #69 from bowen-zhu/feature/runner - chore: 🤖 types - chore: 🤖 navigate in worker - chore: renemae variable - chore: update example - chore: rename variables - Merge pull request #68 from myron-li/navigator-redirect - Merge pull request #66 from bowen-zhu/fix/runner - Merge pull request #65 from myron-li/page-url - Merge pull request #64 from myron-li/app-js - Merge pull request #60 from bowen-zhu/feature/runner-navigation - chore: 🤖 remove redundant code - chore: 🤖 rename function names - chore: 🤖 add response interface - chore: 🤖 update types and ui - Merge pull request #63 from myron-li/integrate-app-and-page - Merge pull request #57 from myron-li/navigator - Merge pull request #54 from luffy-wang/add-app - enhance - create once only - Merge pull request #52 from sora-liu/master - typos - add createApp and interfaces - chore: rename pageid to rendererid - chore: 🤖 update compiler fixture - Merge pull request #51 from myron-li/init-process - chore: 🤖 build prod version - Merge pull request #48 from bowen-zhu/feature/compiler - chore: 🤖 compiler dir structure - Merge pull request #46 from myron-li/single-bridge - Merge pull request #45 from myron-li/multi-page - refacotr: change rpc message definition - Merge pull request #44 from myron-li/test - test: add component test - Merge pull request #43 from myron-li/setup-test - chore: setup jest - Merge pull request #40 from myron-li/fix-compatibility - Merge pull request #39 from myron-li/format - Merge pull request #38 from myron-li/compiler-helper - Merge pull request #37 from myron-li/worker-render-protocol - Merge pull request #36 from myron-li/update-rpc - change rpc - Merge pull request #34 from myron-li/mock-service - Merge pull request #32 from myron-li/bridge-ready - Merge pull request #31 from myron-li/multi-bridge - Merge pull request #30 from luffy-wang/change-rpc - Merge pull request #27 from myron-li/build-sdk - chore: add command to generate sdk - Merge pull request #26 from myron-li/cleanup - Merge pull request #25 from shenxiang-feng/master - Merge pull request #23 from luffy-wang/add-compile-functions - Merge pull request #19 from myron-li/patch - chore: update readme - chore: update readme - Merge pull request #10 from myron-li/dev-script - chore: 🤖 add todo - chore: rename packages - chore: 🤖 project setup - chore: 🤖 add @types/node - chore: 🤖 add eslint and prettier - chore: 🤖 build ts files - chore: 🤖 add lerna - init - wip - init ## [3.14.5] 2022-11-10 **Download: [SDK-3.14.5](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.5.zip)** ### Bug Fixes - fix(demo): fix benchmark - fix(sdk, demo): check promise polyfill by using \_\_\_mp_polyfill - fix(demo): public demo read file - fix(sdk): native-cover-view not work when using taro - fix(demo): two-fa demo scene data is undefined - fix(demo): pull down refresh not works - fix(sdk): cache promise online with polyfill - fix(sdk): mini game audio adapter - fix: disable ed and add @deprecated flag - fix(sdk): changelog issue - fix(sdk): callbackId could be zero - fix(sdk): input scrollbar css issue on android - fix(sdk): isCache undefined issue - fix(mpp-service): fix status api empty fail message - fix(sdk): add properties on webgl context - fix(sdk): fix timeOrigin 0 issues on IOS14 - fix(runtime): cannot resolve the font with url "bnshare://" - fix(sdk): fix getperformance firstRender - fix: cherry-pick cachePromise of getSystemInfo - fix(sdk): use promise polyfill fix promise task order in ios12 - ios14 - fix(sdk): error code detection of remote debug - fix(sdk): requestAnimationFrame NaN - fix(automator): web cli core apis - fix: add dependency to pass build job - fix(sdk): performance init appLaunch payload - fix: getPerformance first-render - fix(sdk): delete useless report - fix(sdk): loading when expect route-change type - fix(sdk): remove cachePromise to fix ios 13 eventloop issue - fix(sdk): fix: fix to signature error when include specific data struct issue - fix(sdk): remove type check in wallet-connect plugin - fix(sdk): gcanvas texImage2D flushnative - fix(sdk): fix taskify cache fail - fix(sdk): remove canvas service code - fix(sdk): fix applaunch-getPerformance - fix(sdk): fix webview sdk - fix(mpp-service): publish issue - fix(sdk): fix mg api host register - fix(sdk): navigateBackMiniProgram extra data should transform to string - fix(sdk): fix blank screen issue when relaunch because of taskify - fix(demo): public demo - fix(sdk): getCurrentPages error handler - fix(demo): textarea confirm-type - fix(sdk): fetch remote tags with force arg when tag conflict - fix(demo): textarea maxlength caused display issue - fix(sdk): access methods defined within methods property - fix(sdk): fix this problem for '\_setDataMaxSize' of undefined - fix(cli & runtime): useExtendedLib issue - fix(demo): public-demo textarea bug - fix(bundler): if directive not work as non-first attribute - fix(sdk): revert removing of setTimeout hack because of useDidShow issues on IOS - fix(server-side-bundle): set default value of versionSetting - fix(runtime): plainText body not supported - fix(demo): fix crash caused by private request demo - fix(sdk): bug in OnOffManager and add test - fix(sdk): revert changes of performance entry name - fix(demo): callback should not inside function component - fix(bundler): nested component with directive "for" - fix(runtime): set different left for title on different lefticon - fix(mpp-service): remove request body of getApplicationVersions - fix(sdk): request-timeout - fix: webstudio qa test - fix(sdk): tmpl_0_undefined bug lead to a blank page - fix(sdk): remove 120ms timeout of page show, make sure onShow is before onReady - fix(sdk): use logger to enable warn log visible - fix(bundler): disable autoloading postcss config of MP project - fix(sdk): tmpl_0_undefined issue - fix(demo): component-demo-public head component click fix - fix(demo): get appid from systemInfo - fix(runtime): set title when route-changed - fix(sdk): add missing @mp/runtime-plugin-sensor-orientation depenedncies - fix(sdk): page instance option property update - fix(sdk): from render to worker UIRendererServiceReady - fix(sdk): use log.error instead of filter text nest component - fix(demo): route query parameter different handler with encode64 - fix(runtime): load extended lib of specific version - fix(bundler): require relative path for cocos game - fix(sdk): reject the previous defer when reLaunch too early - fix(sdk): adjust MPRunTimeLogger - fix(sdk): routing api should wait app launched - fix(automator): api is undefined during first lauch of e2e - fix(sdk): share-panel not working (#542) - fix(bundler): copy non-existent files issue - fix(demo): how to use custom tabbar - fix(cli): resolve path of react - fix(sdk): rename package - fix(runtime): add getBridgeCode to files array - fix(runtime): remove dependency cycle - fix(runtime): align fail behaviour of request plugin with wechat - fix(sdk): cherry pick - timeline check app & hotfix 3.8.2 - fix(bundler): common.bxss is imported twice & release factory after jsModule is required - fix(sdk): empty subpackages force download action - fix(runtime): add service.d.ts to npm pack - fix(cli): update vendors to support node 16 - fix: catch downloadFile fail and remove --unhandled-rejections=warn - fix(sdk): mg add devicePixelRatio into getSystemInfo api - fix(sdk): mp canvastouche event payload - fix(bundler): add globalThis polyfill to page-frame - fix(sdk): setData in onLoad not working - fix(cli): fix tarojs version can not found in yarn global action - fix(sdk): fix timeline order error - fix(sdk): remove global wx, fix getOpenDataContext placeholder - fix(sdk): timeline appJs error - fix(sdk): timeline-update - fix(cli): debugReact with react-reconciler not works - fix(sdk): increase gas limit when estiamte gas failed - fix(runtime): postMessage should wait for ready - fix(cli): resolve taro presets from installation dir of bmp - fix(cli): support node 15 - fix(sdk): can-i-use types & injectPrivateApi - fix(rumtime): support tmp/store/usr http request - fix(bundler): source-map OOM & repeated refresh in watch mode issues - fix(sdk): fix onOffManager memory leak for task-style apis - fix(demo): fix demo for fileSystemManager - fix(runtime): add Math.ceil when populate gas - fix(sdk): canvas plugin - fix(bundler): adjust the order of loading script in page-frame - fix(bundler): load base.bxml.js earlier than renderer-service.js - fix(sdk): plugin write file - fix(sdk): blank page when relaunch in old ios device - fix(sdk): support cocos - fix(sdk): app-rpc-logger judge from or to & delete extra log - fix(sdk): monitor d change to dt & update RuntimeLogger monitor-upload - fix(sdk): webview not working for the webview using node-bridge - fix(bundler): load base.bxml.js in head element of page-frame - fix(sdk): plugin-private-request command - fix(sdk): add dataset to MPEventTarget - fix(runtime): onNativeApiRequest able to listen all actions - fix(sdk): radio and checkbox components - fix(sdk): ios not support bigint 64 - fix(sdk): sentry + vconsole cause oom - fix(sdk): fix Android need to tap input twice to focus - fix(sdk): fix the issue that slider wrap with position: relative container - fix(mp): fix request cookie setting - fix(sdk): fix reportEvent with keyword to error - fix(sdk): timeline startup del loadAppJs - fix(sdk): DeprecatedInput auto-fill not emit input event - fix(sdk): fix native input color with autoFocus props - fix(runtime): storage plugin api not work - fix(sdk): fix Image style width:100% - fix(sdk): remove header filed with null value - fix: add defer for webview context in the node-bridge demo - fix: create a empty webview if src not provied - fix(mp): fix tab bar css, red dot api error message - fix(sdk): fix Image style being overridden and comments using English - fix(sdk): image can not use width/height:auto with div-bgImg - fix(sdk): onAppShow not working - fix(sdk): remove the error of webivew-sdk Unknown Action $ready - fix(sdk): update image component from img to div with background-image - fix: framework-load-script has been registed - fix(sdk): fix View component touchstart twice (#295) - fix(lib,sdk): fix deprecated-input onInput not working - fix(runtime): show & hide ToastContainer - fix(sdk): plugin create native buffer - fix(sdk): Image and IDECoverImage onload & onerror - fix(sdk): timelogger error add time - fix(sdk): debounce update state for native input - fix(sdk): fix re-launch page not found issue - fix(runtime): fix storage plugin - fix(sdk): disable the JS timer for blank page detection - fix(lib): make bundler generate component code that not override comp… - fix(runtime): prevent app.js load twice - fix(sdk): polyfill IntersectionObserver for iOS 12.1 (#237) - fix:add commit hash to branch name - Fix: release script - fix: unexport subscribeLocationChange - fix: sdk build - fix the problem that bundler still work when in h5 mode - fix some dependencies of project template - fix: use path.resolve - fix: make form component soft controlled & add missing component map - fix: use -o - fix the problem after last commit which make bundle script not work - fix: normalize page url - fix: 🐛 overwrite template files - fix for debugger - fix: 🐛 add http-proxy-middleware@0.19 in runtime-render - Fix/fix the request with correct parameters and all other things for mvp2 - fix: send body only for post and put method - fix: prevent user from scaling view - fix: remove useless code - fix(runtime-renderer): fix multiple event binding on same event - fix: get props and data from parent & rename api - fix: typo - fix: use Object.assign - fix: reduce payload size - fix: Resolve events from attrs and separate two rpc events - fix: use eventNames to tell the different if it is a event name or a normal props name - fix: watch $props - fix: rename - fix: watch all props changed - fix: remove bind props interface - fix: remove useless code - fix the problem invoked by packange name changed of taro plugin - fix: prevent capture event trigger twice - fix: 🐛 use e.currentTarget - fix: 🐛 renderTaro and updateData - fix: 🐛 renderTaro - fix: keep compatible with taro - fix: add tapCapture - fix: add capture event - fix: update props naming - fix: remove console.log - fix: Non-function value encountered for default slot. Prefer function slots for better performance. - fix: remove console.log - fix: types - fix: update sdk - fix: response.data typing - fix: 🐛 enableCSSModule - fix: call ready before navigation-push - fix: typo - fix: typo - fix: typo - fix: change data type - fix: 🐛 back to list page - fix: rpc - fix(runner): rpc message format - fix(runner): rpc message format - fix: pass query to page.oLoad - fix: fix ready and push action order - fix: page component created twice - fix: fix page hooks - fix: 🐛 support page-hide and page-show - fix: 🐛 not parse querystring when method is GET or HEAD - fix: 🐛 createAndSavePage params - fix: 🐛 init lifecycle and method - fix: 🐛 only create page when \_\_pageConfig exist - fix: 🐛 create page on worker runtime - fix: build - fix: disable webpack-dev-server host check - fix: improve js compatibility - fix: improve js compatibility - fix: prefix component instance id with page id - fix(rpc): change rpc interface - fix: 🐛 add recordInstanceBoundEffect - fix: 🐛 remove effect - fix: 🐛 computed bind to ctx - fix: change defualt build format to esm-bundler - fix: change defualt build format to esm-bundler - fix(project): fix default format - fix(project): format package.json - fix(project): rm .gitkeep & fix deps - fix: typo - fix: COMPONENT_TYPE_ID is undefined - fix: 🐛 build script ### Features - feat(sdk): add page-frame-resource points - feat(sdk): shareAppMessage support fallback url - feat(sdk): generate bytecode for worker-service - feat(sdk): toDataURL and getuserprofile - feat(sdk): chainId should be number when pass to native - feat(demo): add promise polyfill demo for QA regression - feat: web host cli - feat(demo): release demo on QA env - feat(cli): cover-view support hover-class - feat(demo): improve twoFa demo - feat(demo): remove webauthn demo - feat(bundler): add statistics mode to pkg-cli & feat(mpp-service): support config msv - feat(sdk,demo): add private fps api and benchmark for render fps - feat(sdk): cache promise reject handler - feat(sdk): getperformance-evaluateScript - feat(lib): add promise polyfill source code and descreption - feat(sdk): gcanvas async method - feat(server-side-bundle): use X-Mp-Open-Api-Token to authorize - feat(sdk): add warn deprecated info for sdk 4.0 - feat(sdk): support injected prop in webview component - feat(sdk): add experimental on walletconnector - feat(bundler): support include options in project.config.json - feat(sdk): error with stack - feat(sdk): new render point NEZHA_INJECT_RENDERER_JS_END & update timeline point info - feat(lib): use body class to control theme rather than prefers-color-scheme - feat(lib): remote-debug route-change-done notify to render - feat(cli): add props to webview - feat(sdk): mpRuntimeLogger rename & add error code - feat(sdk): webgl finish api - feat(mpp-service): output version info to MPP_SERVICE_OUTPUT.json - feat(sdk): time app check after app-launch - feat(bundler): impl util-function analyzeSource & remove AddEntryAppJsPlugin - feat(mpp-service): output hostQrcode to a file - feat(sdk): sdk-loading - feat(lib): remote-debug new action & ignore native side delay error - feat(sdk): create webview sdk & demo - feat(runtime): disable click when loading display - feat(sdk): gcanvas supports cocos - feat(bundler): use zlib to compress pkg - feat(sdk): setInterval 0 with warning - feat(sdk): add api requestSubscribeMessage - feat(sdk): make-phone-call - feat(runtime): @mp/host catch error and send to parent window - feat(sdk): canvas to temp file path api and demo - feat(sdk): add FP/FCP/LCP entry for performance API - feat(demo): add readfile api to benchmark - feat(sdk): add route-change-done event to fix route entry negative duration - feat(demo): add apiBenchmark at globalThis to run customize api benchmark - feat(demo): add extended-libs page - feat(demo): demo for webgl - feat(cli): quick publish for dev & qa - feat(sdk): add mt_start when monitorupload setdata - feat(extended-lib): integrate distribution API (test on dev env) - feat(cli): support plugins - feat(sdk): improve web3 api - feat(demo): Standard Benchmark DSL Mini Program for runtimes - feat(demo): migrate component-demo api to component-demo-public - feat(sdk): cache promise api until it resolved - feat(bundler): add file hash to pkg - feat(sdk): filesystem api - copyfile, unzip - feat(demo): update radio example code as wechat example - feat(runtime): assign path to render iframe name - feat(demo): form view media public demo components - feat(demo): release demos in QA env - feat(demo): release demos in QA env - feat(demo): release demos in QA env - feat(cli): support taro prerender - feat(mpp-service): intergate server-side-bundle - feat(sdk): open-type getEmailAddress / getPhoneNumber - feat(demo): share app demo - feat(sdk): universal link - feat(extended-lib): export libs info - feat(bundler): add analyse mode to pkg-cli - feat(extended-lib): add new package @mp/extended-lib - feat(bundler): add pkg-cli - feat(sdk): monitorupload NEZHA_RENDER_PAGE_JS with data-eb - feat(sdk): setData payload size & remove cocos - feat(sdk): check TIME_APP by heartbeat scheme - feat(lib): preload styles bug fix - feat(demo): migrate theme-context - feat(bundler): bundler-cli add disabledSubpackages - feat(mpp-service): upload pkg of mini-program - feat(sdk): refactor framework-load-script - feat(demo): update custome event demo - feat(sdk): ide clipboard plugin migrate - feat(demo): add getEmailAddress getPhoneNumber demo - feat(server-side-bundle): upload source-map & source-code - feat(lib): preload html core - feat(mpp-service): support auto increase version code & improve error… - feat(runtime): simulator navigator title left align - feat(sdk): custom event on/off - feat(sdk): open-type button support getPhoneNumber, getEmail - feat(demo): expose base64_encode method example for developers - feat(sdk): native send event to worker with time - feat(sdk): renderer send RendererReady to Native - feat(demo): standalone webview demo - feat(sdk): add create offscreen canvas api - feat(sdk): warn if developer call sync api in app & page lifecycle - feat(runtime,sdk): handle page-not-found and fix onPageNotFound not working - feat(server-side-bundle): add new package @mp/server-side-bundle - feat(demo): implement 5 api to component-demo - feat(demo): component-demo for dsl - feat(sdk): route query parameters updates - feat(demo): migrate e2e test - feat(mpp-service): submit the MiniProgram in audit step - feat(demo): enterkeyhint of search - feat(sdk): remote debug support sync rpc - feat(sdk): remove cocos runtime script from sdk package - feat(automator): replace puppeteer wiht playwright - feat(sdk): wallet-connector issue fix - feat(sdk): text component support decode and space - feat(sdk): add new rpc action RendererServiceReady - feat(sdk): add fullyDownloaded to FrameworkDownloadPackage - feat(demo): webview custom nav demo - feat(lib): host getImageInfo plugin - feat(sdk): getImageInfo support relative path - feat(sdk): add wallet-connector plugin - feat(bundler) : bxml support relative path - feat(cli): update deprecated input props - feat(demo): public demo component migrate - feat(demo): update wallet connector demo - feat(demo): include get-image-info demo image files - feat(demo): component demo public - feat(runtime): deprecated input support confirm event - feat(demo): update wallet connector demo - feat(demo): getImageInfo support absolute path and short path - feat(demo): add more cases in wallet-connector demo - feat(cli,doc): modify bundler info for useExtendedLib and update doc troubleshooting - feat(bundler & runtime): support useExtendedLib - feat(demo): update the unsupported domain test - feat: e2e-test - feat(sdk): hotfix 3.8.1 cherry pick master & restore yml - feat(sdk): redesign timeline - feat(sdk): startlocationupdate type - feat(sdk): image-info plugin - feat(demo): get-image-info demo - feat(sdk): add plugin user-info & migrate getUserProfile to action get-user-info-profile - feat(cli): support externals lib - feat(playground): add wallet-connector context api - feat(cli): upgrade tarojs to 3.4.4 - feat(sdk): expose esmoudle of plugin submodule with .mjs - feat(bundler): empty app.js for drop compatibility & fix independent … - feat(bundler & mpp-service): add bundler-cli & support output .pkg files - feat(sdk): clear detection when hidden - feat(demo): update runtime-web-host bundleAll params - feat(sdk): hotfix-3.7.6-cherry-pick-to-master timeline update - feat(sdk): hotfix-3.7.6-cherry-pick-to-master timeline update - feat(sdk): add more info about AppLaunch in runtimeloger - feat(sdk): framework-storage plugin - feat(bundler,cli): update bundler log info - feat(mpp-service): add package mpp-service to tools - feat(sdk): hotfix-3.7.3-onerror-monitor-upload - feat(sdk): try catch error in App lifecycle - feat(sdk): add load pageJS info in timeline logger - feat(sdk): add more info about AppLaunch in runtimeloger - feat(bundler): move page logic to page.worker.js - feat(sdk): add startAppLaunch handleAppLaunchCallback in runtimeloger - feat(demo): preloadRule demo app - feat(sdk,runtime): file system manger access api sdk,runtime,demo - feat(cli): add button open-type getUserProfile & getEmailAddress - feat(sdk): canIUse plugin - feat(demo): handle error demo - feat(runtime): remove native-ui - feat(sdk): add Button open-type attribute getUserProfile - feat(sdk): add Button open-type attribute openSetting - feat(sdk): add wallet-connector plugin - feat(lib): add binary-pkg to bundler - feat(sdk): add API isLoggedIn & add custom plugin ensure-logged-in - feat(demo): private-request demo - feat(runtime): filesystem permission - feat(sdk): plugin device-orientation-change - feat: add disableBounces page to demo app - feat(mp,sdk): file system plugins - feat: private-request plugin - feat(sdk): app-rpc logger add event - feat(mp): buffer-url mp plugin - feat(sdk): timeLogger-startup add loadAppJs and appLoad - feat(sdk): native-rpc-logger supprot event - feat(cli): add support autocomplete feature for DeprecatedInput - feat(sdk): support confirm event for web input - feat(sdk,mp): mp,sdk plugin tab bar red dot - feat(cli & bundler): provide source-map in prod mode - feat: update blank-page demo with navigate to a new page - feat: update blank page demo with input - feat(runtime): on-off plugin - feat(sdk): add system log label - feat(sdk): plugins show-leaderboard, cloud-storage - feat(mp): plugin background-fetch - feat(runtime): save image to photos album plugin - feat(bundler): extract base.bxml - feat(sdk): plugin beforeAppClose api and demo - feat: add blank-page demo - feat(sdk): add direction RTL support for native components include native-input - feat(runtime): clipboard plugin - feat(sdk): optimize vconsole, lazy load, split log and system panel - feat(sdk): report plugin - feat(mp-runtime): add webview plugin - feat: sync with mono 3.5.0 - feat: test([32d06ace](https://git.toolsfdg.net/fe/mini-program/commit/32d06aceb8d95036bc2f28bd72ea4f7347db3db2)) by ka - feat: test - feat: trigger - feat: failed trigger and do it one more time - feat: test publish - feat: modify release script - feat(Slider): add mp-slider component - feat: add fallback action handler - feat: add bn.login - feat(cli): archive bundle to zip file - feat(cli): do bundle after taro build - feat: add downloadFile and requestPayment - feat: add base component Radio and RadioGroup & fix wrong onChange target id - feat: add dist -d option - feat: add bn apis - feat(taro-plugin): 🎸 add bn typings for taro - feat(build): add build command in @mp/cli - feat: 🎸 add cli-init react template - feat: implement WorkerService with iframe - feat: add mp-checkbox & mp-checkbox-group - feat: add action defintions - feat: 🎸 add options to dev cli - feat: 🎸 init @mp/cli - feat: support api cors - feat: expose rpcworker on dev - feat: add toast action - feat: 🎸 change page in app.json from object to array - feat: enhance request taro - feat: enhance request taro - feat: enhance request taro - feat: 🎸 add set method - Feature/bundler - feat(runtime-render): connect mp event to taro event - feat: enhance request - feat: add icon - feat: add mp-text & fix input event - feat: 🎸 add entry html and update taro plugin - feat: 🎸 add **cid and **pageConfig to Page function - feature/bundle - feat: 🎸 remove isPage logic and add test cases - feat: 🎸 defineApp and defineComponent - feat: 🎸 _.config.json => _.json - feat: 🎸 add \_\_cid to components - feat: 🎸 add bundleAll method - feat: 🎸 add merge-page-config-plugin - feat: 🎸 return empty style and import pages - feat: 🎸 add bundleApp function - feat: export renderTaro - feat: output sdk manifest - feat: 🎸 add mp-tpl-loader and complete mp-bjs-loader - feat: 🎸 use mp-bjs-loader - feat: add mp-switch - feat: add mp-textarea - feat: add mp-label - feat: runner-web-cli - feat: add onTap - feat: add mp-input - feat: 🎸 add @babel/runtime - feat: 🎸 support css module and scss - feat: 🎸 clean memfs dir before run each test - feat: 🎸 set config.optimization and add test cases - feat: 🎸 extract css files - feat: 🎸 add webpack-chain and support css files - feat: 🎸 bundle single page - feat: 🎸 invoke AppShow before first page loaded - feat: 🎸 runner: support app-hide & app-show - feat: 🎸 bn.api - feat: 🎸 `runner` support navigate-pop and navigate-redirect - feat: add navigator.redirect - feat(public-api): init bn - feat(rpc): add callback error - feat: add app.js - feat: 🎸 add multi pages and remove app-launch / page-load event - feat: 🎸 add page2 and import worker.js on demand - feat: 🎸 set navigation bar title - feat: 🎸 add bn.request function - feat: 🎸 mock native functions - feat: navigator - feat: add App and Page - feat: navigator - feat(runtime-render): add mp- prefix - feat(runtime-render): add comments - feat(runtime-render): update text - feat(runtime-render): add tap event - feat: add load and unload method - feat: 🎸 support tsconfig.json in packages - feat: 🎸 add @vue/compiler - feat: multipage runner - feat: 🎸 compiler init - feat: add cmd typings - feat: add runner-web - feat: queue msg before ready - feat(event): add event support - feat: desctroy component when unmounted - feat: add build watch option and add methods and computed function - feat: 🎸 support methods and computed functionality - feat(compiler): add base compile functions - feat(project): add dev:all script - feat(project): add dev:all script - feat(project): specify format - feat(project): update dev:app scripts - feat(project): add owners - feat: add dev script - feat: use single rpc implementation - feat: counter demo - feat: first commit for runtime-\* - feat: 🎸 add rollup to build runtime bundle - feat: 🎸 minify code - feat: 🎸 add rollup to build runtime bundle - feat(rpc): add webwork rpc & native rpc - feat(rpc): change names - feat(rpc): add nativeBridge - feat(rpc): add nativeBridge - feat(rpc): fix issue - feat(rpc): fix issue - feat(rpc): add createRpcFromWorkerToView - feat(rpc): add result - feat(rpc): add createRpcFromViewToWorkder for dev - feat: define rpc interface ### Refactor - refactor(sdk): remove locationReadyManager - refactor(sdk): delete gcanvas useless code - refactor(demo): move component - refactor: websocket hostplugin and text-line-height - refactor: ide plugin login, location, download-package - refactor: sensor plugin migration - refactor: move plugins to runtime-plugins - refactor(demo): mp-web - refactor: ide plugin migration(error page, preview-image) - refactor(sdk): optimize logger - refactor: ide-host plugin migration - refactor(runtime): redefine definePlugin to support service - refactor(sdk): refactor plugins - refactor: plugins migration - refactor: clean dist of @mp/host - refactor(runtime): re-export by host itself - refactor(demo): component transform page - refactor(sdk): fix plugin migration types errors - refactor: new DSL demo page - tabbar - refactor(demo): new component demo based on bxml - refactor(sdk): migrate choose-image clipboard cloud-storage - refactor(sdk): migrate plugin-canvas - refactor(runtime): migrate plugins - refactor(plugins): plugins -> runtime-plugins - refactor(sdk): rename directories & fix watch mode - refactor: remove @mp/runtime-host - refactor(runtime): migrate plugins from to runtime-plugins - refactor(sdk): plugins -> runtime-plugins - refactor(runtime): code quality - refactor(plugin): migrate internal-plugins - refactor(runtime): add new desgin for plugin service - refactor(sdk,runtime): extract internal plugins & fix types for mp-ide - refactor(sdk,runtime): colocate host plugin & extract @mp/host-core - refactor: restructure folders - refactor: unit test of mp runtime - refactor: rename deviceInfo to viewportInfo - refactor(runtime): re-export @mp/plugins-mp - refactor(sdk): add new runtime-core and move plugins to runtime-plugins - refactor(runtime): rename runtime api - refactor: runtime re-export - refactor(runtime): add watch mode - refactor(runtime): export resolvePublicAsset instead of dirs - refactor(runtime): remove jump plugin effect - refactor(runtime): jump plugin - refactor(runtime): plugin performance-test and fix a bug cause by defaultTargetId is zero - refactor(runtime): mp-runtime dev mode - refactor(sdk,runtime): remove rollup warnings and prevent it - refactor(sdk): use disableBuiltInPlugins options instead of setIsMG - refactor(mp runtime): mp runtime api - refactor(runtime): remove useless service - refactor(runtime): move service plugin to IDE - refactor(runtime): move service plugin to IDE - refactor(runtime): move service plugin to IDE - refactor(sdk): monitor-upload service and plugin - refactor: update-manager - refactor(sdk): performance plugin - refactor: extract fs - refactor(sdk): share-panel plugin for mp & mg - refactor: navigation-bar plugin - refactor: rollup build - refactor: split action and event - refactor: separate action and event - refactor: events -> listeners - refactor: use cache & proxy - refactor: bind props with relation - refactor: rename customevent -> events & emitEvents - refactor: separate component props into normal props and custom events - refactor: using async setup to init instance - refactor: 💡 add webpack utils.ts - refactor: use $emit event - refactor: 💡 addStyleRule - refactor: change action to string from object - refactor: 💡 ViewManager.\_destroyView - refactor: remove render.js suffix - refactor: change page url - refactor: 💡 change name - refactor: pass rendererId by context - refactor: change ready process - refactor: change native bridge interface - refactor: 💡 @compiler -> @mp/compiler - refactor: use single bridge - refactor: rpc init process - refactor: update rpc message struct - refactor: use two bridge to communicate - refactor: change rpc interface - refactor: change rpc interface ### Performance Improvements - perf: app-rpc msg encoder - perf: pre-create worker - perf(sdk): use local js-sha3 ### Misc - Revert "refactor(sdk): remove locationReadyManager " (#888) - Revert "fix: cherry-pick cachePromise of getSystemInfo " (#867) - revert(sdk): revert getPhoneNumber/getEmailAddress feature because IOS not ready yet - revert(sdk): rollback to use the old get-user-profile action - Revert "fix(sdk): update image component from img to div with background-image " (#309) - Revert "feat(mp-runtime): add webview plugin" - Revert "feat: 🎸 change page in app.json from object to array " (#119) - Revert "feat(project): add dev:all script " (#21) ### Internal - chore(cicd): yaml files - chore(changelog): update changelog for version v3.14.0 - chore(changelog): update changelog for version v3.14.0-dev.4 - chore(changelog): update changelog for version v3.13.3 - chore(changelog): update changelog for version v3.14.0-dev.3 - chore(changelog): update changelog for version v3.14.0-dev.2 - chore(changelog): update changelog for version v3.14.0-dev.1 - chore(changelog): update changelog for version v3.13.2 - chore(tools): remove cicd - chore: fix dockerfile - chore(changelog): update changelog for version v3.13.1 - docs(demo): update automator readme - update cicd tool - update cicd tool - docs(docs): provide troubleshooting for canvas dependencies installing issue - cicd tools - docs: remove duplicated changelog for 3.13.0 - chore(changelog): update changelog for version v3.13.0 - chore(changelog): update changelog for version v3.13.0 - docs: changelog for hotfix 3.12.2 - chore(changelog): update changelog for version v3.12.3 - chore(changelog): update changelog for version v3.13.0-dev.5 - chore(changelog): update changelog for version v3.13.0-dev.4 - chore(changelog): update changelog for version v3.13.0-dev.3 - chore(changelog): update changelog for version v3.13.0-dev.2 - docs(sdk): components docs - chore: changelog automation - docs(sdk): view & text components docs - chore(sdk): getperformance update - test: taskify-unit-test - chore: deploy extended-lib to prod env - docs: add typedoc doc to generate plugin docs - chore: test publish @mp/extended-lib on QA env - chore(demo): release prod demos - chore: publish @mp/extended-lib - chore(demo): bump component-demo-public prod version - chore(demo): release improve web3 api feature with component-demo app - chore(sdk): debug log - chore(demo): bump qa demo version for radio-issue - style(demo): add style of public - docs(bundler): add how to use pkg-cli - chore: webstudio release public-demo on prod - build: sync webview demo - build: sync-demos - chore: build with bump version from hotfix or local - chore: webstudio release public-demo on prod - chore: webstudio release public demo to prod - chore: rebuild webstudio public-demo - chore: prepare demo app release - chore: webstudio test disabledSubpackage - chore: webstudio test subPackage - chore: bump version - docs: mp-host overview - chore: bump version - chore: webstudio - chore: release component-demo - chore(sdk): delete RendererReady - Chore/webstudio - chore: test-webstudio - chore: add service.ts to files field - chore(sdk): update local gen-sdk mainfest.json version - chore: webstudio - chore: hide migrated pages for testing purpose - chore: webstudio config - chore: webstudio config - chore: webstudio config - chore: bump version - chore(sdk): cherrypick 3.10.1 to master - chore(release): mp-sdk v3.10.0 - chore: bump versions - chore: image url - build: issue template - chore: test webstudio auto submit - chore: studio publish mp-sdk - chore: test webstudio - chore: webstudio demo - chore: webstudio - chore: add 1st version of issue templates - chore(lib): bump versions cause by router query parameter feature - docs: update documents about how to test plugin - chore(sdk): cherry pick - delay 30s check app temporary - chore(sdk): cherry pick 3.9.2 to master - Merge branch 'master' into release/3.9 - docs: format readme - chore(sdk): cherry pick 3.9.2 to master - chore(sdk): cherry pick 3.9.2 to master - chore: add concurrency script - chore(release): mp-sdk v3.9.0 - chore: forgot to add .cjs suffix - chore: fix yarn release script - chore(demo): migrate component-demo to use cli 2.4.9 - chore: bump npm versions - chore: add @tarojs/react to dependencies of babel-preset-bmp - chore(cli): remove useless webpack alias - docs(runtime): added migration plugin - chore: bump version - docs(demo): how to add new feature on new demo app - chore: bump npm versions - chore: bump npm versions - chore: trigger packages republish - chore(sdk): drop compatibility code isLegacyAppJsLoaded - chore(doc): update mp-runtime doc troubleshooting - chore: update automator README & puppeteer package - docs(sdk): add special cases description - docs(runtime): test host plugin - Merge pull request #471 from finley-x/release/3.8 - Merge branch 'master' into release/3.8 - chore: bump npm versions - chore(release): mp-sdk v3.8.0 - docs: plugin integrate with IDE & release - chore: add wallet created action - docs: how to development mp runtime - docs: add plugin docs - chore: set --unhandled-rejections=warn with jest to fix unit-test on node16 - chore: add @mp/mp-runtime-shared-plugins - chore: bump versions - chore: throw typescript check error - chore: bump mp-runtime version - chore: pre commit disallow empty files - Merge pull request #423 from finley-x/release/3.7.4 - chore(cli): re-trigger bump CLI v2.3.3 - chore: organize mono workspaces - chore(sdk): release/3.7.3 -> master - chore(sdk): restore yml - chore(sdk): restore yml - test(sdk): logger test update - chore(release): mp-sdk v3.7.2 - test(runtime): add inner audio unit tests - chore(sdk): canvas plugins - test(lib): improve logger unit tests - ci: commitlint allow multiple scopes - test(lib): add logger unit tests - chore(sdk): fix fs plugin demos - ci: fix commit-lint issue - chore(sdk): demo for fs and orientation plugin - chore: bump version to 1.1.0 - chore(sdk): fix Circular dependencies - chore(cli): downgrade Taro to 3.2.13 - chore(bundler & sdk): move patches to root of workspace - chore(bundler): add compiler-dom.d.ts - chore(bundler): use tsc to build bundler - build: fix cli build & render dev mode - test: remove jest errors - build(lib): update runtime-worker-common build script - test(sdk): fix report test error - test(sdk): fix report test error - chore: use tsc to build cli - chore: logger error caused by navigation-bar - build: fix validate sdk output & add runtime-worker-common as deps of MP_ONLY - chore: merge release/3.6 - chore: integrate v3.5.2 - Merge pull request #168 from kami-c/feature/test-ci-5 - Merge pull request #167 from fe/\_\_release-mp-sdk_prod_1.0.1_c7aa75d45e4516e684e941c544935c32a862b2ca_1646900584973 - release mp-sdk v1.0.1 - Merge pull request #154 from henry-w/mono-sdk-3.4.0 - moved from mono 3.4.0, add prowjob + config - Merge pull request #152 from michael-xu/feature/mp-slider - Merge pull request #151 from myron-li/dev - Merge pull request #150 from myron-li/dev - Merge pull request #148 from chengfan-lin/mp-cli-build-bundle-zip - Merge pull request #149 from myron-li/dev - Merge pull request #147 from myron-li/dev - Merge pull request #146 from michael-xu/feature/radio - update - Merge pull request #145 from myron-li/refactor-build - Merge pull request #144 from myron-li/fix-build - Merge pull request #143 from james-l/feat/patches - unit the style of module import - use cross-spwan instead of child_process - add livereload for dev server - clean up package.json of cli - added a link cmd to make it easy to install cli added cli related document - Merge pull request #142 from michael-xu/fix/origin-bundler-with-path - do patches before build - Merge pull request #139 from myron-li/work - chore: 🤖 update yarn.lock - Merge pull request #136 from myron-li/html-worker-container - Merge pull request #135 from luffy-wang/fix-for-debugger - Merge pull request #131 from myron-li/add-actions - Merge pull request #126 from myron-li/refactor-rpc - Merge pull request #125 from myron-li/MYRON-1 - Merge pull request #124 from myron-li/dev - Merge pull request #97 from michael-xu/feature/custom-event - Merge pull request #120 from james-l/Feature/watch-mode-bundler - added exception catching in bundle script of watch mode - test: 💍 add cid equal test case - complete w -> watch as watch mode argument - chore: upgrade vue - Merge pull request #121 from myron-li/toast - added the bundler usage to README.md - add watching mode for bundler - Merge pull request #117 from myron-li/action - Merge pull request #109 from luffy-wang/enhance-request - chore: 🤖 update service assets - Merge branch 'master' of https://git.toolsfdg.net/fe/mini-program into enhance-request - Merge pull request #115 from chengfan-lin/api-taro - Merge branch 'master' into feature/custom-event - Merge pull request #114 from bowen-zhu/feature/bundler - Merge branch 'master' of https://git.toolsfdg.net/fe/mini-program into enhance-request - Merge pull request #113 from myron-li/MYRON-1 - chore: fix typo - Merge pull request #111 from chengfan-lin/api-taro - Merge pull request #112 from james-l/simplify-taro-plugin - make bxss generate correct sourcemap when is in development - simplify taro plugin and make it work as an npm package - Merge pull request #108 from luffy-wang/add-icon - Merge pull request #107 from james-l/fix/yarn-command-of-build-taro-plugin - Merge pull request #106 from myron-li/batch-updated - optimize: batch setData call - Merge pull request #105 from michael-xu/feature/components - Merge pull request #104 from myron-li/optimize - chore: optimize build - Merge pull request #103 from bowen-zhu/fix/bunlder - Merge pull request #102 from james-l/fix/sourcemap-of-css - dont let bxss generate sourcemap - Merge pull request #101 from james-l/change-output-of-taro-plugin - Merge branch 'master' into change-output-of-taro-plugin - added components definitions of uikit requirements - test: 💍 add test cases - use tsc instead of rollup as the packer - Merge pull request #95 from myron-li/refactor - add sourcemap to bjs files - use a modified app loader instead of origin one - let page's code export via umd - make output of the page scripts ends with .bjs - Merge pull request #87 from bowen-zhu/feature/app-bundler - chore: 🤖 remove bundled files - chore: 🤖 add todos - chore: 🤖 rename .tpl -> .bxml - chore: 🤖 update package.json - test: 💍 update test cases - test: 💍 update test cases - Merge pull request #90 from james-l/Feature/taro-integration - add components - Merge pull request #91 from myron-li/custom-event - chore: custom component - add code to support lifecycle callback of taro for Page object - added REDME to taro plugin package - add taro platform plugin into repository - Merge pull request #89 from myron-li/bundle-demo - chore: add example - Merge pull request #88 from myron-li/rename - chore: rename - Merge pull request #84 from myron-li/taro - chore: 🤖 build bundler by tsc - Merge pull request #79 from michael-xu/feature/mp-components - chore: 🤖 split bundler - Merge pull request #77 from bowen-zhu/feature/bundler - test: 💍 remove useless test fixtures - test: 💍 add basic fixtures - Merge pull request #78 from myron-li/runner - chore: 🤖 remove unused example - Merge pull request #74 from bowen-zhu/feature/loader - test: 💍 add runInDom test function - chore: 🤖 rename and remove useless code - Merge branch 'master' of https://git.toolsfdg.net/fe/mini-program - chore: 🤖 setup bundler - chore: 🤖 add compiler example - merge upstream master - chore: update example - Merge branch 'master' of https://git.toolsfdg.net/fe/mini-program - add weather app demo - Merge pull request #71 from myron-li/fix-page-hooks - chore: 🤖 rename types - Merge pull request #69 from bowen-zhu/feature/runner - chore: 🤖 types - chore: 🤖 navigate in worker - chore: renemae variable - chore: update example - chore: rename variables - Merge pull request #68 from myron-li/navigator-redirect - Merge pull request #66 from bowen-zhu/fix/runner - Merge pull request #65 from myron-li/page-url - Merge pull request #64 from myron-li/app-js - Merge pull request #60 from bowen-zhu/feature/runner-navigation - chore: 🤖 remove redundant code - chore: 🤖 rename function names - chore: 🤖 add response interface - chore: 🤖 update types and ui - Merge pull request #63 from myron-li/integrate-app-and-page - Merge pull request #57 from myron-li/navigator - Merge pull request #54 from luffy-wang/add-app - enhance - create once only - Merge pull request #52 from sora-liu/master - typos - add createApp and interfaces - chore: rename pageid to rendererid - chore: 🤖 update compiler fixture - Merge pull request #51 from myron-li/init-process - chore: 🤖 build prod version - Merge pull request #48 from bowen-zhu/feature/compiler - chore: 🤖 compiler dir structure - Merge pull request #46 from myron-li/single-bridge - Merge pull request #45 from myron-li/multi-page - refacotr: change rpc message definition - Merge pull request #44 from myron-li/test - test: add component test - Merge pull request #43 from myron-li/setup-test - chore: setup jest - Merge pull request #40 from myron-li/fix-compatibility - Merge pull request #39 from myron-li/format - Merge pull request #38 from myron-li/compiler-helper - Merge pull request #37 from myron-li/worker-render-protocol - Merge pull request #36 from myron-li/update-rpc - change rpc - Merge pull request #34 from myron-li/mock-service - Merge pull request #32 from myron-li/bridge-ready - Merge pull request #31 from myron-li/multi-bridge - Merge pull request #30 from luffy-wang/change-rpc - Merge pull request #27 from myron-li/build-sdk - chore: add command to generate sdk - Merge pull request #26 from myron-li/cleanup - Merge pull request #25 from shenxiang-feng/master - Merge pull request #23 from luffy-wang/add-compile-functions - Merge pull request #19 from myron-li/patch - chore: update readme - chore: update readme - Merge pull request #10 from myron-li/dev-script - chore: 🤖 add todo - chore: rename packages - chore: 🤖 project setup - chore: 🤖 add @types/node - chore: 🤖 add eslint and prettier - chore: 🤖 build ts files - chore: 🤖 add lerna - init - wip - init ## [3.14.5] 2022-11-09 **Download: [SDK-3.14.5](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.5.zip)** ### Features - feat(sdk): add page-frame-resource points ## [4.0.1] 2022-11-04 **Download: [SDK-4.0.1](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.0.1.zip)** ### Bug Fixes - fix(sdk): env undefined ### Internal - chore(cicd): yaml files ## [3.14.4] 2022-11-03 **Download: [SDK-3.14.4](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.4.zip)** ### Features - feat(sdk): shareAppMessage support fallback url ### Internal - chore(cicd): yaml files ## [4.0.0] 2022-10-25 **Download: [SDK-4.0.0](https://ftp.binance.com/mp-sdk/prod/mp-sdk-4.0.0.zip)** ### Bug Fixes - fix(demo): update webgl demo with rgba - fix(demo): payment request use success callback instead - fix(sdk): useNativeImage - fix(mpp-service): copy source-code ignore node_module & hidden files - fix(sdk): fix image and keep **MP_WARN_DEPRECATED** - fix(sdk): gcanvas toDataURL and audio time update event - fix(server-side-bundle): upload bytecode pkg issue - fix(sdk): getUserProfile mini game doesn't need check tap event - fix(demo): native input width zero in android when container is a flex box - fix(sdk): reuqest text no response - fix(bundler): update dependencies to fix pkg-cli - fix(bundler): support error stack link jump of dev mode page.worker.js ### Features - feat(sdk): support multiple intersectionObserver - feat(sdk): navigateTo add target external - feat(sdk): update canIUse for new api - feat(runtime): downloa-package add two fields - feat(bundler): add monitor NEZHA_RENDER_PAGE_JS & update sorter of pkg - feat(host): remove canvas useless dep - feat(sdk): remove deprecated items for sdk4.0 - feat(sdk): getSystemInfo cache - feat(server-side-bundle): compile & upload worker code into bytecode when enableBytecode - feat(sdk): bump versions - feat(sdk): bump version for ide deps - feat(sdk): validate current page is tabBar page when call tabBar apis - feat(demo): update prod demo - feat(sdk): plugin createIntersectionObserver and fix selectorQuery setTimeout issue - feat(sdk): detect darkmode for appBaseInfo - feat(sdk): load app js advance after worker send $Ready - feat(sdk): generate bytecode for worker-service - feat(sdk): gcanvas buffer data optimize - feat: native image - feat(bundler): add new package node-qjsc - feat(sdk): getAppBaseInfo & getWindowInfo & getDeviceInfo - feat(runtime): expose updateBackground of create webview service for ide - feat(sdk): $renderer-ready action - feat(sdk): loadScriptSync method ### Misc - Revert "Revert "refactor(sdk): remove locationReadyManager " (#888)" (#929) ### Internal - chore(changelog): update changelog for version v3.14.3 - chore(changelog): update changelog for version v4.0.0-dev.3 - chore(runtime): add currentSize filed - chore: update public demo - chore(sdk): automator package rename - chore(changelog): update changelog for version v4.0.0-dev.2 - chore(changelog): update changelog for version v3.14.2 - chore: update public demo - chore: component-demo - chore: bump npm versions - chore(changelog): update changelog for version v4.0.0-dev.1 - chore(changelog): update changelog for version v3.14.1 ## [3.14.3] 2022-10-24 **Download: [SDK-3.14.3](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.3.zip)** ### Features - feat(sdk): generate bytecode for worker-service ## [3.14.2] 2022-10-17 **Download: [SDK-3.14.2](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.2.zip)** ### Features - feat(sdk): toDataURL and getuserprofile ## [3.14.1] 2022-10-05 **Download: [SDK-3.14.1](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.1.zip)** ### Bug Fixes - fix(demo): fix benchmark - fix(sdk, demo): check promise polyfill by using \_\_\_mp_polyfill - fix(demo): public demo read file - fix(sdk): native-cover-view not work when using taro - fix(demo): two-fa demo scene data is undefined - fix(demo): pull down refresh not works ### Features - feat(sdk): chainId should be number when pass to native - feat(demo): add promise polyfill demo for QA regression - feat: web host cli - feat(demo): release demo on QA env - feat(cli): cover-view support hover-class ### Internal - chore(changelog): update changelog for version v3.14.0 - chore(changelog): update changelog for version v3.14.0-dev.4 ## [3.14.0] 2022-09-29 **Download: [SDK-3.14.0](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.14.0.zip)** ### Bug Fixes - fix(sdk): cache promise online with polyfill - fix(sdk): mini game audio adapter - fix: disable ed and add @deprecated flag - fix(sdk): changelog issue - fix(sdk): callbackId could be zero - fix(sdk): input scrollbar css issue on android - fix(sdk): isCache undefined issue - fix(mpp-service): fix status api empty fail message - fix(sdk): add properties on webgl context - fix(sdk): fix timeOrigin 0 issues on IOS14 - fix(runtime): cannot resolve the font with url "bnshare://" - fix(sdk): fix getperformance firstRender - fix: cherry-pick cachePromise of getSystemInfo - fix(sdk): use promise polyfill fix promise task order in ios12 - ios14 - fix(sdk): error code detection of remote debug - fix(sdk): requestAnimationFrame NaN - fix(automator): web cli core apis - fix: add dependency to pass build job - fix(sdk): performance init appLaunch payload - fix: getPerformance first-render ### Features - feat(demo): improve twoFa demo - feat(demo): remove webauthn demo - feat(bundler): add statistics mode to pkg-cli & feat(mpp-service): support config msv - feat(sdk,demo): add private fps api and benchmark for render fps - feat(sdk): cache promise reject handler - feat(sdk): getperformance-evaluateScript - feat(lib): add promise polyfill source code and descreption - feat(sdk): gcanvas async method - feat(server-side-bundle): use X-Mp-Open-Api-Token to authorize - feat(sdk): add warn deprecated info for sdk 4.0 - feat(sdk): support injected prop in webview component - feat(sdk): add experimental on walletconnector - feat(bundler): support include options in project.config.json - feat(sdk): error with stack - feat(sdk): new render point NEZHA_INJECT_RENDERER_JS_END & update timeline point info - feat(lib): use body class to control theme rather than prefers-color-scheme - feat(lib): remote-debug route-change-done notify to render - feat(cli): add props to webview - feat(sdk): mpRuntimeLogger rename & add error code - feat(sdk): webgl finish api - feat(mpp-service): output version info to MPP_SERVICE_OUTPUT.json - feat(sdk): time app check after app-launch - feat(bundler): impl util-function analyzeSource & remove AddEntryAppJsPlugin ### Refactor - refactor(sdk): remove locationReadyManager ### Performance Improvements - perf: app-rpc msg encoder - perf: pre-create worker - perf(sdk): use local js-sha3 ### Misc - Revert "refactor(sdk): remove locationReadyManager " (#888) - Revert "fix: cherry-pick cachePromise of getSystemInfo " (#867) ### Internal - chore(changelog): update changelog for version v3.13.3 - chore(changelog): update changelog for version v3.14.0-dev.3 - chore(changelog): update changelog for version v3.14.0-dev.2 - chore(changelog): update changelog for version v3.14.0-dev.1 - chore(changelog): update changelog for version v3.13.2 - chore(tools): remove cicd - chore: fix dockerfile - chore(changelog): update changelog for version v3.13.1 - docs(demo): update automator readme - update cicd tool - update cicd tool - docs(docs): provide troubleshooting for canvas dependencies installing issue - cicd tools - docs: remove duplicated changelog for 3.13.0 - chore(changelog): update changelog for version v3.13.0 - chore(changelog): update changelog for version v3.13.0 ## [3.13.3] 2022-09-26 **Download: [SDK-3.13.3](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.13.3.zip)** ### Features - feat(sdk): android cache promise ## [3.13.2] 2022-09-20 **Download: [SDK-3.13.2](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.13.2.zip)** ### Misc - Revert "fix(sdk): cache promise for getSystemInfo " (#866) ## [3.13.1] 2022-09-16 **Download: [SDK-3.13.1](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.13.1.zip)** ### Bug Fixes - fix(sdk): cache promise for getSystemInfo - fix(sdk): requestAnimationFrame NaN ## [3.13.0] 2022-09-02 **Download: [SDK-3.13.0](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.13.0.zip)** ### Bug Fixes - fix(sdk): delete useless report - fix(sdk): loading when expect route-change type - fix(sdk): remove cachePromise to fix ios 13 eventloop issue - fix(sdk): fix: fix to signature error when include specific data struct issue - fix(sdk): remove type check in wallet-connect plugin - fix(sdk): gcanvas texImage2D flushnative - fix(sdk): fix taskify cache fail - fix(sdk): remove canvas service code - fix(sdk): fix applaunch-getPerformance - fix(sdk): fix webview sdk - fix(mpp-service): publish issue - fix(sdk): fix mg api host register ### Features - feat(mpp-service): output hostQrcode to a file - feat(sdk): sdk-loading - feat(lib): remote-debug new action & ignore native side delay error - feat(sdk): create webview sdk & demo - feat(runtime): disable click when loading display - feat(sdk): gcanvas supports cocos - feat(bundler): use zlib to compress pkg - feat(sdk): setInterval 0 with warning - feat(sdk): add api requestSubscribeMessage - feat(sdk): make-phone-call - feat(runtime): @mp/host catch error and send to parent window - feat(sdk): canvas to temp file path api and demo - feat(sdk): add FP/FCP/LCP entry for performance API - feat(demo): add readfile api to benchmark - feat(sdk): add route-change-done event to fix route entry negative duration - feat(demo): add apiBenchmark at globalThis to run customize api benchmark - feat(demo): add extended-libs page - feat(demo): demo for webgl - feat(cli): quick publish for dev & qa ### Refactor - refactor(sdk): delete gcanvas useless code ### Internal - docs: changelog for hotfix 3.12.2 - chore(changelog): update changelog for version v3.12.3 - chore(changelog): update changelog for version v3.13.0-dev.5 - chore(changelog): update changelog for version v3.13.0-dev.4 - chore(changelog): update changelog for version v3.13.0-dev.3 - chore(changelog): update changelog for version v3.13.0-dev.2 - docs(sdk): components docs - chore: changelog automation - docs(sdk): view & text components docs - chore(sdk): getperformance update - test: taskify-unit-test - chore: deploy extended-lib to prod env - docs: add typedoc doc to generate plugin docs ## [3.12.3] 2022-09-01 **Download: [SDK-3.12.3](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.12.3.zip)** ### Bug Fixes - fix(sdk): iOS 13.8 promise eventloop issue ### Internal - chore: changelog automation (#808) ## [3.12.2] 2022-08-31 **Download: [SDK-3.12.2](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.12.2.zip)** ### Bug Fixes - fix(sdk): fix taskify cache fail ## [3.12.1] 2022-08-12 **Download: [SDK-3.12.1](https://ftp.binance.com/mp-sdk/prod/mp-sdk-3.12.1.zip)** ### Bug Fixes - fix(sdk): navigateBackMiniProgram extra data should transform to string - fix(sdk): fix blank screen issue when relaunch because of taskify - fix(demo): public demo - fix(sdk): getCurrentPages error handler - fix(demo): textarea confirm-type ### Features - feat(sdk): add mt_start when monitorupload setdata - feat(extended-lib): integrate distribution API (test on dev env) - feat(cli): support plugins ### Internal - chore: test publish @mp/extended-lib on QA env - chore(demo): release prod demos - chore: publish @mp/extended-lib - chore(demo): bump component-demo-public prod version - chore(demo): release improve web3 api feature with component-demo app --- ## Document: Download Development Version URL: /en/dev-docs/products/mini-program/framework/download-development # Download Development Version ## [5.12.0-dev.2] 2026-04-28 **Download: [5.12.0-dev.2(2.80 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.12.0-dev.2.zip)** ### Features - feat(sdk): editor support rtl ## [5.12.0-dev.1] 2026-04-26 **Download: [5.12.0-dev.1(2.80 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.12.0-dev.1.zip)** ### Features - feat(host): add RTL text direction and custom text align for editor ## [5.12.0-dev.0] 2026-04-21 **Download: [5.12.0-dev.0(2.80 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.12.0-dev.0.zip)** ### Bug Fixes - fix(sdk): add NODE_OPTIONS=--openssl-legacy-provider for Node 17+ build compat in renderer-mp - fix(host): remove copy webpack plugin to fix copy-webpack-plugin v11 compat - fix(host): add tslib 2.8.1 resolution for Node 24 exports compatibility - fix(host): pin isolated-vm to 6.1.2 for Node 24 / C++20 compatibility - fix(host): remove isolated-vm resolution, not used in project - fix(host): return align and divider in editor mark, revert keepOnSplit override - fix(cli): auto-recover from adb INSTALL_FAILED_UPDATE_INCOMPATIBLE - fix(ide-cli): prevent infinite recursion in console-to-WebSocket forwarding ### Features - feat(bundler): renderer components support shared chunks - feat(native-cli): add Android inspector and native MCP tooling ## [5.11.0-dev.2] 2026-04-02 **Download: [5.11.0-dev.2(2.76 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.11.0-dev.2.zip)** ### Bug Fixes - Fix/mp renderjs missing - fix(sdk): add backward compatibility for ViewPager2 in SwiperView - Fix/native cli preview UI layout - Fix/type 0331 ### Features - feat(sdk): add QJS bytecode compilation for renderer-service-hummer - feat(sdk): support virtual appid for widget ## [5.11.0-dev.1] 2026-03-31 **Download: [5.11.0-dev.1(2.21 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.11.0-dev.1.zip)** ### Bug Fixes - fix(cli): bundle native-cli resources and resolve adb - fix: showErrorPage for 600402 page_not_found error - fix(sdk): mcp bin - fix(lib): fix ide cli toolbar sync api - fix(cli): ide cli node version match ### Features - feat(sdk): add useNewWindow parameter to previewImage API - feat(cli): native-cli & ide-cli-mcp-server recover capabilities improve - Feat/ios orba - feat(cli): mcp tool stability improve - feat(sdk): screen cast - feat(cli): ide cli mcp server sync - feat(cli): add mobile screen viewer and simulator host capture ## [5.10.0-dev.2] 2026-03-11 **Download: [5.10.0-dev.2(2.21 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.10.0-dev.2.zip)** ### Bug Fixes - fix(sdk): fix video props type - fix(native-cli): prevent host hang on Ctrl+C ### Features - feat(sdk): support root portal to specific element - Feat/hummer lcp - feat(cli): sub mode default render path - feat(cli): native cli UI bridge - feat(cli): orba desktop mp side work - feat(cli): make get_log_files as example - feat(cli): native cli UI dev env - feat(cli): init native-cli project ## [5.10.0-dev.1] 2026-03-03 **Download: [5.10.0-dev.1(2.21 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.10.0-dev.1.zip)** ### Features - feat: fix error when stack is empty ## [5.9.0-dev.1] 2026-02-17 **Download: [5.9.0-dev.1(2.21 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.9.0-dev.1.zip)** ### Bug Fixes - fix(sdk): swiper autoheight child item ### Features - Feat/hummer swiper - Feat/hummer event - feat(cli): use custom ios runtime version - feat(cli): ios simulator support - feat(bundler): show error page when load module error ### Misc - Revert " fix(sdk): sortable items when height changes " (#2522) (#2541) ## [5.8.0-dev.1] 2026-01-29 **Download: [5.8.0-dev.1(2.21 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.8.0-dev.1.zip)** ### Bug Fixes - fix(sdk): cherry pick 5.7.1 - fix(sdk): sortable items when height changes - fix(sdkl): wallet prerender failed ### Features - feat(sdk): hummer gcanvas - feat(sdk): load appjs when reload worker - feat(sdk): enhance native event channel for CustomNativeComponent - feat(cli): miniprogram mcp server - feat(cli): more function in devtool ## [5.8.0-dev.1] 2026-01-28 **Download: [5.8.0-dev.1(1.88 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.8.0-dev.1.zip)** ### Bug Fixes - fix(sdk): sortable items when height changes - fix(sdkl): wallet prerender failed ### Features - feat(sdk): enhance native event channel for CustomNativeComponent - feat(cli): miniprogram mcp server - feat(cli): more function in devtool ## [5.7.0-dev.2] 2026-01-07 **Download: [5.7.0-dev.2(1.87 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.7.0-dev.2.zip)** ### Bug Fixes - fix(sdk): rm geature event listener binding ### Features - feat(sdk): hummer button functions - feat(sdk): support createContext with customNativeComponent widget rendererId ## [5.7.0-dev.1] 2025-12-29 **Download: [5.7.0-dev.1(1.87 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.7.0-dev.1.zip)** ### Bug Fixes - fix(sdk): rm geature event listener binding ### Features - feat(sdk): add internal doc site - feat(cli): auto perf ## [5.6.0-dev.2] 2025-12-19 **Download: [5.6.0-dev.2(1.87 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.6.0-dev.2.zip)** ### Bug Fixes - fix(sdk): fix prerender inject data path ## [4.51.5-dev.1] 2025-12-18 **Download: [4.51.5-dev.1(1.85 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.51.5-dev.1.zip)** ### Features - feat(bundler): update terser - feat(sdk): theme getter in systemInfo incorrect ## [5.6.0-dev.1] 2025-12-18 **Download: [5.6.0-dev.1(1.87 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.6.0-dev.1.zip)** ### Bug Fixes - fix(sdk,bundler): init nativeScrollNegotiation/enableBackToTop config - fix(sdk): reuse page issue on ios platform - fix(sdk): text dont filter nest components - fix(sdk): chain routechange handler when receviced multiple routechange - fix(lib): add missing code back to protect web import ### Features - feat(sdk): add extra type - feat(sdk): support debug prefetch configuration - feat(sdk): lottie comp support animationData props - feat(bundler): update terser avoid bugs of old ver ## [5.5.0-dev.1] 2025-11-27 **Download: [5.5.0-dev.1(1.80 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.5.0-dev.1.zip)** ### Features - feat(sdk): add private api getVisibilityState - feat(sdk): input support force-decimal-dot - feat(sdk): fliter standalone chunk js for bytecode pkg - feat(sdk): support webview markdown list style - feat(cli): release 1.0.0 stable version - feat(cli): dx improve ## [5.4.0-dev.2] 2025-11-06 **Download: [5.4.0-dev.2(1.80 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.4.0-dev.2.zip)** ### Features - feat(sdk): page timeline add check point ## [5.4.0-dev.1] 2025-11-05 **Download: [5.4.0-dev.1(1.80 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.4.0-dev.1.zip)** ### Bug Fixes - fix(sdk): cp view based sdk 5.0 issue - fix(sdk): cp tab area scroll - fix(sdk): render data and prerender data independent to resolve flutter blink - fix(sdk): ignore preload font on flutter - fix(bundler): compatibility for old android ### Features - feat(sdk): editor chart UI revamp - feat(sdk,bundler): customize renderer components - feat(sdk): add debug - feat(sdk): b8 widget custom lifecycle - feat(extendedLib): extended lib ci and checksum ## [5.3.0-dev.1] 2025-10-16 **Download: [5.3.0-dev.1(1.80 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.3.0-dev.1.zip)** ### Features - feat(sdk): update value for input - feat(script): add dev tag for publish-dev - feat(sdk): add scrollOffset for pageScrollTo - feat(sdk): support access node in SelectQuery - feat(sdk): flutterToImage and nativeComponent for iOS webview renderer - feat(sdk): remove root style 100% - feat(mpp-service): use label as rev ## [4.52.0-dev.1] 2025-10-14 **Download: [4.52.0-dev.1(1.85 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.52.0-dev.1.zip)** ### Features - feat(sdk): support custom native component in iOS ## [5.3.0-dev.1] 2025-10-10 **Download: [5.3.0-dev.1(1.81 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.3.0-dev.1.zip)** ### Bug Fixes - fix(cli): version sort ### Features - feat(sdk): remove root style 100% - feat(mpp-service): use label as rev ## [5.2.0-dev.1] 2025-09-25 **Download: [5.2.0-dev.1(1.81 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.2.0-dev.1.zip)** ### Bug Fixes - fix(sdk): fix prerender measure - fix(sdk): sdk5.2 cherry pick bn.removeWidgetSkeleton - fix(sdk): inst id not exist - fix(sdk): sdk5.2 cherry pick usePageScroll - fix(sdk): sdk5.x hummer log & nezha debug flag - fix(sdk): hotfix scrollview - fix(sdk): avoid XSS attack - fix(sdk): mounted to ensure nativeComponents context ready and dom instanceId for native widget map - fix(mpp-service): ai meta info upload without widgets - fix(sdk): remove unused log ### Features - feat(sdk): call all api - feat(sdk): preload font - feat(mpp-service): add widget qrcode request logic - feat(bundler): update widgetConfigs - feat(cli): dynamic bundle version support - feat(sdk): video class name - feat(cli): clean code & fix no-qjs flag & fix fs-extra copy failed - feat: add preload-worker - feat(cli): use libversion ## [4.51.0-dev.1] 2025-09-25 **Download: [4.51.0-dev.1(1.85 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.51.0-dev.1.zip)** ### Features - Feat call all - feat(sdk): sdk4.x support support formatter for all echart options ## [5.1.4-dev.2] 2025-09-22 **Download: [5.1.4-dev.2(1.81 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.1.4-dev.2.zip)** ### Features - feat(sdk): bn.removeWidgetSkeleton ## [5.1.4-dev.1] 2025-09-19 **Download: [5.1.4-dev.1(1.81 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.1.4-dev.1.zip)** ### Bug Fixes - fix(sdk): usePageScroll hooks not work - fix(sdk): hummer renderer support update single child ## [5.1.0-dev.1] 2025-09-03 **Download: [5.1.0-dev.1(1.81 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-5.1.0-dev.1.zip)** ### Bug Fixes - fix(bmp): pika ci error - fix(sdk): fix resolve native comp & input update timestamp - fix(sdk): render child node directly when component need children vnode - fix(sdk): host mini app events and setData damaged by widget flow - fix: revert comment - fix(sdk): @binance/bmp-xx deps - fix(sdk): scrollViewUpdate rendererId undefined - fix(lib): define EMPTY_OBJ ### Features - feat(lib): support legacy dynamic widget slot - feat(lib): release prod bmp-components and bmp-react - feat(bundler): remove prerender data after build in - feat(lib): update bmp component for ts - feat(lib): support legacy widget-slot - feat(sdk): update systemInfo cache when shellapp not restart - feat(sdk): prerender remove skeleton auto - feat(sdk): prerender support combined data - feat(lib): update typo and EMPTY_OBJ - feat(sdk): update taro-bn-components - feat(lib): remove useTheme - feat(bundler): support bundler version ### Misc - Revert "Merge master" - revert: root condition in setData ## [4.50.0-dev.1] 2025-09-03 **Download: [4.50.0-dev.1(1.85 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.50.0-dev.1.zip)** ### Bug Fixes - fix(sdk): mounted to ensure nativeComponents context ready and dom instanceId for native widget map - fix(mpp-service): ai meta info upload without widgets - fix(sdk): remove unused log ### Features - feat(sdk): video class name - feat(cli): clean code & fix no-qjs flag & fix fs-extra copy failed - feat: add preload-worker - feat(cli): use libversion - feat(bundler): support bundler version ## [4.48.0-dev.3] 2025-07-25 **Download: [4.48.0-dev.3(1.85 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.48.0-dev.3.zip)** ### Bug Fixes - fix(sdk): relaunch deeplink issue - fix(sdk): fix swiper autoplay ## [4.48.0-dev.2] 2025-07-24 **Download: [4.48.0-dev.2(1.85 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.48.0-dev.2.zip)** ### Features - feat(sdk): revert autoheight default value to false ## [4.48.0-dev.1] 2025-07-24 **Download: [4.48.0-dev.1(1.85 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.48.0-dev.1.zip)** ### Bug Fixes - Fix/swiper 0708 - fix(sdk): deeplink with data loader issue - fix(sdk): exports utils - fix(sdk): export bmp component utils - fix(sdk): scroll X in scroll Y ### Features - feat(sdk): swiper autoHeight - feat(sdk): mp plugin support AbortSignal - feat(sdk): add require error log - feat(cli): bundle watch process not exiting correctly - feat(cli): add error handler for ios debug target query - feat(cli): support inspect webview/webf with native devtool protocol message ### Misc - Revert "fix(sdk): export bmp component utils" ## [4.47.0-dev.3] 2025-07-03 **Download: [4.47.0-dev.3(1.84 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.47.0-dev.3.zip)** ### Bug Fixes - fix(sdk): expose the error before app init ### Features - feat(sdk): support nested scroll view - feat(sdk): blank detector - feat(sdk): support typewriter effect for flutter markdown - feat(sdk): support playsinline for video - feat(sdk): use \_\_mp_runtime_config.screenWidth for set rem - feat(mpp-service): add report file size functions - feat(extended-lib): mpp runtime vendor ## [4.47.0-dev.2] 2025-06-30 **Download: [4.47.0-dev.2(1.80 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.47.0-dev.2.zip)** ### Features - feat(sdk): new api bn.addPhoneCalendar & bn.addPhoneRepeatCalendar ## [4.47.0-dev.1] 2025-06-24 **Download: [4.47.0-dev.1(1.80 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.47.0-dev.1.zip)** ### Features - feat(cli): add meta info indicator and every day tip - feat(sdk): add new svg component demo ## [4.46.0-dev.3] 2025-06-13 **Download: [4.46.0-dev.3(1.80 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.46.0-dev.3.zip)** ### Features - feat(sdk): not set dataurl on style change ## [4.46.0-dev.2] 2025-06-13 **Download: [4.46.0-dev.2(1.80 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.46.0-dev.2.zip)** ### Features - feat(sdk): w3w timeline monitor ## [4.46.0-dev.1] 2025-06-11 **Download: [4.46.0-dev.1(1.80 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.46.0-dev.1.zip)** ### Bug Fixes - fix(sdk): hide home button api - fix(server-side-bundle): add bundler as dep ### Features - feat(sdk): flutter svg class support - feat(sdk): add ios timeline log fit regexp - feat(sdk): virtualList support size by function - feat(sdk): remove set rem in flutter - feat(sdk): add createEventSource support for IDE - feat(sdk): add `max-lines` for text-span - feat(sdk): support page preload - feat(sdk): negotiation scroll with native on Android - feat(extended-lib): use dynamicExtendedLib for all the libs and remove upload builtIn lib ## [4.45.3-dev.1] 2025-05-22 **Download: [4.45.3-dev.1(1.80 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.45.3-dev.1.zip)** ## [4.45.0-dev.1] 2025-05-14 **Download: [4.45.0-dev.1(1.73 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.45.0-dev.1.zip)** ### Features - feat(sdk): suspend & resume lifecycle ## [4.44.0-dev.1] 2025-04-29 **Download: [4.44.0-dev.1(1.73 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.44.0-dev.1.zip)** ### Bug Fixes - fix(sdk): set scroll top not work / request support enableCache - fix(sdk): `show-scrollbar` doesn't work ### Features - feat(sdk): support keyboard accessory item - feat(sdk): remove sync api - feat(sdk): domtoimage can ignore error when image not exist or load error - feat(sdk): scrollview support enableBackToTop - feat(sdk): showErrorPage support auto detect rendererId - feat(sdk): flutter scrollView add events - feat(cli): achieve pkg stability & log process stability optimization - feat(host): support five themes - feat(cli): support mcp refresh - feat(sdk): remove hack worker patch - feat(sdk): add dark_midnight support - feat(bundler): support polyfill self and XMLHttpRequest - feat(bundler): dynamic path by env. BUNDLER_PATCH - feat(extended-lib): support extended lib uikit flow - feat(host): support midnight ## [4.43.0-dev.2] 2025-04-10 **Download: [4.43.0-dev.2(1.72 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.43.0-dev.2.zip)** ### Bug Fixes - fix(sdk): flutter getAttribute polyfill ## [4.43.0-dev.1] 2025-04-09 **Download: [4.43.0-dev.1(1.72 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.43.0-dev.1.zip)** ### Bug Fixes - fix(sdk): fix input textarea type adjustPosition ### Features - feat(sdk): alpha chart for editor - feat(sdk): new component flutter markdown - feat(sdk): add `` & `` components - feat(sdk): support get prefetch data synchronous - feat: update process-md-paths - feat(cli): log process status indicator - feat: update md jobs - feat: add job to convert md path - feat(cli): filter standalone-chunks while addEntry - feat(sdk): input support max-digits-length - feat(cli): use release version devtool - feat(sdk): add runtime-plugin-create-event-source - feat(cli): chrome devtools Integration - console - feat: update llms.txt title and filter docs - feat: add upload-docs-md job ## [4.42.0-dev.1] 2025-03-18 **Download: [4.42.0-dev.1(1.72 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.42.0-dev.1.zip)** ### Bug Fixes - fix(sdk): add LCP report target - fix(sdk): drawer component visible when mounted - fix(mpp-service): fix qjs build for Andriod - fix(demo): pika no longer support `independent` ### Features - feat(cli): improve achieve stability - feat(cli): adjust glob params - feat(cli): manual update qjsc version - feat(cli): add syncPackInclude flag - feat(bmp): add direction type for sortable - feat(runtime): add api `fs.removeSavedFile` - feat(demo): add more chose file or media demo ## [4.41.0-dev.1] 2025-03-04 **Download: [4.41.0-dev.1(1.72 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.41.0-dev.1.zip)** ### Bug Fixes - fix(sdk): page frame await syntax error - fix op_line_number size increased and get_label_pos not changed on node-qjsc - fix(mp-service): fix track line and column numbers for expressions on… ### Features - feat(sdk): sortable support x-axis/free dragging - feat(sdk): add image info type - feat(sdk): init rem to avoid style issue in flutter renderer - feat(sdk): widget support selectorQuery & intersectionObserver - feat(sdk): implement lite-timeline sdk part - feat(sdk): improve virtual scrollview - feat(sdk): remove webf sync command during the initialization - feat(sdk): support disableCleanStack and cleanOtherStack - feat(sdk): increase priority of framework level message - feat(runtime): add plugin `addEventListenerToBody` - feat(server-side-bundle): add new qjs compilation ## [4.41.0-dev.3] 2025-02-28 **Download: [4.41.0-dev.3(1.72 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.41.0-dev.3.zip)** ### Features - feat(sdk): add image info type ## [4.41.0-dev.2] 2025-02-27 **Download: [4.41.0-dev.2(1.72 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.41.0-dev.2.zip)** ### Features - feat(sdk): init rem to avoid style issue in flutter renderer - feat(sdk): widget support selectorQuery & intersectionObserver ## [4.41.0-dev.1] 2025-02-25 **Download: [4.41.0-dev.1(1.72 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.41.0-dev.1.zip)** ### Bug Fixes - fix op_line_number size increased and get_label_pos not changed on node-qjsc - fix(mp-service): fix track line and column numbers for expressions on… ### Features - feat(sdk): implement lite-timeline sdk part - feat(sdk): improve virtual scrollview - feat(sdk): remove webf sync command during the initialization - feat(sdk): support disableCleanStack and cleanOtherStack - feat(sdk): increase priority of framework level message - feat(runtime): add plugin `addEventListenerToBody` - feat(server-side-bundle): add new qjs compilation ## [4.40.0-dev.2] 2025-02-10 **Download: [4.40.0-dev.2(2.48 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.40.0-dev.2.zip)** ### Bug Fixes - fix(bundler): loadScriptSync issue on android - fix(sdk): svg data url regexp missing text wrap - fix(sdk): fix cursor flashing on devices ### Features - feat(sdk): add disable-ios-embed props for ios native input ## [4.40.0-dev.1] 2025-02-06 **Download: [4.40.0-dev.1(2.48 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.40.0-dev.1.zip)** ### Bug Fixes - fix(sdk): handle non-enumerable CustomEvent properties type and detail - fix(sdk): cherry-pick virtual list hotfix - fix(sdk): clear unreachable rpc promise - fix(sdk): remove skyline sync ui command (#2058) - fix(sdk): mitigate the risk of memory leak - fix(host): loadScriptSync issue - fix(cli): change @shoelace-style/shoelace version to 2 ### Features - feat(sdk): get static template theme from body - feat(sdk): support remove skeleton after static templete rendered - feat(sdk): drawer support teleportTo - feat(demo): add fixed page input demo - feat(sdk): flutter svg support - feat(sdk): input component can highlight the inputed content - feat(sdk): flutter deprecated textarea add `cursor-spacing` - feat(sdk): support auto zip sdk in watch mode - feat(cli): add socket status indicator - feat(bundler): support standalone-chunks ## [4.39.5-dev.1] 2025-01-22 **Download: [4.39.5-dev.1(2.57 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.39.5-dev.1.zip)** ### Bug Fixes - fix(sdk): clear unreachable rpc promise ## [4.38.0-dev.2] 2024-12-26 **Download: [4.38.0-dev.2(2.50 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.38.0-dev.2.zip)** ### Features - feat(sdk): `MP.onError` message format & `MP.lifecycle` throw error ## [4.38.0-dev.1] 2024-12-25 **Download: [4.38.0-dev.1(2.50 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.38.0-dev.1.zip)** ### Bug Fixes - fix(sdk): adjust unload timming - fix(sdk): native input with number type issue - fix(cli): ide-cli pnpm dep package.json resolve failed ### Features - feat(sdk): add params in chooseFile - feat(sdk): scrollview support flex height virtual list - feat(sdk): svg inline tag performence improve - feat(bmp): `` support events - feat(sdk): `` support switching animation - feat(sdk): add `flutter-video` component - feat(sdk): throw bmp app `onError` - feat(sdk): add `` component - feat(extended-lib): update react/react-dom 18.3.1 - feat(sdk): echarts tooltip formatter support function - feat(cli): ide cli build failed not catch - feat(bmp): `PickerView` add options `maskClass|maskStyle|indicatorClass|indicatorStyle` - feat(cli): fix hot reload & change package name to ide-cli ## [4.37.0-dev.3] 2024-12-05 **Download: [4.37.0-dev.3(2.48 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.37.0-dev.3.zip)** ### Bug Fixes - fix(sdk): widget load timeline - fix(sdk): flutter deprecated-textarea autoheight style error - fix(sdk): trigger renderEffect before componentinit to fix patch issues ### Features - feat: sortable component - feat(sdk): flutter-scrollview add `refresher` props - feat:(sdk): builtin svg component ## [4.37.0-dev.2] 2024-12-03 **Download: [4.37.0-dev.2(2.46 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.37.0-dev.2.zip)** ### Bug Fixes - fix(sdk): fix page stack update timing ### Features - feat(lib): bmp-components - feat(sdk): deprecated textarea autoHeight support - feat(ide-cli): preview functions for binance devtool - feat: bundler - feat: sortable component ### Performance Improvements - perf: enhance scroll performance by reduce binding getter from event target ### Misc - Revert "chore: @mp/bundler dev" ## [4.37.0-dev.1] 2024-11-26 **Download: [4.37.0-dev.1(2.43 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.37.0-dev.1.zip)** ### Bug Fixes - fix(sdk): run setdata callback after vue nexttick - fix(bmp): update type `BnInputProps&BnTextareaProps` ### Features - feat(sdk): create chart context support options params - feat(sdk): DeprecatedTextarea add `autocorrect` & `autocapitalize` - feat(sdk): add scrollstart scrollend to scrollview - feat(sdk): add `flutter-container` - feat(sdk): add `option.url` in applyUpdate ## [4.36.0-dev.4] 2024-11-26 **Download: [4.36.0-dev.4(2.43 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.36.0-dev.4.zip)** ### Bug Fixes - fix(sdk): run setdata callback after vue nexttick - fix(bmp): update type `BnInputProps&BnTextareaProps` ### Features - feat(sdk): create chart context support options params - feat(sdk): DeprecatedTextarea add `autocorrect` & `autocapitalize` - feat(sdk): add scrollstart scrollend to scrollview - feat(sdk): add `flutter-container` - feat(sdk): add `option.url` in applyUpdate ## [4.36.0-dev.3] 2024-11-14 **Download: [4.36.0-dev.3(2.43 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.36.0-dev.3.zip)** ### Bug Fixes - fix(sdk): change handlePaste defaultValue ## [4.36.0-dev.2] 2024-11-14 **Download: [4.36.0-dev.2(2.43 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.36.0-dev.2.zip)** ## [4.36.0-dev.1] 2024-11-13 **Download: [4.36.0-dev.1(2.43 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.36.0-dev.1.zip)** ### Bug Fixes - fix(sdk): remove native component background color - fix(sdk): flutter-image remove eventListener ### Features - feat(sdk): add switch tab options in api - feat(sdk): add timeformat api - feat(sdk): add showBackButton api - feat(sdk): `native-textarea` add onPaste - feat(sdk): `native-textarea` add `alwaysEmbed` - feat(sdk): add the value of input type `decimals` - feat(sdk): flutter-deprecated-textarea add `autoFocus` ## [4.35.2-dev.1] 2024-11-07 **Download: [4.35.2-dev.1(2.43 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.35.2-dev.1.zip)** ### Bug Fixes - fix(sdk): release flutter image load - fix(sdk): wrap inline element with bn-span for bn-markdown ### Misc - Revert "chore: revert ui command" ## [4.35.0-dev.4] 2024-10-25 **Download: [4.35.0-dev.4(2.43 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.35.0-dev.4.zip)** ### Bug Fixes - fix(sdk): support inlineLayout for skyline ### Features - feat(sdk): new api page.updateRouteOptions ## [4.35.0-dev.3] 2024-10-24 **Download: [4.35.0-dev.3(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.35.0-dev.3.zip)** ### Bug Fixes - fix(sdk): flutter scroll refresher background color ### Features - feat(sdk): `DeprecatedTextarea` support `cursor/autoFocus/selection-start/selection-end` - feat(demo): add error handler bot modal demo ## [4.35.0-dev.2] 2024-10-24 **Download: [4.35.0-dev.2(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.35.0-dev.2.zip)** ### Features - feat(sdk): use tap for skyline ## [4.35.0-dev.1] 2024-10-23 **Download: [4.35.0-dev.1(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.35.0-dev.1.zip)** ### Bug Fixes - fix(sdk): android quickjs unsupport Unicode Property Escapes - fix(sdk): cherry pick webview message issue - fix(sdk): re-publish @mp/runtime-plugin-enable-sheet-gesture - fix(sdk): fix cursor issue - fix(runtime): premature return issue in ide enviroment's show-modal api - fix(sdk): editor pos nodeBefore return real textContent if node is nonTextNode - fix(sdk): `deprecated-textarea` support force update - fix(sdk): deprecated input does not update when is composing - fix(sdk): jarvis input does not update correctly ### Features - feat(sdk): add tab-switched api - feat(sdk): update caniuse api - feat(sdk): support multi pages in tabbar - feat(sdk): webview clearScrollStatus, invoke api - feat(sdk): add sticky-header & stick-section - feat(sdk): add `` - feat(sdk): setup markdown on flutter - feat(sdk): new api enable enableSheetGesture - feat(extended-lib): expose buildIn libs for server side bundle ## [4.35.0-dev.1] 2024-10-17 **Download: [4.35.0-dev.1(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.35.0-dev.1.zip)** ### Bug Fixes - fix(sdk): editor pos nodeBefore return real textContent if node is nonTextNode - fix(sdk): `deprecated-textarea` support force update - fix(sdk): deprecated input does not update when is composing - fix(sdk): jarvis input does not update correctly ### Features - feat(sdk): add `` - feat(sdk): setup markdown on flutter - feat(sdk): new api enable enableSheetGesture - feat(extended-lib): expose buildIn libs for server side bundle ## [4.34.0-dev.3] 2024-10-04 **Download: [4.34.0-dev.3(2.38 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.34.0-dev.3.zip)** ### Bug Fixes - fix(sdk): fix webview message action not work ### Features - feat(host): align response with native ## [4.34.0-dev.2] 2024-10-03 **Download: [4.34.0-dev.2(2.38 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.34.0-dev.2.zip)** ### Features - feat(sdk): flutter text component ## [4.34.0-dev.1] 2024-10-02 **Download: [4.34.0-dev.1(2.38 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.34.0-dev.1.zip)** ### Bug Fixes - fix(sdk): native list view conflict with sliver style - fix(automator): add timeout when run automator ### Features - feat(sdk): update markdown & pika version update - feat(sdk): support readme feature - feat(sdk): add 2 components `ContextMenu` & `ContextMenuItem` - feat(sdk): add `` component & lottie-context - feat(bundler): emit handlePageBundled when skeleton build finish - feat(bundler): upgrade webpack to support Node >=18 ## [4.33.0-dev.4] 2024-10-01 **Download: [4.33.0-dev.4(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.33.0-dev.4.zip)** ### Bug Fixes - fix(sdk): native list view conflict with sliver style - fix(automator): add timeout when run automator ### Features - feat(sdk): update markdown & pika version update - feat(sdk): support readme feature - feat(sdk): add 2 components `ContextMenu` & `ContextMenuItem` - feat(sdk): add `` component & lottie-context - feat(bundler): emit handlePageBundled when skeleton build finish - feat(bundler): upgrade webpack to support Node >=18 ## [4.33.0-dev.4] 2024-09-30 **Download: [4.33.0-dev.4(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.33.0-dev.4.zip)** ### Bug Fixes - fix(sdk): native list view conflict with sliver style - fix(automator): add timeout when run automator ### Features - feat(sdk): support readme feature - feat(sdk): add 2 components `ContextMenu` & `ContextMenuItem` - feat(sdk): add `` component & lottie-context - feat(bundler): emit handlePageBundled when skeleton build finish - feat(bundler): upgrade webpack to support Node >=18 ## [4.33.0-rc.1] 2024-09-12 **Download: [4.33.0-rc.1(NaN MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.33.0-rc.1.zip)** ## [4.33.0-dev.3] 2024-09-12 **Download: [4.33.0-dev.3(2.20 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.33.0-dev.3.zip)** ### Bug Fixes - fix(sdk): fix catchmove not work - fix(sdk):add textarea placeholder class prop ### Features - feat(demo): error handler demo - feat(sdk): add deeplink target type ## [4.33.0-dev.2] 2024-09-12 **Download: [4.33.0-dev.2(2.20 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.33.0-dev.2.zip)** ### Bug Fixes - fix(sdk): fix component patch error messsage ### Features - feat(sdk): hack textarea with **BN_IGNORE_IS_COMPOSING** id - feat(extended-lib): update react qjs ## [4.33.0-dev.1] 2024-09-10 **Download: [4.33.0-dev.1(2.20 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.33.0-dev.1.zip)** ### Bug Fixes - fix(sdk): fix drawer error and support accelaration - fix(lib): fix event channel type - fix(bundler): bundle watch mode should copy ignore files - fix(sdk): scroll y on scrollView is not works - fix(sdk): fix textarea props and type ### Features - feat(sdk): add component `flutter-image` - feat(demo): add style inject demo page - feat(sdk): add component flutter-scroll-view - feat(sdk): add plugin `runtime-plugin-update-page-query` - feat(sdk): add type `injected` for bmp-component - feat(sdk): add plugin `runtime-plugin-control-button` ### Misc - Revert "fix(sdk): vnode patch issues " (#1786) (#1796) ## [4.32.0-dev.2] 2024-08-22 **Download: [4.32.0-dev.2(2.20 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.32.0-dev.2.zip)** ### Features - feat(sdk): drawer component ## [4.32.0-dev.1] 2024-08-22 **Download: [4.32.0-dev.1(2.20 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.32.0-dev.1.zip)** ### Bug Fixes - fix(sdk): delay page set to make sure buforeRouteChange done - fix(bundler): disable sourcemap to reduce memory ### Features - feat(bundler): support static script, do not bundle into \_app.js and \_common.js - feat(bundler): mark build is done before send pageBundled - feat(bundler): add entry must trigger a rebuild - feat(sdk): scroll view support extra data prop - feat(sdk): performance babel plugin log format with timeline - feat(sdk): flutter scroll-view - feat(bundler): update watch page utils - feat(bundler): support ignore qjs options - feat(bundler): skeleton create style tags by script to avoid webf issues - feat(sdk): remove game script in sdk - feat(sdk): flutter scroll view - feat(sdk): add props for input - feat(bundler): update bundler for host - feat(doc): update doc - feat(demo): add input unfocuse issue - feat(sdk): lcp element timeline metrics ## [4.31.0-dev.2] 2024-07-31 **Download: [4.31.0-dev.2(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.31.0-dev.2.zip)** ### Bug Fixes - fix(lib): fix bmp component types - fix(bundler): fix expression bundler ### Features - feat(sdk): webview scrollChange event - feat(sdk): add logger for timeline log analyze - feat(sdk): scrollView skyline type list property support - feat(sdk): input prop disablePaste - feat(bundler): support bns in base.bxml and pika compile mode ## [4.31.0-dev.1] 2024-07-24 **Download: [4.31.0-dev.1(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.31.0-dev.1.zip)** ### Features - feat(sdk): editor chart ui revamp - feat(sdk): support create worker - feat(lib): add type of Script to bmp-components ## [4.30.0-dev.3] 2024-07-12 **Download: [4.30.0-dev.3(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.30.0-dev.3.zip)** ### Bug Fixes - fix(sdk): native component webview message ## [4.30.0-dev.2] 2024-07-11 **Download: [4.30.0-dev.2(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.30.0-dev.2.zip)** ### Bug Fixes - fix(sdk): native event in worker - fix(sdk): fix webview component ### Features - feat(sdk): webview component event api in queryselector ## [4.30.0-dev.1] 2024-07-10 **Download: [4.30.0-dev.1(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.30.0-dev.1.zip)** ### Bug Fixes - fix(sdk): intersectionObserver margin - fix(sdk): eventhandler of chart component - fix(extended-lib): ethers Event identifier duplicated and getGlobal function error ### Features - feat(sdk): support navigate api with animated - feat(sdk): bn.onCopy Api on Android - feat(host): export workerEnvCode for host - feat(extended-lib): upload bitcoinjs-lib & solana/web3.js - feat(extended-lib): upload ethers-5.5.4.js ## [4.29.0-dev.2] 2024-06-20 **Download: [4.29.0-dev.2(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.29.0-dev.2.zip)** ### Bug Fixes - fix(sdk): webview sdk only send invoke message - fix(sdk): image to figure will insert a new paragraph before the figure ### Features - feat(sdk): new api for webview component - feat(sdk): api show setting - feat(sdk): support fontFamily for native-input and native-textarea - feat(extended-lib): upload react-dom 18.2.0 - feat(sdk): remove load skeleton ## [4.29.0-dev.1] 2024-06-13 **Download: [4.29.0-dev.1(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.29.0-dev.1.zip)** ### Bug Fixes - fix(sdk): cursor is wired when editor tap keyboard enter ### Features - feat(sdk): add onCopy event for text component - feat: mini program performance babel plugin - feat(sdk):add ut coverage 98% ## [4.28.0-dev.1] 2024-05-28 **Download: [4.28.0-dev.1(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.28.0-dev.1.zip)** ### Features - feat(extended-lib): support web3 libs - feat(sdk): richtext support a href - feat(sdk): add page name to performance point - feat(sdk): widget props support functions in deeper obj - feat(sdk): webview status and invoke api - feat(sdk): add ut and increase coverage to 96.88% - feat(sdk): support dynamic rendering cache - feat(sdk): defer for taro useReady - feat(sdk): editor chart insert should focus next line ## [4.27.0-dev.4] 2024-05-09 **Download: [4.27.0-dev.4(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.27.0-dev.4.zip)** ### Bug Fixes - fix(sdk): image should not add appid for bn protocal src in widget - fix(sdk): page query not ready when onload ## [4.27.0-dev.3] 2024-05-08 **Download: [4.27.0-dev.3(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.27.0-dev.3.zip)** ### Features - feat(sdk): api getrandomvalues - feat(sdk): widgetslot props can use functions start with 'on' - feat(plugin): sdk support w3w evm configurable - feat(sdk): add flutter input comp - feat(lib): add getWidgetId and try get ctx from current.widget - feat(sdk): widget can load base.bxml in target app ## [4.27.0-dev.2] 2024-04-30 **Download: [4.27.0-dev.2(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.27.0-dev.2.zip)** ### Features - feat(sdk): api hide back button ## [4.27.0-dev.1] 2024-04-26 **Download: [4.27.0-dev.1(2.42 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.27.0-dev.1.zip)** ### Bug Fixes - fix(extended-lib): postpublish script throw error ### Features - feat(sdk): editor echart card - feat(sdk): cross app rpc support sync action - feat(sdk): bump - feat(host): support big int ## [4.26.0-w3w] 2024-04-22 **Download: [4.26.0-w3w(NaN MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.26.0-w3w.zip)** ### Bug Fixes - fix(host): support webassembly on host ### Features - feat(sdk): web3 plugin use shell app - feat(demo):host shell app add basebxml & preload - feat(server-side-bundle): add bytecode full - feat(sdk): api open document ## [4.26.0-dev.1] 2024-04-17 **Download: [4.26.0-dev.1(2.41 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.26.0-dev.1.zip)** ### Bug Fixes - fix(sdk): hover class not disappear - fix(sdk): create webview support widget - fix(host): widget ref not works and webview size not correct - fix(sdk): chart component need delay to setOptions ### Features - feat(sdk): cross app rpc api - feat(demo): native component demo update - feat(bundler): support widget extended lib - feat(sdk): bns can work on exp - feat(sdk): cherry-pick: delay onReady for tarojs & add more error message info for appjs load - feat(cli): webf lint add new rules - feat(lib): check media query in webf - feat(sdk): taro page await app loaded ## [4.25.0-dev.2] 2024-03-27 **Download: [4.25.0-dev.2(2.40 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.25.0-dev.2.zip)** ### Bug Fixes - fix(extended-lib): add missing deps ### Features - feat(sdk): custom native component ## [4.25.0-dev.1] 2024-03-27 **Download: [4.25.0-dev.1(2.40 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.25.0-dev.1.zip)** ### Bug Fixes - fix(sdk): fix createwebview node-bridge issu - fix(sdk): fix bmp-component type ### Features - feat(sdk): improve doc 0325 - feat(sdk): add new prop webPreferences - feat(bundler): add solution for dynamic lib - feat(sdk): render earlier for pages with static template configuration ## [4.23.0-dev.2] 2024-02-16 **Download: [4.23.0-dev.2(2.40 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.23.0-dev.2.zip)** ### Bug Fixes - fix(sdk): when user delete all content web input may act unexpected ## [4.23.0-dev.1] 2024-02-16 **Download: [4.23.0-dev.1(2.40 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.23.0-dev.1.zip)** ### Bug Fixes - fix(sdk): remote-debug env update - fix(sdk): remote debugger resend ready to IDE ### Features - feat(sdk): add error code for widget when renderer destroy during init - feat(sdk): widget can get props without properties define ## [4.22.0-dev.2] 2024-01-24 **Download: [4.22.0-dev.2(2.40 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.22.0-dev.2.zip)** ### Features - feat(sdk): webf lint adjustment - feat(sdk): add api setPageScrollable ## [4.22.0-dev.1] 2024-01-22 **Download: [4.22.0-dev.1(2.39 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.22.0-dev.1.zip)** ### Bug Fixes - fix(sdk): label trigger itemClick event for radio and checkbox ### Features - feat(sdk): limit data point max length - feat(sdk): closeWidget can close native opend widget - feat(sdk): editor support \n inside paste content ## [4.21.0-dev.1] 2024-01-08 **Download: [4.21.0-dev.1(2.39 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.21.0-dev.1.zip)** ### Features - feat(sdk): editor link paste with strick whitelist validator - feat(bundler): increase SOURCEMAP_SIZE_LIMIT to 10MB ## [4.20.0-dev.1] 2023-12-12 **Download: [4.20.0-dev.1(2.39 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.20.0-dev.1.zip)** ### Bug Fixes - fix(sdk): flutter gradient issue - fix(bundler): using prettier as formatter ## [4.19.0-dev.3] 2023-11-22 **Download: [4.19.0-dev.3(2.39 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.19.0-dev.3.zip)** ### Bug Fixes - fix(bundler): fix IDE can not reload ### Features - feat(sdk): cherry-pick: add preloadflutterwebview api ## [4.19.0-dev.2] 2023-11-21 **Download: [4.19.0-dev.2(2.39 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.19.0-dev.2.zip)** ### Features - feat(sdk): add error code to show error page - feat(sdk): add renderer Type in getCurrentPages api - feat(sdk): createSelectorQuery select support rootPortal options - feat(sdk): add latest version to update event ## [4.19.0-dev.1] 2023-11-14 **Download: [4.19.0-dev.1(2.39 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.19.0-dev.1.zip)** ### Features - feat(sdk): editor enter event - feat(sdk): enableCursor for developers to use native cursor ## [4.18.0-dev.3] 2023-11-02 **Download: [4.18.0-dev.3(2.39 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.18.0-dev.3.zip)** ### Bug Fixes - fix(sdk): fix webview sdk to compatible with node bridget - fix(cli): fix scroll-speed-limit default value - fix(cli): fix scroll-speed-limit default value ### Features - feat(sdk): hold atom selection - feat(sdk): web input support inputmode and pattern - feat(bundler): merge widgetconfig to appconfig - feat(sdk): support atom selection ## [4.18.0-dev.2] 2023-10-30 **Download: [4.18.0-dev.2(2.39 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.18.0-dev.2.zip)** ### Features - feat(sdk): add scrollSpeedLimit to avoid blank frame of virtual list ## [4.17.2-dev.1] 2023-10-23 **Download: [4.17.2-dev.1(2.39 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.17.2-dev.1.zip)** ### Bug Fixes - fix(sdk): support input focus and blur action by developers ## [4.18.0-dev.1] 2023-10-23 **Download: [4.18.0-dev.1(2.39 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.18.0-dev.1.zip)** ### Bug Fixes - fix(sdk): support input focus and blur action by developers ### Features - feat(sdk): editor support mention and hardBreak ## [4.16.3-dev.1] 2023-10-13 **Download: [4.16.3-dev.1(2.39 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.16.3-dev.1.zip)** ### Bug Fixes - fix(sdk): clone data avoid reuse data object when reopen page ## [4.17.0-dev.2] 2023-10-13 **Download: [4.17.0-dev.2(2.39 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.17.0-dev.2.zip)** ### Bug Fixes - fix(sdk): clone data avoid reuse data object when reopen page ### Features - feat(lib): bmp-api openWidget add support for convention path ## [4.17.0-dev.1] 2023-10-10 **Download: [4.17.0-dev.1(2.39 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.17.0-dev.1.zip)** ### Bug Fixes - fix(sdk): cherry pick 4.16.2 + try catch instance update - fix(sdk): using show-scrollbar disable scrollbar - fix(sdk): iOS cursor always at the edge of the word, selection update event not trigger ### Features - feat(sdk): report error during renderer launching process - feat(sdk): scroll view support scrollWithAnimation and scrollIntoViewAlignment - feat(sdk): support swiper rtl props - feat(sdk): widget support open dialog - feat(tools):webf style linter - feat(sdk): report LCP only after user interacts - feat(sdk): set tab bar list api - feat(lib): refactor WidgetSlot as react component - feat(lib): bmp-react & bmp-component add support for widget ## [4.16.0-dev.2] 2023-09-19 **Download: [4.16.0-dev.2(2.38 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.16.0-dev.2.zip)** ### Bug Fixes - fix(demo): component-demo use built-in chart - fix(sdk): decode extra data without appid - fix(sdk): swiper located to wrong child when children updated - fix(bundler): fix expression not work on tag in `bn:for` - fix(demo): independent package config - fix(demo): private-close-app require shouldClose payload - fix(bundler): decompress replace unzipper ### Features - feat(sdk): echarts tooltip support basic dom - feat(sdk): widget in widgetslot support lifecycles ## [4.16.0-dev.1] 2023-09-11 **Download: [4.16.0-dev.1(2.38 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.16.0-dev.1.zip)** ### Bug Fixes - fix(bundler): bundler watch has 60s cache ### Features - feat(sdk): editor internal plugin link support ## [4.15.0-dev.3] 2023-08-29 **Download: [4.15.0-dev.3(2.34 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.15.0-dev.3.zip)** ### Bug Fixes - fix(sdk): enbale flutter qjs - fix(sdk): swiper may throw error when disable indicatorDots ### Features - feat(sdk): add more info to showErrorPage and add widget error report - feat(sdk): export standard error to developers ## [4.15.0-dev.2] 2023-08-25 **Download: [4.15.0-dev.2(2.34 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.15.0-dev.2.zip)** ### Bug Fixes - fix(sdk): widget props can get in worker - fix(sdk): cursor always jump to the first position when value change from an empty string - fix(sdk): check demo page ci ### Features - feat(sdk): bump version - feat(sdk): dynamic widget support props and add openWidget API - feat(sdk): sdk ut to 95% - feat(bundler): build qjs for renderer in flutter ## [4.15.0-dev.1] 2023-08-17 **Download: [4.15.0-dev.1(1.45 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.15.0-dev.1.zip)** ### Bug Fixes - fix(bundler): source-map issue of swc-loader - fix(sdk): reset transform when refresher unmount ### Features - feat(demo): enable flutter - feat(bundler): server side bundle add more files into qjs ## [4.14.0-dev.2] 2023-08-09 **Download: [4.14.0-dev.2(1.45 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.14.0-dev.2.zip)** ### Bug Fixes - fix(sdk): customize component data not update when return a data getter ### Features - feat(sdk): editor transform pasted content - feat(demo): pika extendedlib - feat(sdk): scroll-view supports scroll-anchor - feat(sdk): api bn.preloadWebContent to preload webview content advance - Feat/metadata ## [4.14.0-dev.1] 2023-08-01 **Download: [4.14.0-dev.1(1.46 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.14.0-dev.1.zip)** ### Bug Fixes - fix(cli): webview component onmessage event - fix(sdk): cherry-pick fix web input seqId - fix(sdk): cherry-pick editor remove link and style recover (#1515) - fix(sdk): cherry-pick editor split figure bugs - fix(sdk): object spread syntax error - fix(cli): add webview component, webpack chain error - fix(bundler): lock unzipper version cause new version may lost file - fix(host): block TextEncoder prop ### Features - feat(sdk): editor paste event props - feat(sdk): echart component ## [4.13.1-dev.1] 2023-07-27 **Download: [4.13.1-dev.1(1.15 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.13.1-dev.1.zip)** ### Bug Fixes - fix(sdk): editor split figure bugs - fix(sdk): object spread sytax error - fix(sdk): add seqId to web input event ## [4.13.0-dev.2] 2023-07-26 **Download: [4.13.0-dev.2(1.14 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.13.0-dev.2.zip)** ### Bug Fixes - fix(demo): intersection observer usage - fix(sdk): bundler remove touchmove prevent modifer ### Misc - Revert "fix(sdk): iOS native component created failed when container is not visible " ## [4.13.0-dev.1] 2023-07-18 **Download: [4.13.0-dev.1(1.14 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.13.0-dev.1.zip)** ### Bug Fixes - fix(demo): editor toolbar bottom 0 when platform is not iOS - fix(sdk): iOS native component created failed when container is not visible - fix: cherry-pick from 4.12.1 - fix(sdk): cancel load-script when redirect - fix(lib): add type of removeSkeleton ### Features - feat(sdk): editor selectImage api - feat(mpp-service) add released pr - feat(sdk): support walletkit and init func - feat(demo): add manual to web input public demo ## [4.12.0-dev.1] 2023-06-28 **Download: [4.12.0-dev.1(1.13 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.12.0-dev.1.zip)** ### Bug Fixes - fix(sdk): font-family should go with system font-family - fix(sdk): domtoimage svg base64 not have datatype - fix(sdk): add export type - fix(demo): fix canvas toTempFilePath - fix(server-side-bundle): remove subpackage prefix of sourceURL - fix(server-side-bundle): sourceURL issue of qjs ### Features - feat(sdk): control input - feat(server-side-bundle): add sentry project name and releaseid - feat(sdk): split figure into fig-caption and image ### Performance Improvements - perf: add filesystem cache ## [4.11.0-dev.3] 2023-06-09 **Download: [4.11.0-dev.3(1.13 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.11.0-dev.3.zip)** ### Bug Fixes - fix(sdk): domtoImage local image support for android - fix(demo): fix share demo ## [4.11.0-dev.2] 2023-06-07 **Download: [4.11.0-dev.2(1.12 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.11.0-dev.2.zip)** ### Bug Fixes - fix(sdk): video fullscreenchange on IOS - fix(cli): hack taro catch event - fix(demo): update prefetch image path - fix(mpp-service): newVersionFromServer might be null issue - fix(demo): reset zoom ref when toggle camera position - fix(sdk): dom to image support private static server images ### Features - feat(server-side-bundle): use file path as sourceURL of qjs - feat(sdk): support udpsocket api - feat(sdk): 🎸 [plugin] add universal web3 provider ## [4.10.2-dev.1] 2023-06-06 **Download: [4.10.2-dev.1(1.14 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.10.2-dev.1.zip)** ### Bug Fixes - fix(sdk): fix startCheckPageTimeline error ## [4.11.0-dev.1] 2023-05-29 **Download: [4.11.0-dev.1(1.11 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.11.0-dev.1.zip)** ### Bug Fixes - fix(sdk): editorContext insertCoin not works - fix(mpp-service): min versoin should not replace the input version - fix(mpp-service): set min upload version as 0.0.1 - fix(automator): read route of undefined issue - fix(mpp-service): disable contentType when getUploadFileKey - fix(demo): websocket url not work ### Features - feat(sdk): dom to image support native canvas - feat(sdk): editor extension link - feat(sdk,bundler,demo): support skeleton - feat(sdk,bundler,demo): add camera component & createCameraContext API ## [4.10.1-dev.1] 2023-05-25 **Download: [4.10.1-dev.1(1.14 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.10.1-dev.1.zip)** ### Bug Fixes - fix(sdk): renderer service compatitable with es5 ## [4.10.0-dev.4] 2023-05-19 **Download: [4.10.0-dev.4(1.10 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.10.0-dev.4.zip)** ### Bug Fixes - fix(sdk): canIUseCustom support string params - fix(cli): support catch touchend ### Features - feat(demo): add prefetchRules ## [4.9.2-dev.1] 2023-05-19 **Download: [4.9.2-dev.1(1.09 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.9.2-dev.1.zip)** ### Bug Fixes - fix(sdk): canIUseCustom support string params ## [4.10.0-dev.3] 2023-05-18 **Download: [4.10.0-dev.3(1.10 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.10.0-dev.3.zip)** ### Bug Fixes - fix(sdk): fix ths issue about get appConfig & getPage - fix(sdk): callbackify error no stack ### Features - feat(sdk): getUserOpenId return token ## [4.9.1-dev.2] 2023-05-17 **Download: [4.9.1-dev.2(1.09 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.9.1-dev.2.zip)** ## [4.10.0-dev.2] 2023-05-16 **Download: [4.10.0-dev.2(1.09 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.10.0-dev.2.zip)** ### Bug Fixes - fix(sdk): load page frame after load base.bxml success ## [4.10.0-dev.1] 2023-05-15 **Download: [4.10.0-dev.1(1.09 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.10.0-dev.1.zip)** ### Bug Fixes - fix(mpp-service): add contentType filed when upload for security - fix(host): download support put - fix(demo): add private send transaction demo - fix(cli): webview injected not work - fix(demo): webview page not found ### Features - feat(sdk): editor coin - feat(sdk): editor image scrollIntoView - feat(sdk): editor image default spinner - feat(sdk): Mini Game touch event optimization - feat(bundler): support bxs ## [4.9.1-dev.1] 2023-05-15 **Download: [4.9.1-dev.1(1.10 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.9.1-dev.1.zip)** ### Bug Fixes - fix(sdk): update load script error code ### Features - feat(sdk): use appConfig after init appConfig & add appConfig detection & syncGetPage or asyncGetPage - feat(host): set custom http headers for fetch requests ## [4.9.0-dev.3] 2023-04-26 **Download: [4.9.0-dev.3(1.09 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.9.0-dev.3.zip)** ### Bug Fixes - fix(demo): production convertToMPUrl usage ### Features - feat(sdk): ut from plugin-location to plugin-request-subscribe-message ## [4.9.0-dev.2] 2023-04-25 **Download: [4.9.0-dev.2(1.09 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.9.0-dev.2.zip)** ### Bug Fixes - fix(sdk): editor caption selection and image keyboard handler - fix(host): definitions for bn.env - fix(sdk): unhandleRejection support polyfilled promise ### Features - feat(sdk): file method support put method - feat(demo): add beforeRouteChange usage to component-demo ## [4.9.0-dev.1] 2023-04-24 **Download: [4.9.0-dev.1(1.09 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.9.0-dev.1.zip)** ### Bug Fixes - fix(sdk): fix edtior editing image error - fix(sdk): init performance observer after worker ready - fix(sdk): editor delete image event stopropagation - fix(sdk): fix load page.js error to report 603505 when webview is des… - fix(demo): fix event-channel demo - fix(demo): on/off pairs ### Features - feat(sdk,bundler): add show confirm bar for input - feat(sdk): srcollview pulldown refresher ## [4.9.0-dev.1] 2023-04-24 **Download: [4.9.0-dev.1(1.09 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.9.0-dev.1.zip)** ### Bug Fixes - fix(sdk): fix edtior editing image error - fix(sdk): init performance observer after worker ready - fix(sdk): editor delete image event stopropagation - fix(sdk): fix load page.js error to report 603505 when webview is des… - fix(demo): fix event-channel demo - fix(demo): on/off pairs ### Features - feat(sdk,bundler): add show confirm bar for input - feat(sdk): srcollview pulldown refresher ## [4.8.0-dev.2] 2023-04-06 **Download: [4.8.0-dev.2(1.09 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.8.0-dev.2.zip)** ### Features - feat(sdk): bids use monitorupload - feat(demo): editor component demo ## [4.8.0-dev.1] 2023-04-04 **Download: [4.8.0-dev.1(1.09 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.8.0-dev.1.zip)** ### Bug Fixes - fix(sdk): editor image selection and focus - fix(mpp-service): print the old and new version ### Features - feat(sdk): remove settimeout for page.show - feat(sdk): page-not-found - feat(sdk): add page-frame-html in sdk - feat(sdk): chooseMedia & chooseFile API # Download Development Version ## [4.7.0-dev.6] 2023-03-17 **Download: [4.7.0-dev.6(1.07 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.7.0-dev.6.zip)** ### Bug Fixes - fix(sdk): editor image cursor position and delete use touchend event - fix(sdk): update report data object & cancel startupTimeout when load resources ## [4.7.0-dev.5] 2023-03-16 **Download: [4.7.0-dev.5(1.07 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.7.0-dev.5.zip)** ### Bug Fixes - fix(sdk): editor image support update and deletable, hashtag keyboard key unexpected issue ## [4.7.0-dev.4] 2023-03-16 **Download: [4.7.0-dev.4(1.07 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.7.0-dev.4.zip)** ### Bug Fixes - fix(sdk): update load-script payload to ensure the cache is loaded - fix(sdk): update event channel if page init before eventChannel ## [4.7.0-dev.3] 2023-03-14 **Download: [4.7.0-dev.3(1.07 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.7.0-dev.3.zip)** ### Bug Fixes - fix(sdk): fix native input color issues on ios13 - fix(demo): update pika to fix input issue - fix(sdk): update dom to image scale impl and fix image / font issues - fix(sdk): rename getUserOpenId & doc-api - getUserOpenId/getUserKycStatus ### Features - feat(sdk): editor focus and mark - feat(sdk): add startupTimeout & restore time compensation ## [4.7.0-dev.2] 2023-03-13 **Download: [4.7.0-dev.2(1.07 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.7.0-dev.2.zip)** ### Bug Fixes - fix(sdk): editor focus and mark ### Features - feat(sdk): catch html - feat(sdk): figure ## [4.7.0-dev.1] 2023-03-09 **Download: [4.7.0-dev.1(1.07 MB)](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.7.0-dev.1.zip)** ### Bug Fixes - fix(host): get-image-info is broken on IDE - fix(host): bn.request support arraybuffer body - fix(demo): radio page issue ### Features - feat(sdk): editor extension update and docs - feat(sdk): loading progress animation - feat(host): createBufferUrl support svg - feat(demo): add dom to image demo - feat(sdk): method domToImage - feat(sdk): exitMiniProgram support force close - feat(sdk): new api - getuseropenid getuserkycstatus - feat(sdk): editor component & editorContext api - feat(sdk):load resource fail or slowly ## [4.6.0-dev.2] 2023-02-22 **Download: [SDK-4.6.0-dev.2](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.6.0-dev.2.zip)** ### Bug Fixes - fix(sdk): add native-send-appLuanch timer ([532dde2e](https://git.toolsfdg.net/fe/mini-program/commit/532dde2e37e8c3ff48cbf655238b88a9a1ff0dcd)) by finley.x@binance.com ### Internal - chore: bump commit after write files ([9378fed1](https://git.toolsfdg.net/fe/mini-program/commit/9378fed122a9613f50aac333ff8543d12893bbbc)) by dylan.z@binance.com ## [4.6.0-dev.1] 2023-02-21 **Download: [SDK-4.6.0-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.6.0-dev.1.zip)** ### Bug Fixes - fix(bundler): css variables rpx to rem align with wechat ([5fcfd131](https://git.toolsfdg.net/fe/mini-program/commit/5fcfd1319437e3fd52389083be12f459cb53d243)) by dylan.z@binance.com - fix(sdk): mini game view port size ([fc6048f0](https://git.toolsfdg.net/fe/mini-program/commit/fc6048f03ed5b9cb7357654e8a5699124fa38898)) by henry.w@binance.com - fix(sdk): getChildrenNode util function ([7c5764b6](https://git.toolsfdg.net/fe/mini-program/commit/7c5764b60831fa1c194490a907a1ad10e7ded92b)) by henry.w@binance.com - fix(sdk): rendererId zero issue in native ui ([c3d9020b](https://git.toolsfdg.net/fe/mini-program/commit/c3d9020b10630ac6c12f71595fb3c80cd3e7d2cf)) by dylan.z@binance.com - fix(bundler): catchmove value should be an exp ([dc53e87f](https://git.toolsfdg.net/fe/mini-program/commit/dc53e87f6ccb59b859b0eb13171f5038c98910da)) by lawrence.w@binance.com - fix(sdk): swiper Item blank ([7981ff89](https://git.toolsfdg.net/fe/mini-program/commit/7981ff894557f9145b619a68c823252654826014)) by finley.x@binance.com - fix(demo):fix custom demo textarea maxlength ([c28c58aa](https://git.toolsfdg.net/fe/mini-program/commit/c28c58aa2556d9e8eb21ef3b46269461bcf308c4)) by henry.w@binance.com ### Features - feat(demo): control picker view demo ([b80c088c](https://git.toolsfdg.net/fe/mini-program/commit/b80c088cd6307f659af3fba713787becc824479c)) by lawrence.w@binance.com - feat(sdk): detect page timeline ([0b1381a4](https://git.toolsfdg.net/fe/mini-program/commit/0b1381a4406d0767f736836a8418aede38ccd44f)) by finley.x@binance.com - feat(host): support pageReadyCallback ([1339544e](https://git.toolsfdg.net/fe/mini-program/commit/1339544ec010a520efab2e822bfe15d4249fdc66)) by dylan.z@binance.com ### Refactor - refactor: remove any type in AppCommandMap ([9b2411bd](https://git.toolsfdg.net/fe/mini-program/commit/9b2411bde6250820403082572e38070d9c9fc443)) by lucifer.l@binance.com ### Internal - docs: add api comment for documentation ([7993a741](https://git.toolsfdg.net/fe/mini-program/commit/7993a741307a4049768fcfe771cfbb3ad6231723)) by dylan.z@binance.com - chore: update bump with git auto push ([e25b674f](https://git.toolsfdg.net/fe/mini-program/commit/e25b674f8ed8fd0638bc25122a9d8c6efb223d6d)) by dylan.z@binance.com - chore: change UT coverage scope and threshold ([50820980](https://git.toolsfdg.net/fe/mini-program/commit/50820980c6a0d517e0a19df8d2ed740965c36f40)) by lucifer.l@binance.com - docs: format issue ([05c3cc6e](https://git.toolsfdg.net/fe/mini-program/commit/05c3cc6e632ea84fc316a8db27fa7c9337d2ca24)) by dylan.z@binance.com - docs: update config ([aaae5561](https://git.toolsfdg.net/fe/mini-program/commit/aaae556164f3bd260fbed971c490f090b6327a25)) by dylan.z@binance.com - docs: excited features of the JSCore team 202302 ([1b38cbfe](https://git.toolsfdg.net/fe/mini-program/commit/1b38cbfe6c2344120f532eed76bda7a6990a7fc8)) by dylan.z@binance.com - [WIP]fix(sdk): controlled picker view ([661aa89a](https://git.toolsfdg.net/fe/mini-program/commit/661aa89ad9c3289ce614f2b77995d4ebf6d08bfa)) by lawrence.w@binance.com - mpp service support binance us host app ([fb8edeb8](https://git.toolsfdg.net/fe/mini-program/commit/fb8edeb8c6840cc84ef840c6ca84dcfc3a51fd72)) by leo.cc@binance.com # [4.5.1-dev.1] 2023-02-14 **Download: [SDK-4.5.1-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.5.1-dev.1.zip)** ### Bug Fixes - fix(sdk): cherry-pick - picker view control mode ([01449416](https://git.toolsfdg.net/fe/mini-program/commit/01449416c3989a0e9d2e89811987e30c8d40bdbd)) by lawrence.w@binance.com ## [3.14.16-dev.1] 2023-02-10 **Download: [SDK-3.14.16-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-3.14.16-dev.1.zip)** ### Bug Fixes - fix(sdk): cherry-pick - picker view control mode ([d9a10d59](https://git.toolsfdg.net/fe/mini-program/commit/d9a10d599fb2ab6d7c222c2204917dcd7511a888)) by lawrence.w@binance.com # [4.5.0-dev.2] 2023-02-01 **Download: [SDK-4.5.0-dev.2](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.5.0-dev.2.zip)** ### Bug Fixes - fix(sdk): fix requestBinanceCardInfo error response & cicd ([b18093ab](https://git.toolsfdg.net/fe/mini-program/commit/b18093abab0f1aa938d804d91d93e6c55e2ba949)) by lawrence.w@binance.com - fix(bundler): compile optional chaining when using latest caniuse-lite ([771dc7af](https://git.toolsfdg.net/fe/mini-program/commit/771dc7af2ea7eb809d3c3834f5733052dfb6df27)) by jolin.h@binance.com - fix(sdk): android css transition native component ([a70840e6](https://git.toolsfdg.net/fe/mini-program/commit/a70840e6d95fd2488bfe0993377224da6defa855)) by henry.w@binance.com ### Features - feat(sdk): add binance-card-info api ([65680864](https://git.toolsfdg.net/fe/mini-program/commit/65680864e327d5b81eca872e11ca4db55039948e)) by lawrence.w@binance.com - feat(demo): migrate to pika ([8cdffe8c](https://git.toolsfdg.net/fe/mini-program/commit/8cdffe8c1f46bb9181a915b7f21fc9a512db2063)) by dylan.z@binance.com - feat(sdk): jssdk dashboard rename & calculate ([ea78ac01](https://git.toolsfdg.net/fe/mini-program/commit/ea78ac01e11f57278428b190b600e0e008e0fc53)) by finley.x@binance.com - feat(sdk): wallet connector use new wallet provider ([ca346f5d](https://git.toolsfdg.net/fe/mini-program/commit/ca346f5d4f9560ae2fb59c2c2fdbb251eb8f4a33)) by zane.x@binance.com ### Refactor - refactor: throw error for the non-supported apis in IDE ([62e2ad65](https://git.toolsfdg.net/fe/mini-program/commit/62e2ad659b2143dd6eac1567fb2016758a4294e6)) by lucifer.l@binance.com ### Internal - docs: remove the app.config.json issue since pika will support it ([747343ed](https://git.toolsfdg.net/fe/mini-program/commit/747343ed66a9de848d6399a9e9521a6ba5f883e1)) by dylan.z@binance.com ## [4.5.0-dev.1] 2023-01-18 **Download: [SDK-4.5.0-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.5.0-dev.1.zip)** ### Features - feat(lib): add WebViewComponent to @binance/bmp-components - feat(demo): add English desc to image mode demo - feat(sdk): remove window info cache for view-base mode - feat(lib): add getCurrentInstance & getTabBar to @binance/bmp-react ### Internal - docs: getCurrentInstance query incorrect ## [4.4.0-dev.5] 2023-01-12 **Download: [SDK-4.4.0-dev.5](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.4.0-dev.5.zip)** ### Bug Fixes - fix(sdk): fit audio platform api getters/setters on Andriod - fix(sdk): add RootPortal type ## [4.4.0-dev.4] 2023-01-11 **Download: [SDK-4.4.0-dev.4](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.4.0-dev.4.zip)** ### Bug Fixes - fix(sdk): mpc method - fix(lib): update types of bmp-react ### Features - feat(sdk): webview component supports message ### Internal - chore: update config for FAQ - docs: faq about app.config.json ## [4.4.0-dev.3] 2023-01-10 **Download: [SDK-4.4.0-dev.3](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.4.0-dev.3.zip)** ### Bug Fixes - fix(sdk): types of bn.call & add RootPortal to bmp-components ### Features - feat(sdk): add runtime-plugin-mpc - feat(automator): impove `setupProxyMethod` & add test - feat(sdk): create buffer url supports extension option ### Internal - docs(sdk): darkmode ## [4.4.0-dev.2] 2023-01-06 **Download: [SDK-4.4.0-dev.2](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.4.0-dev.2.zip)** ### Bug Fixes - fix(demo): caret-color - fix(lib): virtual-list use new bmp packages - fix(sdk): update canIuse info ### Features - feat(demo): add audio and write file benchemark - feat(sdk): swiper support previousMargin/nextMargin/snapToEdge - feat(automator): add mock api for automator - feat(lib): bmp-api & bmp-components & bmp-react - feat(sdk): add error log for 603114 ## [4.4.0-dev.1] 2023-01-04 **Download: [SDK-4.4.0-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.4.0-dev.1.zip)** ### Bug Fixes - fix(sdk): cherry pick fix picker view component - fix(lib): @binance/mp-components don't import @tarojs/components - fix(sdk): image reload after src changes ### Features - feat(sdk): View support prop: catchMove - feat(demo): images add mode & readFile add length & position config - feat(lib): generate types for @binance/mp-service - feat(sdk): root-portal ### Internal - chore(sdk): cherry pick update sdk loading - test: add more unit tests for host ## [4.3.0-dev.4] 2022-12-22 **Download: [SDK-4.3.0-dev.4](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.3.0-dev.4.zip)** ### Bug Fixes - fix(sdk): mini game keyboard event ### Features - feat: integrate automator on CI ### Internal - chore: remove `yarn playwright install --with-deps` ## [4.3.0-dev.3] 2022-12-21 **Download: [SDK-4.3.0-dev.3](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.3.0-dev.3.zip)** ### Bug Fixes - fix(demo): fix demo navigation bar page - fix(bundler): fix babel env target ### Features - feat(sdk): loadFontFace - feat(sdk): file system api use platform api - feat(sdk): expose navigateBackMiniProgram, add mpModalType prop to navigateToMiniProgram - feat(sdk): webview bounce and loading bar ### Refactor - refactor: rename host-mp-ide to host-ide ### Internal - docs(sdk): integrate with doc-system - chore(package.json): fix installing sqllite3 in macos ## [4.3.0-dev.2] 2022-12-19 **Download: [SDK-4.3.0-dev.2](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.3.0-dev.2.zip)** ### Bug Fixes - fix(demo): api navigation bar input element - fix(sdk): cherry-pick from release/3.14 ### Features - feat(lib): fork implement from @tarojs/components to @binance/mp-components - feat(sdk): create buffer url use platformAPI ### Internal - chore(package.json): add packageManager field - chore: replace resolve with join - chore(sdk): cherry-pick from 4.2.1 - chore: update version remote and pwd alias ## [4.3.0-dev.1] 2022-12-14 **Download: [SDK-4.3.0-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.3.0-dev.1.zip)** ### Bug Fixes - fix(runtime): network service setupServices multiple times - fix(automator): update @binance/mp-web for fix some issue and add `sdkPath` option - fix(bundler): launch MP with page of independent subpackage - fix(sdk): Image widthfix/heightFix mode can update size automatically - fix(demo): fix universal-share css ### Features - feat(sdk): createInnerAudioContext use platform api - feat(demo): fix create buffer url demo ### Internal - chore: bump local - chore: update prefetch rule of component demo - docs: demos readme ## [4.2.0-dev.4] 2022-11-30 **Download: [SDK-4.2.0-dev.4](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.2.0-dev.4.zip)** ### Bug Fixes - fix(bundler): reorder files in pkg - renderer files first - fix(sdk): fix web canvas width and height ### Features - feat(sdk): gcanvas optimazation ### Internal - chore: remove useless message in changelog.md by 'bot' ## [4.2.0-dev.3] 2022-11-30 **Download: [SDK-4.2.0-dev.3](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.2.0-dev.3.zip)** ### Bug Fixes - fix(automator): replace parcel with http server to fix the installation issue from BIDS - fix(sdk): selectorQuery return empty when error - fix(runtime): remove BXML spaces ### Features - feat(demo): add a rendererId 0 issue test case ### Refactor - refactor(sdk): plugins including show-leaderboard, storage and tab-bar ### Internal - chore: redirect blank page issue ## [4.2.0-dev.2] 2022-11-24 **Download: [SDK-4.2.0-dev.2](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.2.0-dev.2.zip)** ### Bug Fixes - fix(bundler): remove setImmediate polyfill to fix pika MP white screen on iOS ### Refactor - refactor(sdk): native ui plugin - refactor(sdk): replace enum with union type ### Internal - chore(changelog): @mp/worker-mg@1.0.23 - chore(changelog): @mp/server-side-bundle@1.0.15 - chore(changelog): @mp/runtime-service-web@0.2.29 - chore(changelog): @mp/gen-sdk@1.0.25 - chore(changelog): @mp/host@0.2.58 - chore(changelog): @binance/mp-automator@2.0.7 - chore(changelog): @mp/remote-debug@1.0.25 - chore(changelog): @mp/mp-runtime-shared-plugins@1.1.24 - chore(changelog): @mp/runtime-plugin-user-info@1.0.16 - chore(changelog): @mp/runtime-plugin-ensure-resources@1.0.15 - chore(changelog): @mp/runtime-plugin-load-subpackage@1.0.13 - chore(changelog): @mp/plugins-mg@1.0.48 - chore(changelog): @mp/runtime-plugin-download-package@1.0.16 - chore(changelog): @mp/webview@1.0.16 - chore(changelog): @mp/runtime-plugin-performance@1.0.19 - chore(changelog): @mp/runtime-plugin-fps@1.0.9 - chore(changelog): @mp/app-command@1.0.18 - chore(changelog): @mp/runtime-plugin-create-intersection-observer@1.0.9 - chore(changelog): @mp/runtime-plugin-wallet-connector@1.0.5 - chore(changelog): @mp/runtime-plugin-current-ui-event@1.0.9 - chore(changelog): @mp/plugins-mp-internal@1.0.15 - chore(changelog): @mp/runtime-plugin-sensor-compass@1.0.8 - chore(changelog): @mp/runtime-plugin-app-lifecycle@1.0.8 - chore(changelog): @mp/runtime-plugin-system-info@1.0.13 - chore(changelog): @mp/runtime-plugin-sensor-gyroscope@1.0.8 - chore(changelog): @mp/runtime-plugin-keyboard@1.0.8 - chore(changelog): @mp/runtime-plugin-request-subscribe-message@1.0.6 - chore(changelog): @mp/runtime-plugin-sensor-accelerometer@1.0.8 - chore(changelog): @mp/runtime-plugin-app-internal@1.0.10 - chore(changelog): @mp/runtime-plugin-custom-plugin@1.0.13 - chore(changelog): @mp/runtime-plugin-ensure-logged-in@1.0.7 - chore(changelog): @mp/runtime-plugin-share-panel@1.0.11 - chore(changelog): @mp/runtime-plugin-inner-audio@1.0.7 - chore(changelog): @mp/runtime-plugin-update-manager@1.0.13 - chore(changelog): @mp/runtime-plugin-location@1.0.9 - chore(changelog): @mp/runtime-plugin-save-image-to-photos-album@1.0.8 - chore(changelog): @mp/runtime-plugin-audio-interruption@1.0.7 - chore(changelog): @mp/runtime-plugin-websocket@1.0.13 - chore(changelog): @mp/runtime-plugin-sensor-device-motion@1.0.8 - chore(changelog): @mp/runtime-plugin-upload-file@1.0.12 - chore(changelog): @mp/runtime-plugin-share-menu@1.0.5 - chore(changelog): @mp/runtime-plugin-scan-code@1.0.8 - chore(changelog): @mp/runtime-plugin-file-system-manager@1.0.8 - chore(changelog): @mp/runtime-plugin-create-webview@1.0.12 - chore(changelog): @mp/runtime-plugin-authorize@1.0.6 - chore(changelog): @mp/runtime-plugin-error-page@1.0.9 - chore(changelog): @mp/runtime-plugin-image-info@1.0.14 - chore(changelog): @mp/runtime-plugin-make-phone-call@1.0.6 - chore(changelog): @mp/runtime-plugin-can-use@1.0.14 - chore(changelog): @mp/bundler@3.0.9 - chore(changelog): @mp/runtime-plugin-framework-storage@1.0.4 - chore(changelog): @mp/runtime-plugin-choose-image@1.0.8 - chore(changelog): @mp/host-core@1.0.14 - chore(changelog): @binance/mp-cli@2.4.29 - chore(changelog): @mp/mpp-service@1.0.34 - chore(changelog): update changelog for version v4.2.0-dev.1 - chore(changelog): @binance/mp-web@0.0.34 - chore(changelog): @binance/mp-automator@2.0.5 - chore(changelog): @mp/runtime-sdk-electron@0.1.28 - chore(changelog): @mp/host@0.2.57 - chore(changelog): @mp/gen-sdk@1.0.24 - chore(changelog): @mp/mp-runtime-shared-plugins@1.1.23 - chore(changelog): @mp/runtime-service-web@0.2.28 - chore(changelog): @mp/remote-debug@1.0.24 - chore(changelog): @mp/runtime-plugin-load-subpackage@1.0.12 - chore(changelog): @mp/plugins-mp@1.0.47 - chore(changelog): @mp/plugins-mg@1.0.47 - chore(changelog): @mp/runtime-worker-common@1.0.26 - chore(changelog): @mp/runtime-plugin-download-package@1.0.15 - chore(changelog): @mp/runtime-plugin-ensure-resources@1.0.14 ## [4.2.0-dev.1] 2022-11-23 **Download: [SDK-4.2.0-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.2.0-dev.1.zip)** ### Bug Fixes - fix(automator): fix some bugs & add `.waitFor` - fix(sdk): native component css - fix(sdk): (cherry-pick) reduce the blank page - fix(runtime): no need to add webview when open new page - fix(demo): input style of storage pages & update privatePrefetchRules - fix(sdk): cherry pick - load-script-progress event when mp background event to lead blank screen - fix(sdk): cherry pick fix location plugin - fix(cli): skip generation of unmatched tags - fix(demo): request pages issue of component-demo - fix(sdk): load \_\_app.js after $ready - fix(sdk): remove generating worker-service-game.qjs - fix(runtime): vibrate shifting bug - fix(demo): show isPrefetch in request pages ### Features - feat(sdk): demo update & delete appTimeline - feat(sdk): native webview component - feat(demo): runtime benchmark add getAppBaseInfo apis - feat(sdk): (cherry-pick)support caretColor for Input and TextArea components - feat(automator): automator added headless option & refactor `.launch` & demo page - feat(demo): move sync-api-demo to component-demo & update prefetchRules - feat(sdk): api on add to favorites - feat(bundler): generate fileTree for analyzeSource - feat(sdk): first render new fields - feat(runtime): support selecting sdk ### Refactor - refactor(host): plugin user-info - refactor(host): plugin & remove twoFA demo ### Internal - chore(changelog): @mp/runtime-service-web@0.2.27 - chore(changelog): @mp/server-side-bundle@1.0.13 - chore(changelog): @binance/mp-automator@2.0.4 - chore(changelog): @binance/mp-web@0.0.33 - chore(changelog): @mp/runtime-sdk-electron@0.1.27 - chore(changelog): @mp/gen-sdk@1.0.23 - chore(changelog): @mp/runtime-worker-common@1.0.25 - chore(changelog): @mp/worker-mg@1.0.21 - chore(changelog): @mp/mp-runtime-shared-plugins@1.1.22 - chore(changelog): @mp/remote-debug@1.0.23 - chore(changelog): @mp/host@0.2.56 - chore(changelog): @mp/runtime-plugin-load-subpackage@1.0.11 - chore(changelog): @mp/plugins-mg@1.0.46 - chore(changelog): @mp/runtime-plugin-ensure-resources@1.0.13 - chore(changelog): @mp/runtime-plugin-user-info@1.0.15 - chore(changelog): @mp/runtime-plugin-download-package@1.0.14 - chore(changelog): @mp/webview@1.0.15 - chore(changelog): @mp/runtime-plugin-performance@1.0.17 - chore(changelog): @mp/runtime-plugin-fps@1.0.8 - chore(changelog): @mp/app-command@1.0.17 - chore(changelog): @mp/runtime-plugin-create-selector-query@1.0.11 - chore(changelog): @mp/runtime-plugin-wallet-connector@1.0.4 - chore(changelog): @mp/runtime-plugin-create-intersection-observer@1.0.8 - chore(changelog): @mp/runtime-plugin-current-ui-event@1.0.8 - chore(changelog): @mp/runtime-plugin-request-subscribe-message@1.0.5 - chore(changelog): @mp/runtime-plugin-app-lifecycle@1.0.7 - chore(changelog): @mp/runtime-plugin-ensure-logged-in@1.0.6 - chore(changelog): @mp/plugins-mg-internal@1.0.13 - chore(changelog): @mp/runtime-plugin-update-manager@1.0.12 - chore(changelog): @mp/runtime-plugin-auth-capture@1.0.6 - chore(changelog): @mp/runtime-plugin-sensor-gyroscope@1.0.7 - chore(changelog): @mp/runtime-plugin-upload-file@1.0.11 - chore(changelog): @mp/runtime-plugin-web3@1.0.4 - chore(changelog): @mp/runtime-plugin-network@1.0.8 - chore(changelog): @mp/runtime-plugin-websocket@1.0.12 - chore(changelog): @mp/runtime-plugin-save-image-to-photos-album@1.0.7 - chore(changelog): @mp/runtime-plugin-sensor-compass@1.0.7 - chore(changelog): @mp/runtime-plugin-sensor-orientation@1.0.6 - chore(changelog): @mp/runtime-plugin-image-info@1.0.13 - chore(changelog): @mp/runtime-plugin-location@1.0.8 - chore(changelog): @mp/mpp-service@1.0.33 - chore(changelog): @mp/runtime-plugin-app-internal@1.0.9 - chore(changelog): @mp/runtime-plugin-keyboard@1.0.7 - chore(changelog): @mp/runtime-plugin-custom-plugin@1.0.12 - chore(changelog): @mp/runtime-plugin-share-panel@1.0.10 - chore(changelog): @mp/runtime-plugin-download-file@1.0.6 - chore(changelog): @mp/runtime-plugin-choose-image@1.0.7 - chore(changelog): @mp/runtime-plugin-make-phone-call@1.0.5 - chore(changelog): @mp/runtime-plugin-authorize@1.0.5 - chore(changelog): @mp/runtime-plugin-system-info@1.0.12 - chore(changelog): @mp/runtime-plugin-preview-image@1.0.8 - chore(changelog): @mp/runtime-plugin-scan-code@1.0.7 - chore(changelog): @mp/runtime-plugin-on-off@1.0.9 - chore(changelog): @mp/runtime-plugin-create-webview@1.0.11 - chore(changelog): @mp/runtime-plugin-can-use@1.0.13 - chore(changelog): @mp/runtime-plugin-clipboard@1.0.7 - chore(changelog): @mp/bundler@3.0.7 - chore(changelog): @mp/runtime-plugin-file-system-manager@1.0.7 - chore(changelog): @mp/runtime-plugin-favorite@1.0.2 - chore(changelog): @mp/runtime-shared@1.0.15 - chore(changelog): @mp/host-core@1.0.13 - chore(changelog): @binance/mp-cli@2.4.28 - chore(changelog): @binance/mp-web@0.0.32 - chore(changelog): @binance/mp-automator@2.0.3 - chore(changelog): @binance/mp-automator@2.0.2 - chore(changelog): @mp/runtime-sdk-electron@0.1.26 - chore(changelog): @mp/runtime-service-web@0.2.26 - chore(changelog): @binance/mp-web@0.0.31 - chore(changelog): @mp/host@0.2.55 - chore(changelog): @mp/worker-mg@1.0.20 - chore(changelog): @mp/remote-debug@1.0.22 - chore(changelog): @mp/plugins-mg@1.0.45 - chore(changelog): @mp/runtime-worker-common@1.0.24 - chore(changelog): @mp/runtime-plugin-download-package@1.0.13 - chore(changelog): @mp/runtime-plugin-performance@1.0.16 - chore(changelog): update changelog for version v3.14.8 - chore(changelog): @mp/runtime-service-web@0.2.25 - chore(changelog): @mp/gen-sdk@1.0.21 - chore(changelog): @binance/mp-web@0.0.30 - chore(changelog): @mp/runtime-worker-common@1.0.23 - chore(changelog): @mp/worker-mg@1.0.19 - chore(changelog): @mp/remote-debug@1.0.21 - chore(changelog): @mp/runtime-plugin-user-info@1.0.14 - chore(changelog): @mp/plugins-mp@1.0.44 - chore(changelog): update changelog for version v4.0.3 - chore(changelog): @mp/mpp-service@1.0.32 - chore(changelog): @binance/mp-automator@2.0.0 - chore(changelog): @mp/bundler@3.0.6 - chore(changelog): @mp/server-side-bundle@1.0.12 - chore(changelog): @binance/mp-web@0.0.29 - chore(changelog): @mp/runtime-service-web@0.2.24 - chore(changelog): @binance/mp-automator@1.0.14 - chore(changelog): @binance/mp-web@0.0.28 - chore(changelog): @mp/host@0.2.53 - chore(changelog): @mp/gen-sdk@1.0.20 - chore(changelog): @mp/worker-mg@1.0.18 - chore(changelog): @mp/mp-runtime-shared-plugins@1.1.19 - chore(changelog): @mp/plugins-mg@1.0.43 - chore(changelog): @mp/runtime-worker-common@1.0.22 - chore(changelog): @mp/remote-debug@1.0.20 - chore(changelog): @mp/plugins-mp@1.0.43 - ci: fix git push tag one by one - chore(changelog): @mp/server-side-bundle@1.0.11 - chore(changelog): @mp/mpp-service@1.0.31 - chore(changelog): @mp/bundler@3.0.5 - chore(changelog): update changelog for version v3.14.7 - chore: add caretColor demo - chore(changelog): update changelog for version v3.14.6 - chore(changelog): update changelog for version v4.1.0 - chore(changelog): update changelog for version v4.1.0 - chore(changelog): @binance/mp-cli@2.4.27 - chore(changelog): update changelog for version v4.0.2 - chore(changelog): @mp/gen-sdk@1.0.17 - chore(changelog): @mp/gen-sdk@1.0.16 - chore: gen-sdk local - chore(changelog): @binance/mp-automator@1.0.9 - chore(changelog): @binance/mp-web@0.0.23 - chore(changelog): update changelog for version v4.1.0-dev.3 ## [4.1.0-dev.3] 2022-11-10 **Download: [SDK-4.1.0-dev.3](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.1.0-dev.3.zip)** ### Bug Fixes - fix(cli): mpService should support both function api and object api ### Features - feat(sdk): web canvas component - feat(demo): mini game system info demo ### Internal - chore(changelog): @binance/mp-cli@2.4.26 - chore(changelog): @binance/mp-automator@1.0.7 - chore(changelog): @binance/mp-web@0.0.21 - chore(mp-web): update start script - chore(changelog): update changelog for version v3.14.5 - chore(changelog): @binance/mp-cli@2.4.25 - chore: fix changelog.md - chore(changelog): update changelog for version v4.1.0-dev.2 ## [4.1.0-dev.2] 2022-11-09 **Download: [SDK-4.1.0-dev.2](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.1.0-dev.2.zip)** ### Bug Fixes - fix(mp-web): support absolute path - fix(changelog): changelog bug: 3.14.5-dev.1 & 4.0.2-dev.1 - fix(sdk): add readme for deprecated usage - fix(sdk): cherry pick - await load appJs - fix(sdk): fix image style not work - fix(cli): remove .npmrc and add npm token - fix(cli): duplicate resolve issue of ConditionNamesPlugin - fix(sdk): network service - fix(sdk): ready replace uirenderserviceready - fix(host): create webview files issue - fix(host): support private-request command - fix(runtime): download-file not work - fix(sdk): env undefined - fix(sdk): revoke native buffer issue - fix(mp-web): fix sw.js ready timeline issue - fix(sdk): native-image onload and image bug ### Features - feat(sdk): load gcanvas on demand - feat(sdk): add page-frame-resource points - feat(automator): refactor mp-web & inject mp-web to automator - feat(sdk): gcanvas createJSBuffer, less cpu cost - feat(automator): support plugins service to fix service undefined issue - feat(bundler): add **REPORT_POINTS** for renderer - feat(sdk): nezhaRenderPageJs point - feat(automator): allow reloading the mini-program - feat(cli): update publish yml file - feat(sdk): truncate long rpc logs limit length - feat(sdk): shareAppMessage support fallback url - feat(sdk): add debounce to navigator - feat(cli): support conditional exports bmp - feat(sdk): renderer to native page ready - feat(sdk): add param usePrefetchCache to bn.request - feat(demo): release component-demo PROD - feat(sdk): getPerformance support entryType: loadPackage downloadPackage - feat(sdk): scroll-view support showScrollbar - feat(sdk): mg keyboard api - feat(demo): taro version runtime benchmark ### Refactor - refactor(sdk): migrate wallet-connector plugin - refactor(host): share-menu(sdk & host)and network - refactor(sdk): migrate toast plugin ### Misc - Revert "fix(sdk): env undefined" ### Internal - chore(changelog): @binance/mp-cli@2.4.24 - chore(demo): update prefetchRules of component-demo - chore(changelog): @binance/mp-cli@2.4.23 - ci: fix bump exclude checked cache files - chore(changelog): @mp/gen-sdk@1.0.12 - ci: fix wrong git tag versions for manifest and changelog - chore(changelog): update changelog for version v3.14.5 - ci: pass the job if there is nothing to be validated - chore(changelog): @binance/mp-web@0.0.18 - chore(changelog): @binance/mp-web@0.0.17 - docs: update how to fixed log when version validate failed - chore(changelog): update changelog for version v3.14.5-dev.1 - docs(sdk): add docs about yarn bump - chore(changelog): update changelog for version v4.0.2-dev.1 - chore: fix submodule error by removing temp file - chore(changelog): @binance/mp-cli@2.4.22 - chore: bump version issue cause by cicd - chore: local auto bump support - chore(changelog): @binance/mp-cli@2.4.21 - chore: update ci - chore(changelog): update changelog for version v4.0.1 - chore: version validate - chore: rename pipeline name - chore: update npm-publish job - ci: fix release job for git fetch failed on CI - chore: test new job success - chore(changelog): update changelog for version v3.14.4 - chore: bump host deps chain - chore(changelog): update changelog for version v4.0.1-dev.1 - ci: setup ci changelog & release automatically - chore(sdk): bump plugins version - chore(sdk): plugin bump version - chore(sdk): bump versions - chore(sdk): add mg adapter file - chore(changelog): update changelog for version v4.1.0-dev.1 ## [3.14.5-dev.1] 2022-11-08 **Download: [SDK-3.14.5-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-3.14.5-dev.1.zip)** ### Features - feat(sdk): add page-frame-resource points ## [4.0.2-dev.1] 2022-11-08 **Download: [SDK-4.0.2-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.0.2-dev.1.zip)** ### Bug Fixes - fix(sdk): cherry pick - fix image style not work - fix(sdk): await load appJs ## [4.0.1-dev.1] 2022-11-02 **Download: [SDK-4.0.1-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.0.1-dev.1.zip)** ### Bug Fixes - fix(sdk): env undefined ### Internal - chore(cicd): yaml files ## [4.1.0-dev.1] 2022-10-27 **Download: [SDK-4.1.0-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.1.0-dev.1.zip)** ### Bug Fixes - fix(runtime): width of scroll-bar should be zero - fix(automator): support download-package rpc - fix(cli): update web host cli ### Features - feat(demo): virtual list - feat(runtime): support bn.env.USER_DATA_PATH - feat(sdk): remove monitor because native didn't support the commands - feat(sdk): loadScriptSync rpc ### Refactor - refactor(host): update manager and webview plugin - refactor(sdk): migrate web3 plugin ### Internal - chore(cicd): migrate prowjobs - chore(changelog): update changelog for version v4.0.0 - chore: noopify commands ## [4.0.0-dev.3] 2022-10-19 **Download: [SDK-4.0.0-dev.3](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.0.0-dev.3.zip)** ### Bug Fixes - fix(sdk): useNativeImage - fix(mpp-service): copy source-code ignore node_module & hidden files ### Features - feat(sdk): navigateTo add target external - feat(sdk): update canIUse for new api - feat(runtime): downloa-package add two fields ### Internal - chore(runtime): add currentSize filed - chore: update public demo - chore(sdk): automator package rename - chore(changelog): update changelog for version v4.0.0-dev.2 ## [4.0.0-dev.2] 2022-10-17 **Download: [SDK-4.0.0-dev.2](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.0.0-dev.2.zip)** ### Bug Fixes - fix(sdk): fix image and keep **MP_WARN_DEPRECATED** - fix(sdk): gcanvas toDataURL and audio time update event - fix(server-side-bundle): upload bytecode pkg issue - fix(sdk): getUserProfile mini game doesn't need check tap event ### Features - feat(bundler): add monitor NEZHA_RENDER_PAGE_JS & update sorter of pkg - feat(host): remove canvas useless dep - feat(sdk): remove deprecated items for sdk4.0 - feat(sdk): getSystemInfo cache - feat(server-side-bundle): compile & upload worker code into bytecode when enableBytecode - feat(sdk): bump versions - feat(sdk): bump version for ide deps - feat(sdk): validate current page is tabBar page when call tabBar apis - feat(demo): update prod demo - feat(sdk): plugin createIntersectionObserver and fix selectorQuery setTimeout issue - feat(sdk): detect darkmode for appBaseInfo - feat(sdk): load app js advance after worker send $Ready ### Misc - Revert "Revert "refactor(sdk): remove locationReadyManager " (#888)" (#929) ### Internal - chore(changelog): update changelog for version v3.14.2 - chore: update public demo - chore: component-demo - chore: bump npm versions - chore(changelog): update changelog for version v4.0.0-dev.1 ## [4.0.0-dev.1] 2022-10-12 **Download: [SDK-4.0.0-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-4.0.0-dev.1.zip)** ### Bug Fixes - fix(demo): native input width zero in android when container is a flex box - fix(sdk): reuqest text no response - fix(bundler): update dependencies to fix pkg-cli - fix(bundler): support error stack link jump of dev mode page.worker.js ### Features - feat(sdk): generate bytecode for worker-service - feat(sdk): gcanvas buffer data optimize - feat: native image - feat(bundler): add new package node-qjsc - feat(sdk): getAppBaseInfo & getWindowInfo & getDeviceInfo - feat(runtime): expose updateBackground of create webview service for ide - feat(sdk): $renderer-ready action - feat(sdk): loadScriptSync method ### Internal - chore(changelog): update changelog for version v3.14.1 ## [3.14.0-dev.4] 2022-09-26 **Download: [SDK-3.14.0-dev.4](https://ftp.binance.com/mp-sdk/dev/mp-sdk-3.14.0-dev.4.zip)** ### Bug Fixes - fix(sdk): cache promise online with polyfill - fix(sdk): mini game audio adapter - fix: disable ed and add @deprecated flag - fix(sdk): changelog issue ### Features - feat(demo): improve twoFa demo - feat(demo): remove webauthn demo - feat(bundler): add statistics mode to pkg-cli & feat(mpp-service): support config msv ### Misc - Revert "refactor(sdk): remove locationReadyManager " (#888) ### Internal - chore(changelog): update changelog for version v3.13.3 - chore(changelog): update changelog for version v3.14.0-dev.3 ## [3.14.0-dev.3] 2022-09-23 **Download: [SDK-3.14.0-dev.3](https://ftp.binance.com/mp-sdk/dev/mp-sdk-3.14.0-dev.3.zip)** ### Bug Fixes - fix(sdk): callbackId could be zero - fix(sdk): input scrollbar css issue on android - fix(sdk): isCache undefined issue ### Features - feat(sdk,demo): add private fps api and benchmark for render fps ### Internal - chore(changelog): update changelog for version v3.14.0-dev.2 ## [3.14.0-dev.2] 2022-09-22 **Download: [SDK-3.14.0-dev.2](https://ftp.binance.com/mp-sdk/dev/mp-sdk-3.14.0-dev.2.zip)** ### Bug Fixes - fix(mpp-service): fix status api empty fail message ### Features - feat(sdk): cache promise reject handler - feat(sdk): getperformance-evaluateScript - feat(lib): add promise polyfill source code and descreption ### Refactor - refactor(sdk): remove locationReadyManager ### Internal - chore(changelog): update changelog for version v3.14.0-dev.1 ## [3.14.0-dev.1] 2022-09-21 **Download: [SDK-3.14.0-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-3.14.0-dev.1.zip)** ### Bug Fixes - fix(sdk): add properties on webgl context - fix(sdk): fix timeOrigin 0 issues on IOS14 - fix(runtime): cannot resolve the font with url "bnshare://" - fix(sdk): fix getperformance firstRender - fix: cherry-pick cachePromise of getSystemInfo - fix(sdk): use promise polyfill fix promise task order in ios12 - ios14 - fix(sdk): error code detection of remote debug - fix(sdk): requestAnimationFrame NaN - fix(automator): web cli core apis - fix: add dependency to pass build job - fix(sdk): performance init appLaunch payload - fix: getPerformance first-render ### Features - feat(sdk): gcanvas async method - feat(server-side-bundle): use X-Mp-Open-Api-Token to authorize - feat(sdk): add warn deprecated info for sdk 4.0 - feat(sdk): support injected prop in webview component - feat(sdk): add experimental on walletconnector - feat(bundler): support include options in project.config.json - feat(sdk): error with stack - feat(sdk): new render point NEZHA_INJECT_RENDERER_JS_END & update timeline point info - feat(lib): use body class to control theme rather than prefers-color-scheme - feat(lib): remote-debug route-change-done notify to render - feat(cli): add props to webview - feat(sdk): mpRuntimeLogger rename & add error code - feat(sdk): webgl finish api - feat(mpp-service): output version info to MPP_SERVICE_OUTPUT.json - feat(sdk): time app check after app-launch - feat(bundler): impl util-function analyzeSource & remove AddEntryAppJsPlugin ### Performance Improvements - perf: app-rpc msg encoder - perf: pre-create worker - perf(sdk): use local js-sha3 ### Internal - chore(changelog): update changelog for version v3.13.2 - chore(tools): remove cicd - chore: fix dockerfile - chore(changelog): update changelog for version v3.13.1 - docs(demo): update automator readme - update cicd tool - update cicd tool - docs(docs): provide troubleshooting for canvas dependencies installing issue - cicd tools - docs: remove duplicated changelog for 3.13.0 - chore(changelog): update changelog for version v3.13.0 - chore(changelog): update changelog for version v3.13.0 ## [3.13.0-dev.5] 2022-09-01 **Download: [SDK-3.13.0-dev.5](https://ftp.binance.com/mp-sdk/dev/mp-sdk-3.13.0-dev.5.zip)** ### Bug Fixes - fix(sdk): loading when expect route-change type - fix(sdk): remove cachePromise to fix ios 13 eventloop issue ### Internal - chore(changelog): update changelog for version v3.13.0-dev.4 ## [3.13.0-dev.4] 2022-08-31 **Download: [SDK-3.13.0-dev.4](https://ftp.binance.com/mp-sdk/dev/mp-sdk-3.13.0-dev.4.zip)** ### Bug Fixes - fix(sdk): fix: fix to signature error when include specific data struct issue - fix(sdk): remove type check in wallet-connect plugin ### Internal - chore(changelog): update changelog for version v3.13.0-dev.3 ## [3.13.0-dev.3] 2022-08-31 **Download: [SDK-3.13.0-dev.3](https://ftp.binance.com/mp-sdk/dev/mp-sdk-3.13.0-dev.3.zip)** ### Features - feat(sdk): sdk-loading ### Internal - chore(changelog): update changelog for version v3.13.0-dev.2 ## [3.13.0-dev.2] 2022-08-30 **Download: [SDK-3.13.0-dev.2](https://ftp.binance.com/mp-sdk/dev/mp-sdk-3.13.0-dev.2.zip)** ### Bug Fixes - fix(sdk): gcanvas texImage2D flushnative - fix(sdk): fix taskify cache fail - fix(sdk): remove canvas service code ### Features - feat(lib): remote-debug new action & ignore native side delay error - feat(sdk): create webview sdk & demo - feat(runtime): disable click when loading display - feat(sdk): gcanvas supports cocos - feat(bundler): use zlib to compress pkg ### Internal - docs(sdk): components docs - chore: changelog automation ## [3.13.0-dev.1] 2022-08-23 **Download: [SDK-3.13.0-dev.1](https://ftp.binance.com/mp-sdk/dev/mp-sdk-3.13.0-dev.1.zip)** ### Bug Fixes - fix(sdk): fix applaunch-getPerformance - fix(sdk): fix webview sdk - fix(mpp-service): publish issue - fix(sdk): fix mg api host register ### Features - feat(sdk): setInterval 0 with warning - feat(sdk): add api requestSubscribeMessage - feat(sdk): make-phone-call - feat(runtime): @mp/host catch error and send to parent window - feat(sdk): canvas to temp file path api and demo - feat(sdk): add FP/FCP/LCP entry for performance API - feat(demo): add readfile api to benchmark - feat(sdk): add route-change-done event to fix route entry negative duration - feat(demo): add apiBenchmark at globalThis to run customize api benchmark - feat(demo): add extended-libs page - feat(demo): demo for webgl - feat(cli): quick publish for dev & qa ### Refactor - refactor(sdk): delete gcanvas useless code ### Internal - docs(sdk): view & text components docs - chore(sdk): getperformance update - test: taskify-unit-test - chore: deploy extended-lib to prod env - docs: add typedoc doc to generate plugin docs --- ## Document: Custom Component URL: /en/dev-docs/products/mini-program/framework/custom-component # Custom Component ## Custom Component Developers can abstract parts of a page into custom components for use across different pages, or to divide a page into multiple low-coupling modules for easy maintenance. Custom components work almost in the same way as basic components. ### Creating a Custom Component Like a page, a custom component includes json, bxml, bxss, and js files. To create a custom component, first declare the custom component in the json file. ```json { "component": true } ``` You can then write a component template in the bxml file and a component style in the bxss file, as you would when creating a page. Code example: ```html {{innerText}} ``` ```css /* This style applies only to this custom component */ .inner { color: red; } ``` Note: You should not use ID selectors, attribute selectors, or tag name selectors in the component's bxss. In the js file of the custom component, you should register the component using `Component()`, specifying the component's property definitions, data, and custom methods. The component's property values and data are used to render the bxml of the component. The property values are passed to the component externally. Code example: ```js Component({ properties: { // The innerText property is defined here, and the property value can be set when the component is used. innerText: { type: String, value: "default value", }, }, data: { // Here are some internal component data someData: {}, }, methods: { // A custom method customMethod: function () {}, }, }); ``` ### Using a Custom Component To use a registered custom component, you need to declare a reference to it in the page's json file. You should specify the tag name of each custom component and the file path to the appropriate custom component: ```json { "usingComponents": { "component-tag-name": "path/to/the/custom/component" } } ``` Then, you can use the custom components in the page's bxml in much the same way as you would use base components. The node name is the custom component's tag name, and the node property is the property value passed to the component. Code example: ```html ``` Once the custom component's bxml node structure is combined with the data, it will be inserted at the referenced location. --- ## Document: Configuration URL: /en/dev-docs/products/mini-program/framework/configuration # Configuration The `app.json` file, located in the root directory of Mini Program, is utilized to impose global configurations on Mini Programs. The contents of this file should be a JSON object encompassing the following properties: ### Configuration Items | Property | Type | Default Value | Required | Description | | ------------- | ------------------------------ | ------------- | -------- | ----------------------------------------------------------------------- | | entryPagePath | `string` | - | ✓ | index page name | | pages | `string[]` | - | ✓ | Page Path List | | window | `Object` | - | - | Global default window behavior | | tabBar | `Object` | - | - | Behavior of the `tab` bar at the bottom of the page. | | subPackages | `Object[]` | - | - | subPackage structure configuration. | | darkmode | `boolean` | - | - | whether app is in darkmode | | theme | `{light?:Object,dark?:Object}` | - | - | theme configuration, basically replaced by themeLocation | | themeLocation | `string` | - | - | Indicate the location of theme.json,it's required when darkmode is true | ### window | Property | Type | Default Value | Required | Description | | ---------------------------- | ---------- | ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | navigationBarBackgroundColor | `HexColor` | #000000 | - | The navigation bar background color | | navigationBarButtonColor | `HexColor` | #707A8A | - | The button color in the navigation. | | navigationBarTitleText | `string` | - | ✓ | Title text of the navigation bar | | navigationBarTextStyle | `string` | white | - | The title color of the navigation bar, only supports black or white | | navigationStyle | `string` | default | - | The navigation bar style. Only the following values are supported. `default`: the default style. `custom`: custom navigation bar, only retains the Mini Program control button in the upper-right corner, click [here](/docs/mini-program/framework/extended#navigation) for details. | | backgroundTextStyle | `string` | dark | - | The pull-down loading style, only dark and light are supported. | | backgroundColor | `HexColor` | #ffffff | - | The background color of the window. | ### tabBar Should the Mini Program operate as a multi-tab application (employing a tab bar at the lower or upper part of the application interface for toggling between tabs), the tabBar configuration setting allows you to define the interaction with the tab bar, as well as control the specific pages that appear when the user alternates between the given tabs. | Property | Type | Default Value | Required | Description | | --------------- | ---------- | ------------- | -------- | ---------------------------------------------------------------------------------------- | | color | `HexColor` | | ✓ | The default color of the tab bar text, only supports hex color codes. | | selectedColor | `HexColor` | | ✓ | The color of the tab bar text when being selected, only supports hex color codes. | | backgroundColor | `HexColor` | | ✓ | The color of the tab bar background, only supports hex color codes. | | borderStyle | `string` | black | | The border color of the tab bar, only supports `black` and `white`. | | list | `array` | | ✓ | The tab list (see the `list` property description), supports 2 to 5 tabs. | | position | `string` | bottom | | The tabBar position, only supports `bottom` and `top`. | | custom | `boolean` | false | | A custom tabBar, click [here](/docs/mini-program/framework/extended#tabbar) for details. | The list property accepts an array, **which can only configure 2 to 5 tabs**. The tabs are listed in the order of the array. Each item is an object with the following properties: | Property | Type | Default Value | Required | Description | | ---------------- | -------- | ------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | pagePath | `string` | | ✓ | The page path, which must be defined first in pages. | | text | `string` | | ✓ | The text of tab buttons. | | iconPath | `string` | | | The image path. The size of the icon is limited to 40 KB, suggested dimensions: 81px by 81px, online images are not supported. **When `position` is set to `top`, the icon is not displayed.** | | selectedIconPath | `string` | | | The image path for the selected icon. The size of the icon is limited to 40 KB, suggested dimensions: 81px by 81px, online images are not supported. **When `position` is set to `top`, the icon is not displayed.** | ### subPackages In certain scenarios, developers might need to segment a Mini Program into distinct subunits, bundling these subsidiary packages into separate subpackages during construction, hence enabling users to load them on an as-needed basis. During the development of a subpackage project, one or more subpackages may appear. Every subpackaged Mini Program should encompass a main package embodying the default start page/TabBar page, along with common resources and necessary JS scripts used by all subpackages. The subdivisions of sub-packages are subject to the developer's configuration. Upon initiating the Mini Program, the user's device downloads the main package by default, launching the pages housed within the main package. When a user navigates to a page within a subpackage, the related subpackage is downloaded and displayed upon successful completion of the download. > Supported from SDK ^3.2.0, IDE ^2.9.0 and Native ^2.40.0 | Property | Type | Default Value | Required | Description | | ----------- | ---------- | ------------- | -------- | ---------------------------------- | | root | `string` | | ✓ | root of subPackage | | name | `string` | | | alias name | | pages | `string[]` | | ✓ | page list related to root | | independent | `boolean` | | ✓ | If it is an independent subPackage | ### useExtendedLib This indicates the extra library that's needed. Right now, you can use this for: - react When you set useExtendedLib, it's like you're adding the newest version of that library's npm Package. The good part is, this doesn't make your Mini Program package bigger. The RC (Release Candidate) tool version lets you add references in sub-packages. You can use it like this: Use `true` to get the latestVersion. ```json { "useExtendedLib": { "react": true } } ``` You can also specify the exact version you want to use. ```json { "useExtendedLib": { "react": "17.0.2" } } ``` ### prefetchRules Data prefetching lets the Mini Program start a request early when it's first turned on, and it saves the response from the request. Then, when you actually make the request, you can use the saved data to cut down on the time for network requests. Here's how it works: ![img](https://bin.bnbstatic.com/image/julia/docs/mini-program/prefetch-flow.png) #### Configure prefetch rules Data prefetching rules need to be configured in app.json, examples are as follows: ```json { "prefetchRules": { // launch path that need to be configured with prefetch requests "pages/index/index": { // request url "https://developer.binance.com/${pageid}": { // request method "method": "POST", // request header "header": { "token": "${token}" }, // request body "data": { "pageSize": "${pageSize}", "pageNum": 1 }, // request response type "responseType": "text", "hitPrefetchExtraRules": { "requiredQueryKeys": ["testid"], "requiredHeaderKeys": ["token"] } } }, // match all launch paths "*": { // local file path, language is the variable "file://nezha-i18n-data_${language}.json": { // whether to wait for the file download to complete when starting the mini program "mandatory": true } } } } ``` #### Configure variables To make requests dynamic, we use configuration variables. These have the format ${variable}. To assign the variable, we replace the text ${variable} in the prefetchRules configuration string with the value of the variable. #### Variable data source Configuration variables can come from three places, listed by priority: 1. The query parameters in the Mini Program's page route 2. Data that developers have saved in storage 3. Data from the getSystemInfo interface, such as language When the client looks for a variable, it starts with the highest priority source. If it finds the variable there, it stops looking. If not, it checks the next source. If it can't find the variable in any of the sources, it won't make the request. #### Request url The url is the basic part of a request. With a complete url, we can start a request. Right now, we can use a variable in the path and query of a url, but not in the host. For example, let's say the prefetch configuration is set up a certain way. If the page route is pages/index/index?pageid=1000, and the developer stored the pageSize variable with a value of 10, then the final prefetch request will be https://developer.binance.com/1000?pagesize=10&pagenum=1 ```json { "prefetchRules": { "pages/index/index": { "https://developer.binance.com/${pageid}?pagesize=${pageSize}&pagenum=1": {} } } } ``` #### Request parameters The value of the request address serves as the request parameters. These include method, header, data, and responseType, which correspond to the bn.request API's parameters. These parameters also support configuration variables. Here is a table outlining the default values rules for method, header, data, and responseType: | Property | Type | Default Value | Required | Description | | ------------ | ------------------ | ------------------------------------ | -------- | ----------------------------------------------------- | | header | `object` | {'content-type': 'application/json'} | | Request header | | method | `string` | GET | | Request method, support GET, POST | | data | `string or object` | null | | Request data, needs to be consistent to hit the cache | | responseType | `string` | text | | Response data type, optional value: text | For example, suppose the request parameters are configured as follows: ```json { "https://developer.binance.com/${pageid}": { "method": "POST", "header": { "token": "${token}" }, "data": { "pageSize": "${pageSize}", "pageNum": 1 } } } ``` If the page route is pages/index/index?pageid=1000, the developer has stored the pageSize variable with a value of 10, and also stored the token variable with a value of test_token, then the parameters of the final prefetch request would look like this: ```json { "https://developer.binance.com/1000": { "method": "POST", "header": { "token": "test_token" }, "data": { "pageSize": "10", "pageNum": 1 } } } ``` #### Use prefetch cache The bn.request function includes an extra parameter, usePrefetchCache, and the return data includes the attribute isPrefetch to indicate whether the data was prefetched. Here's an example: ```json { "prefetchRules": { "pages/index/index": { "https://developer1.binance.com/${sid}?testid=${testid}&testdata=${sData}": { "method": "POST", "header": { "testCookie": "${sCookie}", "token": "xxxs1823730" }, "data": { "mData": "${mData}" }, "responseType": "" } } } } ``` ```js //storage const testCookie = bn.getStorageSync("sData"); const sCookie = bn.getStorageSync("sCookie"); const mData = bn.getStorageSync("mData"); //request const token = "xxxs1823730"; const { sid, testid } = option.query; const url = `https://developer1.binance.com/${sid}?testid=${testid}&testdata=${sData}`; const header = { testCookie, token }; const data = { mData }; bn.request({ url, header, data, method: "POST", dataType: "json", responseType: "text", usePrefetchCache: true, success: (res) => { console.log("Whether the returned data is from prefetching:", res.isPrefetch); console.log("Response data:", res.data); }, }); ``` #### Configure Matching rules Like the example at the beginning. You can configure `"hitPrefetchExtraRules"` property to control the behavior of matching rules. This property includes two keys: ```json { "prefetchRules": { "pages/index/index": { "https://developer.binance.com/?a=${a}&b=bbb": { "header": { "c": "${c}", "d": "ddd" }, "hitPrefetchExtraRules": { "requiredQueryKeys": ["a", "b"], "requiredHeaderKeys": ["c"] } } } } } ``` ![img](https://bin.bnbstatic.com/image/julia/docs/mini-program/match-rule.png) When native get a prefetchRule, need to replace the variable first and get the accurate url & parameters, and parse the accurate url to query keys and values (eg. query key is **a**, query value might be **aaa** in above example). If **requiredQueryKeys** is not declared or is a empty array, it will be considered as using exact match. | requiredQueryKeys | Rule URL / Request URL | hit | | -------------------------------------------- | --------------------------------------------------------------------------------------- | --- | | [] | https://developer.binance.com/?a=aaa&b=bbb / https://developer.binance.com/?b=bbb&a=aaa | yes | | [] a is extra | https://developer.binance.com/?b=bbb / https://developer.binance.com/?b=bbb&a=aaa | no | | [] a is missing | https://developer.binance.com/?b=bbb&a=aaa / https://developer.binance.com/?b=bbb | no | | ["b"] a is extra | https://developer.binance.com/?b=bbb / https://developer.binance.com/?b=bbb&a=aaa | yes | | ["b"] a is different | https://developer.binance.com/?b=bbb&a=ccc / https://developer.binance.com/?b=bbb&a=aaa | yes | | ["b"] a is missing | https://developer.binance.com/?b=bbb&a=aaa / https://developer.binance.com/?b=bbb | yes | | ["b"] b is missing | https://developer.binance.com/?b=bbb&a=aaa / https://developer.binance.com/?a=aaa | no | | ["b"] b is different | https://developer.binance.com/?b=bbb&a=aaa / https://developer.binance.com/?b=ccc&a=aaa | no | | ["a", "b"] | https://developer.binance.com/?b=bbb&a=aaa / https://developer.binance.com/?b=aaa&a=aaa | no | | ["c", "b"] c is not in rule url, exact match | https://developer.binance.com/?b=bbb&a=aaa / https://developer.binance.com/?a=ccc&b=bbb | no | | [b] b is not in rule url, exact match | https://developer.binance.com/?a=aaa / https://developer.binance.com/?b=bbb | no | The behavior of requiredHeaderKeys is similar to requiredQueryKeys, but it effects header field, not query of url #### File Prefetch Besides prefetching network requests, we also support prefetching files. The file prefetch configuration is similar to the network request configuration, but the value of the request address is the local file path. The file path also supports configuration variables. For example, if the file prefetch rules are set up as follows: ```json { "prefetchRules": { "pages/index/index": { "file://nezha-i18n-data_${language}.json": { "mandatory": true } } } } ``` If the page route is pages/index/index, and the client language is zh_CN, the variable 'language' will be replaced with 'zh_CN', which is retrieved from the getSystemInfo API. Therefore, the final prefetch request will be file://nezha-i18n-data_zh_CN.json. Upon launching the mini-program, the client will immediately begin downloading the file://nezha-i18n-data_zh_CN.json file using parallel download. If the value of `mandatory` is set as `true`, the mini-program will only launch once the file has successfully downloaded. If it's not set as `true`, the mini-program will launch immediately without waiting for the file to be downloaded (non-blocking). Developers can then use the bn.getFileSystemManager API to read the contents of the file. Here's an example: ```js const fs = bn.getFileSystemManager(); const filePath = "file://nezha-i18n-data_zh_CN.json"; const res = fs.readFileSync(filePath, "utf8"); console.log("File content:", res); ``` ## Page Configuration For each Mini Program page, you may use the .json file that shares the same name as the Mini Program to configure the window behaviors of that page. The configuration items in the current page will overwrite the corresponding `window` configuration items in the app.json file. The file content of this json file should be a JSON object. Here's an example: ```json { "navigationBarBackgroundColor": "#ffffff", "navigationBarTextStyle": "black", "navigationBarTitleText": "Binance API feature demo", "backgroundColor": "#eeeeee", "backgroundTextStyle": "light", "initialRenderingCache": "static", "staticTemplate": { "enable": true, "removeSkeleton": true, "data": { "list": [] } } } ``` | Property | Type | Default Value | Required | Description | | --------------------- | ------------------------------------------------------- | ------------- | -------- | --------------------------------------------------------------------------- | | initialRenderingCache | `"static"`\|`"dynamic"` | | - | Enable rendering cache. | | staticTemplate | `{enable:boolean,removeSkeleton?:boolean,data?:Object}` | | - | Page template can render as static template based on data in configuration. | ## DarkMode We provide developers the ability to incorporate Dark Mode in their applets. ### Enable DarkMode To enable Dark Mode, set `{ "darkmode" : true }` in the `app.json` file. Once enabled, all basic components will display different default styles based on the system theme. The navigation bar and tab bar will automatically switch according to the following configuration. ### Related Configuration When `{ "darkmode": true }` is set in app.json, certain applet configuration items can be set via variables, enabling definition of colors or icons under different themes in the variable configuration file as follows: 1. Configure `themeLocation` in `app.json`, specifying the path to the variable configuration file `theme.json`. For instance, to add `theme.json` in the root directory, configure `{"themeLocation": "/path/to/theme.json"}` 2. Define related variables in `theme.json`. 3. In `app.json`, reference variables that start with `@`. Properties that support configuration through variables include: 1. The window property of the global configuration and the property under the page configuration - navigationBarBackgroundColor - navigationBarTextStyle - backgroundColor - backgroundTextStyle - backgroundColorTop - backgroundColorBottom 2. Global configuration properties of window.tabBar - color - selectedColor - backgroundColor - borderStyle - list - iconPath - selectedIconPath ### Variable configuration file theme.json The `theme.json` file is used for variable definitions related to the color theme. Prioritize setting the path to `theme.json` in `themeLocation`, as the variable configuration cannot be read otherwise. The configuration file must contain the following properties: | Attribute | Type | Required | Description | | --------- | ------ | -------- | ---------------------------------- | | light | object | Yes | Variables definition in light mode | | dark | object | Yes | Variables definition in dark mode | Both light and dark modes can define variable names and values in the key:value format, as shown below: ```js { "light": { "navBgColor": "#f6f6f6", "navTxtStyle": "black" }, "dark": { "navBgColor": "#191919", "navTxtStyle": "white" } } ``` After the definition is completed, it can be referenced at the beginning of `@` in the relevant properties of the `global configuration` or `page configuration`, for example: ```js // global configuration { "window": { "navigationBarBackgroundColor": "@navBgColor", "navigationBarTextStyle": "@navTxtStyle" } } // page configuration { "navigationBarBackgroundColor": "@navBgColor", "navigationBarTextStyle": "@navTxtStyle" } ``` ### Configuration example `app.json` (the example omits configuration items other than those related to the theme) ```js { "window": { "navigationBarBackgroundColor": "@navBgColor", "navigationBarTextStyle": "@navTxtStyle", "backgroundColor": "@bgColor", "backgroundTextStyle": "@bgTxtStyle", "backgroundColorTop": "@bgColorTop", "backgroundColorBottom": "@bgColorBottom" }, "tabBar": { "color": "@tabFontColor", "selectedColor": "@tabSelectedColor", "backgroundColor": "@tabBgColor", "borderStyle": "@tabBorderStyle", "list": [{ "iconPath": "@iconPath1", "selectedIconPath": "@selectedIconPath1" }, { "iconPath": "@iconPath2", "selectedIconPath": "@selectedIconPath2" }] } } ``` `theme.json` ```js { "light": { "navBgColor": "#f6f6f6", "navTxtStyle": "black", "bgColor": "#ffffff", "bgTxtStyle": "light", "bgColorTop": "#eeeeee", "bgColorBottom": "#efefef", "tabFontColor": "#000000", "tabSelectedColor": "#3cc51f", "tabBgColor": "#ffffff", "tabBorderStyle": "black", "iconPath1": "image/icon1_light.png", "selectedIconPath1": "image/selected_icon1_light.png", "iconPath2": "image/icon2_light.png", "selectedIconPath2": "image/selected_icon2_light.png", }, "dark": { "navBgColor": "#191919", "navTxtStyle": "white", "bgColor": "#1f1f1f", "bgTxtStyle": "dark", "bgColorTop": "#191919", "bgColorBottom": "#1f1f1f", "tabFontColor": "#ffffff", "tabSelectedColor": "#51a937", "tabBgColor": "#191919", "tabBorderStyle": "white", "iconPath1": "image/icon1_dark.png", "selectedIconPath1": "image/selected_icon1_dark.png", "iconPath2": "image/icon2_dark.png", "selectedIconPath2": "image/selected_icon2_dark.png", } } ``` ### Get the current system theme If `"darkmode": true` is declared in `app.json`, the output of `bn.getSystemInfo` or `bn.getSystemInfoSync` will include a theme attribute, the value of which can be either 'light' or 'dark'. If `app.json` does not include the `"darkmode": true` declaration, the theme attribute is inaccessible (meaning, 'theme' would be undefined). ### Listening for Theme Switching Events There are two ways to monitor for theme switching: 1. In `App()`, insert the `onThemeChange` callback function. This callback will get triggered when the theme switches. 2. Utilize `bn.onThemeChange` to monitor for theme changes. You can cancel the monitoring using `bn.offThemeChange`. ### BXSS Adaptation In `BXSS`, we support theme adaptation through the media query `prefers-color-scheme`. This approach is consistent with the adaptation method used in Web. See the example below: ```css /* normal css style begin */ .case-background { background: white; } .case-text { color: black; } /* normal css style end */ @media (prefers-color-scheme: dark) { /* style under DarkMode start */ .case-background { background: #1b1b1b; } .case-text { color: #ffffff; } /* style under DarkMode end */ } ``` --- ## Document: BNS URL: /en/dev-docs/products/mini-program/framework/bns # BNS ## BNS BNS (Binance Script) is a scripting language designed for Mini Programs. Alongside BXML, it helps construct the page structure. ### Introduction BNS code can either be drafted within the `...` tags in a bxml file or in a .bns file. Each .bns file and `...` tag constitutes an individual module. Each module maintains its separate scope. Essentially, variables and functions established in a module are naturally private and hidden from other modules. If a module needs to expose its internal private variables and functions, it can only do so through module.exports. The `...` tag has two attributes - module and src. The module attribute is mandatory and ought to be unique. The src attribute is optional. If it isn't specified, the content within the `...` tags serves as the module code. ### Event Binding BNS functions can be employed to react to Mini Program events. At present, they can only respond to built-in component events, and do not support custom component events. Besides pure logical operations, BNS functions can also interact with the encapsulated ComponentDescriptor instance and set the component's classes and styles. For interactive animation, setting the style and class is sufficient. Example: BXML: ```xml module.exports = { changeToRed(e, instance) { instance.setClass('red'); }, changeToBlue(e, instance) { instance.setClass('blue') }, } Click to change font-size to 20px Click to change color to red Click to change color to blue ``` JS: ```js // /pages/comm.bns module.exports = { changeTo20Px(e, instance) { instance.setStyle({ "font-size": "20px", }); }, }; ``` The event handler accepts two parameters: e and instance. - e is the Event Target, the same as the event object in the Mini Program event binding function. - instance is the ComponentDescriptor instance of the current component, which can be used to set the class and style of the component. Currently, only two methods are supported, setClass and setStyle. --- ## Document: Upload to mini program platform URL: /en/dev-docs/products/mini-program/devtools/upload # Upload to mini program platform To use the IDE, log in with your Binance account and ensure your APPID is accurate (located in the Details Panel). If your project was initiated with CLI, run the following command in the root directory of the project to generate code for a real device: ```bash $ bmp build ``` ![img](https://bin.bnbstatic.com/image/julia/docs/mini-program/ide-6.png) By clicking 'Upload' in the Tool Bar, the IDE will bundle and upload your application. Post-upload, manage your app version via the [mpp website](https://developers.binance.com/en/mpp/). --- ## Document: Toolbar URL: /en/dev-docs/products/mini-program/devtools/toolbar # Toolbar ## Introduction Situated at the top of the main page, the toolbar in Devtool houses the most frequently utilized features in the IDE. This guide will walk you through these features from left to right. ![toolbar](https://bin.bnbstatic.com/image/julia/docs/mp-ide/toolbar.png) ## Toggle UI By clicking 'Editor', 'Debugger', 'Simulator', you can show and hide these three areas respectively. Refer to 'IDE Debugging' and 'Simulator' documents for more information. toggle.jpg ## Main Features ### Compile Mode toggle.jpg By default, the initial startup page of the mini-app is the first page listed in the app.json file without any parameters. To facilitate debugging of other pages or setting parameters, follow these steps: 1. Click the '+' sign in the dropdown list of this item to add a compile mode. 2. In the pop-up window, fill out the 'Mode Name', 'Page Parameters', and 'Global Parameters'. Then, select the 'Start Page' and click 'OK'. 3. The simulator will now display the new startup page with parameters automatically included. > Note: Check 'Simulation update at next refresh' in the pop-up window if you wish to simulate the > effect of applet updating. See the 'UpdateManager' documentation for more details. ### Preview Use real machine preview to check the functioning of the API in a mini app. ### Remote Debug Developers can inspect logs and elements from the native IDE using remote debugging. Refer to the 'remote-debug' document for more information. ### Clear Cache Clear authorization data and file cache with a single click. ### Upload toggle.jpg This feature allows you to upload your project code to the backend. The options available before uploading include: - Upload version: Each time you upload, the version is incremented by 0.0.1 by default. This version should be greater than the online version to ensure each code version in the backend is unique. - MSV: This stands for the minimum required SDK Version for your app. This is the lowest version your app can support. ### Details #### Basic Info This includes basic information about your app such as the appid, app name, local directory, output directory, etc. The local directory indicates where your mini-app is located. The output directory shows where your mini-app data is stored. This data includes the bundled app generated by the internal bundler, system data created by SDK, user data generated by mini-app users, and more. Click 'open' for more details. detail1.jpg #### Performance Analysis This is the same as 'Code Quality'. See the 'Code Quality' document for more details. details2.jpg #### Local Setting These settings allow developers to configure the SDK and Bundler versions, use a local SDK, and modify certain debugging behaviors. ##### 1. Select SDK This option lets you choose the SDK version used for running and debugging WeChat Mini Programs. The SDK is responsible for parsing, compiling, and executing Mini Program code. The selected version appears in the dropdown menu (e.g., 4.33.2). Developers can switch to a different SDK version if needed for compatibility testing. ##### 2. Local SDK Allows developers to use a custom or locally built SDK instead of the default WeChat SDK. You can specify the local SDK path (e.g., /Users/user/Works/mini-program/dist). To enable this, check the checkbox next to "Local SDK." Useful for testing modifications in the SDK or debugging specific issues. ##### 3. Select Bundler Determines the Bundler version used for packaging and building the Mini Program. The Bundler is responsible for compressing, minifying, and structuring the project files. The selected version appears in the dropdown menu (e.g., 3.0.127). Developers can switch to a different Bundler version for performance testing or debugging. select-bundler.gif ##### 4. Debugging Option: Disable Domain & Certificate Verification This involves whether to check the network request of the officially released mini-program (bn.request, bn.connectSocket, bn.downloadFile, bn.uploadFile) and whether the business domain name is allowed to be loaded by the '' component and has been configured as a legal domain name. Moreover, the TLS version of the domain name, the validity of the HTTPS certificate, and the server domain name can be configured in the MPP. This option could be enabled during the development process. This way, the IDE will not verify the security domain name, '' business domain name, TLS version, and HTTPS certificate. This aids in conveniently completing the debugging work during development. local-setting.jpg #### Project Setting Domain Info fetched from backend. You can edit these items by mp-admin site. The security domain name information of the mini app will be displayed, and the legal domain name can be set in MPP detail4.jpg --- ## Document: Storage Panel URL: /en/dev-docs/products/mini-program/devtools/storage # Storage Panel The Storage Panel serves to display the data storage of the current project after utilizing the [bn.setStorage](/products/mini-program/framework/api#mpservicesetstorage) command. In the Storage Panel, you can perform tasks such as deleting (by pressing the delete key), adding, and modifying data directly. ![img.png](https://bin.bnbstatic.com/image/julia/docs/mini-program/storage-panel.png) --- ## Document: Startup Page URL: /en/dev-docs/products/mini-program/devtools/startup-page # Startup Page Upon launching the Binance Devtool, a list of your existing projects will be displayed. project list ## Creating a Project A Mini Program project can be swiftly created locally by following these steps: 1. Click the first tile on your project list. 2. Input your chosen project name. 3. Specify the target folder for your project (note, an empty folder will not be accepted). 4. Choose the nature of your project (either Mini Program or Mini Game). 5. Select your preferred template. create a project Alternatively, a new project can be created utilizing @binance/mp-cli. By executing the following command, CLI will generate a simple project: ```bash $ bmp init [project-name] ``` ## Opening an Existing Project Existing projects can be opened by typing **import** and selecting your project's folder. Your selected project card will be placed at the front of the project list. ![img](https://bin.bnbstatic.com/image/julia/docs/mini-program/ide-3.png) If your project was created using CLI, run the following command in the root directory of the project: ```bash $ bmp dev ``` ## Managing Projects Local projects can be deleted either one by one or in batches. manage project --- ## Document: Source Map URL: /en/dev-docs/products/mini-program/devtools/sourcemap # Source Map A source map is a file that maps from the transformed source code to the original source code. This helps the browser to reconstruct the original source and display the reconstructed original in the debugger. Debugging with a source map, rather than the transformed state of the source code that the browser has downloaded, makes the process much easier. ## Enable Source Map You can enable source map under `Setting -> General Settings`. sourcemap ## Download Source Map There are two ways to download a source map. 1. Upon successful upload, you can download the source map by clicking the `Download SourceMap` button. download sourcemap 2. You can also download source map files from `Detail -> Download` in the mini program manager platform. download sourcemap in mini program manager platform --- ## Document: Simulator URL: /en/dev-docs/products/mini-program/devtools/simulator # Simulator The simulator is designed to emulate the behavior of Mini Programs within the Binance app. It allows you to run the compiled codes of the Mini Programs directly. simulator.jpg The following features are primarily located at the top of the simulator window: - Device switch: This allows you to choose different device sizes, including both iOS and Android devices. - Scale control: This enables you to control the scale of the Mini Program. - Text Size: This allows you to adjust the text size on the device. - Language: This enables you to change the device's language. - Network status: This lets you update the current network status (Wifi,2g,3g,4g, etc.). - Theme: This function allows you to switch between dark mode and light mode. - Capsule: This feature lets you switch the visibility of the capsule. - Home/Return: This mocks the scene value when you land your mini program. - Standalone window: This allows you to set the simulator to a standalone window (Tap the **Debugger**). simulator devices.jpg simulator i18n.jpg --- ## Document: Settings URL: /en/dev-docs/products/mini-program/devtools/settings # Settings All settings can be accessed via the tooltip of DevTools. To explore the `Project Settings` and `General Settings` features, simply click through. settings ## General Settings Here, you can customise the Binance DevTools' appearance, code editor operational habits, and styles. The available configurations include: - Language: Currently, only English is supported. - space: This is the default directory when initiating a project. - At Project Open: Set projects to compile automatically upon opening. - Compilation: Activate your source map for enhanced debugging capabilities. - Theme (found in the appearance panel): Choose among Dark, Light or Follow System options for your display. general settings
general appearance settings ## Project Settings [See more at the detail](toolbar.md#details) --- ## Document: Remote Debug URL: /en/dev-docs/products/mini-program/devtools/remote-debug # Remote Debug Developers can inspect logs and elements from the native IDE using remote debug. ## Environment - native version >= 2.53.0 - sdk version >= 3.14.0 ## Other Requirements - ‼️ Your mobile device should be on the same local network as your computer. - ‼️ Scan the QR code with the same Binance account that your IDE is logged into. ## How to Use 1. Click the Remote Debug Button located at the top of the IDE. ![remote-debug-icon](https://bin.bnbstatic.com/image/julia/docs/mp-ide/remote-debug/remote-debug-icon.png) > You must be logged in before proceeding with this step. 2. Scan the QR code generated in the previous step. ![remote-debug-qrcode](https://bin.bnbstatic.com/image/julia/docs/mp-ide/remote-debug/remote-debug-qrcode.png) 3. A panel will appear after scanning the QR code. ![remote-debug-panel](https://bin.bnbstatic.com/image/julia/docs/mp-ide/remote-debug/remote-debug-panel.png) 4. You can perform various operations, inspect logs, and view elements using this panel. In the debugger for remote debugging, you can debug code in the Console panel, view the source code of a Mini Program, and perform breakpoint or single-step debugging in the Sources panel. You can execute `bn` related functions within it. ![img](https://bin.bnbstatic.com/image/julia/docs/mini-program/remote-debug-bn.png) 5. The page will automatically refresh when any code changes. If you prefer it not to, you can click the off button. ![remote-debug-off](https://bin.bnbstatic.com/image/julia/docs/mp-ide/remote-debug/remote-debug-off.png) ## FAQ Q: Failed to connect to IDE? A: Ensure that your mobile device and IDE are on the same local network for the mobile device to access the IDE via IP and port. Q: Why is it loading all the time? A: Try capturing the network requests to see which request is pending. The network might be unstable, so please wait for a few minutes. If it still doesn't work, you can ask someone for help. 1. If the request URL starts with `/local-app-info/`, ask the IDE team for help. 2. If the request URL starts with `detail`, ask the BE team for help. 3. For other requests, ask the IOS or Android team for help. Q: What's the difference between remote debug and preview? A: Remote debug will pop up a `Remote Debug` window. Furthermore, remote debug will fetch `worker-remote-debug.js` and `render-remote-debug.js`. These two files will replace Bridge with WebSocketBridge. WebSocketBridge will forward all the requests for you. --- ## Document: Preview the Developing Application on the Device URL: /en/dev-docs/products/mini-program/devtools/preview # Preview the Developing Application on the Device To begin with, log in to the IDE with your Binance account and ascertain that the APPID is correct (visible in the Details Panel). If you've created the project using CLI, execute the following command in the project's root directory to generate code for the actual device: ```bash $ bmp build ``` ![img](https://bin.bnbstatic.com/image/julia/docs/mini-program/ide-5.png) By clicking 'Preview' in the Tool Bar, the IDE will bundle and upload your application. Upon successful upload, the IDE will generate a QR Code. Scan this QR code using Binance App to preview your application. ## FAQ ### Unable to open the app and received a 404 error code for the devtools preview feature To resolve this, clear cache by clicking the 'clean' button at the top of the IDE, then restart the IDE and try again. --- ## Document: Overview URL: /en/dev-docs/products/mini-program/devtools/overview # Overview Binance DevTools is a platform developed to simplify and boost efficiency in the creation and debugging of Binance Mini Programs. We've recently updated this tool to version [2.23.2](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.23.2.dmg). Key improvements include a better visual display, a smoother interaction experience, and enhanced performance. This notable upgrade aims to enrich the developer's experience in creating Binance Mini Programs. overview.jpg --- ## Document: Logical Layer Memory Debugging URL: /en/dev-docs/products/mini-program/devtools/memory # Logical Layer Memory Debugging Developers can utilize the **Memory** panel in the **Simulator** to capture a snapshot of the JS heap memory of the mini program's logic layer. This allows for the analysis of memory distribution and aids in resolving memory leaks. ![img.png](https://bin.bnbstatic.com/image/julia/docs/mini-program/memory-debugger-simulator-01.png) ![img.png](https://bin.bnbstatic.com/image/julia/docs/mini-program/memory-debugger-simulator-02.png) > For comprehensive instructions, please refer to the **Memory** panel in Chrome's developer tools. --- ## Document: Main Page URL: /en/dev-docs/products/mini-program/devtools/main-page # Main Page The Main Page is divided into four key components: Menu, Toolbar, Debugger, and Simulator. - Menu: Includes options such as Edit, Environment, Devtools, Settings and Help. - Toolbar: Offers functions like Show/Hide, Preview, Remote Debug, etc. - Debugger: Provides Local Debug for features like bxml, console, audit, and others. - Simulator: Represents the current mini-app on display. ## UI Here's an example of the User Interface (UI), using version 2.23.2. ![devtool-main-page](https://bin.bnbstatic.com/image/julia/docs/mp-ide/devtool-main-page.png) --- ## Document: Local Panels URL: /en/dev-docs/products/mini-program/devtools/local-panels # Local Panels With the introduction of Binance devTools 2.19.0 came new features, specifically, the mock data panel and audit panel. ## Audit ### Instructions The audit panel reviews your mini app's implementations, delivering an estimation score indicative of its adherence to best practices. With the latest version of Binance DevTools, new tools have been introduced to assist developers in applying best practices to their mini programs. The Audit Panel can be used to measure just how closely your mini program adheres to suggested methods for optimizing performance and user experience. ### Basic Usage 1. Click the **Run** button at the top-left (pictured below) and perform functions on the Mini Program interface. Upon running, the page will be scrutinized for "Experience Rating". ![img.png](https://bin.bnbstatic.com/image/julia/docs/mini-program/audits-panel-run.png) 2. Click **Stop** to cease the analysis, whereby an analysis report will appear, which you can use to refine your setup. 3. If you want to rerun the experience rating, click **Clear experience rating** at the top of the report to reset. Do bear in mind that the system doesn't currently support report storage services. Once experience ratings have been cleared, they are no longer viewable. ![img.png](https://bin.bnbstatic.com/image/julia/docs/mini-program/audits-panel-clear.png) ## Mock The mock data panel allows developers to mock all of the JS APIs of mini programs, making it possible to debug all features, especially those requiring native capabilities on the devtools, thereby saving significant development time. In the interests of facilitating small program development, the developer tool offers API Mock capability, simulating the calling results of some APIs. ### Instructions ### Basic Usage Find the entry for Mock in the Tab at the top of the tool debug panel and click + New Rule. ![img.png](https://bin.bnbstatic.com/image/julia/docs/mini-program/mock-panel-add.png) Example rule: ![img.png](https://bin.bnbstatic.com/image/julia/docs/mini-program/mock-panel-example-rule.png) Result of hitting the rule above: ![img.png](https://bin.bnbstatic.com/image/julia/docs/mini-program/mock-panel-resault.png) ### Rule Priority When multiple rules are set up for an API, the first rule will be matched first. Once a rule is hit, subsequent rules will not be executed. ### Data Templates Complex simulated data needs can be served by data templates, designed for rapid generation of data to your specifications. _The syntax of the data template is from the open-source library [Mock.js](https://github.com/nuysoft/Mock/wiki/Syntax-Specification). For detailed syntax, review the project documentation._ Data previews are generated in real-time from the template in the template editor, aiding confirmation of the template's accuracy. ![img.png](https://bin.bnbstatic.com/image/julia/docs/mini-program/mock-panel-template-data.png) ### Rule Import and Export If you need to share rules with other project members, you can export the rule configuration in Mock, and then send the configuration file to other members for them to import. The operational entry is shown below: ![img.png](https://bin.bnbstatic.com/image/julia/docs/mini-program/mock-panel-share-rule.png) #### Example Here's a getSystemInfoSync example of the import & export feature. It consists of three steps: - Create `getSystemInfoSync` mock Rules. - Export the rules as a config file to a local folder. - Import the local config file saved earlier in another project. You can use the append or cover mode to import the rules file. ![img.png](https://bin.bnbstatic.com/image/julia/docs/mp-ide/mock-example-step-1.jpg) ![img.png](https://bin.bnbstatic.com/image/julia/docs/mp-ide/mock-example-step-2.jpg) ![img.png](https://bin.bnbstatic.com/image/julia/docs/mp-ide/mock-example-step-3.jpg) ## Code Quality The latest version of Binance DevTools offers new tools designed to assist developers in applying best practices to their mini programs. The Code Quality Panel allows you to scan your mini-program project and receive suggestions about resource sizing to improve performance. ![applog-panel](https://bin.bnbstatic.com/image/julia/docs/mp-ide/analyze-tool.png) ## AppLog The AppLog is designed to assist developers in fine-tuning the performance of their mini programs. It lists all records from the framework, providing detailed insights into how the framework will perform when rendering the mini program. ![applog-panel](https://bin.bnbstatic.com/image/julia/docs/mp-ide/applog-panel.png) ## SourceMap To address issues where SDK errors in mini programs can't be restored, a SourceMap panel has been introduced. Developers simply enter the row and column number where the copied and pasted error is located, then select the version and the corresponding file, which will ensure the source code can be displayed. ![sourcemap-panel](https://bin.bnbstatic.com/image/julia/docs/mp-ide/sourcemap-panel.png) ## Timeline As we know, mini-programs need to run in specific containers, with the render and worker processes separated. This separation creates significant challenges for diagnosing and analyzing issues. The Timeline panel addresses this problem. By providing a complete log, it can display timelines for the native, worker, and render modules for different app IDs and sessions. It also shows a waterfall of resource and network requests, along with key performance data. ![Timeline Performance ](https://bin.bnbstatic.com/image/julia/docs/mp-ide/ide_timeline_panel.png) As shown in the image, you can zoom into a specific module area by scrolling down. Following the prompts, you can identify Long Task and memory warning situations. Clicking on a task will display its original log, allowing you to review and analyze the source code at that time. ![Timeline Performance Log ](https://bin.bnbstatic.com/image/julia/docs/mp-ide/ide_timeline_panel_log.png) ### Performance Timeline A simple panel for developers to see the key metrics such as FCP / LCP / FR and so on. ### Network and Resource Panel For us to detect the resource download timing, such as \_\_app.js, worker.js. If you know how the request happened on mini program, it will be very interesting to see the panel. Mostly the request is created by worker then handle by native and response to worker handlers. When it send from worker to native, it is handle by the rpc bridge, this step we call it as `queue`. After it will handle by native, native will request and get the response like browser fetch api, we call it `request`. Finally it will forward the response to worker, then developers can access the response, the whole step we call it `response`. Under normal circumstances, there should be only a minimal duration difference between the request and response steps. If not, worker is too busy and waiting a long time to response it. ![Timeline Network Log ](https://bin.bnbstatic.com/image/julia/docs/mp-ide/ide_network_timeline.png) ### Worker Timeline The mostly important frame for developers, since code always run at the worker. It list all the jssdk api function call and js engine sync task, such as timer. Additional, the custom log from developers. The dangerous red color means it is [long task](https://web.dev/articles/optimize-long-tasks), please try to optimize it if you consider the better performance. ![Timeline Network Log ](https://bin.bnbstatic.com/image/julia/docs/mp-ide/ide_timeline_worker.png) ### Custom Timeline log We analyze logs on the framework side through a specific format. Additionally, we provide developers with the ability to output custom logs to this timeline, as long as they adhere to the following log format. Please parse the `sync` property to check the long task, it will be helpful for optimization. ```txt [NEZ_C(W|R)][timestamp(endTime)][timestamp(startTime)][name]stringifyPayload(JSONString | string) ``` ### Timeline Usage Pre-require: - Binance App: >=2.87.0 - Binance App Type: Debug App - SDK >= 4.\* (renderer detail log for be available for 4.31.0) - IDE >= 2.49.0 #### iOS Logger Collect your log via `console` application in macOS, make sure the log includes - `Date and Time` - `Category` - `Message` **Make sure the log format endsWith `Message` body**. ![Timeline Network Log ](https://bin.bnbstatic.com/image/julia/docs/mp-ide/ide_timeline_log.png) After you start recording the log, please open the mini app to collect the log. Waiting for a few second to get fully log once you finish the app operation. Then just save all the log to the `txt` file. #### Android Logger For android, you enable the logcat. After all the step already, open the binance app and terminal. Copy the shell command to your terminal to write the log into the file. ```bash adb logcat -> timeline.txt ``` Open your mini app now! --- ## Document: FAQ URL: /en/dev-docs/products/mini-program/devtools/faq # FAQ For quick troubleshooting, we provide a detailed FAQ guide. You can browse it sequentially or use specific keywords to perform a search. For a simplified read, we've categorised the FAQs according to features: Simulator, Devtool Panels, Upload, Network, Preview & Remote Debug, and Extension. ## Simulator ### Dark Mode `darkMode: false` is not working At present, this feature is unsupported. You can verify it on the native side. ## Devtool Panels ### Excessive logs in console For minimising console logs, follow these steps: 1. Go to the toolbar and select `Devtools -> openApp Devtool`. 2. Run script (`document.querySelectorAll('webview')[1].openDevTools()`) in the console panel. 3. Run script (`localStorage.setItem('devtool-debugger', '1')`) in the console panel. 4. Refresh window and run a test now 😄 A dedicated package will be released soon to fix this. ### BXML is empty Upgrade your IDE to version 2.25.0 or later. ### Mocking API with different responses according to the parameters 1. Upgrade your IDE to version 2.26.0 or later. 2. Create multiple mock items each with different rules. ## Upload ### Encountered 400 error during upload Click `details` and verify if the logo is displayed correctly. If not, ensure that your appid and current environment are set correctly. ## Network ### Network requests failing - Activate `Does not verify valid domain names, web-view (business domain names), TLS versions and HTTPS certificates` found in `Details - Local Settings`. ### Image component is blank - Inspect the image node in BXML panel and confirm that the origin-src is correct. If not, review your code. ## Preview & Remote Debug ### Preview loading perpetually Ensure your IDE version is 2.25.0 or above, then clear cache and try again. ### Preview error Here is a list of common error codes, their causes, and remedies to assist developers in troubleshooting quickly. - `350002` means resource not found, please make sure you're using production package or change the env to be production if you're using development package. And make sure you app is in-house mode. - `603301` means invalid (type invalid or cannot download, such as webp type image, not sure we have error code for this before) - `603302` means image not found, please check the url of the image. - `603501` means \_\_app.js is missing, please upgrade your IDE and try again. --- ## Document: Download Stable Version URL: /en/dev-docs/products/mini-program/devtools/download-stable # Download Stable Version ## [2.54.0] 2024-12-06 \*\*Download: [MacOS(196.75 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.54.0.dmg) ### Features - feat: update @mp/bundler version to support svg ## [2.53.0] 2024-11-04 \*\*Download: [MacOS(196.96 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.53.0.dmg) ### Bug Fixes - fix: find extend lib file missing - fix: android qjs pkg support - fix(runtime): premature return issue in ide enviroment's show-modal api ### Features - feat: rank long task in timeline - feat: update timeline ## [2.52.0] 2024-10-04 \*\*Download: [MacOS(199.94 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.52.0.dmg) ### Features - feat: support preview qjs for android - feat(bundler): update bundler version - feat: support navigationBarButtonColor in ide - feat: support prefers-color-scheme ### Performance Improvements - perf: remove widget bundle and ignore skeleton error ## [2.51.0] 2024-09-13 \*\*Download: [MacOS(193.38 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.51.0.dmg) ### Bug Fixes - fix: update file service response for upload plugin ## [2.50.0] 2024-08-23 \*\*Download: [MacOS(193.38 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.50.0.dmg) ### Bug Fixes - fix: bundle pages rpc in bundeWatch for page updates - fix: always enable css agent and timeline renderWorker log bug ### Features - feat: update bundle watch add entry - feat: auto start detected port server - feat: use localips utils - feat: react devtools support - feat: add render worker support ### Performance Improvements - perf: only bundle all pages once then diff the change file to add page entry in watch mode - perf: hot reload without bundleApp ## [2.49.0] 2024-08-01 \*\*Download: [MacOS(187.82 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.49.0.dmg) ### Bug Fixes - fix: update sentry crash dsn and increase remote debug frame size - fix: bundle end then show the qrCode ### Features - feat: timeline support logan file and timezone offeset - feat(chore): update bundler - feat(bundler): update bundler - feat: timeline custom format - feat: new timeline profiler panel ### Performance Improvements - perf: enhance the user experience of the preview&remote-debug mode ## [2.48.0] 2024-07-12 \*\*Download: [MacOS(187.64 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.48.0.dmg) ### Bug Fixes - fix: preview slowly ### Features - feat: update block props in remote debug worker - feat: upgrade CDP method and show remote debug url at the popup - feat: webf cdp dom ## [2.47.0] 2024-06-26 \*\*Download: [MacOS(187.67 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.47.0.dmg) ### Bug Fixes - fix: load script still need defer ### Features - feat: support extendedLib for preview and remote-debug mode ## [2.46.0] 2024-06-03 \*\*Download: [MacOS(187.66 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.46.0.dmg) ### Bug Fixes - fix: no config error from mock ### Features - feat: increase maxReceivedFrameSize and add detail log for close reason - feat: bump mp deps - feat: support flutter cdp - feat: support mock env - feat: update bundler - feat: webf websocket renderer remote debug support ## [2.45.0] 2024-04-22 \*\*Download: [MacOS(187.70 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.45.0.dmg) ### Features - feat: deprecated built in libs - feat: update host - feat: interal local sdk ## [2.44.0] 2024-04-03 \*\*Download: [MacOS(188.23 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.44.0.dmg) ### Bug Fixes - fix: build error notarization - fix(doc): fix doc with chatgpt ### Features - feat: support dynamic libs ## [2.43.0] 2024-03-11 \*\*Download: [MacOS(183.39 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.43.0.dmg) ### Bug Fixes - fix: func is undefined ### Features - feat: remote debug support flutter renderer ## [2.42.0] 2024-02-19 \*\*Download: [MacOS(183.40 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.42.0.dmg) ## [2.41.1] 2024-02-19 \*\*Download: [MacOS(183.39 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.41.1.dmg) ### Bug Fixes - fix: env update - fix: remote debugger white screen ## [2.41.0] 2024-01-29 \*\*Download: [MacOS(183.39 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.41.0.dmg) ### Bug Fixes - fix: remove window download ## [2.40.0] 2023-11-27 **Download: [MacOS(182.98 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.40.0.dmg) ** ### Bug Fixes - fix: audit storage panel ### Features - feat(IDE): support webf-lint ## [2.39.0] 2023-11-06 **Download: [MacOS(175.69 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.39.0.dmg) ** ## [2.38.0] 2023-10-12 **Download: [MacOS(175.82 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.38.0.dmg) ** ### Bug Fixes - fix(ide): bids login page cannot open ## [2.36.0] 2023-09-06 **Download: [MacOS(175.82 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.36.0.dmg) ** ### Features - feat(IDE): update bundler - feat(IDE): support widget ## [2.35.0] 2023-08-15 **Download: [MacOS(184.27 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.35.0.dmg) ** ### Bug Fixes - fix: nightly build private repo issue - fix(ide): login page error ### Features - feat: measure devtool waiting time after modifying source code ## [2.34.0] 2023-07-31 **Download: [MacOS(181.48 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.34.0.dmg) ** ### Bug Fixes - fix: remote debug not work when not using preview - fix: webview src can't be http resource ### Performance Improvements - perf: enable bundle with system-cache ## [2.33.0] 2023-06-30 **Download: [MacOS(182.38 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.33.0.dmg) ** ### Bug Fixes - fix: [clamp] min should not be greater than max ## [2.32.1] 2023-06-12 **Download: [MacOS(182.35 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.32.1.dmg) ** ### Bug Fixes - fix: appid undefined ## [2.32.0] 2023-06-12 **Download: [MacOS(182.36 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.32.0.dmg) ** ### Bug Fixes - fix: object has been destroyed issue - fix: webContent undefined issue - fix: reply was never sent issue - fix: show dialog and stop when bundle failed ### Features - feat: Support skeleton ### Misc - revert: remove systeminforamtion ## [2.31.0] 2023-05-19 **Download: [MacOS(181.13 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.31.0.dmg) ** ### Bug Fixes - fix: cannot upload with contentType - fix: temp file not show - fix: create webview not works - fix: add contentType filed when upload for security - fix: bindings not found issue - fix: preview issue ### Features - feat: force pika with eta - feat: sourcemap viewer for mini-sdk - feat: bundler error ui - feat: login extension support dev mode - feat: add metric data for IPC channel - feat: data report for login extension ### Performance Improvements - perf: on demand bundleAll - perf: setup server on demand ## [2.30.0] 2023-04-07 **Download: [MacOS(155.92 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.30.0.dmg) ** ### Bug Fixes - fix: requestHeaders missing when using login extension ### Features - feat: filter other usage of cpu and memory - feat: login extension support qa env ## [2.29.0] 2023-03-20 **Download: [MacOS(155.88 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.29.0.dmg) ** ### Bug Fixes - fix: non pika response undefined - fix: pika build fold support ### Features - feat: remove systeminforamtion - feat: support uploading extension ## [2.28.0] 2023-02-24 **Download: [MacOS(159.06 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.28.0.dmg) ** ### Bug Fixes - fix: preview cache when websocket keep alive - fix: nightly build tags not update - fix: renderer logs not saved ### Features - feat: hide internal requests - feat: better capture timing - feat: add problem panel ## [2.27.0] 2023-02-03 **Download: [MacOS(154.65 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.27.0.dmg) ** ### Bug Fixes - fix: loading project board no data - fix: pass the skip verify domain configuration - fix: nightly build version with stable version - fix(bundler): root-portal component not work - fix: force update crash - fix: time picker mismatch - fix: non-pika remote upstream repo incorrect - fix: non-pika data appid is empty - fix: no tags in the nightly builder - fix: performance float issue in the test - fix: unit test error - fix: no response issue when use debugger ### Features - feat: format process name - feat: add changelog link for developer to check version info - feat: only expose worker context - feat: mock panel supports searching by name ## [2.26.0] 2023-01-16 **Download: [MacOS(154.61 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.26.0.dmg) ** ### Bug Fixes - fix: date picker style align native - fix: force update issue - fix: resolve pika and inner bmp path - fix: code quality issue and upload sentry symbols - fix: performance measure point no report ### Features - feat: add otf fonts for BinancePlex - feat: all the point - feat: support multi match - feat: reporter build duration in cicd - feat: auto fill upload form when last upload fail - feat: provide login extension for internal developers - feat: auto update by env ## [2.25.1] 2023-01-06 **Download: [MacOS(154.17 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.25.1.dmg) ** ### Bug Fixes - fix: resolve pika and inner bmp path ## [2.25.0] 2022-12-22 **Download: [MacOS(154.18 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.25.0.dmg) ** ### Bug Fixes - fix: csp protocol for blob - fix: msv auto fill not works - fix: reload app lead to BXML panel empty ### Features - feat: provide code quality panel UI - feat: metrics data collection - feat: write msv to project.config.json - feat: hide useless bxml panel and breadcrumbs ## [2.24.2] 2022-12-15 **Download: [MacOS(145.17 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.24.2.dmg) ** ### Bug Fixes - fix: performance measure point no report (#654) ## [2.24.1] 2022-12-09 **Download: [MacOS(145.17 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.24.1.dmg) ** ### Bug Fixes - fix: eslint - fix: reload app lead to BXML panel empty ### Features - feat: metrics data collection ## [2.24.0] 2022-12-01 **Download: [MacOS(143.41 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.24.0.dmg) ** ### Bug Fixes - fix: remove BXML spaces - fix: high cpu load issue - fix: page log not show - fix: default value not set in the form instance ### Features - feat: hide internal requests ## [2.23.2] **Download: [MacOS(143.24 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.23.2.dmg) ** ### Bug Fixes - fix: high cpu load issue - fix: default value not set in the form instance ## [2.23.1] **Download: [MacOS(143.24 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.23.1.dmg) ** ### Bug Fixes - fix: yarn lock cause withFileTypes of null ### Internal - ci: use prod check instead - chore(changelog): update changelog for version v2.23.0 - chore(changelog): update changelog for version v2.23.0-development.1 ## [2.23.0] **Download: [MacOS(139.13 MB)](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.23.0.dmg) ** ### Bug Fixes - fix: use bn-image tag instead of img to detect - fix: add same local network info when preview - fix: preview logo image styles - fix: show error when user's libVersion field not valid - fix: latest version has cache in yarn.lock - fix: audit panel export to html ### Features - feat: support msv auto fill - feat: migrate buitin sdk from 3.4.0 to 3.6.2 ### Refactor - refactor: remove plugin - refactor: remove share menu and network plugin - refactor(sdk): move plugin into skd host plugin ### Internal - ci: add package size when release - fead(ide): update bundler version - docs: custom compilation - chore: update settings - docs: setting - doc: public doc- Detail Dialog - doc: remote debug public doc - chore(changelog): update changelog for version v2.22.3 - chore(changelog): update changelog for version v2.22.3-development.1 - docs: startup page - docs: simulator - doc: public doc about main page and toolbar - doc: public doc about main page and toolbar - chore(changelog): update changelog for version v2.22.2 - chore(changelog): update changelog for version v2.22.2-development.1 - chore: upgrade @mp/host - docs: update img url - docs: update readme and overview - chore(changelog): update changelog for version v2.22.1 - chore(changelog): update changelog for version v2.22.1-development.1 ## [2.22.3] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.22.3.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/production/binance-devtools-setup-2.22.3.exe)** ### Features - feat: update bundler to ^3.0.0 ## [2.22.2] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.22.2.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/production/binance-devtools-setup-2.22.2.exe)** ### Internal - chore: upgrade @mp/host ## [2.22.1] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.22.1.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/production/binance-devtools-setup-2.22.1.exe)** ### Bug Fixes - fix: update error message - fix: skip loading when launch if no auto compile ### Features - feat: audit panel support base64 image cheking ### Internal - chore: update electron builder - chore(cicd): migrate prowjobs - chore(cicd): migrate prowjobs - ci(flow): migrate to flow cicd pipeline - chore(changelog): update changelog for version v2.22.0 ## [2.22.0] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.22.0.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/production/binance-devtools-setup-2.22.0.exe)** ### Bug Fixes - fix: capture time and timeout update - fix(ide): upload dialog issues - fix(ide): open project type error in hostRenderer - fix: copy source-code ignore node_module & .git - fix: msv support multiselection - fix: sourcemap dev mode link not works - fix: add file size field - fix: changelog issue - fix: reload devtool if needed ### Features - feat: update latest sdk deps and docs updates - feat(sdk): loadScriptSync rpc - feat(ide): create project validate - feat: validate upload parameters and refactor the dialog - feat(ide): capture preview of mp - feat(ide): update deps - feat: support webview template - feat(ide): support create webview - feat(panel): audit panel support exporting JSON - feat(plugin): plugin refactor and better types - feat: sourcemap zip with version - feat: guide user to use `code quality` - feat: support sourcemap download ### Internal - chore(changelog): update changelog for version v2.22.0-development.2 - chore(changelog): update changelog for version v2.22.0-development.1 - chore(changelog): update changelog for version v2.22.0-development.1 - doc: devtool panels - chore(changelog): update changelog for version v2.21.1-development.1 - chore(ide): compile check - chore: update MSV - chore(changelog): update changelog for version v2.21.0 - WIP: remote debug devtools use ws as protocol channel - chore(changelog): update changelog for version v2.21.0-development.1 ## [2.21.0] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.21.0.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/production/binance-devtools-setup-2.21.0.exe)** ### Features - feat(applog-panel): implement applog panel - feat: [IDE] Static analyze mp code using bundler's ability - feat: [IDE] Make console panel log more clean on production version ### Internal - chore: update bundler version - chore: update dependency - chore(changelog): update changelog for version v2.20.0 - chore(changelog): update changelog for version v2.20.0-development.1 ## [2.20.0] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.20.0.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/production/binance-devtools-setup-2.20.0.exe)** ### Bug Fixes - fix(ide-devtools-panel): fix audits - fix(audit-score): fix light theme color - fix: handle taro built mp - fix: replace template chinese comment and add logs page - fix: fix mock method no data - fix: fix mock fail template ### Features - feat: Audit panel detect performance remaining metrics - feat: repeat call warn in ide - feat: check local sdk version also - feat(audit-panel): deal with taro mp setData - feat(audit-score): research and implement audit score calculation - feat(audit-experience): add more columns into experience metrics - feat(audit-panel): Audit panel detect performance remaining metrics - feat(audit-panel): detect render cost time | init render, setData render - feat(audit): add experience related metric - feat(audit-panel): implement audit panel best practice metrics - feat(ide): mock open-type getPhoneNumber getEmailAddress behavior - feat(audit-panel): optimize report context - feat(ide-devtools-panel): audit panel render performance metrics - feat(mock panel): optimize mock panel - feat: show error message when webview fails to load ### Internal - chore: bump @mp/host version - docs: update v2.19.0-development.1 change log - chore(changelog): update changelog for version v2.19.0 ## [2.19.0] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.19.0.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/production/binance-devtools-setup-2.19.0.exe)** ### Bug Fixes - fix: use shelljs replace zx & install dep on linux - fix: remove duplicate them change emit event - fix: executeJavaScript causes bxml not to be displayed - fix: bxml page node has redundant spaces - fix(mock panel): fix ordered before existing data & generated template error - fix(mock panel): fix some bugs - fix: loading assets from resources - fix: fix no proxy method when open IDE for the first time - fix: fix-select-method - fix(ide): remote debug - fix: remove zx dependency ### Features - feat: clean console context - feat: clean console panel context selector - feat: close watcher to stop compile - feat: add mock sys - feat: setdata cnt adjust and bug fix - feat: integrate @mp/extended-lib - feat(devtools): implement audit panel for detect setData ### Refactor - refactor: plugin remove location, download-package, login - refactor: Mock Panel Better user behavior - refactor: move sensor plugin ### Internal - chore(ide): @mp/host upgrade to 0.2.25 - chore: optimization code - chore: universal link - chore(changelog): update changelog for version v2.18.1 - chore: changelog automation ## [2.18.1] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.18.1.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/production/binance-devtools-setup-2.18.1.exe)** ### Bug Fixes - fix: plainText body not supported ## [2.18.0] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/production/binance-devtools-2.18.0.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/production/binance-devtools-setup-2.18.0.exe)** ### Bug Fixes - fix: [IDE]custom launch condition mode-name show issue - fix: remove unnessary http request in mp-runtime-container ### Features - feat: update framework-load-script - feat: integrate service-side-bundle - feat(sdk): handle not found page ### Refactor - refactor: move plugins to runtime-plugins - refactor: plugin migration(error page, preview image) - refactor: migrate ide clipborad plugin - refactor: plugin migration ### Internal - chore: upgrade dependencies --- ## Document: Download Developer Version URL: /en/dev-docs/products/mini-program/devtools/download-rc # Download Developer Version ## [2.56.0-development.2] 2025-09-18 \*\*Download: [MacOS(205.20 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.56.0-development.2.dmg) ### Bug Fixes - fix: filter standalone-chunk from addEntry ### Features - feat: check node enviroment before download bundler - feat: feature request 2547 & 1893 - feat: support EventSource for IDE - feat: support five themes - feat: midnight -> dark_midnight - feat: support midnight - feat: enhance change bundler feature - feat: implement lite-timeline devtool panel ui - feat: support dynamic bundler - feat: support standalone-chunks - feat(ide): add diagnosticPage ## [2.56.0-development.1] 2025-01-17 \*\*Download: [MacOS(196.78 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.56.0-development.1.dmg) ## [2.55.0-development.1] 2025-01-10 \*\*Download: [MacOS(196.78 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.1.dmg) ## [2.50.0-development.2024082101] 2024-08-21 \*\*Download: [MacOS(193.36 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.50.0-development.2024082101.dmg) ### Features - feat: update bundle watch add entry ## [2.33.0-development.1] 2023-06-30 **Download: [MacOS(182.34 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.33.0-development.1.dmg) ** ### Bug Fixes - fix: [clamp] min should not be greater than max ## [2.32.1-development.1] 2023-06-12 **Download: [MacOS(182.35 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.32.1-development.1.dmg) ** ### Bug Fixes - fix: loading project not end - fix: appid undefined ## [2.31.0-development.1] 2023-04-27 **Download: [MacOS(175.06 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.31.0-development.1.dmg) ** ### Bug Fixes - fix: bindings not found issue - fix: preview issue ### Features - feat: bundler error ui - feat: login extension support dev mode - feat: add metric data for IPC channel - feat: data report for login extension ### Performance Improvements - perf: setup server on demand ## [2.26.0-development.1] 2023-01-11 **Download: [MacOS(154.61 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.26.0-development.1.dmg) ** ### Bug Fixes - fix: date picker style align native - fix: force update issue - fix: resolve pika and inner bmp path - fix: code quality issue and upload sentry symbols - fix: performance measure point no report ### Features - feat: add otf fonts for BinancePlex - feat: all the point - feat: support multi match - feat: reporter build duration in cicd - feat: auto fill upload form when last upload fail - feat: provide login extension for internal developers - feat: auto update by env ## [2.25.0-development.2] 2022-12-13 **Download: [MacOS(154.16 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.25.0-development.2.dmg) ** ### Bug Fixes - fix: csp protocol for blob - fix: msv auto fill not works ## [2.25.0-development.1] 2022-12-12 **Download: [MacOS(154.16 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.25.0-development.1.dmg) ** ### Bug Fixes - fix: reload app lead to BXML panel empty ### Features - feat: provide code quality panel UI - feat: metrics data collection - feat: write msv to project.config.json - feat: hide useless bxml panel and breadcrumbs ## [2.24.1-development.1] 2022-12-09 **Download: [MacOS(145.17 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.24.1-development.1.dmg) ** ### Bug Fixes - fix: eslint - fix: reload app lead to BXML panel empty ### Features - feat: metrics data collection ## [2.24.0-development.1] **Download: [MacOS(143.42 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.24.0-development.1.dmg) ** ### Bug Fixes - fix: remove BXML spaces - fix: high cpu load issue - fix: page log not show - fix: default value not set in the form instance ### Features - feat: hide internal requests ## [2.23.2-development.1] **Download: [MacOS(143.23 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.23.2-development.1.dmg) ** ### Bug Fixes - fix: high cpu load issue - fix: default value not set in the form instance ## [2.23.1-development.1] **Download: [MacOS(143.23 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.23.1-development.1.dmg) ** ### Bug Fixes - fix: yarn lock cause withFileTypes of null ### Internal - ci: use prod check instead - chore(changelog): update changelog for version v2.23.0 - chore(changelog): update changelog for version v2.23.0-development.1 ## [2.23.0-development.1] **Download: [MacOS(143.23 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.23.0-development.1.dmg) ** ### Bug Fixes - fix: yarn lock cause withFileTypes of null - fix: use bn-image tag instead of img to detect - fix: add same local network info when preview - fix: preview logo image styles - fix: show error when user's libVersion field not valid - fix: latest version has cache in yarn.lock - fix: audit panel export to html ### Features - feat: support msv auto fill - feat: migrate buitin sdk from 3.4.0 to 3.6.2 ### Refactor - refactor: remove plugin - refactor: remove share menu and network plugin - refactor(sdk): move plugin into skd host plugin ### Internal - ci: use prod check instead - chore(changelog): update changelog for version v2.23.0 - chore(changelog): update changelog for version v2.23.0-development.1 - ci: add package size when release - fead(ide): update bundler version - docs: custom compilation - chore: update settings - docs: setting - doc: public doc- Detail Dialog - doc: remote debug public doc - chore(changelog): update changelog for version v2.22.3 - chore(changelog): update changelog for version v2.22.3-development.1 - docs: startup page - docs: simulator - doc: public doc about main page and toolbar - doc: public doc about main page and toolbar - chore(changelog): update changelog for version v2.22.2 - chore(changelog): update changelog for version v2.22.2-development.1 - chore: upgrade @mp/host - docs: update img url - docs: update readme and overview - chore(changelog): update changelog for version v2.22.1 - chore(changelog): update changelog for version v2.22.1-development.1 ## [2.22.3-development.1] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.22.3-development.1.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/development/binance-devtools-setup-2.22.3-development.1.exe)** ### Features - feat: update bundler to ^3.0.0 ## [2.22.2-development.1] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.22.2-development.1.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/development/binance-devtools-setup-2.22.2-development.1.exe)** ### Internal - chore: upgrade @mp/host ## [2.22.1-development.1] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.22.1-development.1.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/development/binance-devtools-setup-2.22.1-development.1.exe)** ### Bug Fixes - fix: update error message - fix: skip loading when launch if no auto compile ### Features - feat: audit panel support base64 image cheking ### Internal - chore: update electron builder - chore(cicd): migrate prowjobs - chore(cicd): migrate prowjobs - ci(flow): migrate to flow cicd pipeline - chore(changelog): update changelog for version v2.22.0 ## [2.22.0-development.2] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.22.0-development.2.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/development/binance-devtools-setup-2.22.0-development.2.exe)** ### Bug Fixes - fix: capture time and timeout update - fix(ide): upload dialog issues - fix(ide): open project type error in hostRenderer - fix: copy source-code ignore node_module & .git - fix: msv support multiselection ### Features - feat(sdk): loadScriptSync rpc - feat(ide): create project validate - feat: validate upload parameters and refactor the dialog - feat(ide): capture preview of mp - feat(ide): update deps - feat: support webview template - feat(ide): support create webview ### Internal - doc: devtool panels - chore(changelog): update changelog for version v2.22.0-development.1 ## [2.22.0-development.1] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.22.0-development.1.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/development/binance-devtools-setup-2.22.0-development.1.exe)** ### Bug Fixes - fix(ide): open project type error in hostRenderer - fix: copy source-code ignore node_module & .git - fix: msv support multiselection ### Features - feat(ide): capture preview of mp - feat(ide): update deps - feat: support webview template - feat(ide): support create webview ### Internal - doc: devtool panels - chore(changelog): update changelog for version v2.21.1-development.1 ## [2.21.1-development.1] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.21.1-development.1.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/development/binance-devtools-setup-2.21.1-development.1.exe)** ### Bug Fixes - fix: sourcemap dev mode link not works - fix: add file size field - fix: changelog issue - fix: reload devtool if needed ### Features - feat(ide): update deps - feat(panel): audit panel support exporting JSON - feat(plugin): plugin refactor and better types - feat: sourcemap zip with version - feat: guide user to use `code quality` - feat: support sourcemap download ### Internal - chore(ide): compile check - chore: update MSV - chore(changelog): update changelog for version v2.21.0 - WIP: remote debug devtools use ws as protocol channel - chore(changelog): update changelog for version v2.21.0-development.1 ## [2.21.0-development.1] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.21.0-development.1.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/development/binance-devtools-setup-2.21.0-development.1.exe)** ### Features - feat(applog-panel): implement applog panel - feat: [IDE] Static analyze mp code using bundler's ability - feat: [IDE] Make console panel log more clean on production version ### Internal - chore: update bundler version - chore: update dependency - chore(changelog): update changelog for version v2.20.0 - chore(changelog): update changelog for version v2.20.0-development.1 ## [2.20.0-development.1] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.20.0-development.1.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/development/binance-devtools-setup-2.20.0-development.1.exe)** ### Bug Fixes - fix(ide-devtools-panel): fix audits - fix(audit-score): fix light theme color - fix: handle taro built mp - fix: replace template chinese comment and add logs page - fix: fix mock method no data - fix: fix mock fail template ### Features - feat: Audit panel detect performance remaining metrics - feat: repeat call warn in ide - feat: check local sdk version - feat(audit-panel): deal with taro mp setData - feat(audit-score): research and implement audit score calculation - feat(audit-experience): add more columns into experience metrics - feat(audit-panel): Audit panel detect performance remaining metrics - feat(audit-panel): detect render cost time | init render, setData render - feat(audit): add experience related metric - feat(audit-panel): implement audit panel best practice metrics - feat(ide): mock open-type getPhoneNumber getEmailAddress behavior - feat(audit-panel): optimize report context - feat(ide-devtools-panel): audit panel render performance metrics - feat(mock panel): optimize mock panel - feat: show error message when webview fails to load ### Internal - chore: bump @mp/host version - docs: update v2.19.0-development.1 change log - chore(changelog): update changelog for version v2.19.0 ## [2.19.0-development.1] **Download: [MacOS](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.19.0-development.1.dmg) | [Windows](https://ftp.binance.com/mp-ide/windows/development/binance-devtools-setup-2.19.0-development.1.exe)** ### Bug Fixes - fix: remove duplicate them change emit event - fix: executeJavaScript causes bxml not to be displayed - fix: bxml page node has redundant spaces - fix(mock panel): fix ordered before existing data & generated template error - fix(mock panel): fix some bugs - fix: loading assets from resources - fix: fix no proxy method when open IDE for the first time - fix: fix-select-method - fix(ide): remote debug - fix: remove zx dependency ### Features - feat: clean console context - feat: clean console panel context selector - feat: close watcher to stop compile - feat: add mock sys - feat: setdata cnt adjust and bug fix - feat: integrate @mp/extended-lib - feat(devtools): implement audit panel for detect setData ### Refactor - refactor: plugin remove location, download-package, login - refactor: Mock Panel Better user behavior - refactor: move sensor plugin ### Internal - chore(ide): @mp/host upgrade to 0.2.25 - chore: optimization code - chore: universal link - chore(changelog): update changelog for version v2.18.1 - chore: changelog automation --- ## Document: Download Nightly Version URL: /en/dev-docs/products/mini-program/devtools/download-nightly # Download Nightly Version ## [2.55.0-development.20250924] 2025-09-24 \*\*Download: [MacOS(205.20 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250924.dmg) ### Features - feat: check node enviroment before download bundler ## [2.55.0-development.20250626] 2025-06-26 \*\*Download: [MacOS(205.20 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250626.dmg) ### Features - feat: feature request 2547 & 1893 ## [2.55.0-development.20250610] 2025-06-10 \*\*Download: [MacOS(205.20 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250610.dmg) ### Features - feat: support EventSource for IDE ## [2.55.0-development.20250421] 2025-04-21 \*\*Download: [MacOS(198.14 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250421.dmg) ### Features - feat: support five themes - feat: midnight -> dark_midnight ## [2.55.0-development.20250421] 2025-04-21 \*\*Download: [MacOS(198.14 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250421.dmg) ### Features - feat: support five themes - feat: midnight -> dark_midnight ## [2.55.0-development.20250416] 2025-04-16 \*\*Download: [MacOS(198.19 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250416.dmg) ### Features - feat: midnight -> dark_midnight ## [2.55.0-development.20250410] 2025-04-11 \*\*Download: [MacOS(201.11 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250410.dmg) ### Features - feat: support midnight ## [2.55.0-development.20250407] 2025-04-07 \*\*Download: [MacOS(196.23 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250407.dmg) ### Bug Fixes - fix: filter standalone-chunk from addEntry ## [2.55.0-development.20250305] 2025-03-05 \*\*Download: [MacOS(196.23 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250305.dmg) ### Features - feat: enhance change bundler feature - feat: implement lite-timeline devtool panel ui ## [2.55.0-development.20250303] 2025-03-03 \*\*Download: [MacOS(196.19 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250303.dmg) ### Features - feat: support dynamic bundler ## [2.55.0-development.20250214] 2025-02-26 \*\*Download: [MacOS(196.23 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250214.dmg) ### Features - feat(ide): adjust lite-timeline tip - feat(ide): add lite-timeline panel ## [2.55.0-development.20250213] 2025-02-13 \*\*Download: [MacOS(196.18 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250213.dmg) ## [2.55.0-development.20250122] 2025-01-22 \*\*Download: [MacOS(196.20 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250122.dmg) ### Features - feat: support standalone-chunks ## [2.55.0-development.20250120] 2025-01-20 \*\*Download: [MacOS(201.36 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.55.0-development.20250120.dmg) ### Features - feat(ide): add diagnosticPage ## [2.54.0-development.20241121] 2024-11-29 \*\*Download: [MacOS(196.78 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.54.0-development.20241121.dmg) ## [2.54.0-development.20241120] 2024-11-20 \*\*Download: [MacOS(196.78 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.54.0-development.20241120.dmg) ## [2.53.0-development.20241101] 2024-11-01 \*\*Download: [MacOS(196.95 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.53.0-development.20241101.dmg) ### Bug Fixes - fix: find extend lib file missing ### Features - feat: rank long task in timeline ## [2.53.0-development.20241030] 2024-10-30 \*\*Download: [MacOS(196.95 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.53.0-development.20241030.dmg) ### Bug Fixes - fix: android qjs pkg support ### Features - feat: update timeline ## [2.53.0-development.20241022] 2024-10-22 \*\*Download: [MacOS(196.96 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.53.0-development.20241022.dmg) ### Bug Fixes - fix(runtime): premature return issue in ide enviroment's show-modal api ## [2.52.0-development.20240922] 2024-09-30 \*\*Download: [MacOS(193.68 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.52.0-development.20240922.dmg) ## [2.52.0-development.20240921] 2024-09-30 \*\*Download: [MacOS(193.68 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.52.0-development.20240921.dmg) ### Features - feat(bundler): update bundler version ## [2.52.0-development.20240920] 2024-09-30 \*\*Download: [MacOS(193.69 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.52.0-development.20240920.dmg) ### Features - feat(bundler): update bundler version ## [2.52.0-development.20240919] 2024-09-19 \*\*Download: [MacOS(193.69 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.52.0-development.20240919.dmg) ### Features - feat: support navigationBarButtonColor in ide - feat: support prefers-color-scheme ## [2.52.0-development.20240918] 2024-09-18 \*\*Download: [MacOS(193.69 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.52.0-development.20240918.dmg) ### Performance Improvements - perf: remove widget bundle and ignore skeleton error ## [2.51.0-development.20240903] 2024-09-03 \*\*Download: [MacOS(193.38 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.51.0-development.20240903.dmg) ## [2.51.0-development.20240902] 2024-09-02 \*\*Download: [MacOS(193.38 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.51.0-development.20240902.dmg) ## [2.50.0-development.20240821] 2024-08-21 \*\*Download: [MacOS(193.37 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.50.0-development.20240821.dmg) ### Bug Fixes - fix: bundle pages rpc in bundeWatch for page updates ### Features - feat: update bundle watch add entry ### Performance Improvements - perf: only bundle all pages once then diff the change file to add page entry in watch mode ## [2.50.0-development.20240821] 2024-08-21 \*\*Download: [MacOS(193.36 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.50.0-development.20240821.dmg) ### Performance Improvements - perf: only bundle all pages once then diff the change file to add page entry in watch mode ## [2.50.0-development.20240819] 2024-08-19 \*\*Download: [MacOS(193.32 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.50.0-development.20240819.dmg) ### Features - feat: auto start detected port server ### Performance Improvements - perf: hot reload without bundleApp ## [2.50.0-development.20240816] 2024-08-16 \*\*Download: [MacOS(193.32 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.50.0-development.20240816.dmg) ### Features - feat: use localips utils ## [2.50.0-development.20240815] 2024-08-15 \*\*Download: [MacOS(193.34 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.50.0-development.20240815.dmg) ### Features - feat: react devtools support ## [2.50.0-development.20240813] 2024-08-13 \*\*Download: [MacOS(187.86 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.50.0-development.20240813.dmg) ### Features - feat: add render worker support ## [2.50.0-development.20240805] 2024-08-05 \*\*Download: [MacOS(187.82 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.50.0-development.20240805.dmg) ### Bug Fixes - fix: always enable css agent and timeline renderWorker log bug ## [2.49.0-development.20240731] 2024-07-31 \*\*Download: [MacOS(187.84 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.49.0-development.20240731.dmg) ### Features - feat(chore): update bundler ## [2.49.0-development.20240725] 2024-07-25 \*\*Download: [MacOS(187.84 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.49.0-development.20240725.dmg) ### Features - feat(bundler): update bundler ## [2.49.0-development.20240722] 2024-07-22 \*\*Download: [MacOS(187.78 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.49.0-development.20240722.dmg) ### Bug Fixes - fix: bundle end then show the qrCode ### Features - feat: timeline custom format ## [2.49.0-development.20240719] 2024-07-19 \*\*Download: [MacOS(187.79 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.49.0-development.20240719.dmg) ### Features - feat: new timeline profiler panel ## [2.49.0-development.20240716] 2024-07-16 \*\*Download: [MacOS(187.66 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.49.0-development.20240716.dmg) ### Performance Improvements - perf: enhance the user experience of the preview&remote-debug mode ## [2.48.0-development.20240711] 2024-07-11 \*\*Download: [MacOS(187.67 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.48.0-development.20240711.dmg) ### Bug Fixes - fix: preview slowly ### Features - feat: update block props in remote debug worker ## [2.48.0-development.20240702] 2024-07-02 \*\*Download: [MacOS(187.65 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.48.0-development.20240702.dmg) ### Features - feat: upgrade CDP method and show remote debug url at the popup ## [2.48.0-development.20240627] 2024-06-27 \*\*Download: [MacOS(187.65 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.48.0-development.20240627.dmg) ### Features - feat: webf cdp dom ## [2.47.0-development.20240620] 2024-06-20 \*\*Download: [MacOS(187.65 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.47.0-development.20240620.dmg) ### Features - feat: support extendedLib for preview and remote-debug mode ## [2.46.0-development.20240531] 2024-05-31 \*\*Download: [MacOS(187.65 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.46.0-development.20240531.dmg) ### Features - feat: increase maxReceivedFrameSize and add detail log for close reason ## [2.46.0-development.20240529] 2024-05-29 \*\*Download: [MacOS(187.61 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.46.0-development.20240529.dmg) ### Features - feat: bump mp deps - feat: support flutter cdp ## [2.46.0-development.20240517] 2024-05-17 \*\*Download: [MacOS(187.67 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.46.0-development.20240517.dmg) ### Bug Fixes - fix: no config error from mock ### Features - feat: support mock env ## [2.46.0-development.20240516] 2024-05-16 \*\*Download: [MacOS(187.67 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.46.0-development.20240516.dmg) ### Features - feat: update bundler ## [2.46.0-development.20240514] 2024-05-14 \*\*Download: [MacOS(187.67 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.46.0-development.20240514.dmg) ### Features - feat: webf websocket renderer remote debug support ## [2.46.0-development.20240510] 2024-05-10 \*\*Download: [MacOS(187.67 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.46.0-development.20240510.dmg) ## [2.45.0-development.20240420] 2024-04-20 \*\*Download: [MacOS(191.33 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.45.0-development.20240420.dmg) ### Features - feat: update host ## [2.45.0-development.20240415] 2024-04-15 \*\*Download: [MacOS(188.21 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.45.0-development.20240415.dmg) ### Features - feat: interal local sdk ## [2.44.0-development.20240318] 2024-03-18 \*\*Download: [MacOS(183.41 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.44.0-development.20240318.dmg) ### Bug Fixes - fix(doc): fix doc with chatgpt ## [2.43.0-development.20240307] 2024-03-07 \*\*Download: [MacOS(183.42 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.43.0-development.20240307.dmg) ### Bug Fixes - fix: func is undefined ## [2.43.0-development.20240305] 2024-03-05 \*\*Download: [MacOS(183.41 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.43.0-development.20240305.dmg) ## [2.43.0-development.20240221] 2024-02-21 \*\*Download: [MacOS(183.40 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.43.0-development.20240221.dmg) ### Features - feat: remote debug support flutter renderer ## [2.42.0-development.20240201] 2024-02-01 \*\*Download: [MacOS(183.40 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.42.0-development.20240201.dmg) ### Bug Fixes - fix: remote debugger white screen ## [2.41.0-development.20231219] 2023-12-19 \*\*Download: [MacOS(182.99 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.41.0-development.20231219.dmg) ## [2.41.0-development.20231128] 2023-11-28 \*\*Download: [MacOS(182.99 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.41.0-development.20231128.dmg) ### Bug Fixes - fix: remove window download ## [2.40.0-development.20231124] 2023-11-24 **Download: [MacOS(182.99 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.40.0-development.20231124.dmg) ** ## [2.40.0-development.20231123] 2023-11-23 **Download: [MacOS(182.99 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.40.0-development.20231123.dmg) ** ## [2.40.0-development.20231119] 2023-11-20 **Download: [MacOS(182.99 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.40.0-development.20231119.dmg) ** ### Features - feat(IDE): support webf-lint ## [2.39.0-development.20231103] 2023-11-03 **Download: [MacOS(175.70 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.39.0-development.20231103.dmg) ** ## [2.36.0-development.20230829] 2023-09-20 **Download: [MacOS(177.57 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.36.0-development.20230829.dmg) ** ### Bug Fixes - fix: add node gyp ## [2.36.0-development.20230826] 2023-09-20 **Download: [MacOS(177.57 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.36.0-development.20230826.dmg) ** ### Bug Fixes - fix: upgrade electron-builder ## [2.36.0-development.20230825] 2023-09-19 **Download: [MacOS(175.88 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.36.0-development.20230825.dmg) ** ### Bug Fixes - fix: release ## [2.36.0-development.20230824] 2023-08-25 **Download: [MacOS(175.87 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.36.0-development.20230824.dmg) ** ### Features - feat(IDE): update bundler ## [2.36.0-development.20230816] 2023-08-16 **Download: [MacOS(175.83 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.36.0-development.20230816.dmg) ** ### Features - feat(IDE): support widget ## [2.35.0-development.20230809] 2023-08-09 **Download: [MacOS(184.28 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.35.0-development.20230809.dmg) ** ### Bug Fixes - fix: nightly build private repo issue - fix(ide): login page error ### Features - feat: measure devtool waiting time after modifying source code ## [2.33.0-development.20230619] 2023-06-19 **Download: [MacOS(182.34 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.33.0-development.20230619.dmg) ** ### Bug Fixes - fix: [clamp] min should not be greater than max ## [2.32.0-development.20230609] 2023-06-09 **Download: [MacOS(182.34 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.32.0-development.20230609.dmg) ** ### Bug Fixes - fix: object has been destroyed issue ## [2.32.0-development.20230608] 2023-06-08 **Download: [MacOS(182.35 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.32.0-development.20230608.dmg) ** ### Bug Fixes - fix: webContent undefined issue - fix: reply was never sent issue - fix: show dialog and stop when bundle failed ### Features - feat: Support skeleton ### Misc - revert: remove systeminforamtion ## [2.32.0-development.20230520] 2023-05-20 **Download: [MacOS(181.14 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.32.0-development.20230520.dmg) ** ## [2.31.0-development.20230518] 2023-05-18 **Download: [MacOS(181.14 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.31.0-development.20230518.dmg) ** ### Bug Fixes - fix: cannot upload with contentType ## [2.31.0-development.20230512] 2023-05-12 **Download: [MacOS(181.14 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.31.0-development.20230512.dmg) ** ## [2.31.0-development.20230511] 2023-05-11 **Download: [MacOS(179.41 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.31.0-development.20230511.dmg) ** ### Bug Fixes - fix: temp file not show - fix: create webview not works ### Performance Improvements - perf: on demand bundleAll ## [2.31.0-development.20230510] 2023-05-10 **Download: [MacOS(179.41 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.31.0-development.20230510.dmg) ** ### Bug Fixes - fix: add contentType filed when upload for security ## [2.31.0-development.20230504] 2023-05-04 **Download: [MacOS(175.26 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.31.0-development.20230504.dmg) ** ### Features - feat: force pika with eta ## [2.31.0-development.20230428] 2023-04-28 **Download: [MacOS(175.24 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.31.0-development.20230428.dmg) ** ### Features - feat: sourcemap viewer for mini-sdk ## [2.31.0-development.20230426] 2023-04-26 **Download: [MacOS(175.06 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.31.0-development.20230426.dmg) ** ### Features - feat: bundler error ui ## [2.31.0-development.20230424] 2023-04-24 **Download: [MacOS(175.05 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.31.0-development.20230424.dmg) ** ### Bug Fixes - fix: bindings not found issue ## [2.31.0-development.20230417] 2023-04-17 **Download: [MacOS(170.55 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.31.0-development.20230417.dmg) ** ### Performance Improvements - perf: setup server on demand ## [2.31.0-development.20230414] 2023-04-14 **Download: [MacOS(170.56 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.31.0-development.20230414.dmg) ** ### Features - feat: login extension support dev mode ## [2.31.0-development.20230413] 2023-04-13 **Download: [MacOS(170.56 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.31.0-development.20230413.dmg) ** ### Bug Fixes - fix: preview issue ## [2.31.0-development.20230412] 2023-04-12 **Download: [MacOS(170.56 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.31.0-development.20230412.dmg) ** ### Features - feat: add metric data for IPC channel - feat: data report for login extension ## [2.30.0-development.20230404] 2023-04-04 **Download: [MacOS(155.89 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.30.0-development.20230404.dmg) ** ### Features - feat: filter other usage of cpu and memory ## [2.30.0-development.20230329] 2023-03-29 **Download: [MacOS(155.87 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.30.0-development.20230329.dmg) ** ### Bug Fixes - fix: requestHeaders missing when using login extension ## [2.30.0-development.20230323] 2023-03-23 **Download: [MacOS(155.89 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.30.0-development.20230323.dmg) ** ### Features - feat: login extension support qa env ## [2.29.0-development.20230317] 2023-03-17 **Download: [MacOS(155.89 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.29.0-development.20230317.dmg) ** ### Features - feat: remove systeminforamtion ## [2.29.0-development.20230311] 2023-03-11 **Download: [MacOS(156.00 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.29.0-development.20230311.dmg) ** ### Bug Fixes - fix: pika build fold support ## [2.29.0-development.20230308] 2023-03-08 **Download: [MacOS(159.09 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.29.0-development.20230308.dmg) ** ## [2.29.0-development.20230303] 2023-03-03 **Download: [MacOS(159.09 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.29.0-development.20230303.dmg) ** ### Features - feat: support uploading extension ## [2.29.0-development.20230302] 2023-03-02 **Download: [MacOS(159.07 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.29.0-development.20230302.dmg) ** ## [2.28.0-development.20230222] 2023-02-22 **Download: [MacOS(159.10 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.28.0-development.20230222.dmg) ** ### Bug Fixes - fix: nightly build tags not update - fix: renderer logs not saved ### Features - feat: better capture timing - feat: add problem panel ## [2.26.0-development.20230216] 2023-02-16 **Download: [MacOS(159.10 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.26.0-development.20230216.dmg) ** ### Features - feat: better capture timing ## [2.26.0-development.20230213] 2023-02-13 **Download: [MacOS(154.65 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.26.0-development.20230213.dmg) ** ### Bug Fixes - fix: renderer logs not saved ## [2.26.0-development.20230208] 2023-02-08 **Download: [MacOS(154.64 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.26.0-development.20230208.dmg) ** ### Bug Fixes - fix: loading project board no data - fix: pass the skip verify domain configuration ### Features - feat: add problem panel ## [2.26.0-development.20230202] 2023-02-02 **Download: [MacOS(154.67 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.26.0-development.20230202.dmg) ** ### Bug Fixes - fix: nightly build version with stable version - fix(bundler): root-portal component not work ## [2.26.0-development.20230201] 2023-02-01 **Download: [MacOS(154.61 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.26.0-development.20230201.dmg) ** ### Features - feat: format process name ## [2.26.0-development.20230131] 2023-01-31 **Download: [MacOS(154.61 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.26.0-development.20230131.dmg) ** ### Bug Fixes - fix: force update crash - fix: time picker mismatch ### Features - feat: add changelog link for developer to check version info - feat: only expose worker context ## [2.26.0-development.20230130] 2023-01-30 **Download: [MacOS(154.61 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.26.0-development.20230130.dmg) ** ### Bug Fixes - fix: non-pika remote upstream repo incorrect ## [2.26.0-development.20230119] 2023-01-19 **Download: [MacOS(154.60 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.26.0-development.20230119.dmg) ** ### Bug Fixes - fix: non-pika data appid is empty ## [2.26.0-development.20230118] 2023-01-18 **Download: [MacOS(154.61 MB)](https://ftp.binance.com/mp-ide/mac/development/binance-devtools-2.26.0-development.20230118.dmg) ** ### Bug Fixes - fix: no tags in the nightly builder - fix: performance float issue in the test - fix: unit test error - fix: no response issue when use debugger ### Features - feat: mock panel supports searching by name --- ## Document: How to Use Devtools URL: /en/dev-docs/products/mini-program/devtools/devtool # How to Use Devtools ## Login ![img](https://bin.bnbstatic.com/image/julia/docs/mini-program/ide-login.png) ![img](https://bin.bnbstatic.com/image/julia/docs/mini-program/ide-login-2.png) ![img](https://bin.bnbstatic.com/image/julia/docs/mini-program/ide-login-3.png) ## Inspect Tool 1. Use `Open inspect tool` to add a request header. ![img](https://bin.bnbstatic.com/image/julia/docs/mini-program/ide-devtools-1.png) Write your request (It won't work if the request URL is incorrect). ```ts async onRequest(){ await bn.request({ url: 'https://www.devfdg.net/en/js-sdk-demo-ui/request' }) }, ``` 2. Add your header. ![img](https://bin.bnbstatic.com/image/julia/docs/mini-program/ide-devtools-2.png) ![img](https://bin.bnbstatic.com/image/julia/docs/mini-program/ide-devtools-3.png) ## How to Debug WebView Click the `Devtool` menu and select `Open Current Webview Component Devtools`. A devtool dialog will then appear. ![webview-devtool-menu](https://bin.bnbstatic.com/image/julia/docs/mp-ide/webview-devtool-menu.png) Ensure there's a webview component when you select `Open Current Webview Component Devtools`. If there isn't, nothing will happen. --- ## Document: Custom Compilation URL: /en/dev-docs/products/mini-program/devtools/custom-compilation # Custom Compilation Developers can use the compile button on the toolbar to compile the current code, and the devtools will automatically refresh the simulator. Additionally, developers can add or select custom compilation conditions to preview the compilation of their project code. This assists developers in debugging issues by entering a specific page from different scene values. custom compilation **Note: Compilation conditions are tied to individual projects, and each project can save its own compilation conditions.** create custom compilation Fields include: - Mode Name: The name for the current compilation. For example: `test`. - Startup Page: The entry page path of the compilation such as `pages/test`. - Parameters: The query string that will append to the startup page, for instance: `name=nezha&type=mp`. - Enter Scene: The Scene value of mini project upon launch. - Launch Options: Switch for 'the simulator update at next refresh'. scene values --- ## Document: /products/link-and-trade/Fast-API/Introduction URL: /en/dev-docs/products/link-and-trade/Fast-API/Introduction # Introduction Fast API can help users quickly authorize specific account permissions, create API keys, and automatically connect to third-party API link platforms. For more details, please refer to the [FAQ](https://www.binance.com/en/support/faq/what-is-fast-api-and-how-does-it-work-6aa7e2253c544d91b60746bfd03fd75d). ## Onboarding Steps 1. Log in [Binance Developer center](https://developers.binance.com/en/dev-docs) with [verified entity(enterprise) account](https://www.binance.com/en/support/faq/how-to-complete-entity-verification-kyb-on-binance-step-by-step-guide-360015552032) 2. Apply for "**Entity KYB**" & "**OAuth Security KYB**" 3. Once both passed, client can create "**Client ID**", upload "**logo(60 x60)**" and set up "**callback url**". We will send an Email that include “**Client ID**” and “**Client Secret**”(**please do not share your Client secret with anyone**) 4. Download the [SDK](https://drive.google.com/file/d/1xFvDTEjUQCL8bviGR9FfszzTiV6pN8Ci/view) for utilizing the pop up dialogues. 5. Apply for the oAuth scopes required. 6. Start development of oAuth and Fast API. ### Minimum requirements for Fast API: - **account:status** - **create:apikey** (For Spot & Margin trading permission, and Futures trading permission) _Or_ **create:apikey:margin** (For Margin Loan, repay, and Transfer permission) _Or_ **create:apikey:options** (For European Options Trading permission) - **user:openId** ## Remarks 1. The baseurl is "https://www.binanceapis.com/oauth-api" 2. When Link clients start to use oAuth, they will get their unique “Client ID” and “Client secret”. 3. When each User grants permission via oAuth, the Link client will get an unique “User’s open ID” and an "Access token". 4. Access token will be expired once the User’s API key is generated. 5. **Each user account** can only use the Fast API to connect with **Each Link client Once**. 6. Link client need to provide a public key for encrypting User’s API key, when requesting the API generation. Additionally, Link clients should be able to decrypt the API key package, and store it safely. 7. When Link client request to generate a user's API key, it should state clearly if this API key should have certain permission(s). In request params: - enableTrade → whether to enable Spot & Margin Trading - enableFutureTrade → whether to enable Futures Trading - enableMargin → whether to enable Margin Loan, Repay and Transfer - enableEuropeanOptions → whether to enable European Options Trading 8. To know if a user has a Futures account, Link client should use Oauth to check the user's status.and show the necessary Front end UI to allow the user to select. The standard Front end is provided as a SDK. ## Common Error messages ### 050009 - Invalid public key. Solution: 1. Do not use pem format 2. Encode the Public key ### 050010 - API generation failed. ### 001512 - Each account can only generate one API key for a certain third party via Fast API. ### 001464 - You have reached the API Key limit. Please delete the unused ones to create new API Keys. ### 2000039xxx - There may be multi error starting with 2000039, which represents the error message related to compliance. --- ## Document: /products/kyc-saas/general/Webhook-Notifications URL: /en/dev-docs/products/kyc-saas/general/Webhook-Notifications # Webhook Notifications The webhook notifications function can be implemented by passing a `notifyUrl` when calling our KYC endpoints to initialize KYC. `notifyUrl` is a mandatory parameter when initiating KYC. If not required, you can pass a "." instead. Binance will send a POST request webhook to your notifyUrl when there are updates to the KYC record. If the system's request to your notifyUrl fails, the system will auto retry as per the below policy: - On first failure, retry in 3 minutes - On second failure, retry in 5 minutes - On third failure, retry in 10 minutes ## Request sample ```json { "bizEntityKey": "BROKERKEY", "entityCustomerId": "45712345678999212345", "kycType": "USER", "eventType": "USER-STATUS", "eventVo": { "statusInfo": { "bizEntityKey": "BROKERKEY", "entityCustomerId": "45712345678999212345", "kycUserId": "45712345678999212345", "userType": "USER", "kycType": "USER", "kycStatus": "REJECT", "failReason": "This ID number has been used. Log in to your original account to complete the transaction.", "basicStatus": "PASS", "basicFailReason": "", "identityStatus": "REJECT", "identityFailReason": "This ID number has been used. Log in to your original account to complete the transaction.", "faceStatus": "REJECT", "faceFailReason": "This ID number has been used. Log in to your original account to complete the transaction.", "wckStatus": "INITIAL", "dbCreateTime": 1751010142158, "dbModifyTime": 1751010192997, "identityCompleteTime": 1751010192926, "faceCompleteTime": 1751010192931, "riskRateLevel": "MEDIUM", "riskRateScore": 31 }, "levelInfo": { "currentLevel": { "levelName": "INTERMEDIATE", "levelDesc": "INTERMEDIATE", "kycStatus": "REFUSED", "limit": { "fiatCurrency": "USD", "withdrawFiatDailyLimit": 20000, "cryptoCurrency": "BTC", "depositCryptoDailyLimit": -1, "withdrawCryptoDailyLimit": 100 } }, "kycPass": false, "hasMultipleLevels": false, "passedLevels": [] }, "basicInfo": { "id": 4581048056761212345, "bizEntityKey": "BROKERKEY", "bizKey": "BROKERKEY", "kycUserId": "45712345678999212345", "basicType": "USER", "basicStatus": "PASS", "firstName": "BO", "middleName": "testMiddleName", "lastName": "LI", "residentialCountry": "AE", "dob": "1986-08-14", "postalCode": "123456", "city": "bbb", "address": "aaa", "submitIp": "192.168.1.1", "dbCreateTime": 1751010142182, "dbModifyTime": 1751010142182, "country": "AE", "requestTime": 1751010142182, "requestIp": "192.168.1.1" } }, "version": 1751010193080 } ``` ## Notify Webhook Verification 1. Receive the webhook request body as String 2. Use the `HmacSHA256` algorithm to sign the request body String obtained in 1st step, and compare the value of request header - `X-SHA2-Signature` , if they are the same, then the request body is valid, otherwise invalid. ### javascript example ```javascript const crypto = require("crypto"); const secret = ""; const postData = ""; const hash = crypto.createHmac("sha256", secret).update(postData).digest("hex"); ``` ### java example ```java import org.apache.commons.codec.binary.Hex; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; public class App { public static void main(String[] args) throws Exception { String rawString = ""; Mac sha256Hmac = Mac.getInstance("HmacSHA256"); SecretKeySpec secretKey = new SecretKeySpec("".getBytes(), "HmacSHA256"); sha256Hmac.init(secretKey); String eventSignature = new String(Hex.encodeHex(sha256Hmac.doFinal(rawString.getBytes(StandardCharsets.UTF_8)))); System.err.println(eventSignature); } } ``` --- ## Document: /products/kyc-saas/general/Request-Specifications URL: /en/dev-docs/products/kyc-saas/general/Request-Specifications # Request Specifications ## General API Information - The base endpoint is: **https://cb.link-kycapi.com** - All endpoints return either a JSON object or array. - All request parameters should be passed in the request body as either a JSON object or array. - All endpoints require passing a valid `X-SHA-Signature` header. - Do note that the signature generation method here may not align with the method used for calling other Binance API endpoints (such as https://fapi.binance.com) - All endpoints should be called from whitelisted IP addresses. - Otherwise, it is expected that you would encounter a HTTP `403` return code. ## Signature Generation 1. KYC Data should be sent in the Request Body in JSON format. 2. Convert the Request Body JSON to a JSON String 3. Use the **HmacSHA256** algorithm to sign the JSON String, and assign the result to the `X-SHA-Signature` request header. ## Examples 1. Request Body to be sent: ```json { "bizEntityKey": "", "entityCustomerId": "", "kycType": "USER", "extra": {}, "notifyUrl": "" } ``` 2. Converted Request BODY to JSON String: ```json { "bizEntityKey": "", "entityCustomerId": "", "kycType": "USER", "extra": {}, "notifyUrl": "" } ``` 3. Sign the JSON String (see below examples). ### NodeJS Example ```javascript const crypto = require("crypto"); const secret = ""; const postData = { bizEntityKey: "", // entity key will be decided and given Binance team entityCustomerId: "", kycType: "USER", extra: {}, notifyUrl: "", }; const hash = crypto.createHmac("sha256", secret).update(JSON.stringify(postData)).digest("hex"); ``` ### Java Example ```java import org.apache.commons.codec.binary.Hex; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; public class App { public static void main(String[] args) throws Exception { String rawString = "{ \"bizEntityKey\": \"\", \"entityCustomerId\": \"\", \"kycType\": \"USER\", \"extra\": { }, \"notifyUrl\": \"\" }"; Mac sha256Hmac = Mac.getInstance("HmacSHA256"); SecretKeySpec secretKey = new SecretKeySpec("".getBytes(), "HmacSHA256"); sha256Hmac.init(secretKey); String eventSignature = new String(Hex.encodeHex(sha256Hmac.doFinal(rawString.getBytes(StandardCharsets.UTF_8)))); System.err.println(eventSignature); } } ``` ### Python Example ```python import requests import json import hmac import hashlib body = { "bizEntityKey": "", "entityCustomerId": "", "kycType": "USER", "extra": { }, "notifyUrl": "" } api_secret = '' ##please replace with your own json.dumps(body, separators=(',', ':')) #use this instead to remove extra spaces signature = hmac.new(api_secret.encode(), json_str.encode(), hashlib.sha256).hexdigest() ``` --- ## Document: /products/kyc-saas/general/Overall-Workflow URL: /en/dev-docs/products/kyc-saas/general/Overall-Workflow # Getting Started Integrating with Binance Link KYC Saas broadly follows the below steps. 1. Create an Exchange Link sub-account via API. 2. KYC is processed for the user in one of two methods. 3. Validate that KYC is passed. 4. Create an API Key for the sub-account, and proceed from there. # Sub Account Creation Flow with Link Module integration 1. Create a Sub account `POST /sapi/v1/broker/subAccount` 2. Complete KYC and bind to Sub account via KYC module through one of: - Share KYC API `/bapi/ekyc/v2/public/ekyc/customer/share-kyc-data` - Oauth Link `/bapi/ekyc/v2/public/ekyc/customer/add-account-info-list` 3. Check KYC Status is passed `/bapi/ekyc/v2/public/ekyc/customer/check-kyc-status` - Requirement: `data.levelInfo.currentLevel.kycStatus` = `PASS` 4. Create Sub account API Key `POST /sapi/v1/broker/subAccountApi` --- ## Document: /products/derivatives-trading-usds-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams URL: /en/dev-docs/products/derivatives-trading-usds-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams # Live Subscribing/Unsubscribing to streams - The following data can be sent through the websocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below. - The `id` used in the JSON payloads is an unsigned INT used as an identifier to uniquely identify the messages going back and forth. ## Subscribe to a stream > **Request** ```json { "method": "SUBSCRIBE", "params": ["btcusdt@aggTrade", "btcusdt@depth"], "id": 1 } ``` > **Response** ```json { "result": null, "id": 1 } ``` ## Unsubscribe to a stream > **Request** ```json { "method": "UNSUBSCRIBE", "params": ["btcusdt@depth"], "id": 312 } ``` > **Response** ```json { "result": null, "id": 312 } ``` ## Listing Subscriptions > **Request** ```json { "method": "LIST_SUBSCRIPTIONS", "id": 3 } ``` > **Response** ```json { "result": ["btcusdt@aggTrade"], "id": 3 } ``` ## Setting Properties Currently, the only property can be set is to set whether `combined` stream payloads are enabled are not. The combined property is set to `false` when connecting using `/ws/` ("raw streams") and `true` when connecting using `/stream/`. > **Request** ```json { "method": "SET_PROPERTY", "params": ["combined", true], "id": 5 } ``` > **Response** ```json { "result": null, "id": 5 } ``` ## Retrieving Properties > **Request** ```json { "method": "GET_PROPERTY", "params": ["combined"], "id": 2 } ``` > **Response** ```json { "result": true, // Indicates that combined is set to true. "id": 2 } ``` ### Error Messages | Error Message | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | {"code": 0, "msg": "Unknown property"} | Parameter used in the `SET_PROPERTY` or `GET_PROPERTY` was invalid | | {"code": 1, "msg": "Invalid value type: expected Boolean"} | Value should only be `true` or `false` | | {"code": 2, "msg": "Invalid request: property name must be a string"} | Property name provided was invalid | | {"code": 2, "msg": "Invalid request: request ID must be an unsigned integer"} | Parameter `id` had to be provided or the value provided in the `id` parameter is an unsupported type | | {"code": 2, "msg": "Invalid request: unknown variant %s, expected one of `SUBSCRIBE`, `UNSUBSCRIBE`, `LIST_SUBSCRIPTIONS`, `SET_PROPERTY`, `GET_PROPERTY` at line 1 column 28"} | Possible typo in the provided method or provided method was neither of the expected values | | {"code": 2, "msg": "Invalid request: too many parameters"} | Unnecessary parameters provided in the data | | {"code": 2, "msg": "Invalid request: property name must be a string"} | Property name was not provided | | {"code": 2, "msg": "Invalid request: missing field `method` at line 1 column 73"} | `method` was not provided in the data | | {"code":3,"msg":"Invalid JSON: expected value at line %s column %s"} | JSON data sent has incorrect syntax. | --- ## Document: /products/derivatives-trading-usds-futures/websocket-market-streams/Important-WebSocket-Change-Notice URL: /en/dev-docs/products/derivatives-trading-usds-futures/websocket-market-streams/Important-WebSocket-Change-Notice # Important WebSocket Change Notice — Base URL Split & Migration ## Background Due to sustained heavy traffic, we have upgraded the WebSocket URL structure by introducing a **root** plus dedicated entry points for **Public / Market / Private** traffic. This separation improves stability, scalability, and operational isolation across different data types. ## What’s New - **3 new WebSocket base URLs (Root + routed paths)** - Public (high-frequency public market data): `wss://fstream.binance.com/public` - Market (regular market data): `wss://fstream.binance.com/market` - Private (user data): `wss://fstream.binance.com/private` - **Two access modes are supported** - `ws` mode: streams are composed in the URL path - `stream` mode: streams are passed via query (e.g., `?streams=`) — private uses `listenKey/events` - **Combined streams remain supported** - **Private supports listenKey + events subscription (multiple listenKeys and multiple events)** ## Examples ### Public / Market: combined subscriptions - `ws` mode (path-based) - `wss://fstream.binance.com/public/ws/bnbusdt@depth/ethusdt@depth` - `wss://fstream.binance.com/market/ws/btcusdt@aggTrade/ethusdt@aggTrade` - `stream` mode (query-based) - `wss://fstream.binance.com/market/stream?streams=bnbusdt@aggTrade/btcusdt@markPrice` - `wss://fstream.binance.com/public/stream?streams=btcusdt@depth/ethusdt@depth` ### Private: listenKey & events - `ws` mode (listenKey + events) - `wss://fstream.binance.com/private/ws?listenKey=&events=ORDER_TRADE_UPDATE/ACCOUNT_UPDATE` - `stream` mode (multiple listenKeys + events) - `wss://fstream.binance.com/private/stream?listenKey=&events=ORDER_TRADE_UPDATE&listenKey=&events=ACCOUNT_UPDATE` > JSON `SUBSCRIBE` is also supported; params may include market/public streams and listenKey event > items. ## Endpoint & Stream Mapping (Excerpt) ### Public (high-frequency public data) - Individual Symbol Book Ticker: `@bookTicker` - All Book Tickers: `!bookTicker` - Partial Book Depth: `@depth` (supports `@500ms` / `@100ms`) - Diff. Book Depth: `@depth` (supports `@500ms` / `@100ms`) ### Market (regular market data) - Aggregate Trades: `@aggTrade` - Mark Price: `@markPrice` or `@markPrice@1s` - Mark Price (All market): `!markPrice@arr` or `!markPrice@arr@1s` - Kline/Candlestick: `@kline_` - Continuous Kline: `_@continuousKline_` - Mini Ticker: `@miniTicker`; All: `!miniTicker@arr` - Ticker: `@ticker`; All: `!ticker@arr` - Liquidations: `@forceOrder`; All: `!forceOrder@arr` - Composite Index: `@compositeIndex` - Contract Info: `!contractInfo` - Multi-Assets Mode Asset Index: `!assetIndex@arr` or `@assetIndex` ## Compatibility & Migration Guidance - **Legacy URLs will remain available until 2026-04-23**, after which they will be permanently decommissioned. Users are strongly encouraged to migrate to the new `/public`, `/market`, `/private` endpoints before this date. - **After the upgrade, any connections not migrated will ONLY be able to receive data from `wss://fstream.binance.com/public`. Channels under `/market` and `/private` will stop pushing data.** For example, `wss://fstream.binance.com/ws/btcusdt@depth` will continue to work, but `wss://fstream.binance.com/ws/btcusdt@markPrice` will not. - Recommended migration order: 1. High-frequency order book & core public feeds → `/public` 2. Regular market feeds (markPrice/kline/ticker, etc.) → `/market` 3. User data feeds (listenKey-based) → `/private` - Client / SDK recommendations: - Split connections by traffic type (separate public/market/private sessions) to reduce per-connection load and jitter. - For combined subscriptions, prefer `stream` mode (`?streams=`; private uses listenKey/events). ## Action Required - Update your WebSocket configuration: - Switch base URLs to `/public`, `/market`, `/private` - Ensure each stream is subscribed via the correct endpoint category - **Complete migration before 2026-04-23.** After this date, legacy URLs (`wss://fstream.binance.com/ws`, `wss://fstream.binance.com/stream`) will no longer be available. --- ## Document: /products/derivatives-trading-usds-futures/websocket-market-streams/How-to-manage-a-local-order-book-correctly URL: /en/dev-docs/products/derivatives-trading-usds-futures/websocket-market-streams/How-to-manage-a-local-order-book-correctly # How to manage a local order book correctly 1. Open a stream to **wss://fstream.binance.com/public/stream?streams=btcusdt@depth**. 2. Buffer the events you receive from the stream. For same price, latest received update covers the previous one. 3. Get a depth snapshot from **https://fapi.binance.com/fapi/v1/depth?symbol=BTCUSDT&limit=1000** . 4. Drop any event where `u` is < `lastUpdateId` in the snapshot. 5. The first processed event should have `U` `<= ``lastUpdateId` **AND** `u` >`= ``lastUpdateId` - U = firstUpdateId (the first update ID) from the WebSocket stream. - u = finalUpdateId (the last update ID) from the WebSocket stream. - lastUpdateId = the update ID you got from the REST depth snapshot. 6. While listening to the stream, each new event's `pu` should be equal to the previous event's `u`, otherwise initialize the process from step 3.ß 7. The data in each event is the **absolute** quantity for a price level. 8. If the quantity is 0, **remove** the price level. 9. Receiving an event that removes a price level that is not in your local order book can happen and is normal. --- ## Document: /products/derivatives-trading-usds-futures/websocket-market-streams/Connect URL: /en/dev-docs/products/derivatives-trading-usds-futures/websocket-market-streams/Connect # Websocket Market Streams - The connection method for Websocket is: - Base Url: **wss://fstream.binance.com** - Three routed endpoints are available based on data type: - **Public** (high-frequency public market data): `wss://fstream.binance.com/public` - **Market** (regular market data): `wss://fstream.binance.com/market` - **Private** (user data): `wss://fstream.binance.com/private` - Two access modes are supported: - `ws` mode: streams are composed in the URL path — **/ws/<streamName>** - `stream` mode: streams are passed via query parameters — **/stream?streams=<streamName1>/<streamName2>/<streamName3>** - Examples: - `wss://fstream.binance.com/market/ws/bnbusdt@aggTrade` - `wss://fstream.binance.com/public/ws/bnbusdt@depth/ethusdt@depth` - `wss://fstream.binance.com/market/stream?streams=bnbusdt@aggTrade/btcusdt@markPrice` > **Important:** Connections that do not include a routed path (`/public`, `/market`, or `/private`) > will only receive data from the **Public** endpoint. Streams belonging to `/market` or `/private` > will not push data on unrouted connections. For example, > `wss://fstream.binance.com/ws/btcusdt@depth` will continue to work (since `@depth` belongs to > `/public`), but `wss://fstream.binance.com/ws/btcusdt@markPrice` will not (since `@markPrice` > belongs to `/market`). See [Important WebSocket Change Notice](Important-WebSocket-Change-Notice) > for the full stream-to-endpoint mapping and migration details. - Combined stream events are wrapped as follows: **{"stream":"<streamName>","data":<rawPayload>}** - All symbols for streams are **lowercase** - A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark - The websocket server will send a `ping frame` every 3 minutes. If the websocket server does not receive a `pong frame` back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited `pong frames` are allowed(the client can send pong frames at a frequency higher than every 15 minutes to maintain the connection). - WebSocket connections have a limit of 10 incoming messages per second. - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of **1024** streams. - Considering the possible data latency from RESTful endpoints during an extremely volatile market, it is highly recommended to get the order status, position, etc from the Websocket user data stream. --- ## Document: /products/derivatives-trading-usds-futures/faq/stp-faq URL: /en/dev-docs/products/derivatives-trading-usds-futures/faq/stp-faq # Self Trade Prevention (STP) FAQ ## What is Self Trade Prevention? Self Trade Prevention (or STP) prevents orders of users, or the user's `tradeGroupId` to match against their own. ## What defines a self-trade? A self-trade can occur in either scenario: - The order traded against the same account. - The order traded against an account with the same `tradeGroupId`. ## What happens when STP is triggered? There are three possible modes for what the system will do if an order could create a self-trade. `EXPIRE_TAKER` - This mode prevents a trade by immediately expiring the taker order's remaining quantity. `EXPIRE_MAKER` - This mode prevents a trade by immediately expiring the potential maker order's remaining quantity. `EXPIRE_BOTH` - This mode prevents a trade by immediately expiring both the taker and the potential maker orders' remaining quantities. The STP event will occur depending on the STP mode of the **taker order**.
Thus, the STP mode of an order that goes on the book is no longer relevant and will be ignored for all future order processing. ## Where do I set STP mode for an order? STP can only be set using field `selfTradePreventionMode` through API endpoints below: - POST `/fapi/v1/order` - POST `/fapi/v1/batchOrders` ## What is a Trade Group Id? Different accounts with the same `tradeGroupId` are considered part of the same "trade group". Orders submitted by members of a trade group are eligible for STP according to the taker-order's STP mode. A user can confirm if their accounts are under the same `tradeGroupId` from the API either from `GET /fapi/v1/accountConfig` (REST API). If the value is `-1`, then the `tradeGroupId` has not been set for that account, so the STP may only take place between orders of the same account. We will release feature for user to group subaccounts to same `tradeGroupId` on website in future updates. ## How do I know which symbol uses STP? Placing orders on all symbols in `GET fapi/v1/exchangeInfo` can set `selfTradePreventionMode`. ## What order types support STP? `LIMIT`/`MARKET`/`STOP`/`TAKE_PROFIT`/`STOP_MARKET`/`TAKE_PROFIT_MARKET`/`TRAILING_STOP_MARKET` all supports STP when Time in force(timeInForce) set to `GTC`/ `IOC`/ `GTD`. STP won't take effect for Time in force(timeInForce) `FOK` or `GTX` ## Does Modify order support STP? No. Modify order that has reset `selfTradePreventionMode` to `NONE` ## How do I know if an order expired due to STP? The order will have the status `EXPIRED_IN_MATCH`. In user data stream event `ORDER_TRADE_UPDATE`, field `X` would be `EXPIRED_IN_MATCH` if order is expired due to STP ```javascript { "e":"ORDER_TRADE_UPDATE", // Event Type "E":1568879465651, // Event Time "T":1568879465650, // Transaction Time "o":{ "s":"BTCUSDT", // Symbol "c":"TEST", // Client Order Id // special client order id: // starts with "autoclose-": liquidation order // "adl_autoclose": ADL auto close order // "settlement_autoclose-": settlement order for delisting or delivery "S":"SELL", // Side "o":"TRAILING_STOP_MARKET", // Order Type "f":"GTC", // Time in Force "q":"0.001", // Original Quantity "p":"0", // Original Price "ap":"0", // Average Price "sp":"7103.04", // Stop Price. Please ignore with TRAILING_STOP_MARKET order "x":"EXPIRED", // Execution Type "X":"EXPIRED_IN_MATCH", // Order Status "i":8886774, // Order Id "l":"0", // Order Last Filled Quantity "z":"0", // Order Filled Accumulated Quantity "L":"0", // Last Filled Price "N":"USDT", // Commission Asset, will not push if no commission "n":"0", // Commission, will not push if no commission "T":1568879465650, // Order Trade Time "t":0, // Trade Id "b":"0", // Bids Notional "a":"9.91", // Ask Notional "m":false, // Is this trade the maker side? "R":false, // Is this reduce only "wt":"CONTRACT_PRICE", // Stop Price Working Type "ot":"TRAILING_STOP_MARKET", // Original Order Type "ps":"LONG", // Position Side "cp":false, // If Close-All, pushed with conditional order "AP":"7476.89", // Activation Price, only puhed with TRAILING_STOP_MARKET order "cr":"5.0", // Callback Rate, only puhed with TRAILING_STOP_MARKET order "pP": false, // ignore "si": 0, // ignore "ss": 0, // ignore "rp":"0", // Realized Profit of the trade "V": "EXPIRE_MAKER", // selfTradePreventionMode "pm":"QUEUE", // price match type "gtd":1768879465650 // good till date } } ``` ## STP Examples: For all these cases, assume that all orders for these examples are made on the same account. **Scenario A- A user sends an order with `EXPIRE_MAKER` that would match with their orders that are already on the book.** ``` Maker Order 1: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=20002 selfTradePreventionMode=EXPIRE_MAKER Maker Order 2: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=20001 selfTradePreventionMode=EXPIRE_MAKER Taker Order 1: symbol=BTCUSDT side=SELL type=LIMIT quantity=1 price=20000 selfTradePreventionMode=EXPIRE_MAKER ``` **Result**: The orders that were on the book will expire due to STP, and the taker order will go on the book. Maker Order 1 ```json { "orderId": 292864710, "symbol": "BTCUSDT", "status": "FILLED", "clientOrderId": "testMaker1", "price": "20002", "avgPrice": "20002", "origQty": "1", "executedQty": "1", "cumQuote": "20002", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` Maker Order 2 ```json { "orderId": 292864711, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testMaker2", "price": "20001", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` Output of the Taker Order ```json { "orderId": 292864712, "symbol": "BTCUSDT", "status": "PARTIALLY_FILLED", "clientOrderId": "testTaker1", "price": "20000", "avgPrice": "20002", "origQty": "2", "executedQty": "1", "cumQuote": "20002", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` **Scenario B - A user sends an order with `EXPIRE_TAKER` that would match with their orders already on the book.** ``` Maker Order 1: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=20002 selfTradePreventionMode=EXPIRE_MAKER Maker Order 2: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=20001 selfTradePreventionMode=EXPIRE_MAKER Taker Order 1: symbol=BTCUSDT side=SELL type=LIMIT quantity=2 price=3 selfTradePreventionMode=EXPIRE_TAKER ``` **Result**: The orders already on the book will remain, while the taker order will expire. Maker Order 1 ```json { "orderId": 292864710, "symbol": "BTCUSDT", "status": "FILLED", "clientOrderId": "testMaker1", "price": "20002", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` Maker Order 2 ```json { "orderId": 292864711, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testMaker2", "price": "20001", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` Output of the Taker order ```json { "orderId": 292864712, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testTaker1", "price": "20000", "avgPrice": "0.0000", "origQty": "3", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_TAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` **Scenario C- A user has an order on the book, and then sends an order with `EXPIRE_BOTH` that would match with the existing order.** ``` Maker Order: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=20002 selfTradePreventionMode=EXPIRE_MAKER Taker Order: symbol=BTCUSDT side=SELL type=LIMIT quantity=3 price=20000 selfTradePreventionMode=EXPIRE_BOTH ``` **Result:** Both orders will expire. Maker Order ```json { "orderId": 292864710, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testMaker1", "price": "20002", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` Taker Order ```json { "orderId": 292864712, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testTaker1", "price": "20000", "avgPrice": "0.0000", "origQty": "3", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_BOTH", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` **Scenario D - A user has an order on the book with `EXPIRE_MAKER`, and then sends a new order with `EXPIRE_TAKER` which would match with the existing order.** ``` Maker Order: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=1 selfTradePreventionMode=EXPIRE_MAKER Taker Order: symbol=BTCUSDT side=SELL type=LIMIT quantity=1 price=1 selfTradePreventionMode=EXPIRE_TAKER ``` **Result**: The taker order's STP mode will be used, so the taker order will be expired. Maker Order ```json { "orderId": 292864710, "symbol": "BTCUSDT", "status": "NEW", "clientOrderId": "testMaker1", "price": "20002", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` Taker Order ```json { "orderId": 292864712, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testTaker1", "price": "20000", "avgPrice": "0.0000", "origQty": "3", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_TAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` **Scenario E - A user sends a market order with `EXPIRE_MAKER` which would match with an existing order.** ``` Maker Order: symbol=ABCDEF side=BUY type=LIMIT quantity=1 price=1 selfTradePreventionMode=EXPIRE_MAKER Taker Order: symbol=ABCDEF side=SELL type=MARKET quantity=3 selfTradePreventionMode=EXPIRE_MAKER ``` **Result**: The existing order expires with the status `EXPIRED_IN_MATCH`, due to STP. The new order also expires but with status `EXPIRED`, due to low liquidity on the order book. Maker Order ```json { "orderId": 292864710, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testMaker1", "price": "20002", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` Taker Order ```json { "orderId": 292864712, "symbol": "BTCUSDT", "status": "EXPIRED", "clientOrderId": "testTaker1", "price": "20000", "avgPrice": "0.0000", "origQty": "3", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` --- ## Document: /products/derivatives-trading-options/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams URL: /en/dev-docs/products/derivatives-trading-options/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams # Live Subscribing/Unsubscribing to streams - The following data can be sent through the websocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below. - The `id` used in the JSON payloads is an unsigned INT used as an identifier to uniquely identify the messages going back and forth. ## Subscribe to a stream > **Request** ```json { "method": "SUBSCRIBE", "params": ["btc-210630-9000-p@ticker", "btc-210630-9000-p@depth"], "id": 1 } ``` > **Response** ```json { "result": null, "id": 1 } ``` ## Unsubscribe to a stream > **Request** ```json { "method": "UNSUBSCRIBE", "params": ["btc-210630-9000-p@ticker"], "id": 312 } ``` > **Response** ```json { "result": null, "id": 312 } ``` ## Listing Subscriptions > **Request** ```json { "method": "LIST_SUBSCRIPTIONS", "id": 3 } ``` > **Response** ```json { "result": ["btc-210630-9000-p@ticker"], "id": 3 } ``` ## Setting Properties Currently, the only property can be set is to set whether `combined` stream payloads are enabled are not. The combined property is set to `false` when connecting using `/ws/` ("raw streams") and `true` when connecting using `/stream/`. > **Request** ```json { "method": "SET_PROPERTY", "params": ["combined", true], "id": 5 } ``` > **Response** ```json { "result": null, "id": 5 } ``` ## Retrieving Properties > **Request** ```json { "method": "GET_PROPERTY", "params": ["combined"], "id": 2 } ``` > **Response** ```json { "result": true, // Indicates that combined is set to true. "id": 2 } ``` ## Error Messages | Error Message | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | {"code": 0, "msg": "Unknown property"} | Parameter used in the `SET_PROPERTY` or `GET_PROPERTY` was invalid | | {"code": 1, "msg": "Invalid value type: expected Boolean"} | Value should only be `true` or `false` | | {"code": 2, "msg": "Invalid request: property name must be a string"} | Property name provided was invalid | | {"code": 2, "msg": "Invalid request: request ID must be an unsigned integer"} | Parameter `id` had to be provided or the value provided in the `id` parameter is an unsupported type | | {"code": 2, "msg": "Invalid request: unknown variant %s, expected one of `SUBSCRIBE`, `UNSUBSCRIBE`, `LIST_SUBSCRIPTIONS`, `SET_PROPERTY`, `GET_PROPERTY` at line 1 column 28"} | Possible typo in the provided method or provided method was neither of the expected values | | {"code": 2, "msg": "Invalid request: too many parameters"} | Unnecessary parameters provided in the data | | {"code": 2, "msg": "Invalid request: property name must be a string"} | Property name was not provided | | {"code": 2, "msg": "Invalid request: missing field `method` at line 1 column 73"} | `method` was not provided in the data | | {"code":3,"msg":"Invalid JSON: expected value at line %s column %s"} | JSON data sent has incorrect syntax.    ## Trade Streams | --- ## Document: /products/derivatives-trading-options/websocket-market-streams/How-to-manage-a-local-order-book-correctly URL: /en/dev-docs/products/derivatives-trading-options/websocket-market-streams/How-to-manage-a-local-order-book-correctly # How to manage a local order book correctly 1. Open a stream to **wss://fstream.binance.com/public/stream?streams=btc-200630-9000-p@depth@100ms**. 2. Buffer the events you receive from the stream. For same price, latest received update covers the previous one. 3. Get a depth snapshot from **https://eapi.binance.com/eapi/v1/depth?symbol=btc-200630-9000-p&limit=1000** . 4. Drop any event where `u` is < `lastUpdateId` in the snapshot. 5. The first processed event should have `U` `<= ``lastUpdateId` **AND** `u` >`= ``lastUpdateId` - U = firstUpdateId (the first update ID) from the WebSocket stream. - u = finalUpdateId (the last update ID) from the WebSocket stream. - lastUpdateId = the update ID you got from the REST depth snapshot. 6. While listening to the stream, each new event's `pu` should be equal to the previous event's `u`, otherwise initialize the process from step 3.ß 7. The data in each event is the **absolute** quantity for a price level. 8. If the quantity is 0, **remove** the price level. 9. Receiving an event that removes a price level that is not in your local order book can happen and is normal. --- ## Document: /products/derivatives-trading-options/websocket-market-streams/Connect URL: /en/dev-docs/products/derivatives-trading-options/websocket-market-streams/Connect # Connect - The baseurl of the websocket interface is: **wss://fstream.binance.com/public/ ** or **/ **wss://fstream.binance.com/market/\*\* - Streams can be access either in a single raw stream or a combined stream - Raw streams are accessed at **/ws/\** - Combined streams are accessed at **/stream?streams=\/\/\** - Example: - `wss://fstream.binance.com/public/ws/btc-210630-9000-p@ticker` - `wss://fstream.binance.com/market/stream?streams=btc-210630-9000-p@markPriceoptionMarkPrice` - A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark - The websocket server will send a `ping frame` every 5 minutes. If the websocket server does not receive a `pong frame` back from the connection within a 15 minute period, the connection will be disconnected. Unsolicited `pong frames` are allowed. - WebSocket connections have a limit of 10 incoming messages per second. - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of **200** streams. - Considering the possible data latency from RESTful endpoints during an extremely volatile market, it is highly recommended to get the order status, position, etc from the Websocket user data stream. - Combined stream events are wrapped as follows: **{"stream":"\","data":\}** - All symbols for streams are **lowercase** - A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark - The websocket server will send a `ping frame` every 5 minutes. If the websocket server does not receive a `pong frame` back from the connection within a 15 minute period, the connection will be disconnected. Unsolicited `pong frames` are allowed. - WebSocket connections have a limit of 10 incoming messages per second. - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of **200** streams. - Considering the possible data latency from RESTful endpoints during an extremely volatile market, it is highly recommended to get the order status, position, etc from the Websocket user data stream. --- ## Document: /products/derivatives-trading-options/faq/stp-faq URL: /en/dev-docs/products/derivatives-trading-options/faq/stp-faq # Self Trade Prevention (STP) FAQ ## What is Self Trade Prevention? Self Trade Prevention (or STP) prevents orders of users, or the user's `tradeGroupId` to match against their own. ## What defines a self-trade? A self-trade can occur in either scenario: - The order traded against the same account. - The order traded against an account with the same `tradeGroupId`. ## What happens when STP is triggered? There are three possible modes for what the system will do if an order could create a self-trade. `EXPIRE_TAKER` - This mode prevents a trade by immediately expiring the taker order's remaining quantity. `EXPIRE_MAKER` - This mode prevents a trade by immediately expiring the potential maker order's remaining quantity. `EXPIRE_BOTH` - This mode prevents a trade by immediately expiring both the taker and the potential maker orders' remaining quantities. The STP event will occur depending on the STP mode of the **taker order**.
Thus, the STP mode of an order that goes on the book is no longer relevant and will be ignored for all future order processing. ## Where do I set STP mode for an order? STP can only be set using field `selfTradePreventionMode` through API endpoints below: - POST `/eapi/v1/order` - POST `/eapi/v1/batchOrders` ## What is a Trade Group Id? Different accounts with the same `tradeGroupId` are considered part of the same "trade group". Orders submitted by members of a trade group are eligible for STP according to the taker-order's STP mode. A user can confirm if their accounts are under the same `tradeGroupId` from the API either from `GET /eapi/v1/accountConfig` (REST API). If the value is `-1`, then the `tradeGroupId` has not been set for that account, so the STP may only take place between orders of the same account. Users can group sub-accounts to the same tradeGroupId via the Sub-Account API Management page. ## How do I know which symbol uses STP? Placing orders on all symbols in `GET /eapi/v1/exchangeInfo` can set `selfTradePreventionMode`. ## What order types support STP? All orders support STP when Time in Force (timeInForce) is set to `GTC`/ `IOC`/ `GTD`. STP won't take effect for Time in force(timeInForce) `FOK` or `GTX` ## How do I know if an order expired due to STP? The order will have the status `EXPIRED_IN_MATCH`. In user data stream event `ORDER_TRADE_UPDATE`, field `X` would be `EXPIRED_IN_MATCH` if order is expired due to STP ```javascript { "e":"ORDER_TRADE_UPDATE", // Event Type "E":1568879465651, // Event Time "T":1568879465650, // Transaction Time "o":{ "s":"BTC-260228-70000-C", // Symbol "c":"TEST", // Client Order Id // special client order id: // starts with "autoclose-": liquidation order // "adl_autoclose": ADL auto close order // "settlement_autoclose-": settlement order for delisting or delivery "S":"SELL", // Side "o":"TRAILING_STOP_MARKET", // Order Type "f":"GTC", // Time in Force "q":"0.001", // Original Quantity "p":"0", // Original Price "ap":"0", // Average Price "sp":"7103.04", // Stop Price. Please ignore with TRAILING_STOP_MARKET order "x":"EXPIRED", // Execution Type "X":"EXPIRED_IN_MATCH", // Order Status "i":8886774, // Order Id "l":"0", // Order Last Filled Quantity "z":"0", // Order Filled Accumulated Quantity "L":"0", // Last Filled Price "N":"USDT", // Commission Asset, will not push if no commission "n":"0", // Commission, will not push if no commission "T":1568879465650, // Order Trade Time "t":0, // Trade Id "b":"0", // Bids Notional "a":"9.91", // Ask Notional "m":false, // Is this trade the maker side? "R":false, // Is this reduce only "wt":"CONTRACT_PRICE", // Stop Price Working Type "ot":"TRAILING_STOP_MARKET", // Original Order Type "ps":"LONG", // Position Side "cp":false, // If Close-All, pushed with conditional order "AP":"7476.89", // Activation Price, only pushed with TRAILING_STOP_MARKET order "cr":"5.0", // Callback Rate, only pushed with TRAILING_STOP_MARKET order "pP": false, // ignore "si": 0, // ignore "ss": 0, // ignore "rp":"0", // Realized Profit of the trade "V": "EXPIRE_MAKER", // selfTradePreventionMode "pm":"QUEUE", // price match type "gtd":1768879465650 // good till date } } ``` ## STP Examples: For all these cases, assume that all orders for these examples are made on the same account. **Scenario A- A user sends an order with `EXPIRE_MAKER` that would match with their orders that are already on the book.** ``` Maker Order 1: symbol=BTC-260228-70000-C side=BUY type=LIMIT quantity=1 price=51 selfTradePreventionMode=EXPIRE_MAKER Taker Order 1: symbol=BTC-260228-70000-C side=SELL type=LIMIT quantity=2 price=50 selfTradePreventionMode=EXPIRE_MAKER ``` **Result**: The order that was on the book will expire due to STP, and the taker order will go on the book. Maker Order ```json { "orderId": 4611875134427365378, "symbol": "BTC-260228-70000-C", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testMaker1", "price": "51", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` Output of the Taker Order ```json { "orderId": 4611875134427365379, "symbol": "BTC-260228-70000-C", "status": "FILLED", "clientOrderId": "testTaker1", "price": "50", "avgPrice": "50", "origQty": "2", "executedQty": "2", "cumQuote": "50", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` **Scenario B - A user sends an order with `EXPIRE_TAKER` that would match with their orders already on the book.** ``` Maker Order 1: symbol=BTC-260228-70000-C side=BUY type=LIMIT quantity=1 price=51 selfTradePreventionMode=EXPIRE_TAKER Taker Order 1: symbol=BTC-260228-70000-C side=SELL type=LIMIT quantity=2 price=50 selfTradePreventionMode=EXPIRE_TAKER ``` **Result**: The orders already on the book will remain, while the taker order will expire. Maker Order ```json { "orderId": 4611875134427365378, "symbol": "BTC-260228-70000-C", "status": "NEW", "clientOrderId": "testMaker1", "price": "51", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_TAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` Output of the Taker order ```json { "orderId": 4611875134427365379, "symbol": "BTC-260228-70000-C", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testTaker1", "price": "50", "avgPrice": "0.0000", "origQty": "2", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_TAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` **Scenario C- A user has an order on the book, and then sends an order with `EXPIRE_BOTH` that would match with the existing order.** ``` Maker Order: symbol=BTC-260228-70000-C side=BUY type=LIMIT quantity=1 price=51 selfTradePreventionMode=EXPIRE_BOTH Taker Order: symbol=BTC-260228-70000-C side=SELL type=LIMIT quantity=3 price=50 selfTradePreventionMode=EXPIRE_BOTH ``` **Result**: Both orders will expire. Maker Order ```json { "orderId": 4611875134427365378, "symbol": "BTC-260228-70000-C", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testMaker1", "price": "51", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_BOTH", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` Taker Order ```json { "orderId": 4611875134427365379, "symbol": "BTC-260228-70000-C", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testTaker1", "price": "50", "avgPrice": "0.0000", "origQty": "3", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_BOTH", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460 } ``` --- ## Document: /products/derivatives-trading-coin-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams URL: /en/dev-docs/products/derivatives-trading-coin-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams # Live Subscribing/Unsubscribing to streams - The following data can be sent through the websocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below. - The `id` used in the JSON payloads is an unsigned INT used as an identifier to uniquely identify the messages going back and forth. ## Subscribe to a stream > **Request** ```json { "method": "SUBSCRIBE", "params": ["btcusd_200925@aggTrade", "btcusd_200925@depth"], "id": 1 } ``` > **Response** ```json { "result": null, "id": 1 } ``` ## Unsubscribe to a stream > **Request** ```json { "method": "UNSUBSCRIBE", "params": ["btcusd_200925@depth"], "id": 312 } ``` > **Response** ```json { "result": null, "id": 312 } ``` ## Listing Subscriptions > **Request** ```json { "method": "LIST_SUBSCRIPTIONS", "id": 3 } ``` > **Response** ```json { "result": ["btcusd_200925@aggTrade"], "id": 3 } ``` ## Setting Properties Currently, the only property can be set is to set whether `combined` stream payloads are enabled are not. The combined property is set to `false` when connecting using `/ws/` ("raw streams") and `true` when connecting using `/stream/`. > **Request** ```json { "method": "SET_PROPERTY", "params": ["combined", true], "id": 5 } ``` > **Response** ```json { "result": null, "id": 5 } ``` ## Retrieving Properties > **Request** ```json { "method": "GET_PROPERTY", "params": ["combined"], "id": 2 } ``` > **Response** ```json { "result": true, // Indicates that combined is set to true. "id": 2 } ``` --- ## Document: /products/derivatives-trading-coin-futures/websocket-market-streams/How-to-manage-a-local-order-book-correctly URL: /en/dev-docs/products/derivatives-trading-coin-futures/websocket-market-streams/How-to-manage-a-local-order-book-correctly # How to manage a local order book correctly 1. Open a stream to **wss://dstream.binance.com/stream?streams=btcusd_200925@depth**. 2. Buffer the events you receive from the stream. For same price, latest received update covers the previous one. 3. Get a depth snapshot from **https://dapi.binance.com/dapi/v1/depth?symbol=BTCUSD_200925&limit=1000** . 4. Drop any event where `u` is < `lastUpdateId` in the snapshot 5. The first processed event should have `U` `<= ``lastUpdateId` **AND** `u` >`= ``lastUpdateId` - U = firstUpdateId (the first update ID) from the WebSocket stream. - u = finalUpdateId (the last update ID) from the WebSocket stream. - lastUpdateId = the update ID you got from the REST depth snapshot. 6. While listening to the stream, each new event's `pu` should be equal to the previous event's `u`, otherwise initialize the process from step 3. 7. The data in each event is the **absolute** quantity for a price level 8. If the quantity is 0, **remove** the price level 9. Receiving an event that removes a price level that is not in your local order book can happen and is normal. --- ## Document: /products/derivatives-trading-coin-futures/websocket-market-streams/Connect URL: /en/dev-docs/products/derivatives-trading-coin-futures/websocket-market-streams/Connect # Websocket Market Streams - There are two connection methods for Websocket: - Base Url: **wss://dstream.binance.com** - Streams can be access either in a single raw stream or a combined stream - Raw streams are accessed at **/ws/\** - Combined streams are accessed at **/stream?streams=\/\/\** - Example: - `wss://dstream.binance.com/ws/bnbusdt@aggTrade` - `wss://dstream.binance.com/stream?streams=bnbusdt@aggTrade/btcusdt@markPrice` - Combined stream events are wrapped as follows: **{"stream":"\","data":\}** - All symbols for streams are **lowercase** - A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark - The websocket server will send a `ping frame` every 3 minutes. If the websocket server does not receive a `pong frame` back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited `pong frames` are allowed(Client can send `pong frames` with frequency higher than 10 minutes). - WebSocket connections have a limit of 10 incoming messages per second. - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of **1024** streams. - Considering the possible data latency from RESTful endpoints during an extremely volatile market, it is highly recommended to get the order status, position, etc from the Websocket user data stream. --- ## Document: /products/derivatives-trading-coin-futures/portfolio-margin-endpoints/General-Info URL: /en/dev-docs/products/derivatives-trading-coin-futures/portfolio-margin-endpoints/General-Info # Classic Portfolio Margin Endpoints The Binance Classic Portfolio Margin Program is a cross-asset margin program supporting consolidated margin balance across trading products with over 200+ effective crypto collaterals. It is designed for professional traders, market makers, and institutional users looking to actively trade & hedge cross-asset and optimize risk-management in a consolidated setup. FAQ: [Classic Portfolio Margin Program](https://www.binance.com/en/support/faq/5054378212d240cca17ecd6006c11f23) Only Classic Portfolio Margin Account is accessible to these endpoints. To enroll, kindly refer to: [How to Enroll into the Binance Classic Portfolio Margin Program](https://www.binance.com/en/support/faq/a7834b9bc03140728583a90bcb469144) --- ## Document: /products/connect-prime/webhook/webhook URL: /en/dev-docs/products/connect-prime/webhook/webhook # Webhook Whenever a key event (currently only "order status change") occurs, Binance Connect will send a webhook message, and the partner (client) can receive this message at the webhook callback url and react accordingly, such as updating order data and frontend UI. ### Request Headers | **Field** | **Type** | **Remarks** | | ---------------------- | --------- | -------------------------------------------------------- | | X-BN-Connect-Timestamp | timestamp | timestamp | | X-BN-Connect-Signature | string | SHA256withRSA(**requestBody** + **X-Connect-Timestamp**) | | X-BN-Connect-For | string | Same with your client id (X-Tesla-ClientId) | ### Request Body | Field | Type | Remarks | | ---------------- | --------- | ------------------------------------------------ | | webhookEventType | string | fixed value: prime_order_event | | orderId | string | Binance order ID | | clientOrderId | string | Client side order ID | | direction | string | BUY or SELL | | fiatCurrency | string | Fiat currency | | cryptoCurrency | string | Crypto currency | | fiatAmount | decimal | Fiat amount | | cryptoAmount | decimal | Crypto Amount | | price | decimal | Price. 1 crypto currency = {price} fiat currency | | status | string | FILLED/FAILED | | createTime | timestamp | Order creation time (UTC) | | settleTime | timestamp | Settlement time (UTC) | ### Response Body - HTTP status code is 200 - Response body is in JSON format. | **Field** | **Type** | **Remarks** | | ------------- | -------- | ----------------------------------------------------------- | | returnCode | string | SUCCESS or other code you wish to return to Binance Connect | | returnMessage | string | the message you wish to return to Binance Connect | ### How signature works The encryption/decryption and verification process of webhook is exactly the opposite/mirrored of API request process. The sender and receiver of the two are opposite, but they are both processes that signed by the sender with a private key and verified by the receiver with a public key. For API requests, the partner (client) generates a pair of keys. The private key is kept securely and privately by the partner (client). Then the partner (client) uses the private key to sign when initiating API requests. The public key is shared to Bianance Connect, with which Binance will verify the signature of the API request to ensure that the request is indeed initiated by the partner (client). For webhook, it's an opposite/mirrored process. Binance Connect generates a pair of keys. The private key is kept securely and privately by Binance Connect. Then Binance Connect uses the private key to sign when initiating the webhook message. The public key is shared to the partner (client), with which the partner (client) can verify the signature of the webhook message to ensure that the message is indeed initiated by Binance. #### The webhook signature flow is as follows: ![signature-Webhook.png](../images/signature-Webhook-prime.png) ### Verify signature As mentioned above, Binance Connect initiates a webhook request to the webhook callback url provided by the partner ( client). And the partner (client) should verify the identity of the request initiator based on the public key provided by Binance Connect. The example code below shows how to verify signature with public key: ```java public static boolean verify(String srcData, PublicKey publicKey, String sign) throws Exception { Signature signature = Signature.getInstance("SHA256withRSA"); signature.initVerify(publicKey); signature.update(srcData.getBytes()); return signature.verify(Base64.decodeBase64(sign.getBytes())); } ``` # ### Example Request Body: ```json { "webhookEventType": "prime_order_event", "orderId": "1234567890", "clientOrderId": "myOrder001", "direction": "BUY", "fiatCurrency": "EUR", "cryptoCurrency": "BTC", "fiatAmount": 100, "cryptoAmount": 0.00102181, "price": 97849.27, "status": "FILLED", "createTime": 1692951399, "settleTime": 1692954999 } ``` --- ## Document: /products/connect-prime/open-apis/9.get-balance URL: /en/dev-docs/products/connect-prime/open-apis/9.get-balance # Get Balance Please refer to [user-assets](../../wallet/asset/user-assets.md) --- ## Document: /products/connect-prime/open-apis/8.get-transaction-list URL: /en/dev-docs/products/connect-prime/open-apis/8.get-transaction-list # Get Transaction List ``` POST /papi/v1/ramp/connect/prime/transactions ``` ### Request Body | Field | Type | Mandatory | Remarks | | --------- | --------- | --------- | --------------------------------------- | | userId | string | Yes | Customer’s Binance sub-account ID | | startTime | timestamp | Yes | Start timestamp | | endTime | timestamp | Yes | End timestamp | | direction | string | No | BUY or SELL | | page | int | No | Page number. Default: 1 | | rows | int | No | Records per page. Default: 10. Max: 100 | #### Example ```json { "userId": "54321123456", "startTime": 1756113110, "endTime": 1756545215, "direction": "BUY", "page": 1, "rows": 10 } ``` ```shell curl -X POST https://{domain}/papi/v1/ramp/connect/prime/transactions \ -H 'Content-Type: application/json' \ -H 'X-Tesla-ClientId: {your client id}' \ -H 'X-Tesla-SignAccessToken: {your access token}' \ -H 'X-Tesla-Timestamp: {now}' \ -H 'X-Tesla-Signature: {signature}' \ -d '{"userId":"{testUserId}","startTime":1762313981786,"endTime":1762400381786,"rows":20,"page":1}' ``` ### Response Body | Field | Type | Remarks | | ------- | ------------ | ---------------------------------------- | | total | int | Total number of records across all pages | | records | object array | records | | page | int | Current page number. | | rows | int | Records per page. | #### Record object | Field | Type | Remarks | | -------------- | --------- | ----------------------------------------------- | | orderId | string | Binance order ID | | clientOrderId | string | Client side order ID | | direction | string | BUY or SELL | | fiatCurrency | string | Fiat currency | | cryptoCurrency | string | Crypto currency | | fiatAmount | decimal | Fiat amount | | cryptoAmount | decimal | Crypto Amount | | price | decimal | Price. 1 crypto currency= {price} fiat currency | | status | string | PROCESSING / FILLED / FAILED | | spreadAmount | string | Revenue from Spread (in Fiat Currency) | | createTime | timestamp | Order creation time (UTC) | | settleTime | timestamp | Settlement time (UTC) | #### Example ```json { "total": 100, "page": 1, "rows": 10, "records": [ { "orderId": "1234567890", "clientOrderId": "myOrder001", "direction": "BUY", "fiatCurrency": "EUR", "cryptoCurrency": "BTC", "fiatAmount": 100, "cryptoAmount": 0.00102181, "price": 97849.27, "status": "FILLED", "spreadAmount": "0.99", "createTime": "1692951399", "settleTime": "1692954999" } ] } ``` --- ## Document: /products/connect-prime/open-apis/7.get-single-transaction URL: /en/dev-docs/products/connect-prime/open-apis/7.get-single-transaction # Get Single Transaction ``` POST /papi/v1/ramp/connect/prime/transaction ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | --------- | -------- | ------------- | ---------------- | | orderId | string | Yes | Binance order ID | #### Example ```json { "orderId": "1234567890" } ``` ```shell curl -X POST https://{domain}/papi/v1/ramp/connect/prime/transaction \ -H 'Content-Type: application/json' \ -H 'X-Tesla-ClientId: {your client id}' \ -H 'X-Tesla-SignAccessToken: {your access token}' \ -H 'X-Tesla-Timestamp: {now}' \ -H 'X-Tesla-Signature: {signature}' \ -d '{"orderId":""}' ``` ### Response Body | **Field** | **Type** | **Remarks** | | -------------- | --------- | ----------------------------------------------- | | orderId | string | Binance order ID | | clientOrderId | string | Client side order ID | | direction | string | BUY or SELL | | fiatCurrency | string | Fiat currency | | cryptoCurrency | string | Crypto currency | | fiatAmount | decimal | Fiat amount | | cryptoAmount | decimal | Crypto Amount | | price | decimal | Price. 1 crypto currency= {price} fiat currency | | status | string | PROCESSING / FILLED / FAILED | | spreadAmount | string | Revenue from Spread (in Fiat Currency) | | createTime | timestamp | Order creation time (UTC) | | settleTime | timestamp | Settlement time (UTC) | #### Example ```json { "orderId": "1234567890", "clientOrderId": "myOrder001", "direction": "BUY", "fiatCurrency": "EUR", "cryptoCurrency": "BTC", "fiatAmount": 100, "cryptoAmount": 0.00102181, "price": 97849.27, "status": "FILLED", "spreadAmount": "0.99", "createTime": "1692951399", "settleTime": "1692954999" } ``` --- ## Document: /products/connect-prime/open-apis/6.execute-quote URL: /en/dev-docs/products/connect-prime/open-apis/6.execute-quote # Execute Quote ``` POST /papi/v1/ramp/connect/prime/quote/execute ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | ------------- | -------- | ------------- | ----------------------------------- | | quoteId | string | Yes | Quote ID | | clientOrderId | string | Yes | Client side order ID. Max length:50 | #### Example ```json { "quoteId": "8Bj35OZEYupTIwdaxQW7vybKNH0J1Cic", "clientOrderId": "OLCingeRI6mT4z9SQqVaABDwK5t3fcFU" } ``` ```shell curl -X POST https://{domain}/papi/v1/ramp/connect/prime/quote/execute \ -H 'Content-Type: application/json' \ -H 'X-Tesla-ClientId: {your client id}' \ -H 'X-Tesla-SignAccessToken: {your access token}' \ -H 'X-Tesla-Timestamp: {now}' \ -H 'X-Tesla-Signature: {signature}' \ -d '{"quoteId":"","clientOrderId":"496334425271"}' ``` ### Response Body | **Field** | **Type** | **Remarks** | | --------- | -------- | ---------------------------- | | orderId | string | Binance order ID | | status | string | PROCESSING / FILLED / FAILED | #### Example ```json { "orderId": "lhJ0uBwFPcCkbxnypoqNzUvri1e8jatT", "status": "PROCESSING" } ``` --- ## Document: /products/connect-prime/open-apis/5.get-quote URL: /en/dev-docs/products/connect-prime/open-apis/5.get-quote # Get Quote ``` POST /papi/v1/ramp/connect/prime/quote ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | -------------- | -------- | ------------- | --------------------------------------------------------------------------------- | | userId | string | Yes | Customer’s Binance sub-account ID | | fiatCurrency | string | Yes | fiat currency | | cryptoCurrency | string | Yes | crypto currency | | direction | string | Yes | BUY or SELL | | amount | decimal | Yes | Requested amount. | | amountType | int | Yes | Specify whether the total amount is in fiat:1 or crypto:2 | | customSpread | decimal | Yes | Specify the custom spread value. For example, 0.01 means a 1% spread (0.01 = 1%). | #### Example ```json { "userId": "54321123456", "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "direction": "BUY", "amount": 100, "amountType": 1, "customSpread": 0.01 } ``` ```shell curl -X POST https://{domain}/papi/v1/ramp/connect/prime/quote \ -H 'Content-Type: application/json' \ -H 'X-Tesla-ClientId: {your client id}' \ -H 'X-Tesla-SignAccessToken: {your access token}' \ -H 'X-Tesla-Timestamp: {now}' \ -H 'X-Tesla-Signature: {signature}' \ -d '{"userId":"{testUserId}","fiatCurrency":"EUR","cryptoCurrency":"BNB","direction":"BUY","amount":10,"amountType":1,"customSpread":0.01}' ``` ### Response Body | **Field** | **Type** | **Remarks** | | ------------ | --------- | ----------------------------------------------- | | quoteId | string | Quote ID | | totalAmount | string | total amount | | quotePrice | string | Price. 1 crypto currency= {price} fiat currency | | expiredAt | timestamp | Expired at millisecond timestamp | | spreadAmount | string | Revenue from Spread (in Fiat Currency) | #### Example ```json { "quoteId": "e064b9eacded478192c45110117926aaasdmladsoi", "totalAmount": "114.70018989", "quotePrice": "0.865734", "expiredAt": 1756179222140, "spreadAmount": "0.99" } ``` --- ## Document: /products/connect-prime/open-apis/4.get-fiat-crypto-amount-limit URL: /en/dev-docs/products/connect-prime/open-apis/4.get-fiat-crypto-amount-limit # Get Fiat and Crypto Amount Limit ``` POST /papi/v1/ramp/connect/prime/fiat-crypto-amount-limit ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | -------------- | -------- | ------------- | --------------------------------------------------------------------------------- | | userId | string | Yes | Customer's Binance sub-account ID | | fiatCurrency | string | Yes | fiat currency | | cryptoCurrency | string | Yes | crypto currency | | direction | string | Yes | BUY or SELL | | amount | decimal | Yes | Requested amount. | | amountType | int | Yes | Specify whether the total amount is in fiat:1 or crypto:2 | | customSpread | decimal | Yes | Specify the custom spread value. For example, 0.01 means a 1% spread (0.01 = 1%). | #### Example ```json { "userId": "54321123456", "fiatCurrency": "EUR", "cryptoCurrency": "BTC", "direction": "BUY", "amount": 100, "amountType": 1, "customSpread": 0.01 } ``` ```shell curl -X POST https://{domain}/papi/v1/ramp/connect/prime/fiat-crypto-amount-limit \ -H 'Content-Type: application/json' \ -H 'X-Tesla-ClientId: {your client id}' \ -H 'X-Tesla-SignAccessToken: {your access token}' \ -H 'X-Tesla-Timestamp: {now}' \ -H 'X-Tesla-Signature: {signature}' \ -d '{"userId":"{testUserId}","fiatCurrency":"EUR","cryptoCurrency":"BNB","direction":"BUY","amount":10,"amountType":1,"customSpread":0.01}' ``` ### Response Body | **Field** | **Type** | **Remarks** | | -------------- | -------- | ----------------------- | | fiatMinLimit | decimal | fiat min amount limit | | fiatMaxLimit | decimal | fiat max amount limit | | cryptoMinLimit | decimal | crypto min amount limit | | cryptoMaxLimit | decimal | crypto max amount limit | #### Example ```json { "fiatMinLimit": "10", "fiatMaxLimit": "10000000", "cryptoMinLimit": "0.00448887", "cryptoMaxLimit": "4488.87147336" } ``` --- ## Document: /products/connect-prime/open-apis/3.get-trading-pair URL: /en/dev-docs/products/connect-prime/open-apis/3.get-trading-pair # Get Trading Pair ``` POST /papi/v1/ramp/connect/prime/trading-pair ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | -------------- | -------- | ------------- | -------------------------------------- | | userId | string | Yes | Customer’s Binance sub-account ID | | fiatCurrency | string | Yes (BUY) | For Buy, must fill-in fiat currency | | cryptoCurrency | string | Yes (SELL) | For Sell, must fill-in crypto currency | | direction | string | Yes | BUY or SELL | #### Example For buy flow ```json { "userId": "54321123456", "fiatCurrency": "USD", "direction": "BUY" } ``` ```shell curl -X POST https://{domain}/papi/v1/ramp/connect/prime/trading-pair \ -H 'Content-Type: application/json' \ -H 'X-Tesla-ClientId: {your client id}' \ -H 'X-Tesla-SignAccessToken: {your access token}' \ -H 'X-Tesla-Timestamp: {now}' \ -H 'X-Tesla-Signature: {signature}' \ -d '{"userId":"{testUserId}","fiatCurrency":"EUR","direction":"BUY"}' ``` For sell flow ```json { "userId": "54321123456", "cryptoCurrency": "BTC", "direction": "SELL" } ``` ```shell curl -X POST https://{domain}/papi/v1/ramp/connect/prime/trading-pair \ -H 'Content-Type: application/json' \ -H 'X-Tesla-ClientId: {your client id}' \ -H 'X-Tesla-SignAccessToken: {your access token}' \ -H 'X-Tesla-Timestamp: {now}' \ -H 'X-Tesla-Signature: {signature}' \ -d '{"userId":"{testUserId}","cryptoCurrency":"BTC","direction":"SELL"}' ``` ### Response Body | **Field** | **Type** | **Remarks** | | -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | fiatCurrency | string | fiat currency | | cryptoCurrency | string | crypto currency | | precision | int | The precision of the cryptocurrency applies if the direction is BUY, and the precision of the fiat currency applies if the direction is SELL. | #### Example ```json [ { "fiatCurrency": "EUR", "cryptoCurrency": "BNB", "precision": 8 }, { "fiatCurrency": "EUR", "cryptoCurrency": "BTC", "precision": 8 }, { "fiatCurrency": "EUR", "cryptoCurrency": "ETH", "precision": 8 } ] ``` --- ## Document: /products/connect-prime/open-apis/2.get-crypto-list-for-sell URL: /en/dev-docs/products/connect-prime/open-apis/2.get-crypto-list-for-sell # Get Crypto List for Sell ``` POST /papi/v1/ramp/connect/prime/sell/crypto-list ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | --------- | -------- | ------------- | --------------------------------- | | userId | string | Yes | Customer’s Binance sub-account ID | #### Example ```json { "userId": "54321123456" } ``` ```shell curl -X POST https://{domain}/papi/v1/ramp/connect/prime/sell/crypto-list \ -H 'Content-Type: application/json' \ -H 'X-Tesla-ClientId: {your client id}' \ -H 'X-Tesla-SignAccessToken: {your access token}' \ -H 'X-Tesla-Timestamp: {now}' \ -H 'X-Tesla-Signature: {signature}' \ -d '{"userId":"{testUserId}"}' ``` ### Response Body | **Field** | **Type** | **Remarks** | | ----------------- | ------------ | -------------------------------- | | cryptoCurrencies | object array | crypto currency list | | └─ cryptoCurrency | string | crypto currency code | | └─ precision | int | the precision of crypto currency | #### Example ```json { "cryptoCurrencies": [ { "cryptoCurrency": "BTC", "precision": 8 }, { "cryptoCurrency": "ETH", "precision": 8 }, { "cryptoCurrency": "BNB", "precision": 8 }, { "cryptoCurrency": "USDC", "precision": 6 } ] } ``` --- ## Document: /products/connect-prime/open-apis/12.get-discover-price URL: /en/dev-docs/products/connect-prime/open-apis/12.get-discover-price # Get Discover Price ``` POST /papi/v1/ramp/connect/prime/info/discover ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | ------------ | -------- | ------------- | ------------------------------------ | | fiatCurrency | string | Yes | Fiat currency code, support AED only | #### Example ```json { "fiatCurrency": "AED" } ``` ```shell curl -X POST https://{domain}/papi/v1/ramp/connect/prime/info/discover \ -H 'Content-Type: application/json' \ -H 'X-Tesla-ClientId: {your client id}' \ -H 'X-Tesla-SignAccessToken: {your access token}' \ -H 'X-Tesla-Timestamp: {now}' \ -H 'X-Tesla-Signature: {signature}' \ -d '{"fiatCurrency":"AED"}' ``` ### Response Body | **Field** | **Type** | **Remarks** | | --------------------------------- | -------- | ------------------------------------------------ | | cryptoCurrencies | array | Array of cryptocurrency data | | cryptoCurrencies[].cryptoCurrency | string | Cryptocurrency code, e.g., BTC, ETH | | cryptoCurrencies[].fiatCurrency | string | Fiat currency code, e.g., AED | | cryptoCurrencies[].quotation | decimal | Quotation price in the specified fiat currency | | cryptoCurrencies[].changes | decimal | 24-hour change percentage (positive or negative) | #### Example ```json { "cryptoCurrencies": [ { "cryptoCurrency": "BTC", "fiatCurrency": "AED", "quotation": 16609.58, "changes": -1.56 }, { "cryptoCurrency": "ETH", "fiatCurrency": "AED", "quotation": 0.9973, "changes": 0.01 }, { "cryptoCurrency": "SOL", "fiatCurrency": "AED", "quotation": 0.055, "changes": -4.81 }, { "cryptoCurrency": "USDT", "fiatCurrency": "AED", "quotation": 0.000051, "changes": -5.41 }, { "cryptoCurrency": "USDC", "fiatCurrency": "AED", "quotation": 1.1, "changes": -4.81 } ] } ``` ### Cache Policy The API response is cached for 10 seconds to improve performance and reduce server load. --- ## Document: /products/connect-prime/open-apis/11.get-kline-data URL: /en/dev-docs/products/connect-prime/open-apis/11.get-kline-data # Get Kline Data ``` POST /papi/v1/ramp/connect/prime/info/klines ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | -------------- | -------- | ------------- | -------------------------------------------------- | | cryptoCurrency | string | Yes | Cryptocurrency trading pair symbol, e.g., BTC, ETH | | interval | string | Yes | Kline interval (see supported intervals below) | | startTime | long | Yes | Start time in milliseconds (UTC) | | endTime | long | Yes | End time in milliseconds (UTC) | #### Supported Kline Intervals | **Interval** | **Value** | | ------------ | --------- | | 3 minutes | 3m | | 1 hour | 1h | | 1 day | 1d | #### Example ```json { "cryptoCurrency": "BTC", "interval": "1h", "startTime": 1704067200000, "endTime": 1704153600000 } ``` ```shell curl -X POST https://{domain}/papi/v1/ramp/connect/prime/info/klines \ -H 'Content-Type: application/json' \ -H 'X-Tesla-ClientId: {your client id}' \ -H 'X-Tesla-SignAccessToken: {your access token}' \ -H 'X-Tesla-Timestamp: {now}' \ -H 'X-Tesla-Signature: {signature}' \ -d '{"cryptoCurrency":"BTC","interval":"1h","startTime":1704067200000,"endTime":1704153600000}' ``` ### Response Body The response is an array of kline data. Each kline is represented as an array of values: | **Index** | **Type** | **Remarks** | | --------- | -------- | ------------------------------------ | | 0 | long | Kline open time in milliseconds | | 1 | string | Opening price | | 2 | string | Highest price during the interval | | 3 | string | Lowest price during the interval | | 4 | string | Closing price | | 5 | string | Trading volume (base asset) | | 6 | long | Kline close time in milliseconds | | 7 | string | Trading volume (quote asset) | | 8 | int | Number of trades during the interval | | 9 | string | Taker buy volume (base asset) | | 10 | string | Taker buy volume (quote asset) | | 11 | string | Unused field, can be ignored | #### Example ```json [ [1704067200000, "42500.00", "42800.50", "42300.00", "42650.25", "1234.56789", 1704070799999, "52456789.12", 8456, "617.28394", "26228394.56", "0"], [1704070800000, "42650.25", "42900.00", "42550.00", "42800.00", "987.65432", 1704074399999, "42123456.78", 6789, "493.82716", "21061728.39", "0"] ] ``` ### Notes - `startTime` and `endTime` are required and must be provided in milliseconds (UTC). - Interval values are case-sensitive. - Klines are uniquely identified by their open time. --- ## Document: /products/connect-prime/open-apis/10.get-symbol-detail URL: /en/dev-docs/products/connect-prime/open-apis/10.get-symbol-detail # Get Symbol Detail ``` POST /papi/v1/ramp/connect/prime/info/symbol-detail ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | -------------- | -------- | ------------- | ---------------------------------------- | | cryptoCurrency | string | Yes | Cryptocurrency code, e.g., BTC, ETH, SOL | #### Example ```json { "cryptoCurrency": "BTC" } ``` ```shell curl -X POST https://{domain}/papi/v1/ramp/connect/prime/info/symbol-detail \ -H 'Content-Type: application/json' \ -H 'X-Tesla-ClientId: {your client id}' \ -H 'X-Tesla-SignAccessToken: {your access token}' \ -H 'X-Tesla-Timestamp: {now}' \ -H 'X-Tesla-Signature: {signature}' \ -d '{"cryptoCurrency":"BTC"}' ``` ### Response Body | **Field** | **Type** | **Remarks** | | ----------------- | --------- | ----------------------------------------- | | symbol | string | Cryptocurrency code, e.g., BTC, ETH | | marketCap | decimal | Total market capitalization in USD | | volume | decimal | 24-hour trading volume in USD | | rank | integer | Market ranking by market cap | | circulatingSupply | decimal | Current circulating supply | | maxSupply | long | Maximum supply limit (null if infinite) | | totalSupply | long | Total supply including locked tokens | | issueDate | timestamp | Token issuance date (ISO 8601 format) | | website | string | Official website URL | | whitePaperUrl | string | Whitepaper URL | | dominance | decimal | Market dominance percentage | | description | string | Cryptocurrency description (English only) | #### Example ```json { "symbol": "BTC", "marketCap": 325678900000.5, "volume": 28456789000.25, "rank": 1, "circulatingSupply": 19500000.0, "maxSupply": 21000000, "totalSupply": 21000000, "issueDate": null, "website": "https://bitcoin.org", "whitePaperUrl": "https://bitcoin.org/bitcoin.pdf", "dominance": 45.8, "description": "Bitcoin is a decentralized digital currency, without a central bank or single administrator, that can be sent from user to user on the peer-to-peer bitcoin network without the need for intermediaries." } ``` ### Cache Policy The API response is cached for 1 day and updates daily. --- ## Document: /products/connect-prime/open-apis/1.get-fiat-list-for-buy URL: /en/dev-docs/products/connect-prime/open-apis/1.get-fiat-list-for-buy # Get Fiat List for Buy ``` POST /papi/v1/ramp/connect/prime/buy/fiat-list ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | --------- | -------- | ------------- | --------------------------------- | | userId | string | Yes | Customer’s Binance sub-account ID | #### Example ```json { "userId": "54321123456" } ``` ```shell curl -X POST https://{domain}/papi/v1/ramp/connect/prime/buy/fiat-list \ -H 'Content-Type: application/json' \ -H 'X-Tesla-ClientId: {your client id}' \ -H 'X-Tesla-SignAccessToken: {your access token}' \ -H 'X-Tesla-Timestamp: {now}' \ -H 'X-Tesla-Signature: {signature}' \ -d '{"userId":"{testUserId}"}' ``` ### Response Body | **Field** | **Type** | **Remarks** | | -------------- | ------------ | ------------------------------ | | fiatCurrencies | object array | fiat currency list | | └─ currency | string | fiat currency code | | └─ precision | int | the precision of fiat currency | #### Example ```json { "fiatCurrencies": [ { "currency": "AUD", "precision": 2 }, { "currency": "USD", "precision": 2 }, { "currency": "EUR", "precision": 2 } ] } ``` --- ## Document: /products/connect-prime/basics/9.typical-sell-flow URL: /en/dev-docs/products/connect-prime/basics/9.typical-sell-flow # Typical Sell Flow ## Overview This document describes the standard cryptocurrency sell flow using Binance Connect Prime service. The sequence diagram below illustrates the interaction between partner systems and Binance Connect Prime Open APIs throughout the sell process. ## Participants - **User (u)**: End user selling cryptocurrency - **Merchant (m)**: Partner's system/application - **Connect Prime (c)**: Binance Connect Prime service - **Binance Asset SAPI (a)**: Binance Asset Service API for balance management ## Flow Steps ### 1. Get Crypto List for Sell - User initiates the sell flow - Merchant forwards the request to Connect Prime - Connect Prime returns the list of supported cryptocurrencies for selling - Merchant returns/displays the crypto list to the user ### 2. Get User's Crypto Balance - The merchant queries Binance Asset SAPI for the user's balance - Binance Asset SAPI returns balance details - The merchant displays the balance to the user ### 3. Cryptocurrency Selection - The system sets the default cryptocurrency by user's crypto balance or default option - The user selects a cryptocurrency from the available list ### 4. Get Trading Pair Info - The user/merchant requests trading pair information - The merchant requests supported trading pairs from Connect Prime - Connect Prime returns trading pair information - The merchant returns/displays the trading pair info to the user ### 5. Display Available Fiat Currencies - The system displays the available fiat currencies - The user selects the target fiat currency to receive ### 6. Get Fiat and Crypto Amount Limits (optional) - The merchant requests fiat and crypto amount limits from Connect Prime - Connect Prime returns the limits - The merchant side can validate the user's input amount before requesting a quote and displaying valid range to the user - you can skip this step if not needed and quote API will handle the validation ### 7. Get Quote - The user enters the sell amount - The merchant requests a real-time quote from Connect Prime - Connect Prime returns quote details - The merchant displays the quote information to the user ### 8. Execute Quote - The user confirms and proceeds - The merchant sends an execute quote request to Connect Prime - Connect Prime returns an order ID; the order is created ### 9. Transaction Status Monitoring - System enters a polling loop to monitor transaction status - Merchant continuously queries Connect Prime for transaction details - Connect Prime returns current transaction status - Status updates are relayed back to the user - Process continues until transaction is completed - Connect Prime sends webhook notifications to Merchant for status updates ### 10. Transaction Completion - Once the sell transaction is completed, Connect Prime will invoke [merchant side's transfer API](10.merchant-side-API-requirements.md#transfer-api) to transfer the fiat amount to the user's account - Refer to [Merchant-side API Requirements](10.merchant-side-API-requirements.md) for more details ### Sequence Diagram ![open-api-sell.png](../images/open-api-sell.png) --- ## Document: /products/connect-prime/basics/8.typical-buy-flow URL: /en/dev-docs/products/connect-prime/basics/8.typical-buy-flow # Typical Buy Flow ## Overview This document describes the standard cryptocurrency purchase flow using Binance Connect Prime service. The sequence diagram below illustrates the interaction between partner systems and Binance Connect Prime Open APIs throughout the purchase process. ## Participants - **User (u)**: End user purchasing cryptocurrency - **Merchant (m)**: Partner's system/application - **Connect Prime (c)**: Binance Connect Prime service ## Flow Steps ### 1. Get Fiat List for Buy - User initiates the buy flow - Merchant forwards the request to Connect Prime - Connect Prime returns available fiat currencies for buy - Merchant returns the fiat list to the user ### 2. Fiat Currency Selection - System displays the available fiat list and sets the default fiat currency - User selects their preferred fiat currency from the available list ### 3. Get Trading Pair Info - User/Merchant requests available trading pairs - Merchant queries Connect Prime for supported cryptocurrency trading pairs - Connect Prime returns trading pair info - Merchant returns trading pair info to the user ### 4. Display Available Cryptocurrencies - System displays the available cryptocurrencies to the user - User selects their desired cryptocurrency ### 5. Get Fiat and Crypto Amount Limits (optional) - Merchant requests fiat and crypto amount limits from Connect Prime - Connect Prime returns limits - The merchant side can validate the user's input amount before requesting a quote and displaying valid range to the user - you can skip this step if not needed and quote API will handle the validation ### 6. Get Quote - User inputs the buy amount - Merchant requests real-time quote from Connect Prime - Connect Prime returns quote details - Merchant displays quote information to the user ### 7. Transfer Fiat to Binance's Account - User confirms and decides to proceed with the purchase - Merchant transfers the user's fiat to Binance's designated fiat account on the merchant side - This is a merchant-internal operation — no Connect Prime API call is involved - The fiat transfer must be completed before calling Execute Quote ### 8. Execute Quote - Merchant sends execute quote request to Connect Prime - Connect Prime processes the request and returns an order ID - During the process, Connect Prime will invoke [merchant's check transaction API](10.merchant-side-API-requirements.md#check-merchant-side-transaction-status-api) to verify the fiat transfer in step (7) has been received - If verification fails, Connect Prime will return an error and the order will not be created. Then Connect Prime will invoke [merchant's refund API](10.merchant-side-API-requirements.md#refund-api-buy) to refund the user. - Refer to [Merchant-side API Requirements](10.merchant-side-API-requirements.md) for more details - Order is officially created in the system ### 9. Transaction Status Monitoring - System enters a polling loop to monitor transaction status - Merchant continuously queries Connect Prime for transaction details - Connect Prime returns current transaction status - Status updates are relayed back to the user - Process continues until transaction is completed - Connect Prime sends webhook notifications to Merchant for status updates ### Sequence Diagram ![open-api-buy.png](../images/open-api-buy.png) --- ## Document: /products/connect-prime/basics/7.order-status URL: /en/dev-docs/products/connect-prime/basics/7.order-status # Order status | **Code** | **Type** | **Description** | **Remarks** | | -------- | ---------- | -------------------------------------------------------------------------- | ----------- | | 1 | PROCESSING | The order is being processed and the transaction is ongoing. | | | 20 | FILLED | The transaction has been successfully completed. This is a final state. | | | 99 | FAILED | The transaction has failed and the order is closed. This is a final state. | | --- ## Document: /products/connect-prime/basics/6.apply-developer-account URL: /en/dev-docs/products/connect-prime/basics/6.apply-developer-account # How to apply partner developer account If you are a partner (client) who wants to integrate Binance Connect Prime’s Open API. Please contact Binance Connect team and provide the following items: - [Public key](3.request-signing.md) for API requests (private key kept by the partner/client safely); - IP addresses used to config whitelist; - Webhook callback url; Once Binance Connect receives these items and completes the configuration, Binance Connect will provide the following items to the partner (client): - Client id; - Sign access token; - Public key and partner code for webhook (private key kept by Binance Connect safely); Then the partner (client) will be able to call all Open APIs. > \*_Regarding different environments, please refer to > “[Environments and API base URLs](4.base-urls.md)”. It's recommended to start with the QA > environment first._ --- ## Document: /products/connect-prime/basics/5.error-code URL: /en/dev-docs/products/connect-prime/basics/5.error-code # Error code | **Code** | **Type** | **Message** | | -------- | --------------------------- | ------------------------------------------------------------------------- | | 1230101 | SYS_ERROR | System error | | 1230102 | SYS_BUSY | System busy. Try again later | | 1230303 | ILLEGAL_PARAMETERS | The parameter {0} is illegal | | 1230304 | INVALID_DIRECTION | Invalid trading direction: {0} | | 1230305 | NO_PAYMENT_METHOD_AVAILABLE | No payment method available for the specified currency pair and direction | | 1230306 | INVALID_AMOUNT_TYPE | Invalid amount type {0}. Must be 1 (fiat) or 2 (crypto) | | 1230307 | QUOTE_GENERATION_FAILED | Failed to generate quote from external service | | 1230308 | QUOTE_CACHE_FAILED | Failed to cache quote in Redis | | 1230309 | DUPLICATE_ORDER_SUBMISSION | Duplicate order submission detected | | 1230310 | QUOTE_EXPIRED | Quote has expired or not found | | 1230311 | ORDER_EXECUTION_FAILED | Order execution failed | | 1230312 | MERCHANT_NOT_EXIST | Merchant does not exist or is inactive | | 1230313 | CUSTOM_SPREAD_EXCEEDED | Custom spread {0} is out of bounds [{1}, {2}] | | 1230314 | INVALID_ORDER_STATUS | Invalid order status | | 1230315 | LIMIT_CALCULATION_FAILED | Limit calculation failed. Please check your parameters | # ### Example Response: ```json { "success": false, "code": "1230310", "message": "Quote has expired or not found", "data": null } ``` --- ## Document: /products/connect-prime/basics/4.base-urls URL: /en/dev-docs/products/connect-prime/basics/4.base-urls # Environments and API base URLs According to different environments, please use the following base URLs for API requests: | Environment | URL | | ----------- | ----------------------------------- | | QA | Please ask for Binance Connect team | | Production | Please ask for Binance Connect team | --- ## Document: /products/connect-prime/basics/3.request-signing URL: /en/dev-docs/products/connect-prime/basics/3.request-signing # API request signing The private key and public key are generated by the partner (client). The partner (client) should keep the private key securely and privately, and inform Binance Connect of the public key, then Binance Connect will be able to verify the API requests from the partner (client). # ### Generating key pairs You can use code or the OpenSSL tool to generate key pairs, depending on which one you prefer. #### Generating key pairs with code The example code below shows how to generate public and private keys: ```java import org.apache.commons.codec.binary.Base64; import java.security.KeyPairGenerator; import java.security.KeyPair; KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); generator.initialize(1024); KeyPair kp = generator.generateKeyPair();   String privateK = Base64.encodeBase64String(kp.getPrivate().getEncoded()); String publicK = Base64.encodeBase64String(kp.getPublic().getEncoded()); System.out.println("-----Generating private key-----"); System.out.println(privateK); System.out.println("\n\n-----Generating public key-----"); System.out.println(publicK); ``` #### Generating key pairs with OpenSSL tool Please follow the steps below: 1. Generate private key with command: ``` openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:1024 ``` 2. Extract the DER encoding of the private key with command: ``` openssl rsa -in private_key.pem -outform DER -out private_key.der ``` 3. Convert the DER-encoded private key to Base64 encoding with command: ``` openssl base64 -in private_key.der -out private_key.base64 -A | tr -d '\n' | sed 's/\//\//g' ``` > \*_Please keep the file "private_key.base64" generated by this command securely and privately. The > private key will be used to generate the signature._ 4. Generate public key with command: ``` openssl rsa -in private_key.pem -pubout -outform DER -out public_key.der ``` 5. Convert the DER-encoded public key to Base64 encoding with command: ``` openssl base64 -in public_key.der -out public_key.base64 -A | tr -d '\n' | sed 's/\//\//g' ``` > \*_Please send the file "public_key.base64" generated by this command to Binance Connect for use > in verifying API requests._ # ### Generating signature and set HTTP headers The signature is generated by request body (json string), timestamp and partner (client) private key, the following is the example code: ```java import org.apache.commons.codec.binary.Base64; import java.security.KeyFactory; import java.security.PrivateKey; import java.security.Signature; import java.security.spec.PKCS8EncodedKeySpec; import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; public class TestRequestSigning {     public static void main(String[] args) throws Exception {         MultiValueMap httpHeaders = new HttpHeaders();         String clientPrivateKey = "Your client private key";         String jsonBody = "{\n" +                 "\t\"id\": \"10000001\",\n" +                 "\t\"name\": Jack\n" +                 "}";// Please use utf-8 encoding if body contains special characters such as emoticons.         Long timestamp = System.currentTimeMillis();         PrivateKey cPrivateKey = generatePrivateKey(clientPrivateKey);         String signature = sign(jsonBody + timestamp.toString(), cPrivateKey);         httpHeaders.add("X-Tesla-Signature", signature);     }     public static PrivateKey generatePrivateKey(String privateKey) throws Exception {         PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKey));         KeyFactory keyFactory = KeyFactory.getInstance("RSA");         return keyFactory.generatePrivate(privateKeySpec);     }     public static String sign(String srcData, PrivateKey privateKey) throws Exception {         Signature signature = Signature.getInstance("SHA256withRSA");         signature.initSign(privateKey);         signature.update(srcData.getBytes());         return new String(Base64.encodeBase64(signature.sign()));     } } ``` # ### How signature works #### The signature flow is as follows: ![signature-flow](../images/signature-API-prime.png) # ### Use [Postman](https://www.postman.com/) to sign and test API requests 1. Configure environment variables Create an environment (such as QA) in Postman and add these environment variables for subsequent reference: `base_url`, `client_id`, `access_token`, `private_key`. Please note that the format of the value of `private_key` should be like this: ```javascript -----BEGIN PRIVATE KEY----- MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANAAMnEOR1NIBIbwnDwHu19L/Jv0s4eEDHEjQ24OHjkHQ3CHWj4Ik4iFZyX9MvQsmZEzkDx8mJkkgAmIGjYkkZhEny1z6GPW55+ruo4dLYIRurESYRufZxI49BtIeLOOwL9ZFOnVfxBh8T7xyCvMmMcF93Suv6RcbTWXk8EC0pkXAgMBAAECgYA2cXbChNxCfj1BHMWoKNXwkbEjGR/MvtGK45IIwoVCpBYQ5DzIs/H58AEZvnaR1wKzMO32Bx7iJt2koQ1LUrMQ0UB9ydxhP2BogHvt9ZDI49+UPkTS92HMgPixi6O1HE6nOOu4rHR+6j7pdGcB+dneTwgPngWdk71VsbX8ZzPZsQJBAOGPmztuIpgXCxPlyLWCuEa9zTKc9lHiBe65ZN1jvUq1GCLClVcx/oEtEb9CCo7u1vacr/1sGFPxgBdvzv2y8HMCQQDsEfGEhp/79keDnjvJZ+TLfP4r+u1Gw0gAuj4Cay316K3f3q2OEqNm9lMNzg5dVYb78sVRd+guZ88u9etRBX/NAkAheIrjdcNiaED3keiHrr8jmDSj5xDSM8UHmLEz/QHw3RCYz+ETUFLg3kw84lLoxN5XOAcRhwHRKwwD7k577RqrAkEAhBiGTOIII7Vrzvp7+fdoz3ThxTpkC3S6la2hhTj0PuY0ZVD1TMqhJLwxPUhQQWnaXqE6SJwQD+eGx4BUbMHnAQJBAKomO+rK7ycU9OSRpEbPt2yQskwCcY2fiLgDy0Sy1hWmp/e5Cowt2Uyzp6uk/4QwMkfFApYzWtvjrnRkru19rMw= -----END PRIVATE KEY----- ``` 2. Set up library [postman-util-lib](https://joolfe.github.io/postman-util-lib/) for Postman Add a Postman global variable named `pmlib_code`, and set the value of it as the source code in the [library bundle content](https://joolfe.github.io/postman-util-lib/dist/bundle.js). 3. Configure HTTP headers: add Pre-request scripts to collection or request of Postman Add the following code to the Pre-request script: ```javascript eval(pm.globals.get("pmlib_code")); pm.request.headers.add({ key: "Content-Type", value: "application/json", }); pm.request.headers.add({ key: "X-Tesla-ClientId", value: pm.environment.get("client_id"), }); pm.request.headers.add({ key: "X-Tesla-SignAccessToken", value: pm.environment.get("access_token"), }); const timestamp = new Date().getTime(); let jsonBody = new String(); if (pm.request.body.raw) { jsonBody = pm.request.body.raw; } const dataToSign = jsonBody + timestamp.toString(); const privateKey = pm.environment.get("private_key"); const sha256withRSA = new pmlib.rs.KJUR.crypto.Signature({ alg: "SHA256withRSA" }); sha256withRSA.init(privateKey); sha256withRSA.updateString(dataToSign); const signature = pmlib.rs.hextob64(sha256withRSA.sign()); pm.request.headers.add({ key: "X-Tesla-Signature", value: signature, }); pm.request.headers.add({ key: "X-Tesla-Timestamp", value: timestamp.toString(), }); ``` 4. Everything is ready, feel free to test the API requests! --- ## Document: /products/connect-prime/basics/2.common-response URL: /en/dev-docs/products/connect-prime/basics/2.common-response # Common API response | Field | Type | Mandatory | Remarks | | ------- | ------ | --------- | ------------------------------------------------------------------------------------------ | | success | bool | Yes | true means success. | | code | string | Yes | “000000” means success. Other error codes please refer to “[error code](5.error-code.md)”. | | data | object | No | A json object of returned data. | | message | string | No | Error message, please refer to “[error code](5.error-code.md)”. | --- ## Document: /products/connect-prime/basics/10.merchant-side-API-requirements URL: /en/dev-docs/products/connect-prime/basics/10.merchant-side-API-requirements # Binance Connect Prime API Requirements Document ## Table of Contents - [General API Convention](#general-api-convention) - [Base URL](#base-url) - [Authorization (flexible)](#authorization-flexible) - [API Response Envelope](#api-response-envelope) - [Buy flow](#buy-flow) - [Check merchant side transaction status API](#check-merchant-side-transaction-status-api) - [General Buy Flow](#general-buy-flow) - [Minimum Requirements](#minimum-requirements) - [Refund API (BUY)](#refund-api-buy) - [General Refund Flow (BUY)](#general-refund-flow-buy) - [Minimum Requirements](#minimum-requirements-1) - [Sell flow](#sell-flow) - [Transfer API](#transfer-api) - [General Sell Flow](#general-sell-flow) - [Minimum Requirements](#minimum-requirements-2) - [Miscellaneous Requirements](#miscellaneous-requirements) - [Get historical transaction list](#get-historical-transaction-list) - [General Key Notes](#general-key-notes) --- The purpose of this API document is to enable seamless integration between merchant side and Binance Connect Prime, facilitating efficient transaction processing, data retrieval, and other essential operations. The document details the endpoints, request and response formats, authentication methods, and error handling protocols to ensure a clear and consistent implementation. ## General API Convention ### Base URL - **Production environment URL** (real money) - **Testing/Sandbox environment URL** (test money) ### Authorization (flexible) **Below are two common authorization methods for demonstration purposes. The authorization details can be discussed at a later time.** **Token-based authentication:** - HTTP header: `Authorization: Bearer ` **Private-Public-Key signing** - Account-based authentication ### API Response Envelope **Response envelope:** - All endpoints return HTTP code with a JSON body --- ## Buy flow ### Check merchant side transaction status API: #### General Buy Flow: 1. On Merchant Side, user transfers fiat to Binance's account 2. The merchant will call our API to execute the quote, providing information about the transaction in step (1) (e.g. transactionId, orderId, etc…) 3. Binance will verify that we have received the fiat from the user 4. After confirming fiat funds have been received, Binance releases crypto to the user #### Minimum Requirements To facilitate point (2), we would require an endpoint that allows us to check the status of the transaction sent by the user. The transaction status should be exhaustive, ideally an enum. Here's an example: ```java public enum TransactionStatus { PENDING(0), COMPLETED(0), FAILED(0), } ``` --- ### Refund API (BUY) #### General Refund Flow (BUY): 1. On Merchant Side, user transfers fiat to Binance's account 2. The merchant will call our API to execute the quote, providing information about the transaction in step (1) (e.g. transactionId, etc…) 3. Binance will verify that we have received the fiat from the user 4. Binance executes buy transaction based on the given quote 5. Quote has expired 6. Binance calls a provided endpoint to refund fiat back to user #### Minimum Requirements Since fiat funds are already transferred before buy flow was initiated on Binance's side, we need to refund the user in the event we are unable to process the given quote. We would need: - An endpoint that allows Binance to refund the user's fiat transfer in step (1) back to the user. - An endpoint that allows Binance to check the status of the refund. #### Refund API Specification **Request:** Binance will call the merchant's refund endpoint with the following parameter: | Field | Type | Mandatory | Remarks | | ------------- | ------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | clientOrderId | string | Yes | The unique order ID originally provided by the merchant during Execute Quote. This is the sole identifier for the refund — no `userId` or additional fields are required. | **Request Example:** ```json { "clientOrderId": "YOUR_UNIQUE_ORDER_ID_001" } ``` **Response:** The merchant should return the refund status: | Field | Type | Mandatory | Remarks | | -------- | ------ | --------- | ----------------------------------------------- | | refundId | string | Yes | Merchant-side unique refund identifier | | status | string | Yes | Refund status: `PENDING`, `COMPLETED`, `FAILED` | **Response Example:** ```json { "success": true, "code": "000000", "data": { "refundId": "refund_abc123", "status": "PENDING" } } ``` **Key Design Points:** - `clientOrderId` is the **only identifier** needed to locate the original transaction. The merchant should be able to look up the user and transaction details on their side using this ID alone. - The refund endpoint **must be idempotent**: calling it multiple times with the same `clientOrderId` should not create duplicate refunds. - Binance will subsequently call the **refund status check endpoint** with the same `clientOrderId` (or `refundId`) to poll for refund completion. --- ## Sell flow ### Transfer API #### General Sell Flow: 1. Merchant calls Binance API to execute sell quote 2. Binance will calculate the corresponding fiat amount based on the given quote. 3. Binance will call Merchant's API to transfer the fiat amount calculated in step (2) to the user's account #### Minimum Requirements Since Binance will be transferring fiat to the user, we would need: - An endpoint to initiate a fiat fund transfer to a user - An endpoint that allows Binance to check the status of the refund. --- ## Miscellaneous Requirements ### Get historical transaction list For book-keeping purposes, Binance performs T+1 reconciliation. We would require an endpoint that allows us to fetch our past transactions. **Key Information that's required:** - transactionId / orderId - Fiat currency and amount - Direction (transfer IN or OUT) - CreatedAt Timestamp (when the transaction was initiated) - CompletedAt Timestamp (when the transaction finished processing) ### General Key Notes: - For each unique transaction, Idempotency must be ensured. (i.e. transactionId, orderId must be unique) --- ## Document: /products/connect-prime/basics/1.common-request-headers URL: /en/dev-docs/products/connect-prime/basics/1.common-request-headers # Common API request headers | Parameter | Description | Mandatory | Remarks | | ----------------------- | ----------------------------------------------------------------------------------- | --------- | ------------------------------------------------------ | | Content-Type | application/json | Yes | | | X-Tesla-ClientId | Partner (client) id provided by Binance Connect | Yes | | | X-Tesla-SignAccessToken | Access token provided by Binance Connect | Yes | | | X-Tesla-Signature | A signature generated by request body, timestamp and partner (client) private key\* | Yes | Refer to “[API Request signing](3.request-signing.md)” | | X-Tesla-Timestamp | Timestamp in millisecond | Yes | | > \*_The private key and public key are generated by the partner (client). Please refer to > “[API Request signing](3.request-signing.md)” for the generation method._ --- ## Document: /products/connect-2.0/webhook/webhook URL: /en/dev-docs/products/connect-2.0/webhook/webhook # Webhook Whenever a key event (currently only "order status change") occurs, Binance Connect will send a webhook message, and the partner (client) can receive this message at the webhook callback url and react accordingly, such as updating order data and frontend UI. ### Request Headers | **Field** | **Type** | **Remarks** | | ---------------------- | --------- | -------------------------------------------------------- | | X-BN-Connect-Timestamp | timestamp | timestamp | | X-BN-Connect-Signature | string | SHA256withRSA(**requestBody** + **X-Connect-Timestamp**) | | X-BN-Connect-For | string | Same with your client id (X-Tesla-ClientId) | ### Request Body | **Field** | **Type** | **Remarks** | | --------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | webhookEventType | string | A fixed value: connect_order_event | | externalOrderId | string | The unique order id from the partner side. | | type | int | 1: buy, 2: sell, 3: send | | businessType | int | 1: fiat, 2: p2p, 3: send, 4: convert | | status | int | Please refer to "[Order status](../basics/7.order-status.md)" | | payMethodCode | string | The payment method code is from payment method list API | | payMethodSubCode | string | The payment method sub code is from payment method list API | | fiatCurrency | string | fiat currency | | cryptoCurrency | string | crypto currency | | openUserId | string | OpenUserId represents a Binance user ID that has been securely hashed. This field is provided to merchants to facilitate the identification of whether multiple orders originate from the same user. | | fiatAmount | string | fiat amount | | cryptoAmount | string | crypto amount | | feeAmount | string | fee amount | | feeCurrency | string | fee currency, USD or crypto | | revenueAmount | string | partner revenue amount | | revenueCurrency | string | partner revenue currency, USD or crypto | | networkFee | string | network fee amount | | withdrawWalletAddress | string | withdraw wallet address | | withdrawNetwork | string | withdraw network | | withdrawMemo | string | withdraw network memo | | withdrawTxHash | string | withdraw tx hash | | orderDetailLink | string | order detail link | | orderTime | timestamp | order time | | completionTime | timestamp | completion time | | updateTime | timestamp | update time | | convertInfo | object | Convert information. This field is only present for Convert orders. Refer to **ConvertInfo** | | swapDetailInfoVo | object | If the order has swap operation. Then this field has value. Refer to **SwapDetailInfoVo** | | userData | string | AES-encrypted JSON string (see details below). Disabled by default; contact us to enable | #### SwapDetailInfoVo | **Field** | **Type** | **Remarks** | | --------------------------------- | -------- | --------------------------------------------------------------------------------- | | fromCryptoCurrencyContractAddress | string | The "from" crypto contract address, typically a stablecoin or native token. | | toCryptoCurrencyContractAddress | string | The contract address of the target coin the user intends to swap online. | | toCryptoCurrencyAmount | string | The final amount of cryptocurrency the user swapped and received in their wallet. | #### ConvertInfo | **Field** | **Type** | **Remarks** | | -------------- | -------- | --------------------------------------------------- | | fromCoin | string | The source cryptocurrency being converted from | | fromCoinAmount | string | The amount of source cryptocurrency being converted | #### userData field - Type: string - Remarks: When enabled, `userData` contains a JSON object (serialized to a string) that is encrypted with AES. The field value is the AES-encrypted ciphertext encoded as a string. This field is disabled by default — please contact us if you need it enabled and for access to the AES key and configuration. - Decryption reference: follow the AES decryption instructions described in [Binance documentation](/products/binance-pay-merchant/authentication#decryption-instructions-for-merchant-data-sharing) - JSON structure (plaintext before AES encryption): | Field | Type | Remarks | | ---------------- | ------ | ------------------------------- | | firstName | string | User's first name | | middleName | string | User's middle name (optional) | | lastName | string | User's last name | | residenceCountry | string | Country code of residence (ISO) | | birthday | string | Birthday in YYYY-MM-DD format | | country | string | Country code (ISO) | | refundAddress | string | Refund crypto address (if any) | | refundNetwork | string | Network of refund (e.g., ETH) | | refundMemo | string | Refund memo/memo field (if any) | Notes: - Field names and types above show the expected JSON keys that will be present after decrypting `userData`. - The concrete AES parameters (mode, IV, padding) and key delivery method will be provided when the field is enabled; see the decryption reference link above for an example. ### Response Body - HTTP status code is 200 - Response body is in JSON format. | **Field** | **Type** | **Remarks** | | ------------- | -------- | ----------------------------------------------------------- | | returnCode | string | SUCCESS or other code you wish to return to Binance Connect | | returnMessage | string | the message you wish to return to Binance Connect | ### How signature works The encryption/decryption and verification process of webhook is exactly the opposite/mirrored of API request process. The sender and receiver of the two are opposite, but they are both processes that signed by the sender with a private key and verified by the receiver with a public key. For API requests, the partner (client) generates a pair of keys. The private key is kept securely and privately by the partner (client). Then the partner (client) uses the private key to sign when initiating API requests. The public key is shared to Bianance Connect, with which Binance will verify the signature of the API request to ensure that the request is indeed initiated by the partner (client). For webhook, it's an opposite/mirrored process. Binance Connect generates a pair of keys. The private key is kept securely and privately by Binance Connect. Then Binance Connect uses the private key to sign when initiating the webhook message. The public key is shared to the partner (client), with which the partner (client) can verify the signature of the webhook message to ensure that the message is indeed initiated by Binance. #### The webhook signature flow is as follows: ![signature-Webhook.png](../images/signature-Webhook.png) ### Verify signature As mentioned above, Binance Connect initiates a webhook request to the webhook callback url provided by the partner ( client). And the partner (client) should verify the identity of the request initiator based on the public key provided by Binance Connect. The example code below shows how to verify signature with public key: ```java public static boolean verify(String srcData, PublicKey publicKey, String sign) throws Exception { Signature signature = Signature.getInstance("SHA256withRSA"); signature.initVerify(publicKey); signature.update(srcData.getBytes()); return signature.verify(Base64.decodeBase64(sign.getBytes())); } ``` # ### Example Request Body: ```json { "webhookEventType": "connect_order_event", "externalOrderId": "180401941923045", "type": 1, "businessType": 1, "status": 2, "payMethodCode": "BUY_P2P", "payMethodSubCode": "BANK", "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "openUserId": "f47ac10b58cc4372a5670e02b2c3d479", "fiatAmount": "100", "cryptoAmount": "107.8", "feeAmount": "1", "feeCurrency": "USDT", "revenueAmount": "0.08", "revenueCurrency": "USDT", "networkFee": "0.5", "withdrawWalletAddress": "0xbb4CdB98Bd36B01bD1cBaEA52De08d9173bc095c", "withdrawNetwork": "BSC", "withdrawMemo": "", "withdrawTxHash": "0xcb163e2e6322cd6aa7bc4d45306029e846c0c06e9cdee45a06e88801d1231e71", "orderDetailLink": "https://www.binance.com/en/my/wallet/exchange/buysell-history?type=buy", "orderTime": 1723186761000, "completionTime": 1723206761000, "updateTime": 1734446642930 } ``` ### Example (Convert Order) Request Body: ```json { "webhookEventType": "connect_order_event", "networkFee": null, "feeCurrency": "USDT", "type": 1, "businessType": 4, "withdrawMemo": "", "revenueAmount": null, "cryptoCurrency": "USDT", "withdrawTxHash": "", "completionTime": null, "orderTime": 1753344231742, "payMethodSubCode": "CUMBERLAND", "cryptoAmount": "1.03", "orderDetailLink": null, "payMethodCode": "SPOT", "revenueCurrency": "USDT", "convertInfoVo": { "fromCoin": "BNB", "fromCoinAmount": 0.00137386 }, "swapDetailInfoVo": null, "updateTime": 1753344255279, "externalOrderId": "830315252102", "withdrawWalletAddress": "0xbb4CdB98Bd36B01bD1cBaEA52De08d9173bc095c", "fiatCurrency": "", "fiatAmount": "0", "withdrawNetwork": "ETH", "status": 11 } ``` --- ## Document: /products/connect-2.0/send-primary-mode/send-primary-mode URL: /en/dev-docs/products/connect-2.0/send-primary-mode/send-primary-mode # Send primary mode As we know, Binance Connect has a wide range of application scenarios. In addition to on-ramp (buy) and off-ramp (sell), Binance Connect can also be used as a crypto payment channel/tool, that is, users can directly use the crypto balance in their Binance wallet to make third-party payments. This is the "send primary mode" we launched. In send primary mode, the product process and user flow are different from the normal on-ramp (buy), as follows: - Send (transfer) crypto will be promoted as the first priority; - Buy crypto related features will be downgraded and hidden, users don't need to buy crypto, they only need to send (transfer) crypto from their Binance wallet; - Only in one case, when the crypto balance in user's Binance wallet is insufficient, the flow will return back to the buy crypto process, to avoid users being blocked here; ## How to integrate send primary mode If you are going to integrate send primary mode, please follow these instructions: 1. Contact Binance Connect team to enable this feature for you (it's disabled by default); 2. Pass `"SEND_PRIMARY": true` or `"SEND_PRIMARY_FLEXIBLE": true` in the `customization` parameter of the pre-order API. Please refer to [Customization](../basics/9.customization.md). ### Difference between SEND_PRIMARY and SEND_PRIMARY_FLEXIBLE - **SEND_PRIMARY**: The crypto amount is locked and fixed based on the amount specified in the pre-order API. Users cannot modify the amount on the Binance Connect page. Should work together with `amountType: 2`. - **SEND_PRIMARY_FLEXIBLE**: The crypto amount specified in the pre-order API will be used as a default value, but users can freely input and modify the amount on the Binance Connect page. This provides more flexibility for users to adjust the payment amount as needed. > **Note**: You should only use either `SEND_PRIMARY` or `SEND_PRIMARY_FLEXIBLE`, not both at the > same time. ## Typical Send Flow 1. **Initiate Send & Fetch Info** - The user initiates a crypto transfer from Binance on the partner's frontend. - The partner's backend requests the list of supported crypto networks and trading pairs from Binance Connect. - This information is then relayed to the partner's frontend to be displayed to the user. 2. **Confirm & Create Pre-order** - The user confirms the details on the partner's frontend. - The partner's backend sends a pre-order request to Binance Connect. - Binance Connect returns a `redirectUrl` in the response. 3. **Redirect to Binance** - The partner's frontend redirects the user to the Binance App/website using the `redirectUrl`. 4. **Complete Flow on Binance** - The user completes the send process on the Binance platform. - Note: If the user's balance is insufficient, the flow will include a buy step before sending. 5. **Webhook Notification** - Binance Connect sends a webhook notification to the partner's backend about the order status update. 6. **Query Order Status** - The partner's backend can then query the order details from Binance Connect to get the final status of the transaction. ## Diagram ![send-flow.png](../images/send-flow.png) --- ## Document: /products/connect-2.0/sandbox/4.order-status-transition URL: /en/dev-docs/products/connect-2.0/sandbox/4.order-status-transition # Order Status Transition ``` POST /papi/v1/ramp/connect/sandbox/order-status-transition ``` The Order Status Transition API allows merchants to manually transition order statuses in the sandbox environment for testing purposes. This API simulates various order state changes without requiring actual payment processing or blockchain transactions. Refer to the order status list [7.order-status.md](../basics/7.order-status.md) ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | --------------- | -------- | ------------- | ----------------------------------------------------------------------------- | | externalOrderId | string | Yes | The unique order id from the partner side. Supports only letters and numbers. | | targetStatus | int | Yes | The target status to transition to. Must be a positive integer. | ### Response Body | **Field** | **Type** | **Remarks** | | --------- | -------- | ---------------------------------- | | success | boolean | Indicates if the request succeeded | | code | string | Response code | | message | string | Response message | The API supports different status transitions based on the order type and business type. Below are the supported transitions: ### 1. BUY Orders (FIAT/P2P Business Type) #### For Regular Withdraw Orders: | Target Status Code | Status Name | Description | | ------------------ | ------------------- | -------------------------------------- | | 2 | ON_RAMP_COMPLETED | purchase crypto completed successfully | | 11 | WITHDRAW_PROCESSING | Withdrawal is being processed | | 96 | WITHDRAW_ABANDONED | Withdrawal was abandoned | | 97 | ON_RAMP_FAILED | purchase crypto failed | | 98 | WITHDRAW_FAILED | Withdrawal failed | | 20 | COMPLETED | Order fully completed | #### For Swap Orders (Buy Any Token): | Target Status Code | Status Name | Description | | ------------------ | ----------------- | -------------------------------------- | | 2 | ON_RAMP_COMPLETED | purchase crypto completed successfully | | 15 | SWAP_PROCESSING | Token swap is being processed | | 93 | SWAP_ABANDONED | Token swap was abandoned | | 94 | SWAP_FAILED | Token swap failed | | 97 | ON_RAMP_FAILED | purchase crypto failed | | 20 | COMPLETED | Order fully completed | ### 2. BUY Orders (CONVERT Business Type) | Target Status Code | Status Name | Description | | ------------------ | ------------------- | ---------------------------------------- | | 4 | CONVERT_COMPLETED | Crypto conversion completed successfully | | 11 | WITHDRAW_PROCESSING | Withdrawal is being processed | | 92 | CONVERT_FAILED | Crypto conversion failed | | 96 | WITHDRAW_ABANDONED | Withdrawal was abandoned | | 98 | WITHDRAW_FAILED | Withdrawal failed | | 20 | COMPLETED | Order fully completed | ### 3. SEND Orders (Send Crypto) | Target Status Code | Status Name | Description | | ------------------ | --------------- | ------------------------ | | 20 | COMPLETED | Crypto sent successfully | | 98 | WITHDRAW_FAILED | Crypto send failed | ## Status Transition Flow ### BUY Order (FIAT/P2P) - Regular Flow ``` INIT(0) → ON_RAMP_PROCESSING(1) → ON_RAMP_COMPLETED(2) → WITHDRAW_PROCESSING(11) → COMPLETED(20) ``` ### BUY Order (FIAT/P2P) - Swap Flow ``` INIT(0) → ON_RAMP_PROCESSING(1) → ON_RAMP_COMPLETED(2) → SWAP_PROCESSING(15) → COMPLETED(20) ``` ### BUY Order (CONVERT) Flow ``` INIT(0) → CONVERT_PROCESSING(3) → CONVERT_COMPLETED(4) → WITHDRAW_PROCESSING(11) → COMPLETED(20) ``` ### SEND Order Flow ``` INIT(0) → WITHDRAW_PROCESSING(11) → COMPLETED(20) ``` # ### Example 1: Transition order to completed status Request Parameters: ```json { "externalOrderId": "946972922319", "targetStatus": 11 } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": null } ``` ### Example 2: Transition order to pending status Request Parameters: ```json { "externalOrderId": "946972922320", "targetStatus": 20 } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": null } ``` ### Example 3: Transition order to failed status Request Parameters: ```json { "externalOrderId": "946972922321", "targetStatus": 40 } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": null } ``` --- ## Document: /products/connect-2.0/sandbox/3.place-buy-any-token-order URL: /en/dev-docs/products/connect-2.0/sandbox/3.place-buy-any-token-order # Place Buy Any Token Order ``` POST /papi/v1/ramp/connect/sandbox/place-buy-any-token-order ``` This endpoint allows you to place test orders in the sandbox environment for buying any token, including tokens that may not be listed on Binance spot markets. ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | --------------- | -------- | ------------- | ----------------------------------------------------------------------------- | | externalOrderId | string | Yes | The unique order id from the partner side. Supports only letters and numbers. | | fiatCurrency | string | Yes | Fiat currency code (e.g., EUR, USD) | | requestedAmount | string | Yes | Requested amount. Must be greater than 0 and less than 9999999999999999 | | amountType | int | Yes | Specify whether the requested amount is in fiat:1 or crypto:2 | ### Response Body | **Field** | **Type** | **Remarks** | | --------- | -------- | ---------------------------------- | | success | boolean | Indicates if the request succeeded | | code | string | Response code | | message | string | Response message | # ### Example 1: Buy any token with fiat amount Request Parameters: ```json { "externalOrderId": "599518801876", "fiatCurrency": "EUR", "requestedAmount": "150", "amountType": 1 } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": null } ``` ### Example 2: Buy any token with crypto amount Request Parameters: ```json { "externalOrderId": "599518801877", "fiatCurrency": "USD", "requestedAmount": "100", "amountType": 2 } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": null } ``` --- ## Document: /products/connect-2.0/sandbox/2.place-convert-feature-order URL: /en/dev-docs/products/connect-2.0/sandbox/2.place-convert-feature-order # Place Convert Feature Order ``` POST /papi/v1/ramp/connect/sandbox/place-convert-feature-order ``` This endpoint allows you to place test convert orders in the sandbox environment to simulate cryptocurrency conversion scenarios. ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | ------------------ | -------- | ------------- | ------------------------------------------------------------------------------------------ | | externalOrderId | string | Yes | The unique order id from the partner side. Supports only letters and numbers. | | fromCryptoCurrency | string | Yes | The source cryptocurrency to convert from (e.g., BNB, ETH) | | toCryptoCurrency | string | Yes | The target cryptocurrency to convert to (e.g., USDT, BTC) | | toCryptoAmount | string | Yes | The amount of target cryptocurrency. Must be greater than 0 and less than 9999999999999999 | ### Response Body | **Field** | **Type** | **Remarks** | | --------- | -------- | ---------------------------------- | | success | boolean | Indicates if the request succeeded | | code | string | Response code | | message | string | Response message | # ### Example 1: Convert BNB to USDT Request Parameters: ```json { "externalOrderId": "830315252102", "fromCryptoCurrency": "BNB", "toCryptoCurrency": "USDT", "toCryptoAmount": "100" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": null } ``` ### Example 2: Convert ETH to BTC Request Parameters: ```json { "externalOrderId": "830315252103", "fromCryptoCurrency": "ETH", "toCryptoCurrency": "BTC", "toCryptoAmount": "0.5" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": null } ``` --- ## Document: /products/connect-2.0/sandbox/1.place-order URL: /en/dev-docs/products/connect-2.0/sandbox/1.place-order # Place Order ``` POST /papi/v1/ramp/connect/sandbox/place-order ``` This endpoint allows you to place test orders in the sandbox environment to simulate the complete order lifecycle without using real funds. ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | --------------- | -------- | ------------- | ----------------------------------------------------------------------------- | | externalOrderId | string | Yes | The unique order id from the partner side. Supports only letters and numbers. | | fiatCurrency | string | Yes | Fiat currency code (e.g., EUR, USD) | | cryptoCurrency | string | Yes | Crypto currency code (e.g., USDT, BTC) | | requestedAmount | string | Yes | Requested amount. Must be greater than 0 and less than 9999999999999999 | | amountType | int | Yes | Specify whether the requested amount is in fiat:1 or crypto:2 | | type | string | Yes | Order type: BUY, BUY_P2P, SEND | ### Response Body | **Field** | **Type** | **Remarks** | | --------- | -------- | ---------------------------------- | | success | boolean | Indicates if the request succeeded | | code | string | Response code | | message | string | Response message | # ### Example 1: Place a BUY order Request Parameters: ```json { "externalOrderId": "946972922319", "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "requestedAmount": "100", "amountType": 1, "type": "BUY" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": null } ``` ### Example 2: Place a BUY_P2P order Request Parameters: ```json { "externalOrderId": "946972922320", "fiatCurrency": "USD", "cryptoCurrency": "BTC", "requestedAmount": "0.5", "amountType": 2, "type": "BUY_P2P" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": null } ``` ### Example 3: Place a SEND order Request Parameters: ```json { "externalOrderId": "946972922321", "fiatCurrency": "EUR", "cryptoCurrency": "ETH", "requestedAmount": "1.5", "amountType": 2, "type": "SEND" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": null } ``` --- ## Document: /products/connect-2.0/sandbox/0.overview URL: /en/dev-docs/products/connect-2.0/sandbox/0.overview # Sandbox APIs Overview ## Overview The Sandbox APIs provide a safe testing environment for partners to integrate with Binance Connect without using real funds or affecting production systems. These APIs allow you to simulate the complete order lifecycle, test different order types, and verify your integration before going live. **_Note1: The sandbox environment is isolated from production. All data and operations here do not impact real user accounts or transactions._** **_Note2: Invoke the pre-order API first, then use the sandbox APIs below._** ## Purpose The sandbox environment enables you to: - Test order placement flows without real transactions - Simulate various order types (BUY, BUY_P2P, SEND, Convert) - Manually control order status transitions for testing webhooks and order state management - Validate your integration with different scenarios and edge cases ## Available APIs ### 1. Place Order Place standard test orders to simulate regular cryptocurrency purchase flows. ### 2. Place Convert Feature Order Test cryptocurrency conversion scenarios where users convert from one crypto to another. ### 3. Place Buy Any Token Order Simulate purchases of any token, including tokens not listed on Binance spot markets. ### 4. Order Status Transition Manually trigger order status changes to test your order lifecycle management and webhook handling. ## Testing Flow A typical testing workflow in the sandbox: 1. **Place an Order**: Use one of the place order endpoints to create a test order 2. **Verify Order Creation**: Check that your system correctly receives and processes the order 3. **Trigger Status Transitions**: Use the order status transition API to simulate different order states 4. **Test Webhooks**: Verify your webhook handlers correctly process status updates 5. **Validate Order Queries**: Use the order query API to fetch and verify order details ## Key Differences from Production - No real funds are used - Orders don't execute actual blockchain transactions - Status transitions are manual and controlled by the partner - All operations are isolated to the sandbox environment ## Getting Started To start testing with sandbox APIs: 1. Ensure you have sandbox credentials configured 2. Review the individual API documentation for each endpoint 3. Start with simple order placement and gradually test more complex scenarios 4. Use the order status transition API to simulate various order states ## Best Practices - Test all possible order types your integration will support - Verify error handling for invalid requests - Test webhook delivery and processing for all status transitions - Validate order query functionality with different order states - Test edge cases like very small or large amounts --- ## Document: /products/connect-2.0/on-ramp-buy-apis/8.get-p2p-trading-pairs URL: /en/dev-docs/products/connect-2.0/on-ramp-buy-apis/8.get-p2p-trading-pairs # Get P2P-only trading pairs ``` POST /papi/v1/ramp/connect/buy/p2p/trading-pairs ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | ------------ | -------- | ------------- | ------------------------------ | | fiatCurrency | string | No | Filter by target fiat currency | ### Response Body (list of json object) | **Field** | **Type** | **Remarks** | | ---------------- | -------- | ---------------------- | | fiatCurrency | string | | | cryptoCurrencies | array | Crypto currency object | | cryptoCurrency | string | Crypto currency symbol | ### Example Request: ```json { "fiatCurrency": "EUR" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": [ { "fiatCurrency": "EUR", "cryptoCurrencies": [ { "cryptoCurrency": "USDC" }, { "cryptoCurrency": "BTC" } ] } ] } ``` --- ## Document: /products/connect-2.0/on-ramp-buy-apis/7.get-payment-method-list-v2 URL: /en/dev-docs/products/connect-2.0/on-ramp-buy-apis/7.get-payment-method-list-v2 # Get payment method list v2 ``` POST /papi/v2/ramp/connect/buy/payment-method-list ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | --------- | -------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | language | string | No | Language code, which determines the multi-language of the content(if any, such as "payment method name") in the response data. If not passed, English is the default. The format is "[LanguageCode](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)-[RegionCode](https://en.wikipedia.org/wiki/ISO_3166-1)", RegionCode is optional. | ### Response Body ##### Data: PaymentMethodV2Object array | **Field** | **Type** | **Remarks** | | -------------- | ------------ | ------------------------------------------------------------ | | fiatCurrency | string | Fiat currency | | paymentMethods | object array | Payment method details. Refer to PaymentMethodV2DetailObject | ##### PaymentMethodV2DetailObject | **Field** | **Type** | **Remarks** | | --------------------- | -------- | ---------------------------------------------------------- | | payMethodCode | string | payment method code | | payMethodSubCode | string | payment method sub code | | paymentMethod | string | payment method display name | | p2p | bool | Indicate whether the payment method belongs to Binance P2P | | withdrawRestriction\* | int | 0: no restriction

1: T+1 restriction | > \*_Please refer to > [What Are the "T+1", "T+2", and "T+3" Withdrawal Limits?](https://www.binance.com/en/support/faq/what-are-the-t-1-t-2-and-t-3-withdrawal-limits-360037261532)_ # ### Example Request Parameters: ```json { "language": "zh-CN" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": [ { "fiat": "AED", "paymentMethods": [ { "paymentMethodCode": "BUY_APPLE_PAY", "channelCode": "APPLE_PAY", "paymentMethod": "Apple Pay (VISA)", "p2p": false, "withdrawRestriction": 0 }, { "paymentMethodCode": "BUY_P2P", "channelCode": "BANK", "paymentMethod": "Bank", "p2p": true, "withdrawRestriction": 0 }, { "paymentMethodCode": "BUY_P2P", "channelCode": "Paypal", "paymentMethod": "PayPal", "p2p": true, "withdrawRestriction": 0 } ] }, { "fiat": "EUR", "paymentMethods": [ { "paymentMethodCode": "BUY_WALLET", "channelCode": "Wallet", "paymentMethod": "Spot Wallet", "p2p": false, "withdrawRestriction": 0 }, { "paymentMethodCode": "BUY_CARD", "channelCode": "card", "paymentMethod": "Card (VISA/Mastercard)", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_REVOLUT", "payMethodSubCode": "REVOLUT", "paymentMethod": "REVOLUT", "p2p": false, "withdrawRestriction": 0 }, { "paymentMethodCode": "BUY_P2P", "channelCode": "SEPA", "paymentMethod": "SEPA (EU) bank transfer", "p2p": true, "withdrawRestriction": 0 } ] }, { "fiat": "CNY", "paymentMethods": [ { "paymentMethodCode": "BUY_P2P", "channelCode": "ALIPAY", "paymentMethod": "Alipay English", "p2p": true, "withdrawRestriction": 1 }, { "paymentMethodCode": "BUY_P2P", "channelCode": "BANK", "paymentMethod": "Bank", "p2p": true, "withdrawRestriction": 1 }, { "paymentMethodCode": "BUY_P2P", "channelCode": "WECHAT", "paymentMethod": "WeChat", "p2p": true, "withdrawRestriction": 1 } ] }, { "fiatCurrency": "BRL", "paymentMethods": [ { "payMethodCode": "BUY_WALLET", "payMethodSubCode": "Wallet", "paymentMethod": "Spot Account", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_LATAM_GATEWAY_ONLINE_BANKING_PIX", "payMethodSubCode": "LATAM_GATEWAY", "paymentMethod": "Bank Transfer (PIX)", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_APPLE_PAY", "payMethodSubCode": "APPLE_PAY", "paymentMethod": "Apple Pay (VISA)", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_CARD", "payMethodSubCode": "card", "paymentMethod": "Card (VISA/Mastercard)", "p2p": false, "withdrawRestriction": 0 } ] } ] } ``` ##### About payment method "BUY_WALLET" "BUY_WALLET" is a special payment method that allows users to buy crypto using the user's fiat currency balance in Binance wallet. For example, in some countries or regions, users can deposit fiat currency (such as euro - EUR) to Binance. When the user has EUR balance in the Binance wallet, he can use EUR to buy crypto. We call this payment method as "BUY_WALLET". --- ## Document: /products/connect-2.0/on-ramp-buy-apis/6.query-order-details URL: /en/dev-docs/products/connect-2.0/on-ramp-buy-apis/6.query-order-details # Query order details ``` POST /papi/v1/ramp/connect/order ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | --------------- | -------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | externalOrderId | string | Yes | The unique order id from the partner side. | | language | string | No | Language code, which determines the multi-language of the content(if any, such as "payment method name") in the response data. If not passed, English is the default. The format is "[LanguageCode](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)-[RegionCode](https://en.wikipedia.org/wiki/ISO_3166-1)", RegionCode is optional. | ### Response Body | **Field** | **Type** | **Remarks** | | -------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | externalOrderId | string | The unique order id from the partner side. | | type | int | 1: buy, 2: sell, 3: send\* | | status | int | Please refer to "[Order status](../basics/7.order-status.md)" | | fiatCurrency | string | fiat currency | | cryptoCurrency | string | crypto currency | | openUserId | string | OpenUserId represents a Binance user ID that has been securely hashed. This field is provided to merchants to facilitate the identification of whether multiple orders originate from the same user. | | fiatAmount | string | fiat amount | | cryptoAmount | string | crypto amount | | paymentMethod | object | payment method | | feeAmount | string | total fee amount | | feeCurrency | string | fee currency, fiat currency or crypto | | revenueAmount | string | partner revenue amount | | revenueCurrency | string | partner revenue currency, fiat currency or crypto | | networkFee | string | network fee amount | | withdrawWalletAddress | string | withdraw wallet address | | withdrawNetwork | string | withdraw network | | withdrawMemo | string | withdraw network memo | | withdrawTxHash | string | withdraw tx hash | | orderDetailLink | string | order detail link | | orderTime | timestamp | order time | | completionTime | timestamp | completion time | | convertInfo | object | Convert information. This field is only present for Convert orders. Refer to **ConvertInfo** | | swapDetailInfoVo.fromCryptoCurrencyContractAddress | string | swap information. The from crypto currency contract address. Basically, it's stable coin and same with cryptoCurrecny field | | swapDetailInfoVo.toCryptoCurrencyContractAddress | string | swap information. The to crypto currency contract address. The target token that user want to buy | | swapDetailInfoVo.toCryptoCurrencyAmount | string | swap information. The amount of the target token the user purchased. | | userData | string | AES-encrypted JSON string (see details below). Disabled by default; contact us to enable | #### ConvertInfo | **Field** | **Type** | **Remarks** | | -------------- | -------- | --------------------------------------------------- | | fromCoin | string | The source cryptocurrency being converted from | | fromCoinAmount | string | The amount of source cryptocurrency being converted | #### userData field - Type: string - Remarks: When enabled, `userData` contains a JSON object (serialized to a string) that is encrypted with AES. The field value is the AES-encrypted ciphertext encoded as a string. This field is disabled by default — please contact us if you need it enabled and for access to the AES key and configuration. - Decryption reference: follow the AES decryption instructions described in [Binance documentation](/products/binance-pay-merchant/authentication#decryption-instructions-for-merchant-data-sharing) - JSON structure (plaintext before AES encryption): | Field | Type | Remarks | | ---------------- | ------ | ------------------------------- | | firstName | string | User's first name | | middleName | string | User's middle name (optional) | | lastName | string | User's last name | | residenceCountry | string | Country code of residence (ISO) | | birthday | string | Birthday in YYYY-MM-DD format | | country | string | Country code (ISO) | | refundAddress | string | Refund crypto address (if any) | | refundNetwork | string | Network of refund (e.g., ETH) | | refundMemo | string | Refund memo/memo field (if any) | Notes: - Field names and types above show the expected JSON keys that will be present after decrypting `userData`. - The concrete AES parameters (mode, IV, padding) and key delivery method will be provided when the field is enabled; see the decryption reference link above for an example. # ### Example 1 Request Parameters: ```json { "externalOrderId": "180401941923045", "language": "zh-CN" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "externalOrderId": "180401941923045", "type": 1, "status": 11, "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "openUserId": "f47ac10b58cc4372a5670e02b2c3d479", "fiatAmount": "100", "cryptoAmount": "889.35", "paymentMethod": { "payMethodCode": "BUY_CARD", "payMethodSubCode": "card", "paymentMethod": "Card (VISA/Mastercard)", "p2p": false, "withdrawRestriction": 0 }, "feeAmount": "1", "feeCurrency": "EUR", "revenueAmount": "0.3", "revenueCurrency": "EUR", "networkFee": "0.5", "withdrawWalletAddress": "0xbb4CdB98Bd36B01bD1cBaEA52De08d9173bc095c", "withdrawNetwork": "ETH", "withdrawMemo": "", "withdrawTxHash": "0xcb163e2e6322cd6aa7bc4d45306029e846c0c06e9cdee45a06e88801d1231e71", "orderDetailLink": "https://www.binance.com/en/my/wallet/exchange/buysell-history?type=buy", "orderTime": "1723186761000", "completionTime": "1723189981000" } } ``` ### Example 2 Request Parameters: ```json { "externalOrderId": "13402681029896", "language": "en" } ``` Response: ```json { "code": "000000", "message": "success", "data": { "externalOrderId": "13402681029896", "type": 1, "status": 20, "fiatCurrency": "EUR", "cryptoCurrency": "USDC", "openUserId": "f47ac10b58cc4372a5670e02b2c3d479", "fiatAmount": "15", "cryptoAmount": "16.78903899", "paymentMethod": { "payMethodCode": "BUY_WALLET", "payMethodSubCode": "Wallet", "paymentMethod": "Spot Account", "p2p": false, "withdrawRestriction": 0 }, "feeAmount": "1.001", "feeCurrency": "EUR", "networkFee": null, "withdrawWalletAddress": "3WZVn9cY4x8BBdpPsLEDG7LpthoDov4bUT11FvPCqvAA", "withdrawNetwork": "SOL", "withdrawMemo": "", "withdrawTxHash": null, "orderDetailLink": "https://www.binance.com/en/my/wallet/exchange/buysell-history?type=buy", "orderTime": 1746788679000, "completionTime": 1746788688982, "swapDetailInfoVo": { "fromCryptoCurrencyContractAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "toCryptoCurrencyContractAddress": "38PgzpJYu2HkiYvV8qePFakB8tuobPdGm2FFEn7Dpump", "toCryptoCurrencyAmount": 605.496926 } }, "success": true } ``` ### Example 3 (Convert Order) Request Parameters: ```json { "externalOrderId": "830315252102", "language": "en" } ``` Response: ```json { "code": "000000", "message": "success", "data": { "externalOrderId": "830315252102", "type": 1, "status": 11, "openUserId": "09e03149752da10be5471c0c74f2811a", "fiatCurrency": "", "cryptoCurrency": "USDT", "fiatAmount": "0", "cryptoAmount": "1.03", "paymentMethod": { "payMethodCode": "SPOT", "payMethodSubCode": "CUMBERLAND", "paymentMethod": null, "p2p": false, "withdrawRestriction": null }, "feeAmount": "0", "feeCurrency": "USDT", "networkFee": "0.03000000", "withdrawWalletAddress": "0xbb4CdB98Bd36B01bD1cBaEA52De08d9173bc095c", "withdrawNetwork": "ETH", "withdrawMemo": "", "withdrawTxHash": "", "orderDetailLink": null, "orderTime": 1753344231742, "completionTime": null, "swapDetailInfoVo": null, "convertInfo": { "fromCoin": "BNB", "fromCoinAmount": 0.00137386 } }, "success": true } ``` --- ## Document: /products/connect-2.0/on-ramp-buy-apis/5.pre-order URL: /en/dev-docs/products/connect-2.0/on-ramp-buy-apis/5.pre-order # Pre order ``` POST /papi/v1/ramp/connect/buy/pre-order ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | -------------------- | -------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | externalOrderId | string | Yes | The unique order id from the partner side. Supports only letters and numbers. | | fiatCurrency | string | No | Fiat currency. If you don't want to specify it or cannot specify it, you can leave it null and Binance Connect will automatically select/recommend a default fiat currency. | | cryptoCurrency | string | No | Crypto currency. If you don't want to specify it or cannot specify it, you can leave it null and Binance Connect will automatically select/recommend a default crypto currency. (But for `SEND_PRIMARY` it's mandatory) | | amountType | int | Yes | Specify whether the requested amount is in fiat:1 or crypto:2 | | requestedAmount | string | No | Requested amount. Fraction is 8 | | payMethodCode | string | No | The payment method code is from payment method list API. If you don't want to specify it or cannot specify it, you can leave it null and Binance Connect will automatically select/recommend a default payment method. | | payMethodSubCode | string | No | The payment method subcode is from payment method list API. If you don't want to specify it or cannot specify it, you can leave it null and Binance Connect will automatically select/recommend a default payment method. | | network | string | Yes | crypto network | | address | string | Yes | wallet address | | memo | string | No | If blockchain required | | redirectUrl | string | No | The redirectUrl is for redirecting to your website if order is completed | | failRedirectUrl | string | No | The redirectUrl is for redirecting to your website if order is failed | | redirectDeepLink | string | No | The redirectDeepLink is for redirecting to your APP if order is completed | | failRedirectDeepLink | string | No | The failRedirectDeepLink is for redirecting to your APP if order is failed | | clientIp | string | No | The original client IP | | clientType | string | No | The original client type: web/mobile | | customization | object | No | Customization settings for the current order. Please refer to "[Customization](../basics/9.customization.md)". | | contractAddress | string | No | Crypto contract address. required if buying a token that is not listed on Binance spot | | gtrTemplateCode | string | No | GTR (Global travel rule) template code. When users need to submit GTR questionnaire, this field can be used to specify the corresponding template answers for pre-filling the questionnaire form. | | affiliateCode | string | No | The Binance referral code that you can use to earn revenue share from registered users. Note: this feature is disabled by default. Please contact us for more detail. | ### Response Body | **Field** | **Type** | **Remarks** | | -------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | link | string | The landing page link of Binance Connect. For information on how to use it, please refer to "[Landing page and redirection](../basics/8.landing-page-and-redirection.md)". | | linkExpireTime | timestamp | The expiration time of link | # ### Example 1 Request Parameters: ```json { "externalOrderId": "946972922319", "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "amountType": 1, "requestedAmount": "100", "payMethodCode": "BUY_P2P", "payMethodSubCode": "BANK", "network": "ETH", "address": "0xbb4CdB9CBd3AB01bD10BaEBF2De08d9173bc095c", "redirectUrl": "https://test.examplepartner.com/buy/home", "failRedirectUrl": "https://test.examplepartner.com/buy/order/failure", "redirectDeepLink": "examplepartner://buy/home", "failRedirectDeepLink": "examplepartner://buy/order/failure", "clientIp": "154.55.51.218", "customization": { "SKIP_CASHIER": false, "AUTO_REDIRECTION": true } } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "link": "https://app.binance.com/uni-qr/qccnt?amount=800&channel=card&cryptoCurrency=USDT&externalOrderId=676972925203314539&fiatCurrency=EUR&merchantCode=example-partner&paymentMethodCode=BUY_CARD&sign=a6fdb970954b3407e63c2518307bd42b8b1de3fb128914a9f5b926077efcec5f&utm_campaign=connect_open_api&utm_source=test", "linkExpireTime": 1742222863560 } } ``` ### Example 2 Request Parameters: ```json { "externalOrderId": "599518801876", "contractAddress": "0x09f4eBB8567ea0e969f10799CA678F9A172DC2Bb", "fiatCurrency": "EUR", "fiatAmount": "150", "address": "0x41B2E5C72cZB21fB69de8243244AF6F124b2673a", "network": "BSC", "gtrTemplateCode": "TRAVEL_001", "affiliateCode": "test" } ``` Response: ```json { "code": "000000", "message": "success", "data": { "link": "https://app.binance.com/uni-qr/ccnt?amount=150&baseCurrency=EUR&channel&cryptoCurrency=USDT&externalOrderId=599518801876&fiatCurrency=EUR&merchantCode=example-partner&paymentMethodCode®isterChannel=example-partner&sign=dd0a9e3e646d2ce3910d64811a9db46535d756a20650d56e190793a94d03727b&type=1&utm_campaign=connect_open_api&utm_source=test", "linkExpireTime": 1747128070729 }, "success": true } ``` ### Example - lock crypto amount & NET_RECEIVE Request Parameters: ```json { "externalOrderId": "946972922319", "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "amountType": 2, "requestedAmount": "200", "payMethodCode": "BUY_CARD", "payMethodSubCode": "card", "network": "BSC", "address": "0xbb4CdB9CBd3AB01bD10BaEBF2De08d9173bc095c", "redirectUrl": "https://test.examplepartner.com/buy/home", "failRedirectUrl": "https://test.examplepartner.com/buy/order/failure", "redirectDeepLink": "examplepartner://buy/home", "failRedirectDeepLink": "examplepartner://buy/order/failure", "clientIp": "154.55.51.218", "customization": { "LOCK_ORDER_ATTRIBUTES": [6], "SEND_PRIMARY": true, "NET_RECEIVE": true } } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "link": "https://app.binance.com/uni-qr/qccnt?amount=800&channel=card&cryptoCurrency=USDT&externalOrderId=676972925203314539&fiatCurrency=EUR&merchantCode=example-partner&paymentMethodCode=BUY_CARD&sign=a6fdb970954b3407e63c2518307bd42b8b1de3fb128914a9f5b926077efcec5f&utm_campaign=connect_open_api&utm_source=test", "linkExpireTime": 1742222863560 } } ``` --- ## Document: /products/connect-2.0/on-ramp-buy-apis/4.get-estimated-quote URL: /en/dev-docs/products/connect-2.0/on-ramp-buy-apis/4.get-estimated-quote # Get estimated quote ``` POST /papi/v1/ramp/connect/buy/estimated-quote ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | ---------------- | -------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | fiatCurrency | string | Yes | fiat currency | | cryptoCurrency | string | No | crypto currency. Either `cryptoCurrency` or `contractAddress` must be provided. | | requestedAmount | string | Yes | Requested amount. Fraction is 8 | | amountType | int | Yes | Specify whether the total amount is in fiat:1 or crypto:2 | | payMethodCode | string | No | The payment method code is from payment method list API. If no value is provided for payMethodCode, the API will return the best price along with its corresponding payMethodCode, refer to example 5&6. | | payMethodSubCode | string | No | The payment method sub code is from payment method list API. If no value is provided for both payMethodCode and payMethodSubCode, the API will return the best price along with its corresponding payMethodCode and payMethodSubCode, refer to example 5&6. If only a value of payMethodCode is provided, but no value of payMethodSubCode is provided, the best price and its corresponding payMethodSubCode returned will be the best quote and payment method within the category of the specified payMethodCode. | | network | string | No | crypto network. required if contractAddress has value | | address | string | No | the user wallet address, required if contractAddress has value | | contractAddress | string | No | crypto contract address. required if buying a token that is not listed on Binance spot | ### Response Body | **Field** | **Type** | **Remarks** | | ---------------- | -------- | ------------------------------------------------------------------------------- | | totalAmount | string | total amount in crypto (when amountType is 1) or in fiat (when amountType is 2) | | quotePrice | string | quote price | | feeAmount | string | fee amount | | feeCurrency | string | fee currency, fiat currency or crypto | | networkFee | string | network fee amount | | payMethodCode | string | The payment method code supported by this quote | | payMethodSubCode | string | The payment method sub code supported by this quote | # ### Example 1 Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "requestedAmount": "100", "amountType": 1, "payMethodCode": "BUY_CARD", "payMethodSubCode": "card", "network": "ETH" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "totalAmount": "93.64179386", "quotePrice": "1.04654125", "feeAmount": "2", "feeCurrency": "EUR", "networkFee": "0.03", "payMethodCode": "BUY_CARD", "payMethodSubCode": "card" } } ``` User selects to buy crypto with Card (VISA/Mastercard), and prefers "specify fiat currency amount" (amountType: 1) to buy USDT with 100 EUR (requestedAmount). The estimated quote (quotePrice) is 1.04654125 EUR/USDT. After deducting the estimated total fees (feeAmount) of 2 EUR, the estimated final amount of USDT received (totalAmount) is 93.64179386 USDT. Here, totalAmount is calculated as "(requestedAmount - feeAmount) / quotePrice", that is, (100 - 2) / 1.04654125 = 93.64179386. In addition, the blockchain network fee (networkFee) is 0.03 USDT, which will be deducted from the withdrawal amount when processing withdrawal. ### Example 2 Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "requestedAmount": 100, "amountType": 2, "payMethodCode": "BUY_CARD", "payMethodSubCode": "card", "network": "ETH" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "totalAmount": "106.79", "quotePrice": "1.04654125", "feeAmount": "2.14", "feeCurrency": "EUR", "networkFee": "0.03", "payMethodCode": "BUY_CARD", "payMethodSubCode": "card" } } ``` User selects to buy crypto with Card (VISA/Mastercard), and prefers "specify crypto amount" (amountType: 2) to buy 100 USDT (requestedAmount) with EUR. The estimated quote (quotePrice) is 1.04654125 EUR/USDT. After adding the estimated total fees (feeAmount) of 2.14 EUR, the estimated final amount of fiat currency to be paid (totalAmount) is 106.79 EUR. Here, totalAmount is calculated as "requestedAmount _ quotePrice + feeAmount", that is, 100 _ 1.04654125 + 2.14 = 106.79. In addition, the blockchain network fee (networkFee) is 0.03 USDT, which will be deducted from the withdrawal amount when processing withdrawal. ### Example 3 Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "requestedAmount": 100, "amountType": 1, "payMethodCode": "BUY_P2P", "payMethodSubCode": "BANK", "network": "ETH" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "totalAmount": "107.6923", "quotePrice": "0.91", "feeAmount": "2.1978", "feeCurrency": "USDT", "networkFee": "0.03", "payMethodCode": "BUY_P2P", "payMethodSubCode": "BANK" } } ``` User selects to buy crypto with P2P bank transfer, and prefers "specify fiat currency amount" (amountType: 1) to buy USDT with 100 EUR (requestedAmount). The estimated quote (quotePrice) is 0.91 EUR/USDT. After deducting the estimated total fees (feeAmount) of 2.1978 USDT, the estimated final amount of USDT received (totalAmount) is 107.6923 USDT. Here, totalAmount is calculated as "requestedAmount / quotePrice - feeAmount", that is, 100 / 0.91 - 2.1978 = 107.6923. In addition, the blockchain network fee (networkFee) is 0.03 USDT, which will be deducted from the withdrawal amount when processing withdrawal. ### Example 4 Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "requestedAmount": 100, "amountType": 2, "payMethodCode": "BUY_P2P", "payMethodSubCode": "BANK", "network": "ETH" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "totalAmount": "92.857", "quotePrice": "0.91", "feeAmount": "2.04081", "feeCurrency": "USDT", "networkFee": "0.03", "payMethodCode": "BUY_P2P", "payMethodSubCode": "BANK" } } ``` User selects to buy crypto with P2P bank transfer, and prefers "specify crypto amount" (amountType: 2) to buy 100 USDT (requestedAmount) with EUR. The estimated quote (quotePrice) is 0.91 EUR/USDT. After adding the estimated total fees (feeAmount) of 2.04081 USDT, the estimated final amount of fiat currency to be paid (totalAmount) is 92.857 EUR. Here, totalAmount is calculated as "(requestedAmount + feeAmount) _ quotePrice", that is, (100 + 2.04081) _ 0.91 = 92.857. In addition, the blockchain network fee (networkFee) is 0.03 USDT, which will be deducted from the withdrawal amount when processing withdrawal. ### Example 5 Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "requestedAmount": 100, "amountType": 1, "network": "ETH" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "totalAmount": "93.64179386", "quotePrice": "1.04654125", "feeAmount": "2", "feeCurrency": "EUR", "networkFee": "0.03", "payMethodCode": "BUY_CARD", "payMethodSubCode": "card" } } ``` User selects to buy crypto and prefers "specify fiat currency amount" (amountType: 1) to buy USDT with 100 EUR (requestedAmount), but does not specify any payment method. The estimated quote (quotePrice) is 1.04654125 EUR/USDT, and the corresponding payment method is Card (VISA/Mastercard). After deducting the estimated total fees (feeAmount) of 2 EUR, the estimated final amount of USDT received (totalAmount) is 93.64179386 USDT. Here, totalAmount is calculated as "(requestedAmount - feeAmount) / quotePrice", that is, (100 - 2) / 1.04654125 = 93.64179386. In addition, the blockchain network fee (networkFee) is 0.03 USDT, which will be deducted from the withdrawal amount when processing withdrawal. ### Example 6 Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "requestedAmount": 100, "amountType": 2, "network": "ETH" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "totalAmount": "92.857", "quotePrice": "0.91", "feeAmount": "2.04081", "feeCurrency": "USDT", "networkFee": "0.03", "payMethodCode": "BUY_P2P", "payMethodSubCode": "BANK" } } ``` User selects to buy crypto and prefers "specify crypto amount" (amountType: 2) to buy 100 USDT (requestedAmount) with EUR, but does not specify any payment method. The estimated quote (quotePrice) is 0.91 EUR/USDT, and the corresponding payment method is P2P bank transfer. After adding the estimated total fees (feeAmount) of 2.04081 USDT, the estimated final amount of fiat currency to be paid (totalAmount) is 92.857 EUR. Here, totalAmount is calculated as "(requestedAmount + feeAmount) _ quotePrice", that is, (100 + 2.04081) _ 0.91 = 92.857. In addition, the blockchain network fee (networkFee) is 0.03 USDT, which will be deducted from the withdrawal amount when processing withdrawal. ### Example 7 Request Parameters: ```json { "fiatCurrency": "EUR", "requestedAmount": 150, "amountType": 1, "network": "BSC", "contractAddress": "0x09f4eBB8567ea0e969f10799CA678F9A172DC2Bb", "address": "0x123457890abcdef1234567890a12e4ef12345678" } ``` Response: ```json { "code": "000000", "message": "success", "data": { "totalAmount": "1498537.975596644425339737", "quotePrice": "10091.27354635904781021", "feeAmount": "1.67", "feeCurrency": "USDT", "networkFee": "0.02982442", "payMethodCode": "BUY_CARD", "payMethodSubCode": "card" }, "success": true } ``` User opts to purchase meme crypto without specifying a payment method and chooses "specify fiat currency amount" (amountType: 1) to buy meme crypto worth 150 EUR (requestedAmount). --- ## Document: /products/connect-2.0/on-ramp-buy-apis/3.get-payment-method-list URL: /en/dev-docs/products/connect-2.0/on-ramp-buy-apis/3.get-payment-method-list # Get payment method list ``` POST /papi/v1/ramp/connect/buy/payment-method-list ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | --------------- | -------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | fiatCurrency | string | Yes | fiat currency | | cryptoCurrency | string | No | crypto currency. Either `cryptoCurrency` or `contractAddress` must be provided. | | totalAmount | string | Yes | Requested amount | | amountType | int | Yes | Specify whether the total amount is in fiat:1 or crypto:2 | | language | string | No | Language code, which determines the multi-language of the content(if any, such as "payment method name") in the response data. If not passed, English is the default. The format is "[LanguageCode](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)-[RegionCode](https://en.wikipedia.org/wiki/ISO_3166-1)", RegionCode is optional. | | network | string | No | crypto network. Different networks will have different `cryptoMinLimit` fields. required if contractAddress has value | | contractAddress | string | No | crypto contract address. required if buying a token that is not listed on Binance spot | ### Response Body ##### Data | **Field** | **Type** | **Remarks** | | -------------- | ------------ | --------------------------------------------- | | paymentMethods | object array | Payment methods. Refer to PaymentMethodObject | ##### PaymentMethodObject | **Field** | **Type** | **Remarks** | | --------------------- | -------- | ---------------------------------------------------------- | | payMethodCode | string | payment method code | | payMethodSubCode | string | payment method sub code | | paymentMethod | string | payment method display name | | fiatMinLimit | string | fiat min amount limit | | fiatMaxLimit | string | fiat max amount limit | | cryptoMinLimit | string | crypto min amount limit | | cryptoMaxLimit | string | crypto max amount limit | | p2p | bool | Indicate whether the payment method belongs to Binance P2P | | withdrawRestriction\* | int | 0: no restriction

1: T+1 restriction | > \*_Please refer to > [What Are the "T+1", "T+2", and "T+3" Withdrawal Limits?](https://www.binance.com/en/support/faq/what-are-the-t-1-t-2-and-t-3-withdrawal-limits-360037261532)_ # ### Example 1 Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDC", "totalAmount": "100", "amountType": 1, "language": "en-US", "network": "BSC" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "paymentMethods": [ { "payMethodCode": "BUY_WALLET", "payMethodSubCode": "Wallet", "paymentMethod": "Spot Account", "fiatMinLimit": "12.73251855", "fiatMaxLimit": "12500", "cryptoMinLimit": "10", "cryptoMaxLimit": "14669.77658106", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_REVOLUT", "payMethodSubCode": "REVOLUT", "paymentMethod": "Revolut Pay", "fiatMinLimit": "12.73251855", "fiatMaxLimit": "5000", "cryptoMinLimit": "11.61208147", "cryptoMaxLimit": "5806.04073251", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_CARD", "payMethodSubCode": "card", "paymentMethod": "Card (VISA/Mastercard)", "fiatMinLimit": "12.73251855", "fiatMaxLimit": "5000", "cryptoMinLimit": "11.6112052", "cryptoMaxLimit": "5805.60260158", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_GOOGLE_PAY", "payMethodSubCode": "GOOGLE_PAY", "paymentMethod": "Google Pay (VISA/Mastercard)", "fiatMinLimit": "12.73251855", "fiatMaxLimit": "5000", "cryptoMinLimit": "11.6112052", "cryptoMaxLimit": "5805.60260158", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_APPLE_PAY", "payMethodSubCode": "APPLE_PAY", "paymentMethod": "Apple Pay (VISA/Mastercard)", "fiatMinLimit": "12.73251855", "fiatMaxLimit": "5000", "cryptoMinLimit": "11.6112052", "cryptoMaxLimit": "5805.60260158", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_P2P", "payMethodSubCode": "BANK", "paymentMethod": "Bank Transfer", "fiatMinLimit": "12.73251855", "fiatMaxLimit": "69116", "cryptoMinLimit": "10.7066", "cryptoMaxLimit": "74079.77696577", "p2p": true, "withdrawRestriction": 1 }, { "payMethodCode": "BUY_P2P", "payMethodSubCode": "Cash", "paymentMethod": "Cash Payment", "fiatMinLimit": "10", "fiatMaxLimit": "1009", "cryptoMinLimit": "0.8543", "cryptoMaxLimit": "940.87", "p2p": true, "withdrawRestriction": 1 }, { "payMethodCode": "BUY_P2P", "payMethodSubCode": "ALIPAY", "paymentMethod": "Alipay", "fiatMinLimit": "10", "fiatMaxLimit": "1009", "cryptoMinLimit": "0.8543", "cryptoMaxLimit": "940.87", "p2p": true, "withdrawRestriction": 1 }, { "payMethodCode": "BUY_P2P", "payMethodSubCode": "Paypal", "paymentMethod": "PayPal", "fiatMinLimit": "10", "fiatMaxLimit": "1009", "cryptoMinLimit": "0.8543", "cryptoMaxLimit": "940.87", "p2p": true, "withdrawRestriction": 1 } ] } } ``` ### Example 2 Request Parameters: ```json { "fiatCurrency": "EUR", "totalAmount": 100, "amountType": 1, "contractAddress": "0x09f4eBB8567ea0e969f10799CA678F9A172DC2Bb", "network": "BSC" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "paymentMethods": [ { "payMethodCode": "BUY_WALLET", "payMethodSubCode": "Wallet", "paymentMethod": "Spot Wallet", "fiatMinLimit": "15", "fiatMaxLimit": "10000", "cryptoMinLimit": "16.10699996", "cryptoMaxLimit": "10737.99997363", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_CARD", "payMethodSubCode": "card", "paymentMethod": "Card (VISA/Mastercard)", "fiatMinLimit": "15", "fiatMaxLimit": "5000", "cryptoMinLimit": "16.10699996", "cryptoMaxLimit": "5368.99998681", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_GOOGLE_PAY", "payMethodSubCode": "GOOGLE_PAY", "paymentMethod": "Google Pay", "fiatMinLimit": "15", "fiatMaxLimit": "5000", "cryptoMinLimit": "16.10699996", "cryptoMaxLimit": "5368.99998681", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_APPLE_PAY", "payMethodSubCode": "APPLE_PAY", "paymentMethod": "Apple Pay", "fiatMinLimit": "15", "fiatMaxLimit": "5000", "cryptoMinLimit": "16.10699996", "cryptoMaxLimit": "5368.99998681", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_P2P", "payMethodSubCode": "BANK", "paymentMethod": "Bank Transfer", "fiatMinLimit": "10", "fiatMaxLimit": "1009", "cryptoMinLimit": "0.8543", "cryptoMaxLimit": "940.87", "p2p": true, "withdrawRestriction": 1 }, { "payMethodCode": "BUY_P2P", "payMethodSubCode": "Cash", "paymentMethod": "Cash Payment", "fiatMinLimit": "10", "fiatMaxLimit": "1009", "cryptoMinLimit": "0.8543", "cryptoMaxLimit": "940.87", "p2p": true, "withdrawRestriction": 1 }, { "payMethodCode": "BUY_P2P", "payMethodSubCode": "ALIPAY", "paymentMethod": "Alipay", "fiatMinLimit": "10", "fiatMaxLimit": "1009", "cryptoMinLimit": "0.8543", "cryptoMaxLimit": "940.87", "p2p": true, "withdrawRestriction": 1 }, { "payMethodCode": "BUY_P2P", "payMethodSubCode": "Paypal", "paymentMethod": "PayPal", "fiatMinLimit": "10", "fiatMaxLimit": "1009", "cryptoMinLimit": "0.8543", "cryptoMaxLimit": "940.87", "p2p": true, "withdrawRestriction": 1 } ] } } ``` ### Example 3 Request Parameters: ```json { "fiatCurrency": "BRL", "cryptoCurrency": "USDC", "totalAmount": 100, "amountType": 1, "network": "BSC" } ``` Response: ```json { "code": "000000", "message": "success", "data": { "paymentMethods": [ { "payMethodCode": "BUY_WALLET", "payMethodSubCode": "Wallet", "paymentMethod": "Spot Account", "fiatMinLimit": "81.1467441", "fiatMaxLimit": "86000", "cryptoMinLimit": "10", "cryptoMaxLimit": "15707.36039127", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_LATAM_GATEWAY_ONLINE_BANKING_PIX", "payMethodSubCode": "LATAM_GATEWAY", "paymentMethod": "Bank Transfer (PIX)", "fiatMinLimit": "81.1467441", "fiatMaxLimit": "63000", "cryptoMinLimit": "10", "cryptoMaxLimit": "11437.74266192", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_CARD", "payMethodSubCode": "card", "paymentMethod": "Card (VISA/Mastercard)", "fiatMinLimit": "100", "fiatMaxLimit": "60000", "cryptoMinLimit": "17.52411339", "cryptoMaxLimit": "10514.46803156", "p2p": false, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_P2P", "payMethodSubCode": "Pix", "paymentMethod": "Pix", "fiatMinLimit": "81.1467441", "fiatMaxLimit": "16674", "cryptoMinLimit": "10", "cryptoMaxLimit": "2880.84020217", "p2p": true, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_P2P", "payMethodSubCode": "BankBrazil", "paymentMethod": "Bank Transfer (Brazil)", "fiatMinLimit": "81.1467441", "fiatMaxLimit": "16674", "cryptoMinLimit": "10", "cryptoMaxLimit": "2880.84020217", "p2p": true, "withdrawRestriction": 0 }, { "payMethodCode": "BUY_P2P", "payMethodSubCode": "PicPay", "paymentMethod": "PicPay", "fiatMinLimit": "81.1467441", "fiatMaxLimit": "16674", "cryptoMinLimit": "10", "cryptoMaxLimit": "2880.84020217", "p2p": true, "withdrawRestriction": 0 } ] }, "success": true } ``` ##### About payment method "BUY_WALLET" "BUY_WALLET" is a special payment method that allows users to buy crypto using the user's fiat currency balance in Binance wallet. For example, in some countries or regions, users can deposit fiat currency (such as euro - EUR) to Binance. When the user has EUR balance in the Binance wallet, he can use EUR to buy crypto. We call this payment method as "BUY_WALLET". --- ## Document: /products/connect-2.0/on-ramp-buy-apis/2.get-crypto-networks URL: /en/dev-docs/products/connect-2.0/on-ramp-buy-apis/2.get-crypto-networks # Get supported crypto networks ``` POST /papi/v1/ramp/connect/crypto-network ``` ### Request Body No request body ### Response Body ##### Data: CryptoNetworkObject array ###### CryptoNetworkObject | **Field** | **Type** | **Remarks** | | -------------- | ------------ | -------------------------------------------- | | cryptoCurrency | string | fiat currency list | | networks | object array | Network detail. Refer to NetworkDetailObject | ###### NetworkDetailObject | **Field** | **Type** | **Remarks** | | ----------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | network | string | Network name. E.g ETH, BSC, ARBITRUM, SOL, OPTIMISM, BASE | | addressRegex | string array | Network address regex | | memoRegex | string | Memo regex | | withdrawFee | string | Withdraw fee | | withdrawMinAmount | string | Withdraw min amount | | withdrawMaxAmount | string | Withdraw max amount | | contractAddress | string | Contract address | | withdrawEnable | boolean | is withdraw enabled | | depositEnable | boolean | is deposit enabled | | depositDust | string | Minimum deposit amount for this network. Deposits below this amount may not be credited. Used by the [Deposit](../deposit/0.typical-flow.md) feature | # ### Example Response: ```json { "success": true, "code": "000000", "message": "success", "data": [ { "cryptoCurrency": "ETH", "networks": [ { "network": "BSC", "addressRegex": "^(0x)[0-9A-Fa-f]{40}$", "memoRegex": "", "withdrawFee": 115.0, "withdrawMinAmount": 230.0, "withdrawMaxAmount": 555.0, "contractAddress": "0x2170ed0880ac9a755fd29b2688956bd959f933f8", "withdrawEnable": false, "depositEnable": false, "depositDust": "0.00001" }, { "network": "ETH", "addressRegex": "^(0x)[0-9A-Fa-f]{40}$", "memoRegex": "", "withdrawFee": 0.0, "withdrawMinAmount": 1e-8, "withdrawMaxAmount": 9999999.0, "contractAddress": "0x7190ed0880ac9a755fd29b26f8956bd959f933f2", "withdrawEnable": true, "depositEnable": true, "depositDust": "0.00001" } ] }, { "cryptoCurrency": "ORDI", "networks": [ { "network": "ORDIBTC", "addressRegex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^[(bc1q)|(bc1p)][0-9A-Za-z]{37,62}$", "memoRegex": "", "withdrawFee": 0.0, "withdrawMinAmount": 0.01, "withdrawMaxAmount": 9999999.0, "contractAddress": "b61b0172d95e266c18aea0c624db987e971a5d6d4ebc2aaed85da4642d635735i0", "withdrawEnable": true, "depositEnable": true, "depositDust": "0.01" } ] } ] } ``` --- ## Document: /products/connect-2.0/on-ramp-buy-apis/1.get-trading-pairs URL: /en/dev-docs/products/connect-2.0/on-ramp-buy-apis/1.get-trading-pairs # Get supported trading pairs ``` POST /papi/v1/ramp/connect/buy/trading-pairs ``` ### Request Body No request body ### Response Body | **Field** | **Type** | **Remarks** | | ---------------- | ------------ | -------------------- | | fiatCurrencies | string array | fiat currency list | | cryptoCurrencies | string array | crypto currency list | # ### Example Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "fiatCurrencies": ["USD", "EUR", "VND", "AUD", "TWD", "DEFAULT"], "cryptoCurrencies": ["BTC", "ETH", "BNB", "USDT", "USDC", "DAI"] } } ``` --- ## Document: /products/connect-2.0/on-ramp-buy-apis/0.typical-flow URL: /en/dev-docs/products/connect-2.0/on-ramp-buy-apis/0.typical-flow # Typical Buy Flow ## Overview This document describes the standard cryptocurrency purchase flow using Binance Connect's on-ramp service. The sequence diagram below illustrates the interaction between partner systems and Binance Connect APIs throughout the purchase process. ## Flow Steps ### 1. Initialize - Partner frontend renders the buy interface for users - Backend provides necessary configuration and settings (when applicable) ### 2. Query Options - Fetch supported blockchain networks for crypto delivery - Retrieve available trading pairs - Get supported payment methods - Return data to the frontend - You can be done in parallel. Depending on your UI/UX design, you may choose to call these APIs in different sequences. ### 3. Get Quote - Request real-time price quote for the selected trading pair, payment method and amount - Display quote information to the user ### 4. Create PreOrder - Submit pre-order request to Binance Connect with user's selection - Receive a redirect URL for payment processing ### 5. Payment - Redirect user to Binance - User completes the purchase using their preferred payment method - Binance processes the transaction ### 6. Confirmation - Receive webhook notifications for order status updates - Query order details to confirm final transaction status - Update user interface with purchase results and crypto delivery details ![buy-flow.png](../images/buy-flow.png) --- ## Document: /products/connect-2.0/off-ramp-sell-apis/5.get-payment-method-list-v2 URL: /en/dev-docs/products/connect-2.0/off-ramp-sell-apis/5.get-payment-method-list-v2 # Get payment method list v2 ``` POST /papi/v2/ramp/connect/sell/payment-method-list ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | --------- | -------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | language | string | No | Language code, which determines the multi-language of the content(if any, such as "payment method name") in the response data. If not passed, English is the default. The format is "[LanguageCode](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)-[RegionCode](https://en.wikipedia.org/wiki/ISO_3166-1)", RegionCode is optional. | ### Response Body ##### Data: PaymentMethodV2Object array | **Field** | **Type** | **Remarks** | | -------------- | ------------ | ------------------------------------------------------------ | | fiatCurrency | string | Fiat currency | | paymentMethods | object array | Payment method details. Refer to PaymentMethodV2DetailObject | ##### PaymentMethodV2DetailObject | **Field** | **Type** | **Remarks** | | ---------------- | -------- | ---------------------------------------------------------- | | payMethodCode | string | payment method code | | payMethodSubCode | string | payment method sub code | | paymentMethod | string | payment method display name | | p2p | bool | Indicate whether the payment method belongs to Binance P2P | # ### Example Request Parameters: ```json { "language": "zh-CN" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": [ { "fiat": "AED", "paymentMethods": [ { "paymentMethodCode": "SELL_APPLE_PAY", "channelCode": "APPLE_PAY", "paymentMethod": "Apple Pay (VISA)", "p2p": false }, { "paymentMethodCode": "SELL_P2P", "channelCode": "BANK", "paymentMethod": "Bank", "p2p": true }, { "paymentMethodCode": "SELL_P2P", "channelCode": "Paypal", "paymentMethod": "PayPal", "p2p": true } ] }, { "fiat": "EUR", "paymentMethods": [ { "paymentMethodCode": "SELL_WALLET", "channelCode": "Wallet", "paymentMethod": "Spot Wallet", "p2p": false }, { "paymentMethodCode": "SELL_CARD", "channelCode": "card", "paymentMethod": "Card (VISA/Mastercard)", "p2p": false }, { "paymentMethodCode": "SELL_P2P", "channelCode": "SEPA", "paymentMethod": "SEPA (EU) bank transfer", "p2p": true } ] }, { "fiat": "CNY", "paymentMethods": [ { "paymentMethodCode": "SELL_P2P", "channelCode": "ALIPAY", "paymentMethod": "Alipay English", "p2p": true }, { "paymentMethodCode": "SELL_P2P", "channelCode": "BANK", "paymentMethod": "Bank", "p2p": true }, { "paymentMethodCode": "SELL_P2P", "channelCode": "WECHAT", "paymentMethod": "WeChat", "p2p": true } ] } ] } ``` ##### About payment method "SELL_WALLET" "SELL_WALLET" is a special payment method that allows users to sell crypto for fiat currency balances in their Binance wallets. For example, in some countries or regions, Binance supports users to deposit and withdraw fiat currencies (such as euro - EUR) directly. At this time, users can sell crypto for EUR (in Binance wallet). We call this payment method as "SELL_WALLET". --- ## Document: /products/connect-2.0/off-ramp-sell-apis/4.pre-order URL: /en/dev-docs/products/connect-2.0/off-ramp-sell-apis/4.pre-order # Pre order ``` POST /papi/v1/ramp/connect/sell/pre-order ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | -------------------- | -------- | ------------- | -------------------------------------------------------------------------------------------------------------- | | externalOrderId | string | Yes | The unique order id from the partner side. Supports only letters and numbers. | | fiatCurrency | string | Yes | fiat currency | | cryptoCurrency | string | Yes | crypto currency | | amountType | int | Yes | Specify whether the requested amount is in fiat:1 or crypto:2 | | requestedAmount | string | Yes | Requested amount. Fraction is 8 | | payMethodCode | string | Yes | The payment method code is from payment method list API | | payMethodSubCode | string | Yes | The payment method subcode is from payment method list API | | network | string | Yes | crypto network | | redirectUrl | string | No | The redirectUrl is for redirecting to your website if order is completed | | failRedirectUrl | string | No | The redirectUrl is for redirecting to your website if order is failed | | redirectDeepLink | string | No | The redirectDeepLink is for redirecting to your APP if order is completed | | failRedirectDeepLink | string | No | The failRedirectDeepLink is for redirecting to your APP if order is failed | | clientIp | string | No | The original client IP | | clientType | string | No | The original client type: web/mobile | | customization | object | No | Customization settings for the current order. Please refer to "[Customization](../basics/9.customization.md)". | ### Response Body | **Field** | **Type** | **Remarks** | | -------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | link | string | The landing page link of Binance Connect. For information on how to use it, please refer to "[Landing page and redirection](../basics/8.landing-page-and-redirection.md)". | | linkExpireTime | timestamp | The expiration time of link | # ### Example Request Parameters: ```json { "externalOrderId": "8746972922319", "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "amountType": 1, "requestedAmount": "100", "payMethodCode": "SELL_P2P", "payMethodSubCode": "BANK", "network": "ETH", "redirectUrl": "https://test.examplepartner.com/sell/home", "failRedirectUrl": "https://test.examplepartner.com/sell/order/failure", "redirectDeepLink": "examplepartner://sell/home", "failRedirectDeepLink": "examplepartner://sell/order/failure", "clientIp": "154.55.51.218", "customization": { "LOCK_ORDER_ATTRIBUTES": [2, 3], "SKIP_CASHIER": false, "AUTO_REDIRECTION": true } } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "link": "https://app.binance.com/uni-qr/qccnt?amount=1300&baseCurrency=EUR&channel=P2P&cryptoCurrency=USDT&externalOrderId=946972925243314539&fiatCurrency=EUR&merchantCode=example-partner&paymentMethodCode=SELL_P2P&paymentmethod=BANK&sign=c267bcfe69d5e263u9ee6e5cdc374e3a958a1d00a06b9efcdf19e33dca3407e4&type=2&utm_campaign=connect_open_api&utm_source=test", "linkExpireTime": 1742222312058 } } ``` --- ## Document: /products/connect-2.0/off-ramp-sell-apis/3.get-estimated-quote URL: /en/dev-docs/products/connect-2.0/off-ramp-sell-apis/3.get-estimated-quote # Get estimated quote ``` POST /papi/v1/ramp/connect/sell/estimated-quote ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | ---------------- | -------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | fiatCurrency | string | Yes | fiat currency | | cryptoCurrency | string | Yes | crypto currency | | requestedAmount | string | Yes | Requested amount. Fraction is 8 | | amountType | int | Yes | Specify whether the total amount is in fiat:1 or crypto:2 | | payMethodCode | string | No | The payment method code is from payment method list API. If no value is provided for payMethodCode, the API will return the best price along with its corresponding payMethodCode, refer to example 5&6. | | payMethodSubCode | string | No | The payment method sub code is from payment method list API. If the payMethodCode is SELL_P2P, you must provide a value for payMethodSubCode. Otherwise, there is no need to provide a value for payMethodSubCode. | | network | string | No | crypto network | ### Response Body | **Field** | **Type** | **Remarks** | | ---------------- | -------- | ------------------------------------------------------------------------------- | | totalAmount | string | total amount in crypto (when amountType is 1) or in fiat (when amountType is 2) | | quotePrice | string | quote price | | feeAmount | string | fee amount | | feeCurrency | string | fee currency, fiat currency or crypto | | payMethodCode | string | The payment method code supported by this quote | | payMethodSubCode | string | The payment method sub code supported by this quote | # ### Example 1 Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "requestedAmount": "100", "amountType": 1, "payMethodCode": "SELL_CARD", "payMethodSubCode": "card", "network": "ETH" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "totalAmount": "109.24891691", "quotePrice": "0.9336477", "feeAmount": "2", "feeCurrency": "EUR", "payMethodCode": "SELL_CARD", "payMethodSubCode": "card" } } ``` User selects to sell crypto with Card (VISA/Mastercard), and prefers "specify fiat currency amount" (amountType: 1) to sell USDT for 100 EUR (requestedAmount). The estimated quote (quotePrice) is 0.9336477 EUR/USDT. After adding the estimated total fees (feeAmount) of 2 EUR, the estimated final amount of crypto to be deducted (totalAmount) is 109.24891691 USDT. Here, totalAmount is calculated as "(requestedAmount + feeAmount) / quotePrice", that is, (100 + 2) / 0.9336477 = 109.24891691. ### Example 2 Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "requestedAmount": 100, "amountType": 2, "payMethodCode": "SELL_CARD", "payMethodSubCode": "card", "network": "ETH" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "totalAmount": "91.56", "quotePrice": "0.93368279", "feeAmount": "1.8", "feeCurrency": "EUR", "payMethodCode": "SELL_CARD", "payMethodSubCode": "card" } } ``` User selects to sell crypto with Card (VISA/Mastercard), and prefers "specify crypto amount" (amountType: 2) to sell 100 USDT (requestedAmount) with EUR. The estimated quote (quotePrice) is 0.93368279 EUR/USDT. After deducting the estimated total fees (feeAmount) of 1.8 EUR, the estimated final amount of fiat currency received (totalAmount) is 91.56 EUR. Here, totalAmount is calculated as "requestedAmount _ quotePrice - feeAmount", that is, 100 _ 0.93368279 - 1.8 = 91.56. ### Example 3 Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "requestedAmount": 100, "amountType": 1, "payMethodCode": "SELL_P2P", "payMethodSubCode": "BANK", "network": "ETH" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "totalAmount": "104.91278351", "quotePrice": "0.97", "feeAmount": "1.82", "feeCurrency": "USDT", "payMethodCode": "SELL_P2P", "payMethodSubCode": "BANK" } } ``` User selects to sell crypto with P2P bank transfer, and prefers "specify fiat currency amount" (amountType: 1) to sell USDT for 100 EUR (requestedAmount). The estimated quote (quotePrice) is 0.97 EUR/USDT. After adding the estimated total fees (feeAmount) of 1.82 USDT, the estimated final amount of crypto to be deducted (totalAmount) is 104.91278351 USDT. Here, totalAmount is calculated as "requestedAmount / quotePrice + feeAmount”, that is, 100 / 0.97 + 1.82 = 104.91278351. ### Example 4 Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "requestedAmount": 100, "amountType": 2, "payMethodCode": "SELL_P2P", "payMethodSubCode": "BANK", "network": "ETH" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "totalAmount": "95.2346", "quotePrice": "0.97", "feeAmount": "1.82", "feeCurrency": "USDT", "payMethodCode": "SELL_P2P", "payMethodSubCode": "BANK" } } ``` User selects to sell crypto with P2P bank transfer, and prefers "specify crypto amount" (amountType: 2) to sell 100 USDT (requestedAmount) with EUR. The estimated quote (quotePrice) is 0.97 EUR/USDT. After deducting the estimated total fees (feeAmount) of 1.82 USDT, the estimated final amount of fiat currency received (totalAmount) is 95.2346 EUR. Here, totalAmount is calculated as “(requestedAmount - feeAmount) _ quotePrice”, that is, (100 - 1.82) _ 0.97 = 95.2346. ### Example 5 Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "requestedAmount": 100, "amountType": 1, "network": "ETH" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "totalAmount": "109.24891691", "quotePrice": "0.9336477", "feeAmount": "2", "feeCurrency": "EUR", "payMethodCode": "SELL_CARD", "payMethodSubCode": "card" } } ``` User selects to sell crypto and prefers "specify fiat currency amount" (amountType: 1) to sell USDT for 100 EUR (requestedAmount), but does not specify any payment method. The estimated quote (quotePrice) is 0.9336477 EUR/USDT, and the corresponding payment method is Card (VISA/Mastercard). After adding the estimated total fees (feeAmount) of 2 EUR, the estimated final amount of crypto to be deducted (totalAmount) is 109.24891691 USDT. Here, totalAmount is calculated as "(requestedAmount + feeAmount) / quotePrice", that is, (100 + 2) / 0.9336477 = 109.24891691. ### Example 6 Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "requestedAmount": 100, "amountType": 2, "network": "ETH" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "totalAmount": "95.2346", "quotePrice": "0.97", "feeAmount": "1.82", "feeCurrency": "USDT", "payMethodCode": "SELL_P2P", "payMethodSubCode": "BANK" } } ``` User selects to sell crypto and prefers "specify crypto amount" (amountType: 2) to sell 100 USDT (requestedAmount) with EUR, but does not specify any payment method. The estimated quote (quotePrice) is 0.97 EUR/USDT, and the corresponding payment method is P2P bank transfer. After deducting the estimated total fees (feeAmount) of 1.82 USDT, the estimated final amount of fiat currency received (totalAmount) is 95.2346 EUR. Here, totalAmount is calculated as “(requestedAmount - feeAmount) _ quotePrice”, that is, (100 - 1.82) _ 0.97 = 95.2346. --- ## Document: /products/connect-2.0/off-ramp-sell-apis/2.get-payment-method-list URL: /en/dev-docs/products/connect-2.0/off-ramp-sell-apis/2.get-payment-method-list # Get payment method list ``` POST /papi/v1/ramp/connect/sell/payment-method-list ``` ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | -------------- | -------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | fiatCurrency | string | Yes | fiat currency | | cryptoCurrency | string | Yes | crypto currency | | totalAmount | string | Yes | Requested amount | | amountType | int | Yes | Specify whether the total amount is in fiat:1 or crypto:2 | | language | string | No | Language code, which determines the multi-language of the content(if any, such as "payment method name") in the response data. If not passed, English is the default. The format is "[LanguageCode](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)-[RegionCode](https://en.wikipedia.org/wiki/ISO_3166-1)", RegionCode is optional. | ### Response Body ##### Data | **Field** | **Type** | **Remarks** | | -------------- | ------------ | --------------------------------------------- | | paymentMethods | object array | Payment methods. Refer to PaymentMethodObject | ##### PaymentMethodObject | **Field** | **Type** | **Remarks** | | ---------------- | -------- | ---------------------------------------------------------- | | payMethodCode | string | payment method code | | payMethodSubCode | string | payment method sub code | | paymentMethod | string | payment method display name | | fiatMinLimit | string | fiat min amount limit | | fiatMaxLimit | string | fiat max amount limit | | cryptoMinLimit | string | crypto min amount limit | | cryptoMaxLimit | string | crypto max amount limit | | p2p | bool | Indicate whether the payment method belongs to Binance P2P | # ### Example Request Parameters: ```json { "fiatCurrency": "EUR", "cryptoCurrency": "USDT", "totalAmount": "100", "amountType": 1, "language": "zh-CN" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "paymentMethods": [ { "payMethodCode": "SELL_WALLET", "payMethodSubCode": "Wallet", "paymentMethod": "Spot Wallet", "fiatMinLimit": "15", "fiatMaxLimit": "10000", "cryptoMinLimit": "16.10699996", "cryptoMaxLimit": "10737.99997363", "p2p": false }, { "payMethodCode": "SELL_CARD", "payMethodSubCode": "card", "paymentMethod": "Card (VISA/Mastercard)", "fiatMinLimit": "15", "fiatMaxLimit": "5000", "cryptoMinLimit": "16.10699996", "cryptoMaxLimit": "5368.99998681", "p2p": false }, { "payMethodCode": "SELL_GOOGLE_PAY", "payMethodSubCode": "GOOGLE_PAY", "paymentMethod": "Google Pay", "fiatMinLimit": "15", "fiatMaxLimit": "5000", "cryptoMinLimit": "16.10699996", "cryptoMaxLimit": "5368.99998681", "p2p": false }, { "payMethodCode": "SELL_APPLE_PAY", "payMethodSubCode": "APPLE_PAY", "paymentMethod": "Apple Pay", "fiatMinLimit": "15", "fiatMaxLimit": "5000", "cryptoMinLimit": "16.10699996", "cryptoMaxLimit": "5368.99998681", "p2p": false }, { "payMethodCode": "SELL_P2P", "payMethodSubCode": "BANK", "paymentMethod": "Bank Transfer", "fiatMinLimit": "10", "fiatMaxLimit": "1009", "cryptoMinLimit": "0.8543", "cryptoMaxLimit": "940.87", "p2p": true }, { "payMethodCode": "SELL_P2P", "payMethodSubCode": "Cash", "paymentMethod": "Cash Payment", "fiatMinLimit": "10", "fiatMaxLimit": "1009", "cryptoMinLimit": "0.8543", "cryptoMaxLimit": "940.87", "p2p": true }, { "payMethodCode": "SELL_P2P", "payMethodSubCode": "ALIPAY", "paymentMethod": "Alipay", "fiatMinLimit": "10", "fiatMaxLimit": "1009", "cryptoMinLimit": "0.8543", "cryptoMaxLimit": "940.87", "p2p": true }, { "payMethodCode": "SELL_P2P", "payMethodSubCode": "Paypal", "paymentMethod": "PayPal", "fiatMinLimit": "10", "fiatMaxLimit": "1009", "cryptoMinLimit": "0.8543", "cryptoMaxLimit": "940.87", "p2p": true } ] } } ``` ##### About payment method "SELL_WALLET" "SELL_WALLET" is a special payment method that allows users to sell crypto for fiat currency balances in their Binance wallets. For example, in some countries or regions, Binance supports users to deposit and withdraw fiat currencies (such as euro - EUR) directly. At this time, users can sell crypto for EUR (in Binance wallet). We call this payment method as "SELL_WALLET". --- ## Document: /products/connect-2.0/off-ramp-sell-apis/1.get-trading-pairs URL: /en/dev-docs/products/connect-2.0/off-ramp-sell-apis/1.get-trading-pairs # Get supported trading pairs ``` POST /papi/v1/ramp/connect/sell/trading-pairs ``` ### Request Body No request body ### Response Body | **Field** | **Type** | **Remarks** | | ---------------- | ------------ | -------------------- | | fiatCurrencies | string array | fiat currency list | | cryptoCurrencies | string array | crypto currency list | # ### Example Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "fiatCurrencies": ["USD", "EUR", "VND", "AUD", "TWD", "DEFAULT"], "cryptoCurrencies": ["BTC", "ETH", "BNB", "USDT", "USDC", "DAI"] } } ``` --- ## Document: /products/connect-2.0/deposit/6.deposit-status URL: /en/dev-docs/products/connect-2.0/deposit/6.deposit-status # Deposit authorization status | **Code** | **Status** | **Description** | **Remarks** | | -------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | | 0 | INIT | The deposit session has been created via `/deposit/initiate`, but the user has not yet opened the Binance App or taken any action. | Partner should continue polling `/deposit/authorization`. | | 1 | AUTHORIZED | The user has authorized in the Binance App. Deposit addresses for all requested networks are available. | Terminal state. `depositAddresses` will be populated in the response. | | 2 | REJECTED | The user explicitly rejected the authorization request in the Binance App. | Terminal state. Partner may call `/deposit/initiate` again with a new `externalOrderId`. | | 3 | EXPIRED | The authorization window has expired without any user action. | Terminal state. Partner should call `/deposit/initiate` again with a new `externalOrderId`. | # ### How deposit authorization status transitions ``` +---> AUTHORIZED (1) --- terminal | INIT (0) -----> user action | +---> REJECTED (2) --- terminal | (no action, time passes) | +---> EXPIRED (3) --- terminal ``` > **Notes**: > > - All transitions from `INIT` are one-way. Once a deposit session reaches `AUTHORIZED`, > `REJECTED`, or `EXPIRED`, it cannot be changed. > - If the deposit session is `REJECTED` or `EXPIRED`, the Partner should create a new deposit > session by calling `/deposit/initiate` with a **new** `externalOrderId`. > - The `AUTHORIZED` state is permanent — deposit addresses for a given user + coin + network > combination do not change. Multiple authorization sessions for the same user and network will > return the same address. --- ## Document: /products/connect-2.0/deposit/5.deposit-webhook URL: /en/dev-docs/products/connect-2.0/deposit/5.deposit-webhook # Deposit Webhook Whenever the deposit authorization status changes (user authorizes or rejects), Binance Connect will send a webhook message to the Partner's configured webhook callback URL. The Partner can receive this message and react accordingly, such as displaying the deposit addresses or notifying the user of a rejection. > **Note**: Webhook is the **primary** delivery mechanism for deposit status changes. Polling via > `/deposit/authorization` is available as a fallback in case the webhook is missed or not yet > integrated. See [Query deposit authorization](3.query-authorization.md). ### Request Headers | **Field** | **Type** | **Remarks** | | ---------------------- | --------- | -------------------------------------------------------- | | X-BN-Connect-Timestamp | timestamp | Timestamp | | X-BN-Connect-Signature | string | SHA256withRSA(**requestBody** + **X-Connect-Timestamp**) | | X-BN-Connect-For | string | Same with your client id (X-Tesla-ClientId) | > **How signature works**: The signature verification process is the same as the > [existing Connect webhook](../webhook/webhook.md). Binance signs the webhook payload with its > private key, and the Partner verifies using Binance's public key. ### Request Body | **Field** | **Type** | **Remarks** | | ---------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------ | | webhookEventType | string | Fixed value: `deposit_status_event` | | externalOrderId | string | Partner's unique order ID (same as the one used in `/deposit/initiate`). | | status | int | Authorization status: 1 = AUTHORIZED, 2 = REJECTED. Please refer to "[Deposit authorization status](6.deposit-status.md)". | | cryptoCurrency | string | Crypto currency | | depositAddresses | object array | Deposit addresses per network. Present when `status` = 1 (AUTHORIZED), empty array when REJECTED. Refer to **DepositAddressObject**. | | updateTime | timestamp | Status change time (epoch milliseconds) | ###### DepositAddressObject | **Field** | **Type** | **Remarks** | | -------------- | -------- | ------------------------------------------------------------------------- | | depositAddress | string | Deposit address for this network | | network | string | Blockchain network. E.g. "BSC", "ETH", "SOL" | | addressTag | string | Address memo/tag (for networks like XRP, XLM, etc.). Null if not required | ### Response Body - HTTP status code should be 200 - Response body is in JSON format. | **Field** | **Type** | **Remarks** | | ------------- | -------- | ----------------------------------------------------------- | | returnCode | string | SUCCESS or other code you wish to return to Binance Connect | | returnMessage | string | The message you wish to return to Binance Connect | # ### Example - AUTHORIZED (with deposit addresses) Request Body: ```json { "webhookEventType": "deposit_status_event", "externalOrderId": "dep-20260421-001", "status": 1, "cryptoCurrency": "USDT", "depositAddresses": [ { "depositAddress": "0x1234567890abcdef1234567890abcdef12345678", "network": "BSC", "addressTag": null }, { "depositAddress": "0x1234567890abcdef1234567890abcdef12345678", "network": "ETH", "addressTag": null }, { "depositAddress": "HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH", "network": "SOL", "addressTag": null } ], "updateTime": 1745350200000 } ``` ### Example - REJECTED Request Body: ```json { "webhookEventType": "deposit_status_event", "externalOrderId": "dep-20260421-001", "status": 2, "cryptoCurrency": "USDT", "depositAddresses": [], "updateTime": 1745350200000 } ``` --- ## Document: /products/connect-2.0/deposit/4.report-deposit URL: /en/dev-docs/products/connect-2.0/deposit/4.report-deposit # Report deposit ``` POST /papi/v1/ramp/connect/deposit/report ``` Optionally report the on-chain transaction hash after the Partner has executed the deposit transfer. This is for reconciliation and audit purposes only — no downstream action is triggered by this call. > **Note**: This API is idempotent. Calling it multiple times with the same `externalOrderId` will > only update the transaction hash on the first call; subsequent calls are ignored. ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | --------------- | -------- | ------------- | ------------------------------------------------------------------------ | | externalOrderId | string | Yes | Partner's unique order ID (same as the one used in `/deposit/initiate`). | | txHash | string | Yes | On-chain transaction hash of the deposit transfer. | | amount | string | No | Actual deposited amount. | | cryptoCurrency | string | No | Crypto currency. E.g. "USDT" | | network | string | No | Blockchain network. E.g. "BSC", "ETH", "SOL" | ### Response Body No data returned. A successful response indicates the transaction hash has been recorded. # ### Example Request Parameters: ```json { "externalOrderId": "dep-20260421-001", "txHash": "0xabc123def456789012345678901234567890abcdef1234567890abcdef123456", "amount": "100.5", "cryptoCurrency": "USDT", "network": "BSC" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": null } ``` --- ## Document: /products/connect-2.0/deposit/3.query-authorization URL: /en/dev-docs/products/connect-2.0/deposit/3.query-authorization # Query deposit authorization ``` POST /papi/v1/ramp/connect/deposit/authorization ``` Query the authorization status of a deposit session. After the user opens the Binance App via the universal link, this API returns the current status and, once authorized, the deposit addresses for all requested networks. > **Polling contract**: Poll this API every 2-3 seconds. Stop polling when the status transitions > from `0` (INIT) to a terminal state: `1` (AUTHORIZED), `2` (REJECTED), or `3` (EXPIRED). > > **Note**: Webhook is the primary delivery mechanism for authorization results. Polling is > available as a fallback. See [Deposit Webhook](5.deposit-webhook.md) for details. ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | --------------- | -------- | ------------- | ------------------------------------------------------------------------ | | externalOrderId | string | Yes | Partner's unique order ID (same as the one used in `/deposit/initiate`). | ### Response Body | **Field** | **Type** | **Remarks** | | ---------------- | ------------ | -------------------------------------------------------------------------------------------------------------- | | status | int | Authorization status. Please refer to "[Deposit authorization status](6.deposit-status.md)". | | depositAddresses | object array | Deposit addresses per network. Only present when `status` = 1 (AUTHORIZED). Refer to **DepositAddressObject**. | | cryptoCurrency | string | Crypto currency | | expireTime | timestamp | Authorization expiry time (epoch milliseconds) | ###### DepositAddressObject | **Field** | **Type** | **Remarks** | | -------------- | -------- | --------------------------------------------------------------------------------------- | | depositAddress | string | Deposit address for this network | | network | string | Blockchain network. E.g. "BSC", "ETH", "SOL" | | addressTag | string | Address memo/tag (for networks like XRP, XLM, etc.). Null if not required | | minAmount | string | Minimum deposit amount for this network. Deposits below this amount may not be credited | # ### Example - INIT (waiting for user authorization) Request Parameters: ```json { "externalOrderId": "dep-20260421-001" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "status": 0, "depositAddresses": null, "cryptoCurrency": "USDT", "expireTime": 1745352000000 } } ``` ### Example - AUTHORIZED (deposit addresses obtained) Request Parameters: ```json { "externalOrderId": "dep-20260421-001" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "status": 1, "depositAddresses": [ { "depositAddress": "0x1234567890abcdef1234567890abcdef12345678", "network": "BSC", "addressTag": null, "minAmount": "0.01" }, { "depositAddress": "0x1234567890abcdef1234567890abcdef12345678", "network": "ETH", "addressTag": null, "minAmount": "0.01" }, { "depositAddress": "HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH", "network": "SOL", "addressTag": null, "minAmount": "0.01" } ], "cryptoCurrency": "USDT", "expireTime": 1745352000000 } } ``` ### Example - REJECTED (user rejected authorization) Request Parameters: ```json { "externalOrderId": "dep-20260421-001" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "status": 2, "depositAddresses": null, "cryptoCurrency": "USDT", "expireTime": 1745352000000 } } ``` ### Example - EXPIRED (authorization window expired) Request Parameters: ```json { "externalOrderId": "dep-20260421-001" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "status": 3, "depositAddresses": null, "cryptoCurrency": "USDT", "expireTime": 1745352000000 } } ``` --- ## Document: /products/connect-2.0/deposit/2.initiate-deposit URL: /en/dev-docs/products/connect-2.0/deposit/2.initiate-deposit # Initiate deposit ``` POST /papi/v1/ramp/connect/deposit/initiate ``` Create a deposit session. Returns a universal link for opening the Binance App authorization page where the user can authorize the Partner to access their deposit addresses. > The `externalOrderId` serves as an idempotency key. Calling this API multiple times with the same > `externalOrderId` will return the same universal link. ### Request Body | **Field** | **Type** | **Mandatory** | **Remarks** | | ---------------- | ------------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | cryptoCurrency | string | Yes | Crypto currency. E.g. "USDT", "ETH" | | networks | string array | Yes | Blockchain networks (one or more). E.g. `["BSC", "ETH", "SOL"]`. Use `depositEnable` from the crypto-network API to check which networks support deposit. | | externalOrderId | string | Yes | Partner's unique order ID (idempotency key). Supports only letters, numbers, hyphens and underscores. | | amount | string | No | Expected deposit amount (display only, not enforced). This is shown to the user on the authorization page for reference. | | redirectUrl | string | No | Partner web redirect URL. The user will be redirected to this URL after authorization in the Binance App. | | redirectDeepLink | string | No | Partner native app deeplink. The user will be redirected to this deeplink after authorization in the Binance App. | ### Response Body | **Field** | **Type** | **Remarks** | | -------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------- | | link | string | Binance App universal link. Redirect the user to this link to open the deposit authorization page in the Binance App. | | linkExpireTime | timestamp | The expiration time of the link (epoch milliseconds). After this time, the user can no longer authorize this deposit session. | # ### Example Request Parameters: ```json { "cryptoCurrency": "USDT", "networks": ["BSC", "ETH", "SOL"], "externalOrderId": "dep-20260421-001", "amount": "100.5", "redirectUrl": "https://trustwallet.com/deposit-callback", "redirectDeepLink": "trustwallet://deposit-callback" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "link": "https://app.binance.com/mp/web?appId=VzUjjQ&startPagePath=cGFnZXMvb24tY2hhaW4tZGVwb3NpdC9pbmRleA&merchantCode=connect-trustwallet&externalOrderId=dep-20260421-001", "linkExpireTime": 1745352000000 } } ``` ### Example - Single network Request Parameters: ```json { "cryptoCurrency": "ETH", "networks": ["ETH"], "externalOrderId": "dep-20260422-002" } ``` Response: ```json { "success": true, "code": "000000", "message": "success", "data": { "link": "https://app.binance.com/mp/web?appId=VzUjjQ&startPagePath=cGFnZXMvb24tY2hhaW4tZGVwb3NpdC9pbmRleA&merchantCode=connect-trustwallet&externalOrderId=dep-20260422-002", "linkExpireTime": 1745438400000 } } ``` --- ## Document: /products/connect-2.0/deposit/1.get-crypto-networks URL: /en/dev-docs/products/connect-2.0/deposit/1.get-crypto-networks # Get supported crypto networks ``` POST /papi/v1/ramp/connect/crypto-network ``` > This is the same API used by On-ramp and Off-ramp. For deposit use cases, refer to the > `depositEnable` and `depositDust` fields to determine which networks support deposit and the > minimum deposit amount. ### Request Body No request body ### Response Body ##### Data: CryptoNetworkObject array ###### CryptoNetworkObject | **Field** | **Type** | **Remarks** | | -------------- | ------------ | -------------------------------------------- | | cryptoCurrency | string | Crypto currency, e.g. "USDT", "ETH" | | networks | object array | Network detail. Refer to NetworkDetailObject | ###### NetworkDetailObject | **Field** | **Type** | **Remarks** | | ----------------- | -------- | --------------------------------------------------------------------------------------- | | network | string | Network name. E.g. ETH, BSC, ARBITRUM, SOL, OPTIMISM, BASE | | addressRegex | string | Network address regex | | memoRegex | string | Memo regex | | withdrawFee | string | Withdraw fee | | withdrawMinAmount | string | Withdraw min amount | | withdrawMaxAmount | string | Withdraw max amount | | contractAddress | string | Contract address | | withdrawEnable | boolean | Is withdraw enabled | | depositEnable | boolean | Is deposit enabled. Use this to filter networks available for deposit | | depositDust | string | Minimum deposit amount for this network. Deposits below this amount may not be credited | # ### Example Response: ```json { "success": true, "code": "000000", "message": "success", "data": [ { "cryptoCurrency": "USDT", "networks": [ { "network": "BSC", "addressRegex": "^(0x)[0-9A-Fa-f]{40}$", "memoRegex": "", "withdrawFee": 0.29, "withdrawMinAmount": 10.0, "withdrawMaxAmount": 9999999.0, "contractAddress": "0x55d398326f99059ff775485246999027b3197955", "withdrawEnable": true, "depositEnable": true, "depositDust": "0.01" }, { "network": "ETH", "addressRegex": "^(0x)[0-9A-Fa-f]{40}$", "memoRegex": "", "withdrawFee": 3.22, "withdrawMinAmount": 10.0, "withdrawMaxAmount": 9999999.0, "contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7", "withdrawEnable": true, "depositEnable": true, "depositDust": "0.01" }, { "network": "SOL", "addressRegex": "^[1-9A-HJ-NP-Za-km-z]{32,44}$", "memoRegex": "", "withdrawFee": 1.0, "withdrawMinAmount": 10.0, "withdrawMaxAmount": 9999999.0, "contractAddress": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB", "withdrawEnable": true, "depositEnable": true, "depositDust": "0.01" } ] }, { "cryptoCurrency": "ETH", "networks": [ { "network": "ETH", "addressRegex": "^(0x)[0-9A-Fa-f]{40}$", "memoRegex": "", "withdrawFee": 0.0, "withdrawMinAmount": 1e-8, "withdrawMaxAmount": 9999999.0, "contractAddress": "", "withdrawEnable": true, "depositEnable": true, "depositDust": "0.00001" } ] } ] } ``` --- ## Document: /products/connect-2.0/deposit/0.typical-flow URL: /en/dev-docs/products/connect-2.0/deposit/0.typical-flow # Typical Deposit Flow ## Overview This document describes the standard deposit flow using Binance Connect's Deposit service. The deposit feature allows users of Partner Apps (e.g., Trust Wallet) to authorize disclosure of their Binance deposit addresses, so that the Partner App can send crypto to the user's Binance account on their behalf. > **Key distinction**: Connect Deposit is an **address authorization coordinator**, NOT a payment > processor. It never moves funds — the Partner App executes the actual on-chain transfer > independently. ## Flow Steps ### 1. Query Supported Networks - Partner backend queries available coin + network combinations for deposit via `POST /papi/v1/ramp/connect/crypto-network`. - This returns supported networks with deposit-specific metadata (e.g., `depositDust` for minimum deposit amounts). ### 2. Initiate Deposit Session - Partner backend calls `POST /papi/v1/ramp/connect/deposit/initiate` with the selected crypto currency and one or more blockchain networks. - Binance Connect returns a **universal link** (`link`) for opening the Binance App authorization page, along with the link's `linkExpireTime`. ### 3. User Authorization in Binance App - Partner frontend redirects the user to Binance App using the universal link. - User sees the authorization page showing the Partner name, requested crypto currency, and networks. - User taps **"Authorize"** to grant the Partner access to their deposit addresses. ### 4. Receive Deposit Addresses - **Primary (webhook)**: Binance Connect pushes a `deposit_status_event` webhook to the Partner's callback URL with the authorization status and deposit addresses for all requested networks. - **Fallback (polling)**: Partner backend polls `POST /papi/v1/ramp/connect/deposit/authorization` every 2-3 seconds until the status transitions from `INIT` to a terminal state (`AUTHORIZED`, `REJECTED`, or `EXPIRED`). ### 5. Execute On-Chain Transfer - Partner App displays the deposit addresses to the user. - User confirms the deposit amount and the Partner App executes the on-chain transfer to the corresponding deposit address. ### 6. Report Transaction (Optional) - Partner backend optionally calls `POST /papi/v1/ramp/connect/deposit/report` to report the on-chain transaction hash for reconciliation and audit purposes. ## Sequence Diagram ``` Partner App Binance Connect Binance App | | | | 1. Query supported networks | | |------------------------------->| | | networks + coin details | | |<-------------------------------| | | | | | 2. Initiate deposit | | | (coin, networks[], ...) | | |------------------------------->| | | { link, linkExpireTime } | | |<-------------------------------| | | | | | 3. Open universal link ------|------------------------------>| | | | | | User taps "Authorize" | | |<------------------------------| | | | | 4a. Webhook: deposit_status_event (status, depositAddresses) | |<-------------------------------| | | | | | 4b. (fallback) Poll /authorization | |------------------------------->| | | { status, depositAddresses } | | |<-------------------------------| | | | | | 5. Execute on-chain transfer | | | (Partner sends crypto to | | | the deposit address) | | | | | | 6. Report txHash (optional) | | |------------------------------->| | | 200 OK | | |<-------------------------------| | ``` --- ## Document: /products/connect-2.0/convert/1.convert URL: /en/dev-docs/products/connect-2.0/convert/1.convert # Convert Binance Connect provides a flexible and powerful Convert capability as part of the On-ramp (Buy) functionality, through which you can quickly convert one cryptocurrency to another with competitive rates! The Convert capability is a branch of the On-ramp flow that allows users to exchange their existing cryptocurrency holdings directly without going through fiat currency. This is particularly useful for: - Converting between different cryptocurrencies - Portfolio rebalancing - Taking advantage of market opportunities As a partner (client), the conversion process is seamless and uses the same On-ramp APIs with specific parameters. There are no separate Convert APIs - it utilizes the existing On-ramp infrastructure. ## Key Differences for Convert Operations When using the On-ramp APIs for Convert operations, there are some key differences: ### 1. Fiat Fields For Convert operations, the following fields will be empty since no fiat currency is involved: - `fiat` - This field will be empty - `fiatAmount` - This field will be 0 ### 2. Additional Response Fields The [Get order detail](../on-ramp-buy-apis/6.query-order-details.md) API and webhook payload will include an additional object field when processing Convert orders: **For API responses:** ```json { "convertInfo": { "fromCoin": "BTC", "fromCoinAmount": "0.01" } } ``` **For webhook payloads:** ```json { "convertInfo": { "fromCoin": "BTC", "fromCoinAmount": "0.01" } } ``` #### ConvertInfo Fields: - `fromCoin`: The source cryptocurrency being converted from - `fromCoinAmount`: The amount of source cryptocurrency being converted ### 3. Order Status Flow Convert operations will use the following order statuses: - `CONVERT_PROCESSING` (3): In the process of converting crypto - `CONVERT_COMPLETED` (4): Successfully converted crypto. The converted crypto is in the user's Binance wallet, but the withdrawal has not been initiated yet For detailed order status information, refer to [Order Status](../basics/7.order-status.md). --- ## Document: /products/connect-2.0/buy-any-token/1.buy-any-token URL: /en/dev-docs/products/connect-2.0/buy-any-token/1.buy-any-token # Buy any token (Swap) For crypto currencies not listed on Binance spot (such as popular memecoins), Binance Connect provides a suite of flexible and powerful APIs, through which you can quickly buy any token with one click! Its implementation principle is as follows, there are two steps: 1. First buy the bridge token with fiat currency, such as USDT, USDC, BNB, SOL, etc. The bridge token is automatically selected based on the liquidity of different networks and providers, and it may be the native token of the current chain or stable coins; 2. Then swap the target token (such as memecoins) by the bridge token; As a partner (client), you don't need to pay much attention to these implementation details. These two steps are happened automatically in Binance Connect, and users will not realize any unsmooth of this process. The whole user experience is to buy any token with one click. # If you are going to integrate the "Buy any token" capability, it's quite easy. You only need to call the APIs in the following: - [Get payment method list](../on-ramp-buy-apis/3.get-payment-method-list.md). If there is success response and results of the API, it means that Binance Connect supports this token (contract address); - [Get estimated quote](../on-ramp-buy-apis/4.get-estimated-quote.md). If there is success response and result of the API, it means that there is quote and liquidity of this token (contract address), and it's fine to call the pre-order API to place an order; - [Pre order](../on-ramp-buy-apis/5.pre-order.md). In fact, these APIs are no different from the APIs in the On-ramp (Buy) section. The only difference is that On-ramp (Buy) requires the parameter `cryptoCurrency`, while the parameter for Buy any token is `contractAddress`. --- ## Document: /products/connect-2.0/basics/9.customization URL: /en/dev-docs/products/connect-2.0/basics/9.customization # Customization While providing a set of standardized process, Binance Connect also offers some capabilities for customizing interaction details, through which the partner (client) can customize the on/off ramp process according to their needs. For example, lock transaction pairs/payment methods to prevent users from making changes after entering Binance Connect page, skip the cashier page to make the process simpler, automatically redirect to the partner's (client's) platform when the on/off ramp is completed without the user manually clicking the "Back to X" button, etc. **Please note that the customization capabilities are not enabled by default**, as they are only customized for the special needs of few of our partners, and they are not applied for most partners, usually you don't need to enable these customization capabilities, the standard process is sufficient to meet your needs. If you really need these capabilities, **please contact Binance Connect team to enable them for you** (the customization parameter of the pre-order API will be ignored if these capabilities are not enabled and the customization will not work). If the existing capabilities do not meet your needs, feel free to give any suggestions. Binance Connect will add more and more customization capabilities in the future. # ### Customization types If Binance Connect has enabled the customization capabilities for you, you can pass the customization settings for the current order in the `customization` parameter of the pre-order API. Currently, Binance Connect supports the following customization capabilities: | **Key** | **Value Type** | **Description** | **Remarks** | | --------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | LOCK_ORDER_ATTRIBUTES | int array | An array of integers, filled with all the parameters you want to lock. When the user enters the cashier page of Binance Connect, the corresponding information will be locked and cannot be edited. Please refer to “Subtypes for LOCK_ORDER_ATTRIBUTES”. | | | SKIP_CASHIER | boolean | skip cashier page (and show order confirmation page directly) or not | Cannot work together with `SEND_PRIMARY`. | | AUTO_REDIRECTION | boolean | Automatically redirect or not. When the user completes the buy crypto and withdrawal process, there will be a "Back to X" button on the page, clicking it will redirect the user back to the partner's platform. If you enable the `AUTO_REDIRECTION` capability, a countdown will be displayed on the button, and the page will automatically redirect without clicking after the countdown ends. | If `redirectUrl` and `redirectDeepLink ` are not provided in pre-order API, it will not work. | | HIDE_SEND | boolean | Hide send crypto option or not. When user is on the cashier page of the on-ramp (buy) flow, if the user has enough crypto in his Binance wallet, Binance Connect will prompt him whether to send crypto (i.e. transfer) directly. If the user choose this option, Binance connect will skip the purchase process and directly withdraw crypto to the user’s crypto wallet. If you want to disable this prompt and only enable buy, you can use the `HIDE_SEND` customization. | On-ramp only.
Cannot work together with `SEND_PRIMARY`. | | SEND_PRIMARY | boolean | promote send as the first priority (and downgrade buy) or not | On-ramp only.
Cannot work together with `HIDE_SEND`.
Should work together with `amountType: 2` .
Please refer to "[Send primary mode](../send-primary-mode/send-primary-mode.md)". | | SEND_PRIMARY_FLEXIBLE | boolean | promote send as the first priority (and downgrade buy) or not, and allows users to freely input the amount on Binance Connect page | On-ramp only.
Cannot work together with `HIDE_SEND`.
Must work together with `SEND_PRIMARY`.
The amount specified in pre-order API will be used as the default value but users can modify it.
Please refer to "[Send primary mode](../send-primary-mode/send-primary-mode.md)". | | MERCHANT_DISPLAY_NAME | string | customize the partner name displayed on the order pages | On-ramp only. | | NET_RECEIVE | boolean | Normally, since the withdrawal fee will be deducted when withdrawing, the actual amount of crypto received by the user will be less than the amount of crypto purchased. If you want the actual amount of crypto received by the user to be equal to the amount of crypto specified in the pre-order API, please use `NET_RECEIVE`. Binance Connect will purchase more crypto automatically to cover the withdrawal fee deduction at the time of withdrawal. | On-ramp only.
Should work together with `LOCK_ORDER_ATTRIBUTES: CRYPTO_AMOUNT`.
Should work together with `SEND_RPIMARY`. | | P2P_EXPRESS | boolean | When a user lands on Binance Connect, this value can redirect them to the P2P order confirmation page. | On-ramp only.
Cannot work together with `SEND_PRIMARY`. | #### Subtypes for LOCK_ORDER_ATTRIBUTES | **Subtype** | **Value** | **Remarks** | | --------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | ALL | 1 | lock all parameters | | TRADING_PAIR | 2 | lock transaction pair | | NETWORK | 3 | lock crypto network | | PAYMENT_METHOD | 4 | lock payment method | | FIAT_AMOUNT | 5 | lock the fiat amount as specified in the pre-order API. Should work together with `amountType: 1` . Should work together with `HIDE_SEND `. | | CRYPTO_AMOUNT | 6 | lock the crypto amount as specified in the pre-order API. Should work together with `amountType: 2` . | | FIAT_CURRENCY | 7 | lock fiat currency | | CRYPTO_CURRENCY | 8 | lock crypto currency | # ### Example Request Parameters: ```json { // Other parameters... "customization": { "LOCK_ORDER_ATTRIBUTES": [2, 3], "SKIP_CASHIER": false, "AUTO_REDIRECTION": true, "HIDE_SEND": false, "SEND_PRIMARY": true, "MERCHANT_DISPLAY_NAME": "Super Merchant", "NET_RECEIVE": true } } ``` > \*_Please note that the above code is only an example. You don't have to pass in all the > customization attributes, you only need to pass in the attributes you need. If the permission for > a customization attribute is not enabled, the passed parameter will be ignored and the > customization will not work._ --- ## Document: /products/connect-2.0/basics/8.landing-page-and-redirection URL: /en/dev-docs/products/connect-2.0/basics/8.landing-page-and-redirection # Landing page and redirection ### About landing page link The landing page link in the response of the pre-order API is a [universal link](https://developer.apple.com/documentation/xcode/allowing-apps-and-websites-to-link-to-your-content/) starting with `https://app.binance.com/`. When parter (client) opens this universal link, the system's behaviors should be as follows: - Desktop: the system redirects the link to the system browser and opens Binance Connect's webpage; - Mobile (Binance App installed): the system redirects the link to Binance App and opens Binance Connect's mini app; - Mobile (None Binance App installed): the system redirects the link to the system browser and opens Binance Connect's mobile webpage; Regarding the method of opening or loading the landing page link, Binance Connect requires the following requirements: - System browser or Binance App: the only highly recommended method that ensures the best security, product performance, and user experience; - Embedded browser: not a recommended approach, and we cannot guarantee the security, product performance, and user experience. If you have special needs that require you to do this, please contact Binance Connect so that we can customize a solution for you; - iframe: not allowed, we cannot guarantee the security, product performance, and user experience. If you use iframe to load the landing page link, Binance Connect reserves the right to terminate the partnership; ### Best way to load Universal Links in code For iOS native, please code like this: ```swift let connectUrl = URL(string: "https://app.binance.com/...")! UIApplication.shared.open(connectUrl, options: [:]) ``` For Android native, please code like this: ```kotlin val connectUrl = "https://app.binance.com/..." val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(connectUrl)) startActivity(browserIntent) ``` For web side, the following normal page redirect methods are all working: - HTML `` tag ```html Buy with Binance Connect ``` - Window `open()` Method ```javascript window.open("https://app.binance.com/..."); ``` - JavaScript Window Location ```javascript window.location.href = "https://app.binance.com/..."; ``` If you are using frameworks such as React Native that do not apply platform native redirection, which result in unable to redirect to the Binance App normally with Universal Links, please contact Binance Connect to seek a solution. --- ## Document: /products/connect-2.0/basics/7.order-status URL: /en/dev-docs/products/connect-2.0/basics/7.order-status # Order status | **Code** | **Type** | **Description** | **Remarks** | | -------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | | 0 | INIT | The pre-order API has been called and the order was created, but no Fiat or P2P order has been matched (the user may be logging in or staying on the Binance Connect landing page at this time). | | | 1 | ON_RAMP_PROCESSING | In the process of buying crypto with Fiat or P2P. | On-ramp only | | 2 | ON_RAMP_COMPLETED | Successfully bought crypto through Fiat or P2P. The crypto is in the user's Binance wallet, but the withdrawal has not been initiated yet. | On-ramp only | | 3 | CONVERT_PROCESSING | In the process of converting crypto. | Convert only | | 4 | CONVERT_COMPLETED | Successfully converted crypto. The converted crypto is in the user's Binance wallet, but the withdrawal has not been initiated yet. | Convert only | | 6 | OFF_RAMP_PROCESSING | In the process of selling crypto with Fiat or P2P. | Off-ramp only | | 10 | WITHDRAW_INIT | Withdrawal has been initiated. | On-ramp and Send crypto | | 11 | WITHDRAW_PROCESSING | Withdrawal in progress, Binance or blockchain is processing. | On-ramp and Send crypto | | 15 | SWAP_PROCESSING | Swap action in progress, Binance or blockchain is processing. | On-ramp (buy any token) | | 20 | COMPLETED | For on-ramp, it means that the buying crypto and the withdrawal have been both completed; For off-ramp, it means that the selling crypto has been completed; For send crypto, it means that the withdrawal has been completed. This is one of the final states of an order. | | | 93 | SWAP_ABANDONED | Buying crypto successfully but the user voluntarily abandoned the swap action (e.g. clicking the Cancel button). The crypto will be stored in the user's Binance wallet. This is one of the final states of an order. | On-ramp (buy any token) only | | 94 | SWAP_FAILED | Swap action failed. This is one of the final states of an order. | On-ramp (buy any token) only | | 95 | OFF_RAMP_FAILED | Selling crypto failed. This is one of the final states of an order. | Off-ramp only | | 96 | WITHDRAW_ABANDONED | Buying crypto successfully but the user voluntarily abandoned the withdrawal process (e.g. clicking the Abandon button). The crypto will be stored in the user's Binance wallet. This is one of the final states of an order. | On-ramp and Send crypto | | 97 | ON_RAMP_FAILED | Buying crypto failed. This is one of the final states of an order. | On-ramp only | | 98 | WITHDRAW_FAILED | Buying crypto successfully but the withdrawal failed, the crypto will be stored in the user's Binance wallet. This is one of the final states of an order. | On-ramp and Send crypto | | 99 | FAILED | The reserved final failure state of an order, not yet enabled. | | # ### How order status transforms The following flow diagrams indicate how the order status flows during the life cycle of an order. ##### On-ramp (Buy) ![flow-state-buy](../images/flow-state-buy.jpg) ##### On-ramp (Convert) ![flow-state-convert](../images/flow-state-convert.jpg) ##### Buy any token (Swap) ![flow-state-buy](../images/flow-state-buy-any-token.jpg) ##### Send crypto (Normal send & Send primary mode) ![flow-state-send](../images/flow-state-send.jpg) ##### Off-ramp (Sell) ![flow-state-sell](../images/flow-state-sell.jpg) --- ## Document: /products/connect-2.0/basics/6.apply-developer-account URL: /en/dev-docs/products/connect-2.0/basics/6.apply-developer-account # How to apply partner developer account If you are a partner (client) who wants to integrate Binance Connect’s Open API. Please contact Binance Connect team and provide the following items: - [Public key](3.request-signing.md) for API requests (private key kept by the partner/client safely); - IP addresses used to config whitelist; - Webhook callback url; - The domains of the URL/Universal Link that you will pass to the `redirectUrl` and `failRedirectUrl` parameters of the pre-order API, as well as the schema of the Deeplink of the `redirectDeepLink` and `failRedirectDeepLink` parameters. Which are used to config whitelist for redirecting users back to your platform when on/off ramp completed; - A logo image in format of 80 x 80 pixel png, which will be displayed on the Binance Connect page. Once Binance Connect receives these items and completes the configuration, Binance Connect will provide the following items to the partner (client): - Client id; - Sign access token; - Public key and partner code for webhook (private key kept by Binance Connect safely); Then the partner (client) will be able to call all Open APIs. > \*_Regarding to different environments, please refer to > “[Environments and API base URLs](4.base-urls.md)”. It‘s recommended to start with the QA > environment first._ --- ## Document: /products/connect-2.0/basics/5.error-code URL: /en/dev-docs/products/connect-2.0/basics/5.error-code # Error code | **Code** | **Type** | **Message** | | -------- | ------------------------------------ | ---------------------------------------------- | | 1130101 | SYS_ERROR | System error | | 1130102 | SYS_BUSY | System busy. Please try again later | | 1130303 | ILLEGAL_PARAMETERS | The parameter {param} is illegal | | 1130304 | MISSING_CLIENT_ID | Missing client id from request | | 1130305 | PARTNER_IS_DISABLED | The partner is disabled | | 1130306 | ORDER_NOT_FOUND | Can not find the order | | 1130307 | UNSUPPORTED_ORDER_TYPE | Unsupported order type | | 1130314 | PARTNER_IS_NOT_FOUND | Can not find the partner | | 1130320 | NOT_SUPPORT_QUOTE_FOR_PAYMENT_METHOD | Not support quote for this payment method | | 1130326 | ILLEGAL_CUSTOMIZATION_VALUE | The value of customization {param} is illegal. | | 1130327 | SWAP_TOKEN_NOT_FOUND | Swap token not found. | | 1130329 | SWAP_NETWORK_NOT_SUPPORT | Swap network not support | | 1130330 | SWAP_TOKEN_NOT_MATCHED | Swap token not matched {0} | # ### Example Response: ```json { "success": false, "code": "1130306", "message": "Can not find the order", "data": null } ``` --- ## Document: /products/connect-2.0/basics/4.base-urls URL: /en/dev-docs/products/connect-2.0/basics/4.base-urls # Environments and API base URLs According to different environments, please use the following base URLs for API requests: | Environment | URL | | ----------- | ---------------------------------------------- | | QA | Please ask for Binance Connect team | | Sandbox | Sandbox environment is not supported currently | | Production | Please ask for Binance Connect team | --- ## Document: /products/connect-2.0/basics/3.request-signing URL: /en/dev-docs/products/connect-2.0/basics/3.request-signing # API request signing The private key and public key are generated by the partner (client). The partner (client) should keep the private key securely and privately, and inform Binance Connect of the public key, then Binance Connect will be able to verify the API requests from the partner (client). # ### Generating key pairs You can use code or the OpenSSL tool to generate key pairs, depending on which one you prefer. #### Generating key pairs with code The example code below shows how to generate public and private keys: ```java import org.apache.commons.codec.binary.Base64; import java.security.KeyPairGenerator; import java.security.KeyPair; KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); generator.initialize(1024); KeyPair kp = generator.generateKeyPair();   String privateK = Base64.encodeBase64String(kp.getPrivate().getEncoded()); String publicK = Base64.encodeBase64String(kp.getPublic().getEncoded()); System.out.println("-----Generating private key-----"); System.out.println(privateK); System.out.println("\n\n-----Generating public key-----"); System.out.println(publicK); ``` #### Generating key pairs with OpenSSL tool Please follow the steps below: 1. Generate private key with command: ``` openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:1024 ``` 2. Extract the DER encoding of the private key with command: ``` openssl rsa -in private_key.pem -outform DER -out private_key.der ``` 3. Convert the DER-encoded private key to Base64 encoding with command: ``` openssl base64 -in private_key.der -out private_key.base64 -A | tr -d '\n' | sed 's/\//\//g' ``` > \*_Please keep the file "private_key.base64" generated by this command securely and privately. The > private key will be used to generate the signature._ 4. Generate public key with command: ``` openssl rsa -in private_key.pem -pubout -outform DER -out public_key.der ``` 5. Convert the DER-encoded public key to Base64 encoding with command: ``` openssl base64 -in public_key.der -out public_key.base64 -A | tr -d '\n' | sed 's/\//\//g' ``` > \*_Please send the file "public_key.base64" generated by this command to Binance Connect for use > in verifying API requests._ # ### Generating signature and set HTTP headers The signature is generated by request body (json string), timestamp and partner (client) private key, the following is the example code: ```java import org.apache.commons.codec.binary.Base64; import java.security.KeyFactory; import java.security.PrivateKey; import java.security.Signature; import java.security.spec.PKCS8EncodedKeySpec; import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; public class TestRequestSigning {     public static void main(String[] args) throws Exception {         MultiValueMap httpHeaders = new HttpHeaders();         String clientPrivateKey = "Your client private key";         String jsonBody = "{\n" +                 "\t\"id\": \"10000001\",\n" +                 "\t\"name\": Jack\n" +                 "}";// Please use utf-8 encoding if body contains special characters such as emoticons.         Long timestamp = System.currentTimeMillis();         PrivateKey cPrivateKey = generatePrivateKey(clientPrivateKey);         String signature = sign(jsonBody + timestamp.toString(), cPrivateKey);         httpHeaders.add("X-Tesla-Signature", signature);     }     public static PrivateKey generatePrivateKey(String privateKey) throws Exception {         PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKey));         KeyFactory keyFactory = KeyFactory.getInstance("RSA");         return keyFactory.generatePrivate(privateKeySpec);     }     public static String sign(String srcData, PrivateKey privateKey) throws Exception {         Signature signature = Signature.getInstance("SHA256withRSA");         signature.initSign(privateKey);         signature.update(srcData.getBytes());         return new String(Base64.encodeBase64(signature.sign()));     } } ``` # ### How signature works #### The signature flow is as follows: ![signature-flow](../images/signature-API.png) # ### Use [Postman](https://www.postman.com/) to sign and test API requests 1. Configure environment variables Create an environment (such as QA) in Postman and add these environment variables for subsequent reference: `base_url`, `client_id`, `access_token`, `private_key`. Please note that the format of the value of `private_key` should be like this: ```javascript -----BEGIN PRIVATE KEY----- MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANAAMnEOR1NIBIbwnDwHu19L/Jv0s4eEDHEjQ24OHjkHQ3CHWj4Ik4iFZyX9MvQsmZEzkDx8mJkkgAmIGjYkkZhEny1z6GPW55+ruo4dLYIRurESYRufZxI49BtIeLOOwL9ZFOnVfxBh8T7xyCvMmMcF93Suv6RcbTWXk8EC0pkXAgMBAAECgYA2cXbChNxCfj1BHMWoKNXwkbEjGR/MvtGK45IIwoVCpBYQ5DzIs/H58AEZvnaR1wKzMO32Bx7iJt2koQ1LUrMQ0UB9ydxhP2BogHvt9ZDI49+UPkTS92HMgPixi6O1HE6nOOu4rHR+6j7pdGcB+dneTwgPngWdk71VsbX8ZzPZsQJBAOGPmztuIpgXCxPlyLWCuEa9zTKc9lHiBe65ZN1jvUq1GCLClVcx/oEtEb9CCo7u1vacr/1sGFPxgBdvzv2y8HMCQQDsEfGEhp/79keDnjvJZ+TLfP4r+u1Gw0gAuj4Cay316K3f3q2OEqNm9lMNzg5dVYb78sVRd+guZ88u9etRBX/NAkAheIrjdcNiaED3keiHrr8jmDSj5xDSM8UHmLEz/QHw3RCYz+ETUFLg3kw84lLoxN5XOAcRhwHRKwwD7k577RqrAkEAhBiGTOIII7Vrzvp7+fdoz3ThxTpkC3S6la2hhTj0PuY0ZVD1TMqhJLwxPUhQQWnaXqE6SJwQD+eGx4BUbMHnAQJBAKomO+rK7ycU9OSRpEbPt2yQskwCcY2fiLgDy0Sy1hWmp/e5Cowt2Uyzp6uk/4QwMkfFApYzWtvjrnRkru19rMw= -----END PRIVATE KEY----- ``` 2. Set up library [postman-util-lib](https://joolfe.github.io/postman-util-lib/) for Postman Add a Postman global variable named `pmlib_code`, and set the value of it as the source code in the [library bundle content](https://joolfe.github.io/postman-util-lib/dist/bundle.js). 3. Configure HTTP headers: add Pre-request scripts to collection or request of Postman Add the following code to the Pre-request script: ```javascript eval(pm.globals.get("pmlib_code")); pm.request.headers.add({ key: "Content-Type", value: "application/json", }); pm.request.headers.add({ key: "X-Tesla-ClientId", value: pm.environment.get("client_id"), }); pm.request.headers.add({ key: "X-Tesla-SignAccessToken", value: pm.environment.get("access_token"), }); const timestamp = new Date().getTime(); let jsonBody = new String(); if (pm.request.body.raw) { jsonBody = pm.request.body.raw; } const dataToSign = jsonBody + timestamp.toString(); const privateKey = pm.environment.get("private_key"); const sha256withRSA = new pmlib.rs.KJUR.crypto.Signature({ alg: "SHA256withRSA" }); sha256withRSA.init(privateKey); sha256withRSA.updateString(dataToSign); const signature = pmlib.rs.hextob64(sha256withRSA.sign()); pm.request.headers.add({ key: "X-Tesla-Signature", value: signature, }); pm.request.headers.add({ key: "X-Tesla-Timestamp", value: timestamp.toString(), }); ``` 4. Everything is ready, feel free to test the API requests! --- ## Document: /products/connect-2.0/basics/2.common-response URL: /en/dev-docs/products/connect-2.0/basics/2.common-response # Common API response | Field | Type | Mandatory | Remarks | | ------- | ------ | --------- | ------------------------------------------------------------------------------------------ | | success | bool | Yes | true means success. | | code | string | Yes | “000000” means success. Other error codes please refer to “[error code](5.error-code.md)”. | | data | object | No | A json object of returned data. | | message | string | No | Error message, please refer to “[error code](5.error-code.md)”. | --- ## Document: /products/connect-2.0/basics/10.restricted-industries URL: /en/dev-docs/products/connect-2.0/basics/10.restricted-industries # Pay Onchain — Restricted / Unsupported Industries Binance Pay Onchain (Connect) cannot support merchants, businesses, products, services and/or use cases involving any of the following restricted industries: - Child sexual abuse material, pornography, adult industry and/or any sale of sexual services; - Arms, ammunition, weapons, military goods and/or related accessories; - Unlicensed financial services and/or any financial services that require licensing, registration or regulatory approval but do not have the required authorization in the relevant territory; - Illegal and/or unlicensed casinos, gaming, betting, gambling and/or other activities related to these industries; - Cryptocurrency exchanges, coin swap services and/or exchange-like services, as determined by Binance in its sole discretion; - Prepaid card, debit card, credit card, card issuing, card top-up, card balance funding and/or other card-related services; - High-risk crypto financial services, as determined by Binance in its sole discretion; - Non-custodial wallets that do not meet the required approved flow, including the required two-way deposit flow requirement; - Payment processors, aggregators, technical service providers and/or sub-merchant models that cannot provide sufficient merchant transparency, restricted industry controls, payer country controls and/or other required compliance controls; - Such other businesses, products, services and/or activities which would be considered illegal, restricted or sensitive in the relevant territory, or that could expose Binance, its affiliates, partners, users or any other party to legal, regulatory, sanctions, compliance or reputational risk, as determined by Binance in its sole discretion. If you require additional information about the specific onboarding requirements of merchants and restrictions applicable to your business, please reach out to [binanceconnect@binance.com](mailto:binanceconnect@binance.com). --- ## Document: /products/connect-2.0/basics/1.common-request-headers URL: /en/dev-docs/products/connect-2.0/basics/1.common-request-headers # Common API request headers | Parameter | Description | Mandatory | Remarks | | ----------------------- | ----------------------------------------------------------------------------------- | --------- | ------------------------------------------------------ | | Content-Type | application/json | Yes | | | X-Tesla-ClientId | Partner (client) id provided by Binance Connect | Yes | | | X-Tesla-SignAccessToken | Access token provided by Binance Connect | Yes | | | X-Tesla-Signature | A signature generated by request body, timestamp and partner (client) private key\* | Yes | Refer to “[API Request signing](3.request-signing.md)” | | X-Tesla-Timestamp | Timestamp in millisecond | Yes | | > \*_The private key and public key are generated by the partner (client). Please refer to > “[API Request signing](3.request-signing.md)” for the generation method._ --- ## Document: /products/common/sapi/quick-start URL: /en/dev-docs/products/common/sapi/quick-start # Quick Start ## API Key Setup - Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/articles/360002502072) regarding API key creation. - Once API key is created, it is recommended to set IP restrictions on the key for security reasons. - **Never share your API key/secret key to ANYONE.** ## API Key Restrictions - After creating the API key, the default restrictions is `Enable Reading`. - To **enable withdrawals via the API**, the API key restriction needs to be modified through the Binance UI. ## Enabling Accounts ### Spot Account A `SPOT` account is provided by default upon creation of a Binance Account. ### Margin Account To enable a `MARGIN` account for Margin Trading, please refer to the [Margin Trading Guide](https://www.binance.vision/tutorials/binance-margin-trading-guide) ## API Library ### Python connector This is a lightweight library that works as a connector to Binance public API, written in Python. [https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python) ### Javascript connector This is a lightweight library that works as a connector to Binance public API, written for JavaScript users. [https://github.com/binance/binance-connector-js](https://github.com/binance/binance-connector-js) ### Ruby connector This is a lightweight library that works as a connector to Binance public API, written for Ruby users. [https://github.com/binance/binance-connector-ruby](https://github.com/binance/binance-connector-ruby) ### DotNET connector This is a lightweight library that works as a connector to Binance public API, written for C# users. [https://github.com/binance/binance-connector-dotnet](https://github.com/binance/binance-connector-dotnet) ### Java connector This is a lightweight library that works as a connector to Binance public API, written for Java users. [https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java) ### Postman Collections There is now a Postman collection containing the API endpoints for quick and easy use. This is recommended for new users who want to get a quick-start into using the API. For more information please refer to this page: [Binance API Postman](https://github.com/binance/binance-api-postman) ### Swagger A YAML file with OpenAPI specification on the RESTful API is available to be used, as well as a Swagger UI page for the consulting. [https://github.com/binance/binance-api-swagger](https://github.com/binance/binance-api-swagger) --- ## Document: /products/common/sapi/general-info URL: /en/dev-docs/products/common/sapi/general-info # General Info ## General API Information - The following base endpoints are available: - **https://api.binance.com** - **https://api-gcp.binance.com** - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** - The last 4 endpoints in the point above (`api1`-`api4`) might give better performance but have less stability. Please use whichever works best for your setup. - All endpoints return either a JSON object or array. - Data is returned in **ascending** order. Oldest first, newest last. - All time and timestamp related fields are in **milliseconds**. ### HTTP Return Codes - HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. - HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP `409` return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.) - HTTP `429` return code is used when breaking a request rate limit. - HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. - HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. ### Error Codes and Messages - If there is an error, the API will return an error with a message of the reason. > The error payload on API and SAPI is as follows: ```json { "code": -1121, "msg": "Invalid symbol." } ``` - Specific error codes and messages defined in [Error Codes](./error-code). ### General Information on Endpoints - For `GET` endpoints, parameters must be sent as a `query string`. - For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. - Parameters may be sent in any order. - If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. --- ## LIMITS ### General Info on Limits - The following `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". - The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. - A 429 will be returned when either request rate limit or order rate limit is violated. ### IP Limits - Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. - When a 429 is received, it's your obligation as an API to back off and not spam the API. - **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** - IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. - A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - **The limits on the API are based on the IPs, not the API keys.** ### Order Rate Limits - Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. - When the order count exceeds the limit, you will receive a 429 error without the `Retry-After` header. Please check the Order Rate Limit rules using `GET api/v3/exchangeInfo` and wait for reactivation accordingly. - Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - **The order rate limit is counted against each account**. - To monitor order count usage, refer to GET `api/v3/rateLimit/order` ### Websocket Limits - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON controlled message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. - There is a limit of **300 connections per attempt every 5 minutes per IP**. ### /api/ and /sapi/ Limit Introduction The `/api/*` and `/sapi/*` endpoints adopt either of two access limiting rules, IP limits or UID (account) limits. - Endpoints related to `/api/*`: - According to the two modes of IP and UID (account) limit, each are independent. - Endpoints share the 6000 per minute limit based on IP. - Responses contain the header `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)`, defining the weight used by the current IP. - Successful order responses contain the header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`, defining the order limit used by the UID. - Endpoints related to `/sapi/*`: - Endpoints are marked according to IP or UID limit and their corresponding weight value. - Each endpoint with IP limits has an independent 12000 per minute limit. - Each endpoint with UID limits has an independent 180000 per minute limit. - Responses from endpoints with IP limits contain the header `X-SAPI-USED-IP-WEIGHT-1M`, defining the weight used by the current IP. - Responses from endpoints with UID limits contain the header `X-SAPI-USED-UID-WEIGHT-1M`, defining the weight used by the current UID. --- ## Data Sources - The API system is asynchronous, so some delay in the response is normal and expected. - Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates. - **Matching Engine** - the data is from the matching Engine - **Memory** - the data is from a server's local or external memory - **Database** - the data is taken directly from a database ## Request Security - Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](#place-new-order-trade)). - If unspecified, the security type is `NONE`. - Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](#user-data-stream-requests). - Secure endpoints require a valid API key to be specified and authenticated. - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. - API keys can be configured to allow access only to certain types of secure endpoints. - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. | Security Type | Description | | ------------- | -------------------------------------------------------- | | NONE | Endpoint can be accessed freely. | | TRADE | Endpoint requires sending a valid API-Key and signature. | | MARGIN | Endpoint requires sending a valid API-Key and signature. | | USER_DATA | Endpoint requires sending a valid API-Key and signature. | | USER_STREAM | Endpoint requires sending a valid API-Key. | | MARKET_DATA | Endpoint requires sending a valid API-Key. | - `TRADE`, `MARGIN` and `USER_DATA` endpoints are `SIGNED` endpoints. ### SIGNED Endpoint security - `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. #### Signature Case Sensitivity - **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. - **RSA:** Signatures generated using RSA are **case-sensitive**. - **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** Please consult [SIGNED request example (HMAC)](#hmac-keys), [SIGNED request example (RSA)](#rsa-keys), and [SIGNED request example (Ed25519)](#ed25519-keys) on how to compute signature, depending on which API key type you are using. ### Timing security - `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](#general-api-information)) - An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. - Maximum `recvWindow` is 60000 milliseconds. - Request processing logic is as follows: ```javascript serverTime = getCurrentTime() if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request } else { // reject request } ``` **Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. **It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** ### SIGNED Endpoint Examples for POST /api/v3/order #### HMAC Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. Example API key and secret key: | Key | Value | | ----------- | ---------------------------------------------------------------- | | `apiKey` | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A | | `secretKey` | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j | **WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** The example keys are provided here only for illustrative purposes. Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | LTCBTC | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | BUY | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.1 | | `recvWindow` | 5000 | | `timestamp` | 1499827319559 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 ``` **Step 2: Compute the signature** 1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. 2. Sign the signature payload constructed in Step 1. 3. Encode the HMAC-SHA-256 output as a hex string. Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. **Example commands** For the first set of example parameters (ASCII only): ```console $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" ``` For the second set of example parameters (some non-ASCII characters) ```console curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" ``` Here is a sample Bash script performing all the steps above: ```bash apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" # Sign the request signature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey") signature=${signature#*= } # Keep only the part after the "= " # Send the request curl -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?$payload&signature=$signature" ``` #### RSA Keys The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. Only `PKCS#8` keys are supported. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. These examples assume the private key is stored in the file `./test-prv-key.pem`. | Key | Value | | -------- | ---------------------------------------------------------------- | | `apiKey` | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ | Example of request with a symbol name comprised entirely of ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | BTCUSDT | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | Example of a request with a symbol name containing non-ASCII characters: | Parameter | Value | | ------------- | ------------- | | `symbol` | 123456 | | `side` | SELL | | `type` | LIMIT | | `timeInForce` | GTC | | `quantity` | 1 | | `price` | 0.2 | | `timestamp` | 1668481559918 | | `recvWindow` | 5000 | **Step 1: Construct the signature payload** 1. Format parameters as `parameter=value` pairs separated by `&`. 2. Percent-encode the string. For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: ```console symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` After percent-encoding, the signature payload should look like this: ```console symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 ``` **Step 2: Compute the signature** 1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function. 2. Encode the output in base64. Note that the payload and the resulting `signature` are **case-sensitive**. For the first set of example parameters (ASCII only): ```console $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== ``` For the second set of example parameters (some non-ASCII characters): ```console $ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n' qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== ``` 3. Percent-encode the base64 string. For the first set of example parameters (ASCII only): ```console HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D ``` For the second set of example parameters (some non-ASCII characters): ```console qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D ``` **Step 3: Add signature to the request** Complete the request by adding the `signature` parameter to the query string. For the first set of example parameters (ASCII only): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' ``` For the second set of example parameters (some non-ASCII characters): ```console curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' ``` Here is a sample Bash script performing all the steps above: ```bash function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos The error JSON payload: ```javascript { "code":-1121, "msg":"Invalid symbol." } ``` Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. ## 10xx - General Server or Network issues ### -1000 UNKNOWN - An unknown error occurred while processing the request. - An unknown error occurred while processing the request.[%s] ### -1001 DISCONNECTED - Internal error; unable to process your request. Please try again. ### -1002 UNAUTHORIZED - You are not authorized to execute this request. ### -1003 TOO_MANY_REQUESTS - Too many requests queued. - Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. - Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. ### -1004 SERVER_BUSY - Server is busy, please wait and try again ### -1006 UNEXPECTED_RESP - An unexpected response was received from the message bus. Execution status unknown. ### -1007 TIMEOUT - Timeout waiting for response from backend server. Send status unknown; execution status unknown. ### -1008 SERVER_BUSY - Spot server is currently overloaded with other requests. Please try again in a few minutes. ### -1014 UNKNOWN_ORDER_COMPOSITION - Unsupported order combination. ### -1015 TOO_MANY_ORDERS - Too many new orders. - Too many new orders; current limit is %s orders per %s. ### -1016 SERVICE_SHUTTING_DOWN - This service is no longer available. ### -1020 UNSUPPORTED_OPERATION - This operation is not supported. ### -1021 INVALID_TIMESTAMP - Timestamp for this request is outside of the recvWindow. - Timestamp for this request was 1000ms ahead of the server's time. ### -1022 INVALID_SIGNATURE - Signature for this request is not valid. ### -1099 Not found, authenticated, or authorized - This replaces error code -1999 ## 11xx - 2xxx Request issues ### -1100 ILLEGAL_CHARS - Illegal characters found in a parameter. - Illegal characters found in a parameter. %s - Illegal characters found in parameter `%s`; legal range is `%s`. ### -1101 TOO_MANY_PARAMETERS - Too many parameters sent for this endpoint. - Too many parameters; expected `%s` and received `%s`. - Duplicate values for a parameter detected. ### -1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED - A mandatory parameter was not sent, was empty/null, or malformed. - Mandatory parameter `%s` was not sent, was empty/null, or malformed. - Param `%s` or `%s` must be sent, but both were empty/null! ### -1103 UNKNOWN_PARAM - An unknown parameter was sent. ### -1104 UNREAD_PARAMETERS - Not all sent parameters were read. - Not all sent parameters were read; read `%s` parameter(s) but was sent `%s`. ### -1105 PARAM_EMPTY - A parameter was empty. - Parameter `%s` was empty. ### -1106 PARAM_NOT_REQUIRED - A parameter was sent when not required. - Parameter `%s` sent when not required. ### -1111 BAD_PRECISION - Precision is over the maximum defined for this asset. ### -1112 NO_DEPTH - No orders on book for symbol. ### -1114 TIF_NOT_REQUIRED - TimeInForce parameter sent when not required. ### -1115 INVALID_TIF - Invalid timeInForce. ### -1116 INVALID_ORDER_TYPE - Invalid orderType. ### -1117 INVALID_SIDE - Invalid side. ### -1118 EMPTY_NEW_CL_ORD_ID - New client order ID was empty. ### -1119 EMPTY_ORG_CL_ORD_ID - Original client order ID was empty. ### -1120 BAD_INTERVAL - Invalid interval. ### -1121 BAD_SYMBOL - Invalid symbol. ### -1125 INVALID_LISTEN_KEY - This listenKey does not exist. ### -1127 MORE_THAN_XX_HOURS - Lookup interval is too big. - More than %s hours between startTime and endTime. ### -1128 OPTIONAL_PARAMS_BAD_COMBO - Combination of optional parameters invalid. ### -1130 INVALID_PARAMETER - Invalid data sent for a parameter. - Data sent for parameter `%s` is not valid. ### -1131 BAD_RECV_WINDOW - recvWindow must be less than 60000 ### -1134 BAD_STRATEGY_TYPE - `strategyType` was less than 1000000. #### -1145 INVALID_CANCEL_RESTRICTIONS - `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. #### -1151 DUPLICATE_SYMBOLS - Symbol is present multiple times in the list. ### -2010 NEW_ORDER_REJECTED - NEW_ORDER_REJECTED ### -2011 CANCEL_REJECTED - CANCEL_REJECTED ### -2013 NO_SUCH_ORDER - Order does not exist. ### -2014 BAD_API_KEY_FMT - API-key format invalid. ### -2015 REJECTED_MBX_KEY - Invalid API-key, IP, or permissions for action. ### -2016 NO_TRADING_WINDOW - No trading window could be found for the symbol. Try ticker/24hrs instead. #### -2026 ORDER_ARCHIVED - Order was canceled or expired with no executed qty over 90 days ago and has been archived. ## 3xxx-5xxx SAPI-specific issues ### -3000 INNER_FAILURE - Internal server error. ### -3001 NEED_ENABLE_2FA - Please enable 2FA first. ### -3002 ASSET_DEFICIENCY - We don't have this asset. ### -3003 NO_OPENED_MARGIN_ACCOUNT - Margin account does not exist. ### -3004 TRADE_NOT_ALLOWED - Trade not allowed. ### -3005 TRANSFER_OUT_NOT_ALLOWED - Transferring out not allowed. ### -3006 EXCEED_MAX_BORROWABLE - Your borrow amount has exceed maximum borrow amount. ### -3007 HAS_PENDING_TRANSACTION - You have pending transaction, please try again later. ### -3008 BORROW_NOT_ALLOWED - Borrow not allowed. ### -3009 ASSET_NOT_MORTGAGEABLE - This asset are not allowed to transfer into margin account currently. ### -3010 REPAY_NOT_ALLOWED - Repay not allowed. ### -3011 BAD_DATE_RANGE - Your input date is invalid. ### -3012 ASSET_ADMIN_BAN_BORROW - Borrow is banned for this asset. ### -3013 LT_MIN_BORROWABLE - Borrow amount less than minimum borrow amount. ### -3014 ACCOUNT_BAN_BORROW - Borrow is banned for this account. ### -3015 REPAY_EXCEED_LIABILITY - Repay amount exceeds borrow amount. ### -3016 LT_MIN_REPAY - Repay amount less than minimum repay amount. ### -3017 ASSET_ADMIN_BAN_MORTGAGE - This asset are not allowed to transfer into margin account currently. ### -3018 ACCOUNT_BAN_MORTGAGE - Transferring in has been banned for this account. ### -3019 ACCOUNT_BAN_ROLLOUT - Transferring out has been banned for this account. ### -3020 EXCEED_MAX_ROLLOUT - Transfer out amount exceeds max amount. ### -3021 PAIR_ADMIN_BAN_TRADE - Margin account are not allowed to trade this trading pair. ### -3022 ACCOUNT_BAN_TRADE - You account's trading is banned. ### -3023 WARNING_MARGIN_LEVEL - You can't transfer out/place order under current margin level. ### -3024 FEW_LIABILITY_LEFT - The unpaid debt is too small after this repayment. ### -3025 INVALID_EFFECTIVE_TIME - Your input date is invalid. ### -3026 VALIDATION_FAILED - Your input param is invalid. ### -3027 NOT_VALID_MARGIN_ASSET - Not a valid margin asset. ### -3028 NOT_VALID_MARGIN_PAIR - Not a valid margin pair. ### -3029 TRANSFER_FAILED - Transfer failed. ### -3036 ACCOUNT_BAN_REPAY - This account is not allowed to repay. ### -3037 PNL_CLEARING - PNL is clearing. Wait a second. ### -3038 LISTEN_KEY_NOT_FOUND - Listen key not found. ### -3041 BALANCE_NOT_CLEARED - Balance is not enough ### -3042 PRICE_INDEX_NOT_FOUND - PriceIndex not available for this margin pair. ### -3043 TRANSFER_IN_NOT_ALLOWED - Transferring in not allowed. ### -3044 SYSTEM_BUSY - System busy. ### -3045 SYSTEM - The system doesn't have enough asset now. ### -3999 NOT_WHITELIST_USER - This function is only available for invited users. ### -4001 CAPITAL_INVALID - Invalid operation. ### -4002 CAPITAL_IG - Invalid get. ### -4003 CAPITAL_IEV - Your input email is invalid. ### -4004 CAPITAL_UA - You don't login or auth. ### -4005 CAPAITAL_TOO_MANY_REQUEST - Too many new requests. ### -4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT - Support main account only. ### -4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS - Address validation is not passed. ### -4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS - Address tag validation is not passed. ### -4010 CAPITAL_WHITELIST_EMAIL_CONFIRM - White list mail has been confirmed. ### -4011 CAPITAL_WHITELIST_EMAIL_EXPIRED - White list mail is invalid. ### -4012 CAPITAL_WHITELIST_CLOSE - White list is not opened. ### -4013 CAPITAL_WITHDRAW_2FA_VERIFY - 2FA is not opened. ### -4014 CAPITAL_WITHDRAW_LOGIN_DELAY - Withdraw is not allowed within 2 min login. ### -4015 CAPITAL_WITHDRAW_RESTRICTED_MINUTE - Withdraw is limited. ### -4016 CAPITAL_WITHDRAW_RESTRICTED_PASSWORD - Within 24 hours after password modification, withdrawal is prohibited. ### -4017 CAPITAL_WITHDRAW_RESTRICTED_UNBIND_2FA - Within 24 hours after the release of 2FA, withdrawal is prohibited. ### -4018 CAPITAL_WITHDRAW_ASSET_NOT_EXIST - We don't have this asset. ### -4019 CAPITAL_WITHDRAW_ASSET_PROHIBIT - Current asset is not open for withdrawal. ### -4021 CAPITAL_WITHDRAW_AMOUNT_MULTIPLE - Asset withdrawal must be an %s multiple of %s. ### -4022 CAPITAL_WITHDRAW_MIN_AMOUNT - Not less than the minimum pick-up quantity %s. ### -4023 CAPITAL_WITHDRAW_MAX_AMOUNT - Within 24 hours, the withdrawal exceeds the maximum amount. ### -4024 CAPITAL_WITHDRAW_USER_NO_ASSET - You don't have this asset. ### -4025 CAPITAL_WITHDRAW_USER_ASSET_LESS_THAN_ZERO - The number of hold asset is less than zero. ### -4026 CAPITAL_WITHDRAW_USER_ASSET_NOT_ENOUGH - You have insufficient balance. ### -4027 CAPITAL_WITHDRAW_GET_TRAN_ID_FAILURE - Failed to obtain tranId. ### -4028 CAPITAL_WITHDRAW_MORE_THAN_FEE - The amount of withdrawal must be greater than the Commission. ### -4029 CAPITAL_WITHDRAW_NOT_EXIST - The withdrawal record does not exist. ### -4030 CAPITAL_WITHDRAW_CONFIRM_SUCCESS - Confirmation of successful asset withdrawal. ### -4031 CAPITAL_WITHDRAW_CANCEL_FAILURE - Cancellation failed. ### -4032 CAPITAL_WITHDRAW_CHECKSUM_VERIFY_FAILURE - Withdraw verification exception. ### -4033 CAPITAL_WITHDRAW_ILLEGAL_ADDRESS - Illegal address. ### -4034 CAPITAL_WITHDRAW_ADDRESS_CHEAT - The address is suspected of fake. ### -4035 CAPITAL_WITHDRAW_NOT_WHITE_ADDRESS - This address is not on the whitelist. Please join and try again. ### -4036 CAPITAL_WITHDRAW_NEW_ADDRESS - The new address needs to be withdrawn in {0} hours. ### -4037 CAPITAL_WITHDRAW_RESEND_EMAIL_FAIL - Re-sending Mail failed. ### -4038 CAPITAL_WITHDRAW_RESEND_EMAIL_TIME_OUT - Please try again in 5 minutes. ### -4039 CAPITAL_USER_EMPTY - The user does not exist. ### -4040 CAPITAL_NO_CHARGE - This address not charged. ### -4041 CAPITAL_MINUTE_TOO_SMALL - Please try again in one minute. ### -4042 CAPITAL_CHARGE_NOT_RESET - This asset cannot get deposit address again. ### -4043 CAPITAL_ADDRESS_TOO_MUCH - More than 100 recharge addresses were used in 24 hours. ### -4044 CAPITAL_BLACKLIST_COUNTRY_GET_ADDRESS - This is a blacklist country. ### -4045 CAPITAL_GET_ASSET_ERROR - Failure to acquire assets. ### -4046 CAPITAL_AGREEMENT_NOT_CONFIRMED - Agreement not confirmed. ### -4047 CAPITAL_DATE_INTERVAL_LIMIT - Time interval must be within 0-90 days ### -4060 CAPITAL_WITHDRAW_USER_ASSET_LOCK_DEPOSIT - As your deposit has not reached the required block confirmations, we have temporarily locked {0} asset ### -4106 TAG_NOT_SUPPORTED_FOR_NETWORK - This network does not support memo/tag. Please remove the `addressTag` field and try again. ### -5001 ASSET_DRIBBLET_CONVERT_SWITCH_OFF - Don't allow transfer to micro assets. ### -5002 ASSET_ASSET_NOT_ENOUGH - You have insufficient balance. ### -5003 ASSET_USER_HAVE_NO_ASSET - You don't have this asset. ### -5004 USER_OUT_OF_TRANSFER_FLOAT - The residual balances have exceeded 0.001BTC, Please re-choose. - The residual balances of %s have exceeded 0.001BTC, Please re-choose. ### -5005 USER_ASSET_AMOUNT_IS_TOO_LOW - The residual balances of the BTC is too low - The residual balances of %s is too low, Please re-choose. ### -5006 USER_CAN_NOT_REQUEST_IN_24_HOURS - Only transfer once in 24 hours. ### -5007 AMOUNT_OVER_ZERO - Quantity must be greater than zero. ### -5008 ASSET_WITHDRAW_WITHDRAWING_NOT_ENOUGH - Insufficient amount of returnable assets. ### -5009 PRODUCT_NOT_EXIST - Product does not exist. ### -5010 TRANSFER_FAIL - Asset transfer fail. ### -5011 FUTURE_ACCT_NOT_EXIST - future account not exists. ### -5012 TRANSFER_PENDING - Asset transfer is in pending. ### -5021 PARENT_SUB_HAVE_NO_RELATION - This parent sub have no relation ### -5012 FUTURE_ACCT_OR_SUBRELATION_NOT_EXIST - future account or sub relation not exists. ## 6XXX - Savings Issues ### -6001 DAILY_PRODUCT_NOT_EXIST - Daily product not exists. ### -6003 DAILY_PRODUCT_NOT_ACCESSIBLE - Product not exist or you don't have permission ### -6004 DAILY_PRODUCT_NOT_PURCHASABLE - Product not in purchase status ### -6005 DAILY_LOWER_THAN_MIN_PURCHASE_LIMIT - Smaller than min purchase limit ### -6006 DAILY_REDEEM_AMOUNT_ERROR - Redeem amount error ### -6007 DAILY_REDEEM_TIME_ERROR - Not in redeem time ### -6008 DAILY_PRODUCT_NOT_REDEEMABLE - Product not in redeem status ### -6009 REQUEST_FREQUENCY_TOO_HIGH - Request frequency too high ### -6011 EXCEEDED_USER_PURCHASE_LIMIT - Exceeding the maximum num allowed to purchase per user ### -6012 BALANCE_NOT_ENOUGH - Balance not enough ### -6013 PURCHASING_FAILED - Purchasing failed ### -6014 UPDATE_FAILED - Exceed up-limit allowed to purchased ### -6015 EMPTY_REQUEST_BODY - Empty request body ### -6016 PARAMS_ERR - Parameter err ### -6017 NOT_IN_WHITELIST - Not in whitelist ### -6018 ASSET_NOT_ENOUGH - Asset not enough ### -6019 PENDING - Need confirm ### -6020 PROJECT_NOT_EXISTS - Project not exists ## 70xx - Futures ### -7001 FUTURES_BAD_DATE_RANGE - Date range is not supported. ### -7002 FUTURES_BAD_TYPE - Data request type is not supported. ## 20xxx - Futures/Spot Algo ### -20121 - Invalid symbol. ### -20124 - Invalid algo id or it has been completed. ### -20130 - Invalid data sent for a parameter. ### -20132 - The client algo id is duplicated. ### -20194 - Duration is too short to execute all required quantity. ### -20195 - The total size is too small. ### -20196 - The total size is too large. ### -20198 - Reach the max open orders allowed. ### -20204 - The notional of USD is less or more than the limit. ## Filter failures | Error message | Description | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | "Filter failure: PRICE_FILTER" | `price` is too high, too low, and/or not following the tick size rule for the symbol. | | "Filter failure: PERCENT_PRICE" | `price` is X% too high or X% too low from the average weighted price over the last Y minutes. | | "Filter failure: PERCENT_PRICE_BY_SIDE" | `price` is X% too high or Y% too low from the `lastPrice` on that side (i.e. BUY/SELL) | | "Filter failure: LOT_SIZE" | `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MIN_NOTIONAL" | `price` \* `quantity` is too low to be a valid order for the symbol. | | "Filter failure: ICEBERG_PARTS" | `ICEBERG` order would break into too many parts; icebergQty is too small. | | "Filter failure: MARKET_LOT_SIZE" | `MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. | | "Filter failure: MAX_POSITION" | The account's position has reached the maximum defined limit.

This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY`orders. | | "Filter failure: MAX_NUM_ORDERS" | Account has too many open orders on the symbol. | | "Filter failure: MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the symbol. | | "Filter failure: MAX_NUM_ICEBERG_ORDERS" | Account has too many open iceberg orders on the symbol. | | "Filter failure: TRAILING_DELTA" | `trailingDelta` is not within the defined range of the filter for that order type. | | "Filter failure: EXCHANGE_MAX_NUM_ORDERS" | Account has too many open orders on the exchange. | | "Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS" | Account has too many open stop loss and/or take profit orders on the exchange. | ## 10xxx - Crypto Loans ### -10001 SYSTEM_MAINTENANCE - The system is under maintenance, please try again later. ### -10002 INVALID_INPUT - Invalid input parameters. ### -10005 NO_RECORDS - No records found. ### -10007 COIN_NOT_LOANABLE - This coin is not loanable. ### -10008 COIN_NOT_LOANABLE - This coin is not loanable ### -10009 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10010 COIN_NOT_COLLATERAL - This coin can not be used as collateral. ### -10011 INSUFFICIENT_ASSET - Insufficient spot assets. ### -10012 INVALID_AMOUNT - Invalid repayment amount. ### -10013 INSUFFICIENT_AMOUNT - Insufficient collateral amount. ### -10015 DEDUCTION_FAILED - Collateral deduction failed. ### -10016 LOAN_FAILED - Failed to provide loan. ### -10017 REPAY_EXCEED_DEBT - Repayment amount exceeds debt. ### -10018 INVALID_AMOUNT - Invalid repayment amount. ### -10019 CONFIG_NOT_EXIST - Configuration does not exists. ### -10020 UID_NOT_EXIST - User ID does not exist. ### -10021 ORDER_NOT_EXIST - Order does not exist. ### -10022 INVALID_AMOUNT - Invalid adjustment amount. ### -10023 ADJUST_LTV_FAILED - Failed to adjust LTV. ### -10024 ADJUST_LTV_NOT_SUPPORTED - LTV adjustment not supported. ### -10025 REPAY_FAILED - Repayment failed. ### -10026 INVALID_PARAMETER - Invalid parameter. ### -10028 INVALID_PARAMETER - Invalid parameter. ### -10029 AMOUNT_TOO_SMALL - Loan amount is too small. ### -10030 AMOUNT_TOO_LARGE - Loan amount is too much. ### -10031 QUOTA_REACHED - Individual loan quota reached. ### -10032 REPAY_NOT_AVAILABLE - Repayment is temporarily unavailable. ### -10034 REPAY_NOT_AVAILABLE - Repay with collateral is not available currently, please try to repay with borrowed coin. ### -10039 AMOUNT_TOO_SMALL - Repayment amount is too small. ### -10040 AMOUNT_TOO_LARGE - Repayment amount is too large. ### -10041 INSUFFICIENT_AMOUNT - Due to high demand, there are currently insufficient loanable assets for {0}. Please adjust your borrow amount or try again tomorrow. ### -10042 ASSET_NOT_SUPPORTED - asset %s is not supported ### -10043 ASSET_NOT_SUPPORTED - {0} borrowing is currently not supported. ### -10044 QUOTA_REACHED - Collateral amount has reached the limit. Please reduce your collateral amount or try with other collaterals. ### -10045 COLLTERAL_REPAY_NOT_SUPPORTED - The loan coin does not support collateral repayment. Please try again later. ### -10046 EXCEED_MAX_ADJUSTMENT - Collateral Adjustment exceeds the maximum limit. Please try again. ### -10047 REGION_NOT_SUPPORTED - This coin is currently not supported in your location due to local regulations. ## 13xxx - BLVT ### -13000 BLVT_FORBID_REDEEM - Redeption of the token is forbiden now ### -13001 BLVT_EXCEED_DAILY_LIMIT - Exceeds individual 24h redemption limit of the token ### -13002 BLVT_EXCEED_TOKEN_DAILY_LIMIT - Exceeds total 24h redemption limit of the token ### -13003 BLVT_FORBID_PURCHASE - Subscription of the token is forbiden now ### -13004 BLVT_EXCEED_DAILY_PURCHASE_LIMIT - Exceeds individual 24h subscription limit of the token ### -13005 BLVT_EXCEED_TOKEN_DAILY_PURCHASE_LIMIT - Exceeds total 24h subscription limit of the token ### -13006 BLVT_PURCHASE_LESS_MIN_AMOUNT - Subscription amount is too small ### -13007 BLVT_PURCHASE_AGREEMENT_NOT_SIGN - The Agreement is not signed ## 12xxx - Liquid Swap ### -12014 TOO MANY REQUESTS - More than 1 request in 2 seconds ## 18xxx - Binance Code ### -18002 - The total amount of codes you created has exceeded the 24-hour limit, please try again after UTC 0 ### -18003 - Too many codes created in 24 hours, please try again after UTC 0 ### -18004 - Too many invalid redeem attempts in 24 hours, please try again after UTC 0 ### -18005 - Too many invalid verify attempts, please try later ### -18006 - The amount is too small, please re-enter ### -18007 - This token is not currently supported, please re-enter ## 21xxx - Portfolio Margin Account ### -21001 USER_IS_NOT_UNIACCOUNT - Request ID is not a Portfolio Margin Account. ### -21002 UNI_ACCOUNT_CANT_TRANSFER_FUTURE - Portfolio Margin Account doesn't support transfer from margin to futures. ### -21003 NET_ASSET_MUST_LTE_RATIO - Fail to retrieve margin assets. ### -21004 USER_NO_LIABILITY - User doesn’t have portfolio margin bankruptcy loan ### -21005 NO_ENOUGH_ASSET - User’s spot wallet doesn’t have enough BUSD to repay portfolio margin bankruptcy loan ### -21006 HAD_IN_PROCESS_REPAY - User had portfolio margin bankruptcy loan repayment in process ### -21007 IN_FORCE_LIQUIDATION - User failed to repay portfolio margin bankruptcy loan since liquidation was in process ## Order Rejection Issues Error messages like these are indicated when the error is coming specifically from the matching engine: - `-1010 ERROR_MSG_RECEIVED` - `-2010 NEW_ORDER_REJECTED` - `-2011 CANCEL_REJECTED` The following messages which will indicate the specific error: | Error message | Description | | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | "Unknown order sent." | The order (by either `orderId`, `clientOrderId`, `origClientOrderId`) could not be found. | | "Duplicate order sent." | The `clientOrderId` is already in use. | | "Market is closed." | The symbol is not trading. | | "Account has insufficient balance for requested action." | Not enough funds to complete the action. | | "Market orders are not supported for this symbol." | `MARKET` is not enabled on the symbol. | | "Iceberg orders are not supported for this symbol." | `icebergQty` is not enabled on the symbol | | "Stop loss orders are not supported for this symbol." | `STOP_LOSS` is not enabled on the symbol | | "Stop loss limit orders are not supported for this symbol." | `STOP_LOSS_LIMIT` is not enabled on the symbol | | "Take profit orders are not supported for this symbol." | `TAKE_PROFIT` is not enabled on the symbol | | "Take profit limit orders are not supported for this symbol." | `TAKE_PROFIT_LIMIT` is not enabled on the symbol | | "Price \* QTY is zero or less." | `price` \* `quantity` is too low | | "IcebergQty exceeds QTY." | `icebergQty` must be less than the order quantity | | "This action is disabled on this account." | Contact customer support; some actions have been disabled on the account. | | "This account may not place or cancel orders." | Contact customer support; the account has trading ability disabled. | | "Unsupported order combination" | The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. | | "Order would trigger immediately." | The order's stop price is not valid when compared to the last traded price. | | "Cancel order is invalid. Check origClientOrderId and orderId." | No `origClientOrderId` or `orderId` was sent in. | | "Order would immediately match and take." | `LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. | | "The relationship of the prices for the orders is not correct." | The prices set in the `OCO` is breaking the Price rules.

The rules are:

`SELL Orders`: Limit Price > Last Price > Stop Price

`BUY Orders`: Limit Price < Last Price < Stop Price | | "OCO orders are not supported for this symbol" | `OCO` is not enabled on the symbol. | | "Quote order qty market orders are not support for this symbol." | `MARKET` orders using the parameter `quoteOrderQty` are not enabled on this symbol. | | "Trailing stop orders are not supported for this symbol." | Orders using `trailingDelta` are not enabled on the symbol. | | "Order cancel-replace is not supported for this symbol." | `POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is on enabled the symbol. | | "This symbol is not permitted for this account." | Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) | | "This symbol is restricted for this account." | Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) | | "Order was not canceled due to cancel restrictions." | Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW`
or
`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. | ## Errors regarding POST /api/v3/order/cancelReplace ### -2021 Order cancel-replace partially failed This code is sent when either the cancellation of the order failed or the new order placement failed but not both. ### -2022 Order cancel-replace failed. This code is sent when both the cancellation of the order failed and the new order placement failed. --- ## Document: /products/common/sapi/contact-us URL: /en/dev-docs/products/common/sapi/contact-us # Contact Us - [Binance API Telegram Group](https://t.me/binance_api_english) - For any questions in sudden drop in performance with the API and/or Websockets. - For any general questions about the API not covered in the documentation. - [Binance Developers](https://dev.binance.vision/) - For any questions on your code implementation with the API and/or Websockets. - [Binance Customer Support](https://www.binance.com/en/support-center) - For cases such as missing funds, help with 2FA, etc. --- ## Document: /products/common/sapi/change-log URL: /en/dev-docs/products/common/sapi/change-log # Change Log ## 2023-05-26 **Notice:** The change below are being rolled out, and will take approximately a week to complete. - The following base endpoints may give better performance but have less stability than **https://api.binance.com**: - **https://api1.binance.com** - **https://api2.binance.com** - **https://api3.binance.com** - **https://api4.binance.com** --- ## 2023-05-24 - **The previous market data URLs have been deprecated. Please update your code immediately to prevent interruption of our services.** - API Market data from `data.binance.com` can now be accessed from `data-api.binance.vision`. - Websocket Market Data from `data-stream.binance.com` can now be accessed from `data-stream.binance.vision`. - New endpoints for Classic Portfolio Margin: - `POST /sapi/v1/portfolio/auto-collection`: classic portfolio Margin fund collection - `POST /sapi/v1/portfolio/bnb-transfer`: classic portfolio margin BNB transfer - `GET /sapi/v1/portfolio/interest-rate` has be deprecated, users can query the Classic Portfolio Margin Negative Balance Interest Rate by using `GET /sapi/v1/margin/interestRateHistory`. --- ## 2023-05-18 - New endpoints for Wallet: - `POST /sapi/v1/capital/deposit/credit-apply`: apply deposit credit for expired address --- ## 2023-05-09 - New endpoints for Portfolio Margin: - `GET /sapi/v1/portfolio/asset-index-price`: query portfolio margin asset index price - Update endpoints for Wallet: - `POST /sapi/v1/asset/transfer`: add enum `MAIN_PORTFOLIO_MARGIN` and `PORTFOLIO_MARGIN_MAIN` --- ## 2023-04-20 - New endpoints for Sub-Account: - `GET /sapi/v1/managed-subaccount/deposit/address`: get managed sub-account deposit address - Update endpoints for VIP Loans: - `GET /sapi/v1/loan/vip/ongoing/orders`: add fields `totalCollateralValueAfterHaircut` and `lockedCollateralValue` --- ## 2023-04-18 - New endpoints for Spot Algo: - `POST /sapi/v1/algo/spot/newOrderTwap` to support new order - `DELETE /sapi/v1/algo/spot/order` to support cancel Algo order - `GET /sapi/v1/algo/spot/openOrders` to support query Algo open orders - `GET /sapi/v1/algo/spot/historicalOrders` to support query Algo historical orders - `GET /sapi/v1/algo/spot/subOrders` to support query Algo sub orders for a specified algoId --- ## 2023-03-23 - Update endpoints for Sub-Account: - `GET /sapi/v1/managed-subaccount/queryTransLogForInvestor`: Add response field `tranId` - `GET /sapi/v1/managed-subaccount/queryTransLogForTradeParent`: Add response field `tranId` - New endpoints for Sub-Account: - `GET /sapi/v1/managed-subaccount/info`: query investor's managed sub-account list - `GET /sapi/v1/sub-account/transaction-statistics`: Query sub-account transaction tatistics --- ## 2023-03-13 **Notice:** All changes are being rolled out gradually to all our servers, and may take a week to complete. GENERAL CHANGES - The error messages for certain issues have been improved for easier troubleshooting.
Situation Old Error Message New Error Message
An account cannot place or cancel an order, due to trading ability disabled. This action is disabled on this account. This account may not place or cancel orders.
When the permissions configured on the symbol do not match the permissions on the account. This symbol is not permitted for this account.
When the account tries to place an order on a symbol it has no permissions for. This symbol is restricted for this account.
Placing an order when symbol is not TRADING. Unsupported order combination. This order type is not possible in this trading phase.
Placing an order with timeinForce=IOC or FOK on a trading phase that does not support it. Limit orders require GTC for this phase.
- Fixed error message for querying archived orders: - Previously, If an archived order (i.e. order with status `CANCELED` or `EXPIRED` where `executedQty` == 0 that occurred more than 90 days in the past.) is queried, the error message would be: - `{"code": -2013,"msg": "Order does not exist."}` - Now, the error message is: - `{"code": -2026,"msg": "Order was canceled or expired with no executed qty over 90 days ago and has been archived."}` - Behavior for API requests with `startTime` and `endTime`: - Previously some requests failed if the `startTime` == `endTime`. - Now, all API requests that accept `startTime` and `endTime` allow the parameters to be equal. This applies to the following requests: - Rest API - `GET /api/v3/aggTrades` - `GET /api/v3/klines` - `GET /api/v3/allOrderList` - `GET /api/v3/allOrders` - `GET /api/v3/myTrades` The following changes will take effect **approximately a week from the release date**, but the rest of the documentation has been updated to reflect the future changes: - Changes to Filter Evaluation: - Previous behavior: `LOT_SIZE` and `MARKET_LOT_SIZE` required that (`quantity` - `minQty`) % `stepSize` == 0. - New behavior: This has now been changed to (`quantity` % `stepSize`) == 0. - Bug fix with reverse `MARKET` orders (i.e., `MARKET` using `quoteOrderQty`): - Previous behavior: Reverse market orders would always have the status `FILLED` even if the order did not fully fill due to low liquidity. - New behavior: If the reverse market order did not fully fill due to low liquidity the order status will be `EXPIRED`, and `FILLED` only if the order was completely filled. SPOT API - Changes to `DELETE /api/v3/order` and `POST /api/v3/order/cancelReplace`: - A new optional parameter `cancelRestrictions` that determines whether the cancel will succeed if the order status is `NEW` or `PARTIALLY_FILLED`. - If the order cancellation fails due to `cancelRestrictions`, the error will be: - `{"code": -2011,"msg": "Order was not canceled due to cancel restrictions."}` --- ## 2023-02-27 - New endpoints for Margin: - `/sapi/v1/margin/next-hourly-interest-rate`: Get user the next hourly estimate interest - New endpoints for Porfolio Margin: - `GET /sapi/v1/portfolio/interest-history`: get user's portfolio margin interest history - `GET /sapi/v1/portfolio/interest-rate`: get portfolio margin interest rate --- ## 2023-02-21 - Adjusted endpoints for Crypto Loan: - `POST /sapi/v1/loan/borrow`: paramater `loanTerm` is restricted to 7 or 30 --- ## 2023-02-17 The Websocket Stream now only allows 300 connections requests every 5 minutes. This limit is **per IP address**. Please be careful when trying to open multiple connections or reconnecting to the Websocket API. --- ## 2023-02-13 - New endpoints for Sub-Account: - `GET /sapi/v4/sub-account/assets`: Fetch sub-account assets --- ## 2023-02-02 - New endpoints for Margin: - `GET /sapi/v1/margin/exchange-small-liability`: Query the coins which can be small liability exchange - `POST /sapi/v1/margin/exchange-small-liability`: Cross Margin Small Liability Exchange - `GET /sapi/v1/margin/exchange-small-liability-history`: Get Small liability Exchange History - Update endpoints for Wallet: - Universal Transfer `POST /sapi/v1/asset/transfer` support option transfer --- ## 2023-01-26 As per the [announcement](https://www.binance.com/en/support/announcement/binance-spot-launches-self-trade-prevention-stp-function-on-api-312fd0112fb44635b397c116e56d8f84), Self Trade Prevention will be enabled at **2023-01-26 08:00 UTC**. Please refer to `GET /api/v3/exchangeInfo` from the Rest API or `exchangeInfo` from the Websocket API on the default and allowed modes. --- ## 2023-01-23 New API cluster has been added. Note that all endpoints are functionally equal, but may vary in performance. - https://api4.binance.com --- ## 2023-01-19 **ACTUAL RELEASE DATE TBD** SPOT API **New Feature**: Self-Trade Prevention (aka STP) will be added to the system at a later date. This will prevent orders from matching with orders from the same account, or accounts under the same `tradeGroupId`. Please refer to `GET /api/v3/exchangeInfo` from the SPOT API or `exchangeInfo` from the Websocket API on the status. ```javascript "defaultSelfTradePreventionMode": "NONE", //If selfTradePreventionMode not provided, this will be the value passed to the engine "allowedSelfTradePreventionModes": [ //What the allowed modes of selfTradePrevention are "NONE", "EXPIRE_TAKER", "EXPIRE_BOTH", "EXPIRE_MAKER" ] ``` - New order status: `EXPIRED_IN_MATCH` - This means that the order expired due to STP being triggered. - New endpoint: - `GET /api/v3/myPreventedMatches` - This queries the orders that expired due to STP being triggered. - New optional parameter `selfTradePreventionMode` has been added to the following endpoints: - `POST /api/v3/order` - `POST /api/v3/order/oco` - `POST /api/v3/cancelReplace` - New responses that will appear for all order placement endpoints if there was a prevented match (i.e. if an order could have matched with an order of the same account, or the accounts are in the same `tradeGroupId`): - `tradeGroupId` - This will only appear if account is configured to a `tradeGroupId` and if there was a prevented match. - `preventedQuantity` - Only appears if there was a prevented match. - An array `preventedMatches` with the following fields: - `preventedMatchId` - `makerOrderId` - `price` - `takerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_TAKER` or `EXPIRE_BOTH`. - `makerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_MAKER` or `EXPIRE_BOTH`. - New fields `preventedMatchId` and `preventedQuantity` that can appear in the order query endpoints if the order had expired due to an STP trigger: - `GET /api/v3/order` - `GET /api/v3/openOrders` - `GET /api/v3/allOrders` USER DATA STREAM - New execution Type: `TRADE_PREVENTION` - New fields for `executionReport` (These fields will only appear if the order has expired due to STP trigger) - `u` - `tradeGroupId` - `v` - `preventedMatchId` - `U` - `counterOrderId` - `A` - `preventedQuantity` - `B` - `lastPreventedQuantity` --- ## 2023-01-13 - The following endpoints will be discontinued on January 13, 2023 6:00 AM UTC: - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction` to support master account enable and disable IP restriction for a sub-account API Key - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList` to support master account add IP list for a sub-account API Key - New endpoints for Sub-Account: - `GET /sapi/v1/managed-subaccount/fetch-future-asset`: Investor can use this api to query managed sub account futures asset details - `GET /sapi/v1/managed-subaccount/marginAsset`: Investor can use this api to query managed sub account margin asset details - New endpoin for Margin: - `GET /sapi/v1/margin/crossMarginCollateralRatio`: Get cross margin collateral ratio --- ## 2023-01-05 - New endpoints for Sub-Account: - `GET /sapi/v1/managed-subaccount/queryTransLogForInvestor`: Investor can use this api to query managed sub account transfer log - `GET /sapi/v1/managed-subaccount/queryTransLogForTradeParent`: Trading team can use this api to query managed sub account transfer log --- ## 2022-12-26 - New endpoints for wallet: - `GET /sapi/v1/capital/contract/convertible-coins`: Get a user's auto-conversion settings in deposit/withdrawal - `POST /sapi/v1/capital/contract/convertible-coins`: User can use it to turn on or turn off the BUSD auto-conversion from/to a specific stable coin. --- ## 2022-12-15 - New RSA signature - Documentation has been updated to show how to sign a request using an RSA key. - For security reasons, we recommend to use RSA keys instead of HMAC keys when generating an API key. - We accept `PKCS#8` (BEGIN PUBLIC KEY). - More details on how to upload your RSA public key will be added at a later date. --- ## 2022-12-13 REST API Some error messages on error code `-1003` have changed: - Previous error message: `Too much request weight used; current limit is %s request weight per %s %s. Please use the websocket for live updates to avoid polling the API.` has been updated to: `Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API.` - Previous error message `Way too much request weight used; IP banned until %s. Please use the websocket for live updates to avoid bans.` has been updated to: `Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans.` --- ## 2022-12-05 **Notice:** These changes are being rolled out gradually to all our servers, and will take approximately a week to complete. WEBSOCKET - `!bookTicker` will be removed by **December 7, 2022**. Please use the Individual Book Ticker Streams instead. (<symbol>@bookTicker). - Multiple <symbol>@bookTicker streams can be subscribed to over one connection. (E.g. `wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/bnbbtc@bookTicker`) SPOT API - New error code `-1135` - This error code will occur if a parameter requiring a JSON object is invalid. - New error code `-1108` - This error will occur if a value to a parameter being sent was too large, potentially causing overflow. - This error code can occur in the following endpoints: - `POST /api/v3/order` - `POST /api/v3/order/cancelReplace` - `POST /api/v3/order/oco` - Changes to `GET /api/v3/aggTrades` - Previous behavior: `startTime` and `endTime` had to be used in combination and could only be an hour apart. - New behavior: `startTime` and `endTime` can be used individually and the 1 hour limit has been removed. - When using `startTime` only, this will return trades from that time, up to the `limit` provided. - When using `endTime` only, this will return trades starting from the `endTime` including all trades before that time, up to the limit provided. - If `limit` not provided, regardless of used in combination or sent individually, the endpoint will use the default limit. - Changes to `GET /api/v3/myTrades` - Fixed a bug where `symbol` + `orderId` combination would return all trades even if the number of trades went beyond the `500` default limit. - Previous behavior: The API would send specific error messages depending on the combination of parameters sent. E.g: ` { "code": -1106, "msg": "Parameter X was sent when not required." } ` - New behavior: If the combinations of optional parameters to the endpoint were not supported, then the endpoint will respond with the generic error: ` { "code": -1128, "msg": "Combination of optional parameters invalid." } ` - Added a new combination of supported parameters: `symbol` + `orderId` + `fromId`. - The following combinations of parameters were previously supported but no longer accepted, as these combinations were only taking `fromId` into consideration, ignoring `startTime` and `endTime`: - `symbol` + `fromId` + `startTime` - `symbol` + `fromId` + `endTime` - `symbol` + `fromId` + `startTime` + `endTime` - Thus, these are the supported combinations of parameters: - `symbol` - `symbol` + `orderId` - `symbol` + `startTime` - `symbol` + `endTime` - `symbol` + `fromId` - `symbol` + `startTime` + `endTime` - `symbol`+ `orderId` + `fromId` **Note:** These new fields will appear approximately a week from the release date. - Changes to `GET /api/v3/exchangeInfo` - New fields `defaultSelfTradePreventionMode` and `allowedSelfTradePreventionModes` - Changes to the Order Placement Endpoints/Order Query/Order Cancellation Endpoints: - New field `selfTradePreventionMode` will appear in the response. - Affects the following endpoints: - `POST /api/v3/order` - `POST /api/v3/order/oco` - `POST /api/v3/order/cancelReplace` - `GET /api/v3/order` - `DELETE /api/v3/order` - `DELETE /api/v3/orderList` - Changes to `GET /api/v3/account` - New field `requireSelfTradePrevention` will appear in the response. - New field `workingTime`, indicating when the order started working on the order book, will appear in the following endpoints: - `POST /api/v3/order` - `GET /api/v3/order` - `POST /api/v3/order/cancelReplace` - `POST /api/v3/order/oco` - `GET /api/v3/order` - `GET /api/v3/openOrders` - `GET /api/v3/allOrders` - Field `trailingTime`, indicating the time when the trailing order is active and tracking price changes, will appear for the following order types (`TAKE_PROFIT`, `TAKE_PROFIT_LIMIT`, `STOP_LOSS`, `STOP_LOSS_LIMIT` if `trailingDelta` parameter was provided) for the following endpoints: - `POST /api/v3/order` - `GET /api/v3/order` - `GET /api/v3/openOrders` - `GET /api/v3/allOrders` - `POST /api/v3/order/cancelReplace` - `DELETE /api/v3/order` - Field `commissionRates` will appear in the `GET /api/v3/acccount` response USER DATA STREAM - eventType `executionReport` has new fields - `V` - `selfTradePreventionMode` - `D` - `trailing_time` (Appears if the trailing stop order is active) - `W` - `workingTime` (Appears if `isWorking`=`true`) --- ## 2022-12-02 - Added a new market data base URL `https://data.binance.com`. - Added a new WebSocket URL `wss://data-stream.binance.com`. --- ## 2022-11-29 - New endpoint for VIP Loan: - `GET /sapi/v1/loan/vip/collateral/account: Check Locked Value of VIP Collateral Account --- ## 2022-11-22 - New endpoints for Convert: - `GET /sapi/v1/convert/exchangeInfo`: Query for all convertible token pairs and the tokens’ respective upper/lower limits - `GET /sapi/v1/convert/assetInfo`: Query for supported asset’s precision information - `POST /sapi/v1/convert/getQuote`: Request a quote for the requested token pairs - `POST /sapi/v1/convert/acceptQuote`: Accept the offered quote by quote ID. - `GET /sapi/v1/convert/orderStatus`: Query order status by order ID. --- ## 2022-11-18 - New endpoint for Wallet: - `GET /sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage`: The query of Cloud-Mining payment and refund history - New endpoints for Sub-account: - `GET /sapi/v1/sub-account/apiRestrictions/ipRestriction/thirdPartyList`: To query Sub-Account API key Third Party IP whitelist - `POST /sapi/v2/sub-account/subAccountApi/ipRestriction`: To support master account update IP Restriction for Sub-Account API key --- ## 2022-11-14 - New endpoints for VIP Loan: - `GET /sapi/v1/loan/vip/ongoing/orders`: Get VIP Loan Ongoing Orders - `POST /sapi/v1/loan/vip/repay`: VIP Loan Repay - `GET /sapi/v1/loan/vip/repay/history`: Get VIP Loan Repayment History --- ## 2022-11-02 - Update endpoints for Wallet: - `POST /sapi/v1/capital/withdraw/apply`: Weight changed to Weight(UID): 600 --- ## 2022-11-01 - New endpoints for Crypto Loan: - `GET /sapi/v1/loan/loanable/data`: Get interest rate and borrow limit of loanable assets. The borrow limit is shown in USD value. - `GET /sapi/v1/loan/collateral/data`: Get LTV information and collateral limit of collateral assets. The collateral limit is shown in USD value. - `GET /sapi/v1/loan/repay/collateral/rate`: Get the the rate of collateral coin / loan coin when using collateral repay, the rate will be valid within 8 second. - `POST /sapi/v1/loan/customize/margin_call`: Customize margin call for ongoing orders only. --- ## 2022-10-28 - Update endpoints for Wallet: - `POST /sapi/v1/asset/convert-transfer`: New parameter `accountType` - `POST /sapi/v1/asset/convert-transfer/queryByPage`: request method is changed to `GET`, new parameter `clientTranId` --- ## 2022-10-15 - New endpoints for Binance Code: - `POST /sapi/v1/giftcard/buyCode`: For buying a fixed-value Binance Code. - `GET /sapi/v1/giftcard/buyCode/token-limit`: To verify which tokens are available for you to purchase fixed-value gift cards as mentioned in section 2 and its’ limitation. --- ## 2022-09-30 - Delete endpoints for Futures Cross Collateral: - `POST /sapi/v1/futures/loan/borrow` - `POST /sapi/v1/futures/loan/repay` - `GET /sapi/v1/futures/loan/configs` - `GET /sapi/v2/futures/loan/configs` - `GET /sapi/v1/futures/loan/calcAdjustLevel` - `GET /sapi/v2/futures/loan/calcAdjustLevel` - `GET /sapi/v1/futures/loan/calcMaxAdjustAmount` - `GET /sapi/v2/futures/loan/calcMaxAdjustAmount` - `POST /sapi/v1/futures/loan/adjustCollateral` - `POST /sapi/v2/futures/loan/adjustCollateral` - `GET /sapi/v1/futures/loan/collateralRepayLimit` - `GET /sapi/v1/futures/loan/collateralRepay` - `POST /sapi/v1/futures/loan/collateralRepay` - `GET /sapi/v1/futures/loan/collateralRepayResult` --- ## 2022-09-30 Scheduled changes to the removal of `!bookTicker` around November 2022. - The All Book Tickers stream (`!bookTicker`) is set to be removed in **November 2022** - More details of the actual removal date will be announced at a later time. - Please use the Individual Book Ticker Streams instead. (`@bookTicker`). - Multiple `@bookTicker` streams can be subscribed to over one connection. - Example: wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/bnbbtc@bookTicker --- ## 2022-09-29 - New endpoints for Wallet: - `POST /sapi/v1/asset/convert-transfer`: Convert transfer, convert between BUSD and stablecoins. - `POST /sapi/v1/asset/convert-transfer/queryByPage`: Query convert transfer --- ## 2022-09-22 - Update endpoint for Sub-Account: - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction`: Add new param `thirdParty` - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList`: Add new param `thirdPartyName` - `DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList`: Add new param `thirdPartyName` - Add Rate Limit for following endpoints: - `GET /sapi/v1/bswap/liquidity`: 3/1s per account and per pool - `GET /sapi/v1/bswap/quote`: 3/1s per account and per pool - `POST /sapi/v1/lending/daily/purchase`: 1/3s per account - `POST /sapi/v1/lending/customizedFixed/purchase`: 1/3s per account - `POST /sapi/v1/staking/purchase`: 1/3s per account --- ## 2022-09-16 - New endpoint for Margin: - `GET /sapi/v1/margin/tradeCoeff`: Get personal margin level information --- ## 2022-09-15 - New endpoints for Crypto Loan - `POST /sapi/v1/loan/borrow`: Borrow - Crypto Loan Borrow - `GET /sapi/v1/loan/borrow/history`: Borrow - Get Loan Borrow History - `GET/sapi/v1/loan/ongoing/orders`: Borrow - Get Loan Ongoing Orders - `POST/sapi/v1/loan/repay`: Repay - Crypto Loan Repay - `GET/sapi/v1/loan/repay/history`: Repay - Get Loan Repayment History - `POST/sapi/v1/loan/adjust/ltv`: Adjust LTV - Crypto Loan Adjust LTV - `GET/sapi/v1/loan/ltv/adjustment/history`: Adjust LTV - Get Loan LTV Adjustment History --- ## 2022-09-15 Note that these are rolling changes, so it may take a few days for it to rollout to all our servers. - Changes to `GET /api/v3/exchangeInfo` - New optional parameter `permissions` added to display all symbols with the permissions matching the parameter provided. (eg.`SPOT`, `MARGIN`, `LEVERAGED`) - If not provided, the default value will be `["SPOT","MARGIN", "LEVERAGED"]`. - This means the request `GET /api/v3/exchangeInfo` without any parameters will show all symbols that can be used for `SPOT`,`MARGIN` and/or `LEVERAGED` trading. - To search for symbols that can be traded on other permissions (e.g. `TRD_GRP_004`, etc), then this needs to be searched for explicitly. (e.g.`permissions`=`TRD_GRP_004`) - Cannot be combined with `symbol` or `symbols` --- ## 2022-09-12 - Update endpoint for Sub-account: \* `GET /sapi/v1/sub-account/subAccountApi/ipRestriction`: To support master account query Third party IP list name for a sub account API key --- ## 2022-09-05 - Delete endpoint for Futures: - `GET /sapi/v1/futures/loan/wallet` --- ## 2022-08-23 SPOT API Note that these are rolling changes, so it may take a few days for it to rollout to all our servers. - Changes to `GET /api/v3/ticker` and `GET /api/v3/ticker/24hr` - New optional parameter `type` added - Supported values for parameter `type` are `FULL` and `MINI` - `FULL` is the default value and the response that is currently being returned from the endpoint - `MINI` omits the following fields from the response: `priceChangePercent`, `weightedAvgPrice`, `bidPrice`, `bidQty`, `askPrice`, `askQty`, and `lastQty` - New error code `-1008` - This is sent whenever the servers are overloaded with requests. - This error code only appears for the SPOT API. - New field `brokered` has been added to `GET /api/v3/account` - New endpoint: `GET /api/v3/uiKlines` - New kline interval: `1s` --- ## 2022-08-18 - Update endpoint for Convert: - `GET /sapi/v1/convert/tradeFlow`: Update weight from Weight(IP) 3000 to Weight(UID) 3000. --- ## 2022-08-08 SPOT API - Changes to `POST /api/v3/order` and `POST /api/v3/order/cancelReplace` - New optional field `strategyId` is a parameter used to identify an order as part of a strategy. - New optional field `strategyType` is a parameter used to identify what strategy was running. (E.g. If all the orders are part of spot grid strategy, it can be set to `strategyType=1000000`) - **Note:** `strategyType` cannot be less than `1000000`. - Changes to `POST /api/v3/order/oco` - New optional fields `limitStrategyId`, `limitStrategyType`. `stopStrategyId`, `stopStrategyType` - These are the strategy metadata parameters for both legs of the OCO orders. - `limitStrategyType` and `stopStrategyType` both cannot be less than `1000000`. - Changes to `GET /api/v3/order`, `GET /api/v3/openOrders`, and `GET /api/v3/allOrders` - New fields `strategyId` and `strategyType` will appear in the response JSON for orders that had these fields populated upon order placement. - Changes to `DELETE /api/v3/order` and `DELETE /api/v3/openOrders` - New fields `strategyId` and `strategyType` will appear in the response JSON for cancelled orders that had these fields populated upon order placement. USER DATA STREAM - New fields to eventType `executionReport` - `j` for `strategyId` - `J` for `strategyType` - Note that these fields only appear if these were populated upon order placement. --- ## 2022-08-05 - Update endpoint for Convert: - `GET /sapi/v1/convert/tradeFlow`: Update weight from Weight(IP) 100 to Weight(IP) 3000. --- ## 2022-07-21 - New endpoint for Portfolio Margin: - `GET /sapi/v1/portfolio/pmLoan` Query Portfolio Margin Bankruptcy Loan Record - `POST /sapi/v1/portfolio/repay` Portfolio Margin Bankruptcy Loan Repay --- ## 2022-07-18 - New endpoint for Portfolio Margin: - `GET /sapi/v1/portfolio/collateralRate` to get Portfolio Margin Collateral Rate. --- ## 2022-07-01 - New endpoint for Wallet: - `POST /sapi/v3/asset/getUserAsset` to get user assets. - New endpoint for Margin: - `GET /sapi/v1/margin/dribblet` to query the historical information of user's margin account small-value asset conversion BNB. - Update endpoint for Convert: - `GET /sapi/v1/convert/tradeFlow`: Update weight from 3000 to 100. - Update endpoint for Margin: - `GET /sapi/v1/margin/repay`: Add response field rawAsset. --- ## 2022-06-20 SPOT API: Changes to `GET /api/v3/ticker` - Weight has been reduced from 5 to 2 per symbol, regardless of `windowSize`. - The max number of symbols that can be processed in a request is 100. - If the number of `symbols` sent is more than 100, the error will be as follows: ```json { "code": -1101, "msg": "Too many values sent for parameter 'symbols', maximum allowed up to 100." } ``` - The max Weight(IP) for this endpoint will cap at 100. - I.e. If the request has more than 50 symbols, the Weight will still be 100, regardless of `windowSize`. --- ## 2022-06-15 **Note:** The update is being rolled out over the next few days, so these changes may not be visible right away. - `GET /api/v3/ticker` added - Rolling window price change statistics based on `windowSize` provided. - Contrary to `GET /api/v3/ticker/24hr` the list of symbols cannot be omitted. - If `windowSize` not specified, the value will default to `1d`. - Response is similar to `GET /api/v3/ticker/24hr`, minus the following fields: `prevClosePrice`, `lastQty`, `bidPrice`, `bidQty`, `askPrice`, `askQty` - `POST /api/v3/order/cancelReplace` added - Cancels an existing order and places a new order on the same symbol. - The filters are evaluated **before** the cancel order is placed. - e.g. If the `MAX_NUM_ORDERS` filter is 10, and the total number of open orders on the account is also 10, when using `POST /api/v3/order/cancelReplace` both the cancel order placement and new order will fail because of the filter. - The change is being rolled out in the next few days, thus this feature will be enabled once the upgrade is completed. - `GET /api/v3/exchangeInfo` returns new field `cancelReplaceAllowed` in `symbols` list. - New filter `NOTIONAL` has been added. - Defines the allowed notional value (`price * quantity`) based on a configured `minNotional` and `maxNotional` - New exchange filter `EXCHANGE_MAX_NUM_ICEBERG_ORDERS` has been added. - Defines the limit of open iceberg orders on an account WEBSOCKETS - New symbol ticker streams with 1h and 4h windows: - Individual symbol ticker streams - `@ticker_` - All market ticker streams - `!ticker_@arr` --- ## 2022-06-02 - Update endpoint for Subaccount: - `GET /sapi/v1/sub-account/sub/transfer/history`: fromEmail and toEmail can be master email. --- ## 2022-05-31 - Update endpoint for Fiat: - `GET /sapi/v1/fiat/orders`: Weight changes from UID(3000) to UID(90000) - Update endpoint for Pay: - `GET /sapi/v1/pay/transactions`: Param names changed: startTimestamp -> startTime; endTimestamp -> endTime. --- ## 2022-05-26 - Update endpoint for Fiat: - `GET /sapi/v1/fiat/orders`: Weight changes from IP(1) to UID(3000) - Update info for the following margin account endpoints: The max interval between `startTime` and `endTime` is 30 days.: - `GET /sapi/v1/margin/transfer` - `GET /sapi/v1/margin/loan` - `GET /sapi/v1/margin/repay` - `GET /sapi/v1/margin/isolated/transfer` - `GET /sapi/v1/margin/interestHistory` --- ## 2022-05-23 - Changes to Order Book Depth Levels - Quantities in the Depth levels were returning negative values in situations where they were exceeding the max value, resulting in an overflow. - Going forward depth levels will not overflow, but will be capped at the max value based on the precision of the base asset. This means that the depth level is at max value _or more_. - E.g. If the precision is 8, then the max value for quantity will be at 92,233,720,368.54775807. - When the fix has been applied, a change in the order book at the affected price level is required for the changes to be visible. - What does this affect? - SPOT API - `GET /api/v3/depth` - Websocket Streams - `@depth` - `@depth@100ms` - `@depth` - `@depth@100ms` - Updates to `MAX_POSITION` - If an order's `quantity` can cause the position to overflow, this will now fail the `MAX_POSITION` filter. --- ## 2022-05-19 - Update endpoint for Mining: - `GET /sapi/v1/mining/pub/algoList` and `GET /sapi/v1/mining/pub/coinList`: Need no paramter. - Add error codes (21xxx) for Portfolio Margin Account: -21001, -21002, -21003 --- ## 2022-05-17 SPOT API - Changes to `GET api/v3/aggTrades` - When providing `startTime` and `endTime`, the oldest items are returned. - Changed error messaging on `GET /api/v3/myTrades` where parameter `symbol` is not provided: ```json { "code": -1102, "msg": "Mandatory parameter 'symbol' was not sent, was empty/null, or malformed." } ``` - The following endpoints now support multi-symbol querying using the parameter `symbols`. - `GET /api/v3/ticker/24hr` - `GET /api/v3/ticker/price` - `GET /api/v3/ticker/bookTicker` - In the above, the request weight will depend on the number of symbols provided in `symbols`.

Please refer to the table below: | Endpoint | Number of Symbols | Weight | | ------------------------------- | ----------------- | ------ | | `GET /api/v3/ticker/price` | Any | 2 | | `GET /api/v3/ticker/bookTicker` | Any | 2 | | `GET /api/v3/ticker/24hr` | 1-20 | 1 | | `GET /api/v3/ticker/24hr` | 21-100 | 20 | | `GET /api/v3/ticker/24hr` | 101 or more | 40 | --- ## 2022-05-05 - New endpoint for Binance Code: - `GET /sapi/v1/giftcard/cryptography/rsa-public-key` to fetch RSA public key. - Update endpoint for Binance Code: - `POST /sapi/v1/giftcard/redeemCode`: new optional parameter `externalUid`. Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users. --- ## 2022-04-28 - New endpoints for Staking: - `GET /sapi/v1/staking/productList` to get Staking product list - `POST /sapi/v1/staking/purchase` to stake product - `POST /sapi/v1/staking/redeem` to redeem product - `GET /sapi/v1/staking/position` to get Staking product holding position - `GET /sapi/v1/staking/stakingRecord` to inquiry Staking history records - `POST /sapi/v1/staking/setAutoStaking` to set Auto Staking function - `GET /sapi/v1/staking/personalLeftQuota` to inquiry Staking left quota --- ## 2022-04-27 - New endpoint for Futures Algo: - `POST /sapi/v1/algo/futures/newOrderTwap` to support Twap new order FAQ: [Time-Weighted Average Price(Twap) Introduction](https://www.binance.com/en/support/faq/093927599fd54fd48857237f6ebec0b0) --- ## 2022-04-26 - `GET /sapi/v1/margin/rateLimit/order` added - The endpoint will display the user's current margin order count usage for all intervals. --- ## 2022-04-20 - New endpoint for Portfolio Margin: - `GET /sapi/v1/portfolio/account` to support query portfolio margin account info FAQ: [Portfolio Margin Program](https://www.binance.com/en/support/faq/5054378212d240cca17ecd6006c11f23) Only Portfolio Margin Account is accessible to this endpoint. To enroll, kindly refer to: [How to Enroll into the Binance Portfolio Margin Program](https://www.binance.com/en/support/faq/a7834b9bc03140728583a90bcb469144) --- ## 2022-04-13 - New endpoints for Futures Algo: - `POST /sapi/v1/algo/futures/newOrderVp` to support VP new order - `DELETE /sapi/v1/algo/futures/order` to support cancel Algo order - `GET /sapi/v1/algo/futures/openOrders` to support query Algo open orders - `GET /sapi/v1/algo/futures/historicalOrders` to support query Algo historical orders - `GET /sapi/v1/algo/futures/subOrders` to support query Algo sub orders for a specified algoId FAQ: [Volume Participation(VP) Introduction](https://www.binance.com/en/support/faq/b0b94dcc8eb64c2585763b8747b60702) --- ## 2022-04-13 **Information on Trailing Stops** SPOT API - Trailing Stops have been enabled. - This is a type of algo order where the activation is based on a percentage of a price change in the market using the new parameter `trailingDelta`. - This can only used with any of the following order types: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT`. - The `trailingDelta` parameter will be done in Basis Points or BIPS. - For example: a STOP_LOSS SELL order with a `trailingDelta` of 100 will trigger after a price decrease of 1%. (100 / 10,000 => 0.01 => 1%) - When used in combination with OCO Orders, the `trailingDelta` will determine when the contingent leg of the OCO will trigger. - When `trailingDelta` is used in combination with `stopPrice`, once the `stopPrice` condition is met, the trailing stop starts tracking the price change from the `stopPrice` based on the `trailingDelta` provided. - When no `stopPrice` is sent, the trailing stop starts tracking the price changes from the last price based on the `trailingDelta` provided. - Changes to POST `/api/v3/order` - New optional field `trailingDelta` - Changes to POST `/api/v3/order/test` - New optional field `trailingDelta` - Changes to POST `/api/v3/order/oco` - New optional field `trailingDelta` - A new filter `TRAILING_DELTA` has been added. - This filter is defined by the minimum and maximum values for the `trailingDelta` value. USER DATA STREAM - New field in `executionReport` - "d" for `trailingDelta` --- ## 2022-04-12 **Note:** The changes are being rolled out during the next few days, so these will not appear right away. - Error message changed on `GET api/v3/allOrders` where `symbol` is not provided:

``` { "code": -1102, "msg": "Mandatory parameter 'symbol' was not sent, was empty/null, or malformed." } ``` - Fixed a typo with an error message when an account has disabled permissions (e.g. to withdraw, to trade, etc)

``` "This action is disabled on this account." ``` - During a market data audit, we detected some issues with the Spot aggregate trade data. - Missing aggregate trades were recovered. - Duplicated records were marked invalid with the following values: - p = '0' // price - q = '0' // qty - f = -1 // first_trade_id - l = -1 // last_trade_id --- ## 2022-04-08 - Update WEBSOCKET for BLVT:\* Base url changed to `wss://nbstream.binance.com/lvt-p` for BLVT streams `@tokenNav` and `@nav_Kline_` More details: [Websocket BLVT Info Streams](#websocket-blvt-info-streams) and [Websocket BLVT NAV Kline/Candlestick Streams](#websocket-blvt-nav-kline-candlestick-streams) --- ## 2022-3-29 The following updates will take effect on **March 31, 2022 08:00 AM UTC** - Update endpoint for Sub-account: - `GET /sapi/v1/sub-account/universalTransfer` The query time period must be less then 30 days; If `startTime` and `endTime` not sent, return records of the last 30 days by default --- ## 2022-03-25 - Update endpoint for Sub-Account: - New endpoint`GET /sapi/v1/managed-subaccount/accountSnapshot` to support investor master account query asset snapshot of managed sub-account --- ## 2022-03-08 - Update endpoint for Sub-Account: - New transfer types`MARGIN`,`ISOLATED_MARGIN` and parameter`symbol`added in`POST /sapi/v1/sub-account/universalTransfer` to support transfer to sub-account cross margin account and isolated margin account --- ## 2022-02-28 - New field `allowTrailingStop` has been added to `GET /api/v3/exchangeInfo` --- ## 2022-02-22 SPOT API - `(price-minPrice) % tickSize == 0` rule in `PRICE_FILTER` has been changed to `price % tickSize == 0`. - A new filter `PERCENT_PRICE_BY_SIDE` has been added. - Changes to GET `api/v3/depth` - The `limit` value can be outside of the previous values (i.e. 5, 10, 20, 50, 100, 500, 1000,5000) and will return the correct limit. (i.e. if limit=3 then the response will be the top 3 bids and asks) - The limit still cannot exceed 5000. If the limit provided is greater than 5000, then the response will be truncated to 5000. - Due to the changes, these are the updated request weights based on the limit value provided: | Limit | Request Weight | | --------- | -------------- | | 1-100 | 1 | | 101-500 | 5 | | 501-1000 | 10 | | 1001-5000 | 50 | - Changes to GET `api/v3/aggTrades` - When providing `startTime` and `endTime`, the oldest items are returned. --- ## 2022-2-18 - Update endpoint for Sub-Account: - New fields `isManagedSubAccount`and `isAssetManagementSubAccount` added in`GET /sapi/v1/sub-account/list`to support query whether the sub-account is a managed sub-account or a asset management sub-account --- ## 2022-2-17 The following updates will take effect on **February 24, 2022 08:00 AM UTC** - Update endpoint for Wallet: - `GET /sapi/v1/accountSnapshot` The time limit of this endpoint is shortened to only support querying the data of the latest month --- ## 2022-2-09 - New endpoint for Wallet: - `POST /sapi/v1/asset/dust-btc` to get assets that can be converted into BNB --- ## 2022-1-25 - From **January 28, 2022 4:00 AM UTC**, You need to open`Enable Spot & Margin Trading`permission for the API key which requests these endpoints as following: - `POST /sapi/v1/asset/dust` Dust transfer - `POST /sapi/v1/lending/daily/purchase` Purchase Savings flexible product - `POST /sapi/v1/lending/daily/redeem` Redeem Savings flexible product - `POST /sapi/v1/lending/customizedFixed/purchase` Purchase Savings Fixed/Activity project - `POST /sapi/v1/lending/positionChanged` Change Savings Fixed/Activity position to Daily position - `POST /sapi/v1/bswap/liquidityAdd` Bswap add liquidity - `POST /sapi/v1/bswap/liquidityRemove` Bswap remove liquidity - `POST /sapi/v1/bswap/swap` Bswap swap - `POST /sapi/v1/bswap/claimRewards` Bswap claim rewards --- ## 2022-1-21 - New endpoints for Binance Code: - `POST /sapi/v1/giftcard/createCode` to create a Binance Code. - `POST /sapi/v1/giftcard/redeemCode` to redeem a Binance Code. - `GET /sapi/v1/giftcard/verify` to verify a Binance Code. --- ## 2022-1-4 - New endpoint for Mining: - `GET /sapi/v1/mining/payment/uid` to get Mining account earning. - New endpoints for BSwap: - `GET /sapi/v1/bswap/unclaimedRewards` to get unclaimed rewards record. - `POST /sapi/v1/bswap/claimRewards` to claim swap rewards or liquidity rewards. - `GET /sapi/v1/bswap/claimedHistory` to get history of claimed rewards. --- ## 2021-12-30 - Update endpoint for Margin: - Removed out `limit` from`GET /sapi/v1/margin/interestRateHistory`; The max interval between startTime and endTime is 30 days. - Update endpoint for Wallet: - As the Mining account is merged into Funding account, transfer types MAIN_MINING, MINING_MAIN, MINING_UMFUTURE, MARGIN_MINING, and MINING_MARGIN will be discontinued in Universal Transfer endpoint `POST /sapi/v1/asset/transfer` on **January 05, 2022 08:00 AM UTC** --- ## 2021-12-29 - Removed out dated "Symbol Type" enum; added "Permissions" enum. --- ## 2021-12-24 - Update endpoints for Sub-Account: - New parameter`clientTranId`added in`POST /sapi/v1/sub-account/universalTransfer` and `GET /sapi/v1/sub-account/universalTransfer` to support custom transfer id --- ## 2021-12-03 - New endpoints for Margin: - `GET /sapi/v1/margin/crossMarginData` to get cross margin fee data collection - `GET /sapi/v1/margin/isolatedMarginData` to get isolated margin fee data collection - `GET /sapi/v1/margin/isolatedMarginTier` to get isolated margin tier data collection - New endpoints for NFT: - `GET /sapi/v1/nft/history/transactions` to get NFT transaction history - `GET /sapi/v1/nft/history/deposit` to get NFT deposit history - `GET /sapi/v1/nft/history/withdraw` to get NFT withdraw history - `GET /sapi/v1/nft/user/getAsset` to get NFT asset --- ## 2021-11-30 - New endpoint for Convert: - `GET /sapi/v1/convert/tradeFlow` to support user query convert trade history records - New endpoint for Rebate: - `GET /sapi/v1/rebate/taxQuery` to support user query spot rebate history records --- ## 2021-11-19 - New endpoint for Pay: - `GET /sapi/v1/pay/transactions`to support user query Pay trade history - Update endpoint for Wallet: - New field`info`added in`GET /sapi/v1/capital/withdraw/history`to show the reason for withdrawal failure --- ## 2021-11-18 The following updates will take effect on **November 25, 2021 08:00 AM UTC** - Update endpoint for Wallet: - `GET /sapi/v1/accountSnapshot` The query time range of both endpoints are shortened to support data query within the last 6 months only, where startTime does not support selecting a timestamp beyond 6 months. If you do not specify startTime and endTime, the data of the last 7 days will be returned by default. --- ## 2021-11-17 - The following endpoints will be discontinued on **November 17, 2021 13:00 PM UTC**: - `POST /sapi/v1/account/apiRestrictions/ipRestriction` to support user enable and disable IP restriction for an API Key - `POST /sapi/v1/account/apiRestrictions/ipRestriction/ipList` to support user add IP list for an API Key - `GET /sapi/v1/account/apiRestrictions/ipRestriction` to support user query IP restriction for an API Key - `DELETE /sapi/v1/account/apiRestrictions/ipRestriction/ipList` to support user delete IP list for an API Key --- ## 2021-11-16 - New endpoints for Sub-Account: - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction` to support master account enable and disable IP restriction for a sub-account API Key - `POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList` to support master account add IP list for a sub-account API Key - `GET /sapi/v1/sub-account/subAccountApi/ipRestriction` to support master account query IP restriction for a sub-account API Key - `DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList` to support master account delete IP list for a sub-account API Key --- ## 2021-11-09 - New endpoints for Wallet: - `POST /sapi/v1/account/apiRestrictions/ipRestriction` to support user enable and disable IP restriction for an API Key - `POST /sapi/v1/account/apiRestrictions/ipRestriction/ipList` to support user add IP list for an API Key - `GET /sapi/v1/account/apiRestrictions/ipRestriction` to support user query IP restriction for an API Key - `DELETE /sapi/v1/account/apiRestrictions/ipRestriction/ipList` to support user delete IP list for an API Key --- ## 2021-11-08 - New endpoint for Crypto Loans: - New endpoint`GET /sapi/v1/loan/income`to support user query crypto loans income history --- ## 2021-11-05 - Update endpoint for Wallet: - New parameter `walletType `added in `POST /sapi/v1/capital/withdraw/apply` to support user choose wallet type `spot wallet` and `funding wallet` when withdraw crypto. --- ## 2021-11-04 The following updates will take effect on **November 11, 2021 08:00 AM UTC** - Update endpoints for Wallet and Futures: - `GET /sapi/v1/asset/transfer` - `GET /sapi/v1/futures/transfer` The query time range of both endpoints are shortened to support data query within the last 6 months only, where startTime does not support selecting a timestamp beyond 6 months. If you do not specify startTime and endTime, the data of the last 7 days will be returned by default. --- ## 2021-11-01 - `GET /api/v3/rateLimit/order` added - The endpoint will display the user's current order count usage for all intervals. - This endpoint will have a request weight of 20. --- ## 2021-10-22 - Update endpoint for Wallet: - New transfer types `MAIN_FUNDING`,`FUNDING_MAIN`,`FUNDING_UMFUTURE`,`UMFUTURE_FUNDING`,`MARGIN_FUNDING`,`FUNDING_MARGIN`,`FUNDING_CMFUTURE`and `CMFUTURE_FUNDING` added in Universal Transfer endpoint `POST /sapi/v1/asset/transfer` and `GET /sapi/v1/asset/transfer` to support transfer assets among funding account and other accounts - As the C2C account, Binance Payment, Binance Card and other business account are merged into a Funding account, transfer types `MAIN_C2C`,`C2C_MAIN`,`C2C_UMFUTURE`,`C2C_MINING`,`UMFUTURE_C2C`,`MINING_C2C`,`MARGIN_C2C`,`C2C_MARGIN`,`MAIN_PAY`and `PAY_MAIN` will be discontinued in Universal Transfer endpoint `POST /sapi/v1/asset/transfer` and `GET /sapi/v1/asset/transfer` on **November 04, 2021 08:00 AM UTC** --- ## 2021-10-14 - Update the time range of the response data for the following margin account endpoints, `startTime` and `endTime` time span will not exceed 30 days, without time parameter sent the system will return the last 7 days of data by default, while the `archived` parameter is `true`, the system will return the last 7 days of data 6 months ago by default: - `GET /sapi/v1/margin/transfer` - `GET /sapi/v1/margin/loan` - `GET /sapi/v1/margin/repay` - `GET /sapi/v1/margin/isolated/transfer` - `GET /sapi/v1/margin/interestHistory` --- ## 2021-09-18 - New endpoints for BSwap: - `GET /sapi/v1/bswap/poolConfigure` to get pool configure - `GET /sapi/v1/bswap/addLiquidityPreview` to get add liquidity preview - `GET /sapi/v1/bswap/removeLiquidityPreview` to get remove liquidity preview --- ## 2021-09-17 - Add`/api/*`and`/sapi/*` limit introduction in General Info --- ## 2021-09-08 - Add endpoints for enabled isolated margin account limit: - `DELETE /sapi/v1/margin/isolated/account` to disable isolated margin account for a specific symbol - `POST /sapi/v1/margin/isolated/account` to enable isolated margin account for a specific symbol - `GET /sapi/v1/margin/isolated/accountLimit` to query enabled isolated margin account limit - New field "enabled" in response of `GET /sapi/v1/margin/isolated/account` to check if the isolated margin account is enabled --- ## 2021-09-03 - Update endpoint for Wallet: _ New fields `sameAddress`,`depositDust` and `specialWithdrawTips`added in `GET /sapi/v1/capital/config/getall` `sameAddress` means if the coin needs to provide memo to withdraw `depositDust` means minimum creditable amount `specialWithdrawTips` means special tips for withdraw _ New field `confirmNo`added in `GET /sapi/v1/capital/withdraw/history` to support query confirm times for withdraw history --- ## 2021-08-27 - Update endpoint for Wallet: - New parameter `withdrawOrderId`added in `GET /sapi/v1/capital/withdraw/history` to support user query withdraw history by withdrawOrderId - New field `unlockConfirm`added in `GET /sapi/v1/capital/deposit/hisrec` to support query network confirm times for unlocking --- ## 2021-08-23 - New endpoints for Margin Account OCO: - `POST /sapi/v1/margin/order/oco` - `DELETE /sapi/v1/margin/orderList` - `GET /sapi/v1/margin/orderList` - `GET /sapi/v1/margin/allOrderList` - `GET /sapi/v1/margin/openOrderList` Same usage as spot account OCO --- ## 2021-08-20 - Update endpoint for Wallet: - New parameters`fromSymbol`,`toSymbol`and new transfer types `ISOLATEDMARGIN_MARGIN`, `MARGIN_ISOLATEDMARGIN`and `ISOLATEDMARGIN_ISOLATEDMARGIN` added in `POST /sapi/v1/asset/transfer` and `GET /sapi/v1/asset/transfer` to support user transfer assets between Margin(cross) account and Margin(isolated) account --- ## 2021-08-12 - GET `api/v3/myTrades` has a new optional field `orderId` --- ## 2021-08-05 - New endpoint for C2C: - `GET /sapi/v1/c2c/orderMatch/listUserOrderHistory` to query user C2C trade history --- ## 2021-08-05 - Update endpoints for Savings: - `GET /sapi/v1/lending/union/purchaseRecord` - `GET /sapi/v1/lending/union/redemptionRecord` - `GET /sapi/v1/lending/union/interestHistory` The time between `startTime` and `endTime` cannot be longer than 30 days. If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned --- ## 2021-07-29 - Update endpoint for Sub-Account: - `GET /sapi/v1/sub-account/transfer/subUserHistory` if `startTime`and`endTime`are not sent, the recent 30-day data will be returned by default --- ## 2021-07-27 - New endpoint for Fiat: - `GET /sapi/v1/fiat/orders` to query user fiat deposit and withdraw history - `GET /sapi/v1/fiat/payments` to query user fiat payments history --- ## 2021-07-16 - New endpoint for Wallet: - `GET /sapi/v1/account/apiRestrictions` to query user API Key permission --- ## 2021-07-09 - New endpoint for Wallet: - `POST /sapi/v1/asset/get-funding-asset` to query funding wallet, includes Binance Pay, Binance Card, Binance Gift Card, Stock Token --- ## 2021-06-24 - Update endpoints for Wallet: - `GET /sapi/v1/capital/withdraw/history` added default value 1000, max value 1000 for the parameter`limit` - `GET /sapi/v1/capital/deposit/hisrec` added default value 1000, max value 1000 for the parameter`limit` --- ## 2021-06-17 - Update endpoint for Savings: - `GET /sapi/v1/lending/daily/product/list` to include new parameters `current` and `size` --- ## 2021-06-15 - New endpoints for Sub-Account: - `POST /sapi/v1/managed-subaccount/deposit ` to deposit assets into the managed sub-account (only for investor master account) - `GET /sapi/v1/managed-subaccount/asset` to query managed sub-account asset details (only for investor master account) - `POST /sapi/v1/managed-subaccount/withdraw` to withdrawal assets from the managed sub-account (only for investor master account) --- ## 2021-06-04 On **August 01, 2021 02:00 AM UTC** the WAPI endpoints will be discontinued: - `GET /wapi/v3/systemStatus.html` - `POST /wapi/v3/withdraw.html` - `GET /wapi/v3/depositHistory.html` - `GET /wapi/v3/withdrawHistory.html` - `GET /wapi/v3/depositAddress.html` - `GET /wapi/v3/accountStatus.html` - `GET /wapi/v3/apiTradingStatus.html` - `GET /wapi/v3/userAssetDribbletLog.html` - `GET /wapi/v3/assetDetail.html` - `GET /wapi/v3/tradeFee.html` - `GET /wapi/v3/sub-account/list.html` - `GET /wapi/v3/sub-account/transfer/history.html` - `POST /wapi/v3/sub-account/transfer.html` - `GET /wapi/v3/sub-account/assets.html` The WAPI endpoints have been removed from Binance API Documentation.To ensure your trading strategies are not affected, all API users are encouraged to upgrade trading bots to SAPI endpoints as soon as possible. --- ## 2021-05-26 - Update endpoint for Wallet: - New transfer types `MAIN_PAY` ,`PAY_MAIN` added in Universal Transfer endpoint `POST /sapi/v1/asset/transfer` and `GET /sapi/v1/asset/transfer` to support trasnfer assets between spot account and pay account --- ## 2021-05-12 - Added `Data Source` in the documentation to explain where each endpoint is retrieving its data - Added field `Data Source` to each Spot API endpoint in the documentation - GET `api/v3/exchangeInfo` now supports single or multi-symbol query --- ## 2021-04-28 On **May 15, 2021 08:00 UTC** the SAPI Create Margin Account endpoint will be discontinued: - `POST /sapi/v1/margin/isolated/create` Isolated Margin account creation and trade preparation can be completed directly through Isolated Margin funds transfer `POST /sapi/v1/margin/isolated/transfer` --- ## 2021-04-26 On **April 28, 2021 00:00 UTC** the weights to the following endpoints will be adjusted: - `GET /api/v3/order` weight increased to 2 - `GET /api/v3/openOrders` weight increased to 3 - `GET /api/v3/allOrders` weight increased to 10 - `GET /api/v3/orderList` weight increased to 2 - `GET /api/v3/openOrderList` weight increased to 3 - `GET /api/v3/account` weight increased to 10 - `GET /api/v3/myTrades` weight increased to 10 - `GET /api/v3/exchangeInfo` weight increased to 10 --- ## 2021-04-08 - Update endpoint for Sub-Account: - `GET /sapi/v1/sub-account/futures/accountSummary` and `GET /sapi/v2/sub-account/futures/accountSummary` the unit of field `asset` changed to USD valued summary of sub-account assets --- ## 2021-04-02 - New endpoints for Wallet: - `GET /sapi/v1/system/status` to query system status - `GET /sapi/v1/account/status` to query account status - `GET /sapi/v1/account/apiTradingStatus` to query account API trading status - `GET /sapi/v1/asset/dribblet` to query dust log - `GET /sapi/v1/asset/assetDetail` to query asset detail - `GET /sapi/v1/asset/tradeFee` to query trade fee - New endpoint for Sub-Account: - `GET /sapi/v3/sub-account/assets` to query sub-account assets --- ## 2021-04-01 - Update endpoint for Sub-Account: - `GET /sapi/v1/sub-account/transfer/subUserHistory` new fields `fromAccountType` and `toAccountType` added in response --- ## 2021-03-31 - Update endpoint for Sub-Account: - `GET /wapi/v3/sub-account/transfer/history.html` added new parameters `fromEmail` and `toEmail`, the original parameter`email` is equal to`fromEmail`by default --- ## 2021-03-08 - New endpoint for Sub-Account: - `POST /sapi/v1/sub-account/virtualSubAccount` to support create a virtual sub-account - `GET /sapi/v1/sub-account/list` to support query sub-account list - `POST /sapi/v1/sub-account/blvt/enable` to support enable blvt for sub-account --- ## 2021-03-05 - New endpoints for Margin: - `GET /sapi/v1/margin/interestRateHistory` to support margin interest rate history query --- ## 2021-02-08 - New endpoints for Futures: - `GET /sapi/v2/futures/loan/wallet` to support BUSD loan query - `GET /sapi/v2/futures/loan/configs` to support BUSD loan query - `GET /sapi/v2/futures/loan/calcAdjustLevel` to support BUSD loan - `GET /sapi/v2/futures/loan/calcMaxAdjustAmount` to support adjustment of BUSD loan - `POST /sapi/v2/futures/loan/adjustCollateral` to support adjustment of BUSD loan - Update endpoints for Futures - `GET /sapi/v1/futures/loan/adjustCollateral/history` new parameter and fields in response `loanCoin` for BUSD loan - `GET /sapi/v1/futures/loan/liquidationHistory` new parameter and fields in response `loanCoin` for BUSD loan --- ## 2021-02-04 - New transfer types `MARGIN_MINING` ,`MINING_MARGIN`, `MARGIN_C2C` ,`C2C_MARGIN`, `MARGIN_CMFUTURE`, `CMFUTURE_MARGIN` added in Universal Transfer endpoint `POST /sapi/v1/asset/transfer` and `GET /sapi/v1/asset/transfer`. --- ## 2021-01-15 - New endpoint `DELETE /sapi/v1/margin/openOrders` for Margin Trade - This will allow a user to cancel all open orders on a single symbol for margin account. - This endpoint will cancel all open orders including OCO orders for margin account. --- ## 2021-01-10 - New parameter `pageSize` for Mining endpoint `GET /sapi/v1/mining/payment/list` - New fields in response to Mining endpoint `GET /sapi/v1/mining/payment/list`: - "type" for income type - "hashTransfer" for resale Hashrate - "transferAmount" for transferred Income - New Mining endpoints: - `GET /sapi/v1/mining/payment/other` - `GET /sapi/v1/mining/hash-transfer/config/details` - `GET /sapi/v1/mining/hash-transfer/config/details/list` - `GET /sapi/v1/mining/hash-transfer/profit/details` - `POST /sapi/v1/mining/hash-transfer/config` - `POST /sapi/v1/mining/hash-transfer/config/cancel` --- ## 2021-01-01 USER DATA STREAM - `outboundAccountInfo` has been removed. --- ## 2020-12-30 - New endpoint for Wallet: - `POST /sapi/v1/asset/transfer` to support user universal transfer among Spot, Margin, Futures, C2C, MINING accounts. - `GET /sapi/v1/asset/transfer` to get user universal transfer history. --- ## 2020-12-22 - New endpoint for Sub-Account: - `GET /sapi/v1/sub-account/sub/transfer/history` to get spot asset transfer history. --- ## 2020-12-11 - Update endpoints for Futures Cross-Collateral: - `GET /sapi/v1/futures/loan/wallet` new fields in response `interestFreeLimit` for total interest free limit, `interestFreeLimitUsed` for interest free limit used. - `GET /sapi/v1/futures/loan/interestHistory` new fields in response `interestFreeLimitUsed` for interest free limit used. --- ## 2020-12-04 - Update endpoint for BLVT: - `GET /sapi/v1/blvt/tokenInfo` new fields in response `currentBaskets`(include `symbol`, `amount` , `notionalValue` ),`purchaseFeePct`,`dailyPurchaseLimit`,`redeemFeePct`,`dailyRedeemLimit`. - New endpoint for BLVT: - `GET /sapi/v1/blvt/userLimit` to get BLVT user limit info. --- ## 2020-12-02 - New endpoints for Sub-Account: - `GET /sapi/v2/sub-account/futures/account` to get detail on sub-account's USDT margined futures account and COIN margined futures account. - `GET /sapi/v2/sub-account/futures/accountSummary` to get summary of sub-account's USDT margined futures account and COIN margined futures account. - `GET /sapi/v2/sub-account/futures/positionRisk` to get position risk of sub-account's USDT margined futures account and COIN margined futures account. --- ## 2020-12-01 - Update Margin Trade Endpoint: - `POST /sapi/v1/margin/order` new parameter `quoteOrderQty` allow a user to specify the total `quoteOrderQty` spent or received in the `MARKET` order. --- ## 2020-11-27 New API clusters have been added in order to improve performance. Users can access any of the following API clusters, in addition to `api.binance.com` If there are any performance issues with accessing `api.binance.com` please try any of the following instead: - https://api1.binance.com/api/v3/* - https://api2.binance.com/api/v3/* - https://api3.binance.com/api/v3/* --- ## 2020-11-16 - Updated endpoints for Margin, new parameter `archived` to query data from 6 months ago: - `GET /sapi/v1/margin/loan` - `GET /sapi/v1/margin/repay` - `GET /sapi/v1/margin/interestHistory` --- ## 2020-11-13 - New endpoints for Sub-Account: - `POST /sapi/v1/sub-account/universalTransfer` to transfer spot and futures asset between master account and sub accounts. - `GET /sapi/v1/sub-account/universalTransfer` to search transfer records. --- ## 2020-11-10 - New endpoint to toggle BNB Burn: - `POST /sapi/v1/bnbBurn` to toggle BNB Burn on spot trade and margin interest. - `GET /sapi/v1/bnbBurn` to get BNB Burn status. --- ## 2020-11-09 - New field `tranId` is available from endpoints: - `GET /sapi/v1/sub-account/futures/internalTransfer` - `GET /sapi/v1/sub-account/transfer/subUserHistory` --- ## 2020-11-03 - Update endpoints for Futures Cross-Collateral: - `GET /sapi/v1/futures/loan/repay/history` new fields in response `repayType`(`NORMAL` for normal repayment, `COLLATERAL` for collateral repayment), `price` (collateral repayment rate), `repayCollateral`(collateral amount for collateral repayment). - `GET /sapi/v1/futures/loan/wallet` new fields in response `totalInterest` (total interest for cross-collateral), `principalForInterest`(cross-collateral principal for interest), `interest`(cross-collateral interest). - `GET /sapi/v1/futures/loan/configs` new fields in response `interestRate` (interest rate for cross-collateral), `interestGracePeriod` (interest grace period for cross-collateral). - New endpoints for Futures Cross-Collateral: - `GET /sapi/v1/futures/loan/collateralRepayLimit` to check the maximum and minimum limit when repay with collateral. - `GET /sapi/v1/futures/loan/collateralRepay` to get quote for collateral repayment. - `POST /sapi/v1/futures/loan/collateralRepay` to repay with collateral. - `GET /sapi/v1/futures/loan/collateralRepayResult` to check collateral repayment result. - `GET /sapi/v1/futures/loan/interestHistory` to get cross-collateral interest history. --- ## 2020-10-14 - Update endpoints for Futures Cross-Collateral: - `POST /sapi/v1/futures/loan/borrow` and `GET /sapi/v1/futures/loan/borrow/history` new field `borrowId` in response for ID of Cross-Collateral borrow operation. - `POST /sapi/v1/futures/loan/repay` and `GET /sapi/v1/futures/loan/repay/history` new field `repayId` in response for ID of Cross-Collateral repay operation. --- ## 2020-10-10 - New `type` added in the endpoint `POST /sapi/v1/sub-account/futures/transfer`to support transfer asset from subaccount's spot account to its COIN-margined futures account and transfer asset from subaccount's COIN-margined futures account to its spot account. --- ## 2020-09-30 - Update endpoints for Margin Account: - `GET /sapi/v1/margin/maxBorrowable` new field `borrowLimit` in response for account borrow limit. --- ## 2020-09-28 - New endpoints for Binance Savings: - `POST /sapi/v1/lending/positionChanged` to change fixed/activity position to daily position. - New parameter `ACTIVITY` replace `REGULAR`in the following Binance Savings endpoints: - `GET /sapi/v1/lending/project/list` - `POST /sapi/v1/lending/customizedFixed/purchase` - `GET /sapi/v1/lending/project/position/list` - `GET /sapi/v1/lending/union/purchaseRecord` - `GET /sapi/v1/lending/union/interestHistory` --- ## 2020-09-23 - New SAPI endpoints for BSwap: - `GET /sapi/v1/bswap/pools` to list all swap pools. - `GET /sapi/v1/bswap/liquidity` to get liquidity information of a pool. - `POST /sapi/v1/bswap/liquidityAdd` to add liquidity. - `POST /sapi/v1/bswap/liquidityRemove` to remove liquidity. - `GET /sapi/v1/bswap/liquidityOps` to get liquidity operation record. - `GET /sapi/v1/bswap/quote` to request quotes. - `POST /sapi/v1/bswap/swap` to swap. - `GET /sapi/v1/bswap/swap` to get swap history. --- ## 2020-09-16 - New SAPI endpoints for BLVT: - `GET /sapi/v1/blvt/tokenInfo` to get BLVT info. - `POST /sapi/v1/blvt/subscribe (HMAC SHA256)` to subscribe BLVT. - `GET /sapi/v1/blvt/subscribe/record (HMAC SHA256)` to get subscription record。 - `POST /sapi/v1/blvt/redeem (HMAC SHA256)` to redeem BLVT. - `GET /sapi/v1/blvt/redeem/record (HMAC SHA256` to get redemption record. - The BLVT NAV system is working relatively with Binance Futures, so some endpoints are based on futures system: - New endpoint to get historical BLVT Kline. - New WebSocket streams for BLVT Info and BLVT NAV Kline: ## 2020-09-09 USER DATA STREAM - `outboundAccountInfo` has been deprecated. - `outboundAccountInfo` will be removed in the future. (Exact date unknown) **Please use `outboundAccountPosition` instead.** - `outboundAccountInfo` will now only show the balance of non-zero assets and assets that have been reduced to 0. --- ## 2020-09-03 - New endpoint `POST /sapi/v1/sub-account/futures/internalTransfer` to transfer futures asset between master account and subaccount. - New endpoint`GET /sapi/v1/sub-account/futures/internalTransfer` to get futures transfer history of subaccount. --- ## 2020-09-01 - New parameter `masterAccountTotalAsset` added in the endpoint `GET /sapi/v1/sub-account/spotSummary` to get BTC valued asset summary of master account. --- ## 2020-08-27 - New endpoint `GET /sapi/v1/sub-account/spotSummary` to get BTC valued asset summary of subaccout. --- ## 2020-08-26 - New parameter `symbols` added in the endpoint `GET /sapi/v1/margin/isolated/account`. --- ## 2020-07-28 ISOLATED MARGIN - New parameters "isIsolated" and "symbol" added for isolated margin in the following endpoints: - `POST /sapi/v1/margin/loan` - `POST /sapi/v1/margin/repay` - New parameter "isIsolated" and new response field "isIsolated" added for isolated margin in the following endpoints: - `POST /sapi/v1/margin/order` - `DELETE /sapi/v1/margin/order` - `GET /sapi/v1/margin/order` - `GET /sapi/v1/margin/openOrders` - `GET /sapi/v1/margin/allOrders` - `GET /sapi/v1/margin/myTrades` - New parameter "isolatedSymbol" and new response field "isolatedSymbol" added for isolated margin in the following endpoints: - `GET /sapi/v1/margin/loan` - `GET /sapi/v1/margin/repay` - `GET /sapi/v1/margin/interestHistory` - New parameter "isolatedSymbol" and new response field "isIsolated" added for isolated margin in the following endpoint `GET /sapi/v1/margin/forceLiquidationRec` - New parameter "isolatedSymbol" added for isolated margin in the following endpoints: - `GET /sapi/v1/margin/maxBorrowable` - `GET /sapi/v1/margin/maxTransferable` - New endpoints for isolated margin: - `POST /sapi/v1/margin/isolated/create` - `POST /sapi/v1/margin/isolated/transfer` - `GET /sapi/v1/margin/isolated/transfer` - `GET /sapi/v1/margin/isolated/account` - `GET /sapi/v1/margin/isolated/pair` - `GET /sapi/v1/margin/isolated/allPairs` - New endpoints for listenKey management of isolated margin account: - `POST /sapi/v1/userDataStream/isolated` - `PUT /sapi/v1/userDataStream/isolated` - `DELETE /sapi/v1/userDataStream/isolated` --- ## 2020-07-20 - The max value of parameter "limit" in `GET /sapi/v1/margin/allOrders` has been changed as 500. --- ## 2020-07-17 - There is now a request limit specifically for the sapi/v1/margin/allOrders endpoint at 60 raw requests per minute for a single IP address. --- ## 2020-07-13 - New SAPI Endpoints for futures Cross-Collateral: - `POST /sapi/v1/futures/loan/borrow` - `GET /sapi/v1/futures/loan/borrow/history` - `POST /sapi/v1/futures/loan/repay` - `GET /sapi/v1/futures/loan/repay/history` - `GET /sapi/v1/futures/loan/wallet` - `GET /sapi/v1/futures/loan/configs` - `GET /sapi/v1/futures/loan/calcAdjustLevel` - `GET /sapi/v1/futures/loan/calcMaxAdjustAmount` - `POST /sapi/v1/futures/loan/adjustCollateral` - `GET /sapi/v1/futures/loan/adjustCollateral/history` - `GET /sapi/v1/futures/loan/liquidationHistory` --- ## 2020-06-28 - SAPI Endpoints for futures: - `POST /sapi/v1/futures/transfer` - `GET /sapi/v1/futures/transfer` --- ## 2020-05-06 - New endpoints for Mining: - `GET /sapi/v1/mining/pub/algoList` - `GET /sapi/v1/mining/pub/coinList` - `GET /sapi/v1/mining/worker/detail` - `GET /sapi/v1/mining/worker/list` - `GET /sapi/v1/mining/payment/list` - `GET /sapi/v1/mining/statistics/user/status` - `GET /sapi/v1/mining/statistics/user/list` --- ## 2020-05-01 - From 2020-05-01 UTC 00:00, all symbols will have a limit of 200 open orders using the [MAX_NUM_ORDERS](https://binance-docs.github.io/apidocs/spot/en/#filters) filter. - No existing orders will be removed or canceled. - Accounts that have 200 or more open orders on a symbol will not be able to place new orders on that symbol until the open order count is below 200. - OCO orders count as 2 open orders before the `LIMIT` order is touched or the `STOP_LOSS` (or `STOP_LOSS_LIMIT`) order is triggered; once this happens the other order is canceled and will no longer count as an open order. --- ## 2020-04-25 SPOT API - New field `permissions` - Defines the trading permissions that are allowed on accounts and symbols. - `permissions` is an enum array; values: - `SPOT` - `MARGIN` - `permissions` will replace `isSpotTradingAllowed` and `isMarginTradingAllowed` on `GET api/v3/exchangeInfo` in future API versions (v4+). - For an account to trade on a symbol, the account and symbol must share at least 1 permission in common. - Updates to GET `api/v3/exchangeInfo` - New field `permissions` added. - New field `quoteAssetPrecision` added; a duplicate of the `quotePrecision` field. `quotePrecision` will be removed in future API versions (v4+). - Updates to GET `api/v3/account` - New field `permissions` added. - New endpoint DELETE `api/v3/openOrders` - This will allow a user to cancel all open orders on a single symbol. - This endpoint will cancel all open orders including OCO orders. - Orders can be canceled via the API on symbols in the `BREAK` or `HALT` status. USER DATA STREAM - `OutboundAccountInfo` has new field `P` which shows the trading permissions of the account. --- ## 2020-04-23 WEB SOCKET STREAM - WebSocket connections have a limit of 5 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON control message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 1024 streams. ## 2020-04-16 - New fields in response to endpoint`GET /sapi/v1/lending/daily/token/position`: - `todayPurchasedAmount` for user's purchased amount today - New lending endpoints for customized fixed projects: - `GET /sapi/v1/lending/project/list` - `POST /sapi/v1/lending/customizedFixed/purchase` - `GET /sapi/v1/lending/project/position/list` --- ## 2020-04-02 - New fields in response to endpoint`GET /sapi/v1/capital/config/getall`: - `minConfirm` for min number for balance confirmation - `unLockConfirm` for confirmation number for balance unlock --- ## 2020-03-24 - `MAX_POSITION` filter added. - This filter defines the allowed maximum position an account can have on the base asset of a symbol. An account's position defined as the sum of the account's: - free balance of the base asset - locked balance of the base asset - sum of the qty of all open BUY orders - `BUY` orders will be rejected if the account's position is greater than the maximum position allowed. --- ## 2020-03-13 - New parameter `transactionFeeFlag` is available in endpoint: - `POST /sapi/v1/capital/withdraw/apply` and - `POST /wapi/v3/withdraw.html` --- ## 2020-02-05 - New sub account endpoints: - `POST /sapi/v1/sub-account/futures/transfer` to transfer between futures and spot accout of sub-account. - `POST /sapi/v1/sub-account/margin/transfer` to transfer between margin and spot accout of sub-account. - `POST /sapi/v1/sub-account/transfer/subToSub` to transfer to another account by sub-account. - `POST /sapi/v1/sub-account/transfer/subToMaster` to transfer to same master by sub-account. - `GET /sapi/v1/sub-account/transfer/subUserHistory` to get transfer history of sub-account. --- ## 2020-01-15 - New parameter `withdrawOrderId` for client customized withdraw id for endpoint `POST /wapi/v3/withdraw.html`. - New field `withdrawOrderId` in response to `GET /wapi/v3/withdrawHistory.html` --- ## 2019-12-25 - New endpoints for Binance Savings: - `GET /sapi/v1/lending/daily/product/list` - `GET /sapi/v1/lending/daily/userLeftQuota` - `POST /sapi/v1/lending/daily/purchase ` - `GET /sapi/v1/lending/daily/userRedemptionQuota` - `POST /sapi/v1/lending/daily/redeem` - `GET /sapi/v1/lending/daily/token/position` - `GET /sapi/v1/lending/union/account` - `GET /sapi/v1/lending/union/purchaseRecord` - `GET /sapi/v1/lending/union/redemptionRecord` - `GET /sapi/v1/lending/union/interestHistory` - Added time interval limit in `GET /sapi/v1/capital/withdraw/history`, `GET /wapi/v3/withdrawHistory.html`, `GET /sapi/v1/capital/deposit/hisrec` and `GET /wapi/v3/depositHistory.html`: _ The default `startTime` is 90 days from current time, and the default `endTime` is current time. _ Please notice the default `startTime` and `endTime` to make sure that time interval is within 0-90 days. \* If both `startTime` and `endTime` are sent, time between `startTime` and `endTime` must be less than 90 days. --- ## 2019-12-18 - New endpoint to get daily snapshot of account: `GET /sapi/v1/accountSnapshot` --- ## 2019-11-30 - Added parameter `sideEffectType` in `POST /sapi/v1/margin/order (HMAC SHA256)` with enums: - `NO_SIDE_EFFECT` for normal trade order; - `MARGIN_BUY` for margin trade order; - `AUTO_REPAY` for making auto repayment after order filled. - New field `marginBuyBorrowAmount` and `marginBuyBorrowAsset` in `FULL` response to `POST /sapi/v1/margin/order (HMAC SHA256)` --- ## 2019-11-28 - New SAPI endpont to disable fast withdraw switch: `POST /sapi/v1/account/disableFastWithdrawSwitch (HMAC SHA256)` - New SAPI endpont to enable fast withdraw switch: `POST /sapi/v1/account/enableFastWithdrawSwitch (HMAC SHA256)` --- ## 2019-11-22 - Quote Order Qty Market orders have been enabled on all symbols. - Quote Order Qty `MARKET` orders allow a user to specify the total `quoteOrderQty` spent or received in the `MARKET` order. - Quote Order Qty `MARKET` orders will not break `LOT_SIZE` filter rules; the order will execute a quantity that will have the notional value as close as possible to `quoteOrderQty`. - Using `BNBBTC` as an example: - On the `BUY` side, the order will buy as many BNB as `quoteOrderQty` BTC can. - On the `SELL` side, the order will sell as much BNB as needed to receive `quoteOrderQty` BTC. --- ## 2019-11-19 - `GET /sapi/v1/sub-account/margin/account` has new field: `marginTradeCoeffVo` which contains - `forceLiquidationBar` for liquidation margin ratio - `marginCallBar` for margin call margin ratio - `normalBar` for initial margin ratio --- ## 2019-11-13 Rest API - api/v3/exchangeInfo has new fields: - `quoteOrderQtyMarketAllowed` - `baseCommissionPrecision` - `quoteCommissionPrecision` - `MARKET` orders have a new optional field: `quoteOrderQty` used to specify the quote quantity to BUY or SELL. This cannot be used in combination with `quantity`. - The exact timing that `quoteOrderQty` MARKET orders will be enabled is TBD. There will be a separate announcement and further details at that time. - All order query endpoints will return a new field `origQuoteOrderQty` in the JSON payload. (e.g. GET api/v3/allOrders) ```json { "code": -1128, "msg": "Combination of optional parameters invalid. Recommendation: 'stopLimitTimeInForce' should also be sent." } ``` - Updated error messages for -1128 - Sending an `OCO` with a `stopLimitPrice` but without a `stopLimitTimeInForce` will return the error: - Updated error messages for -1003 to specify the limit is referring to the request weight, not to the number of requests. **Deprecation of v1 endpoints**: By end of Q1 2020, the following endpoints will be removed from the API. The documentation has been updated to use the v3 versions of these endpoints. - GET api/v1/depth - GET api/v1/historicalTrades - GET api/v1/aggTrades - GET api/v1/klines - GET api/v1/ticker/24hr - GET api/v1/ticker/price - GET api/v1/exchangeInfo - POST api/v1/userDataStream - PUT api/v1/userDataStream - GET api/v1/ping - GET api/v1/time - GET api/v1/ticker/bookTicker **These endpoints however, will NOT be migrated to v3. Please use the following endpoints instead moving forward.**
Old V1 Endpoints New V3 Endpoints
GET api/v1/ticker/allPrices GET api/v3/ticker/price
GET api/v1/ticker/allBookTickers GET api/v3/ticker/bookTicker
USER DATA STREAM - Changes to`executionReport` event - If the C field is empty, it will now properly return `null`, instead of `"null"`. - New field Q which represents the `quoteOrderQty`. - `balanceUpdate` event type added - This event occurs when funds are deposited or withdrawn from your account. WEB SOCKET STREAM - WSS now supports live subscribing/unsubscribing to streams. --- ## 2019-11-08 - New sapi for subaccount management on margin and futures: - `GET /sapi/v1/sub-account/status (HMAC SHA256)` - `POST /sapi/v1/sub-account/margin/enable (HMAC SHA256)` - `GET /sapi/v1/sub-account/margin/account (HMAC SHA256)` - `GET /sapi/v1/sub-account/margin/accountSummary (HMAC SHA256)` - `POST /sapi/v1/sub-account/futures/enable (HMAC SHA256)` - `GET /sapi/v1/sub-account/futures/account (HMAC SHA256)` - `GET /sapi/v1/sub-account/futures/accountSummary (HMAC SHA256)` - `GET /sapi/v1/sub-account/futures/positionRisk (HMAC SHA256)` --- ## 2019-11-04 - New sapi endpoints for subaccount wallet. - `GET /sapi/v1/capital/deposit/subAddress (HMAC SHA256))`: fetch subaccount deposit address. - `GET /sapi/v1/capital/deposit/subHisrec (HMAC SHA256))`: fetch subaccount deposit history. --- ## 2019-10-29 - New sapi endpoints for wallet. - `POST /sapi/v1/capital/withdraw/apply (HMAC SHA256)`: withdraw. - `Get /sapi/v1/capital/withdraw/history (HMAC SHA256)`: fetch withdraw history with network. --- ## 2019-10-14 - New sapi endpoints for wallet. - `GET /sapi/v1/capital/config/getall (HMAC SHA256)`: get all coins' information for user. - `GET /sapi/v1/capital/deposit/hisrec (HMAC SHA256)`: fetch deposit history with network. - `GET /sapi/v1/capital/deposit/address (HMAC SHA256)`: fetch deposit address with network. --- ## 2019-10-11 - Added parameter `network` in `POST /wapi/v3/withdraw.html` so that asset can be withdrawed with specific network. --- ## 2019-09-09 - New WebSocket streams for bookTickers added: `@bookTicker` and `!bookTicker`. --- ## 2019-09-03 - Faster order book data with 100ms updates: `@depth@100ms` and `@depth#@100ms` - Added "Update Speed:" to `Websocket Market Streams` - Removed deprecated v1 endpoints as per previous announcement: - GET api/v1/order - GET api/v1/openOrders - POST api/v1/order - DELETE api/v1/order - GET api/v1/allOrders - GET api/v1/account - GET api/v1/myTrades --- ## 2019-08-16 - GET api/v1/depth `limit` of 10000 has been temporarily removed - In Q4 2017, the following endpoints were deprecated and removed from the API documentation. They have been permanently removed from the API as of this version. We apologize for the omission from the original changelog: - GET api/v1/order - GET api/v1/openOrders - POST api/v1/order - DELETE api/v1/order - GET api/v1/allOrders - GET api/v1/account - GET api/v1/myTrades - Streams, endpoints, parameters, payloads, etc. described in the documents in this repository are **considered official** and **supported**. The use of any other streams, endpoints, parameters, or payloads, etc. is **not supported; use them at your own risk and with no guarantees.** --- ## 2019-09-15 Rest API - New order type: OCO ("One Cancels the Other") - An OCO has 2 orders: (also known as legs in financial terms) - `STOP_LOSS` or `STOP_LOSS_LIMIT` leg - `LIMIT_MAKER` leg - Price Restrictions: - `SELL Orders` : Limit Price > Last Price > Stop Price - `BUY Orders` : Limit Price < Last Price < Stop Price - As stated, the prices must "straddle" the last traded price on the symbol. EX: If the last price is 10: - A SELL OCO must have the limit price greater than 10, and the stop price less than 10. - A BUY OCO must have a limit price less than 10, and the stop price greater than 10. - Quantity Restrictions: - Both legs must have the **same quantity**. - `ICEBERG` quantities however, do not have to be the same. - Execution Order: - If the `LIMIT_MAKER` is touched, the limit maker leg will be executed first BEFORE canceling the Stop Loss Leg. - if the Market Price moves such that the `STOP_LOSS` or `STOP_LOSS_LIMIT` will trigger, the Limit Maker leg will be cancelled BEFORE executing the `STOP_LOSS` Leg. - Cancelling an OCO - Cancelling either order leg will cancel the entire OCO. - The entire OCO can be canceled via the `orderListId` or the `listClientOrderId`. - New Enums for OCO: 1. `ListStatusType` - `RESPONSE` - used when ListStatus is responding to a failed action. (either order list placement or cancellation) - `EXEC_STARTED` - used when an order list has been placed or there is an update to a list's status. - `ALL_DONE` - used when an order list has finished executing and is no longer active. 2. `ListOrderStatus` - `EXECUTING` - used when an order list has been placed or there is an update to a list's status. - `ALL_DONE` - used when an order list has finished executing and is no longer active. - `REJECT` - used when ListStatus is responding to a failed action. (either order list placement or cancellation) 3. `ContingencyType` - `OCO` - specifies the type of order list. - New Endpoints: - POST api/v3/order/oco - DELETE api/v3/orderList - GET api/v3/orderList - `recvWindow` cannot exceed 60000. - New `intervalLetter` values for headers: - SECOND => S - MINUTE => M - HOUR => H - DAY => D - New Headers `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` will give your current used request weight for the (intervalNum)(intervalLetter) rate limiter. For example, if there is a one minute request rate weight limiter set, you will get a `X-MBX-USED-WEIGHT-1M` header in the response. The legacy header `X-MBX-USED-WEIGHT` will still be returned and will represent the current used weight for the one minute request rate weight limit. - New Header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`that is updated on any valid order placement and tracks your current order count for the interval; rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. - Eg. `X-MBX-ORDER-COUNT-1S` for "orders per 1 second" and `X-MBX-ORDER-COUNT-1D` for orders per "one day" - GET api/v1/depth now supports `limit` 5000 and 10000; weights are 50 and 100 respectively. - GET api/v1/exchangeInfo has a new parameter `ocoAllowed`. USER DATA STREAM - `executionReport` event now contains "g" which has the `orderListId`; it will be set to -1 for non-OCO orders. - New Event Type `listStatus`; `listStatus` is sent on an update to any OCO order. - New Event Type `outboundAccountPosition`; `outboundAccountPosition` is sent any time an account's balance changes and contains the assets that could have changed by the event that generated the balance change (a deposit, withdrawal, trade, order placement, or cancelation). NEW ERRORS - **-1131 BAD_RECV_WINDOW** - `recvWindow` must be less than 60000 - **-1099 Not found, authenticated, or authorized** - This replaces error code -1999 NEW -2011 ERRORS - **OCO_BAD_ORDER_PARAMS** - A parameter for one of the orders is incorrect. - **OCO_BAD_PRICES** - The relationship of the prices for the orders is not correct. - **UNSUPPORTED_ORD_OCO** - OCO orders are not supported for this symbol. --- ## 2019-03-12 Rest API - X-MBX-USED-WEIGHT header added to Rest API responses. - Retry-After header added to Rest API 418 and 429 responses. - When canceling the Rest API can now return `errorCode` -1013 OR -2011 if the symbol's `status` isn't `TRADING`. - `api/v1/depth` no longer has the ignored and empty `[]`. - `api/v3/myTrades` now returns `quoteQty`; the price \* qty of for the trade. Websocket streams - `@depth` and `@depthX` streams no longer have the ignored and empty `[]`. System improvements - Matching Engine stability/reliability improvements. - Rest API performance improvements. --- ## 2018-11-13 Rest API - Can now cancel orders through the Rest API during a trading ban. - New filters: `PERCENT_PRICE`, `MARKET_LOT_SIZE`, `MAX_NUM_ICEBERG_ORDERS`. - Added `RAW_REQUESTS` rate limit. Limits based on the number of requests over X minutes regardless of weight. - /api/v3/ticker/price increased to weight of 2 for a no symbol query. - /api/v3/ticker/bookTicker increased weight of 2 for a no symbol query. - DELETE /api/v3/order will now return an execution report of the final state of the order. - `MIN_NOTIONAL` filter has two new parameters: `applyToMarket` (whether or not the filter is applied to MARKET orders) and `avgPriceMins` (the number of minutes over which the price averaged for the notional estimation). - `intervalNum` added to /api/v1/exchangeInfo limits. `intervalNum` describes the amount of the interval. For example: `intervalNum` 5, with `interval` minute, means "every 5 minutes". Explanation for the average price calculation: 1. (qty \* price) of all trades / sum of qty of all trades over previous 5 minutes. 2. If there is no trade in the last 5 minutes, it takes the first trade that happened outside of the 5min window. For example if the last trade was 20 minutes ago, that trade's price is the 5 min average. 3. If there is no trade on the symbol, there is no average price and market orders cannot be placed. On a new symbol with `applyToMarket` enabled on the `MIN_NOTIONAL` filter, market orders cannot be placed until there is at least 1 trade. 4. The current average price can be checked here: `https://api.binance.com/api/v3/avgPrice?symbol=` For example: https://api.binance.com/api/v3/avgPrice?symbol=BNBUSDT User data stream - `Last quote asset transacted quantity` (as variable `Y`) added to execution reports. Represents the `lastPrice` _ `lastQty` (`L` _ `l`). --- ## 2018-07-18 Rest API - New filter: `ICEBERG_PARTS` - `POST api/v3/order` new defaults for `newOrderRespType`. `ACK`, `RESULT`, or `FULL`; `MARKET` and `LIMIT` order types default to `FULL`, all other orders default to `ACK`. - POST api/v3/order `RESULT` and `FULL` responses now have `cummulativeQuoteQty` - GET api/v3/openOrders with no symbol weight reduced to 40. - GET api/v3/ticker/24hr with no symbol weight reduced to 40. - Max amount of trades from GET /api/v1/trades increased to 1000. - Max amount of trades from GET /api/v1/historicalTrades increased to 1000. - Max amount of aggregate trades from GET /api/v1/aggTrades increased to 1000. - Max amount of aggregate trades from GET /api/v1/klines increased to 1000. - Rest API Order lookups now return `updateTime` which represents the last time the order was updated; `time` is the order creation time. - Order lookup endpoints will now return `cummulativeQuoteQty`. If `cummulativeQuoteQty` is < 0, it means the data isn't available for this order at this time. - `REQUESTS` rate limit type changed to `REQUEST_WEIGHT`. This limit was always logically request weight and the previous name for it caused confusion. User data stream - `cummulativeQuoteQty` field added to order responses and execution reports (as variable `Z`). Represents the cummulative amount of the `quote` that has been spent (with a `BUY` order) or received (with a `SELL` order). Historical orders will have a value < 0 in this field indicating the data is not available at this time. `cummulativeQuoteQty` divided by `cummulativeQty` will give the average price for an order. - `O` (order creation time) added to execution reports --- ## 2018-01-23 - GET /api/v1/historicalTrades weight decreased to 5 - GET /api/v1/aggTrades weight decreased to 1 - GET /api/v1/klines weight decreased to 1 - GET /api/v1/ticker/24hr all symbols weight decreased to number of trading symbols / 2 - GET /api/v3/allOrders weight decreased to 5 - GET /api/v3/myTrades weight decreased to 5 - GET /api/v3/account weight decreased to 5 - GET /api/v1/depth limit=500 weight decreased to 5 - GET /api/v1/depth limit=1000 weight decreased to 10 - -1003 error message updated to direct users to websockets --- ## 2018-01-20 - GET /api/v1/ticker/24hr single symbol weight decreased to 1 - GET /api/v3/openOrders all symbols weight decreased to number of trading symbols / 2 - GET /api/v3/allOrders weight decreased to 15 - GET /api/v3/myTrades weight decreased to 15 - GET /api/v3/order weight decreased to 1 - myTrades will now return both sides of a self-trade/wash-trade --- ## 2018-01-14 - GET /api/v1/aggTrades weight changed to 2 - GET /api/v1/klines weight changed to 2 - GET /api/v3/order weight changed to 2 - GET /api/v3/allOrders weight changed to 20 - GET /api/v3/account weight changed to 20 - GET /api/v3/myTrades weight changed to 20 - GET /api/v3/historicalTrades weight changed to 20 --- ## Document: /products/common/derivatives-trading/quick-start URL: /en/dev-docs/products/common/derivatives-trading/quick-start # Quick Start ## API Key Setup - Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/faq/how-to-create-api-keys-on-binance-360002502072) regarding API key creation. - Once API key is created, it is recommended to set IP restrictions on the key for security reasons. - **Never share your API key/secret key to ANYONE.** ## API Key Restrictions - After creating the API key, the default restrictions is `Enable Reading`. - To **enable withdrawals via the API**, the API key restriction needs to be modified through the Binance UI. ## Enabling Accounts ### Account A `SPOT` account is provided by default upon creation of a Binance Account. ### Futures Account To enable a `FUTURES` account for Futures Trading, please refer to the [Futures Trading Guide](https://www.binance.com/en/support/faq/a-beginner-s-guide-to-futures-trading-website-360039304272) ### Futures Testnet Users can use the Futures Testnet to practice `FUTURES` trading. Currently, this is only available via the API. Please refer to the [Futures Demo Trading page](https://demo.binance.com/en/futures/BTCUSDT) for more information and how to set up the Demo Trading API key. ### Option Account To enable a `OPTION` account for Option Trading, please refer to the [Option Trading Guide](https://www.binance.com/en/support/faq/introduction-to-binance-options-374321c9317c473480243365298b8706) ## API Library ### Python connector This is a lightweight library that works as a connector to Binance public API, written in Python. [https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python) ### Java connector This is a lightweight library that works as a connector to Binance public API, written for Java users. [https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java) --- ## Document: /products/common/derivatives-trading/change-log URL: /en/dev-docs/products/common/derivatives-trading/change-log # Change Log ## 2026-06-20 USDⓈ-M Futures - `POST /fapi/v1/algoOrder` (New Algo Order) - Request Weight now follows the order rate limits: `1` on 10s order rate limit (`X-MBX-ORDER-COUNT-10S`) and `1` on 1min order rate limit (`X-MBX-ORDER-COUNT-1M`). IP weight remains `0`. --- ## 2026-06-16 **Time-sensitive Notice** - **Update:** The Futures COIN-M demo trading maintenance window is extended. The new window is from 2026-06-16 02:00:00 till 2026-06-23 10:00:00 (UTC). We appreciate your patience and understanding. --- ## 2026-06-10 **Effective Date: 2026-06-30** COIN-M Futures architecture integration with USDⓈ-M Futures — REST endpoints, WebSocket streams, and account-level behavior changes. See [Important CM-UM Integration Notice](/products/derivatives-trading-coin-futures/Important-CM-UM-Integration-Notice) for the full list of affected endpoints and the action items. --- ## 2026-06-02 **Effective Date: 2026-06-02** USDⓈ-M Futures - `GET /fapi/v1/tradingSchedule` (Trading Schedule) - Extended time range from 7 days forward to **7 days backward and 7 days forward** starting from the day prior to the query time. - Added Korean equity market (`KR_EQUITY`) support. Korean equity market session types: `REGULAR` and `NO_TRADING`. - WebSocket Stream `tradingSession` (Trading Session Stream) - Added Korean equity market support. - Added new event type `KR_EquityUpdate`. Korean equity market session types: `REGULAR` and `NO_TRADING`. --- ## 2026-05-11 **Effective Date: 2026-05-13** USDⓈ-M Futures - `POST /fapi/v1/positionSide/dual` - New error code `-4531`: When changing UM `dualSidePosition`, the system will automatically sync CM `dualSidePosition`. If the CM account has any open position or open order, the sync cannot proceed and the UM position mode change will be rejected with error code `-4531`. - Error payload: ```json { "code": -4531, "msg": "Position mode change requires syncing UM and CM. Please close any open positions or orders in CM and try again." } ``` - **Note**: This error code is temporary and will only be active until CM enters Guard (approximately 1 month). After CM enters Guard, this error will no longer occur. --- ## 2026-04-17 Portfolio Margin Pro - User Data Stream: - Add new event `PM_PRO_ACCOUNT_UPDATE`, which pushes account asset status every 5 seconds. --- ## 2026-04-15 European Options - Trade - Cancel Multiple Option Orders - Corrected request weight from 1 to 5. --- ## 2026-04-14 Portfolio Margin - The following REST Endpoints and WebSocket User Data Streams will be enabled from 2026-04-28: - REST: - POST `/papi/v1/um/algo/order` - DELETE `/papi/v1/um/algo/order` - DELETE `/papi/v1/um/algo/allOpenOrders` - GET `/papi/v1/um/algo/algoOrder` - GET `/papi/v1/um/algo/openAlgoOrders` - GET `/papi/v1/um/algo/allAlgoOrders` - Websocket: - `ALGO_UPDATE`: algo order update event - The following REST Endpoints will be deprecated from 2026-04-28 - REST: - POST `/papi/v1/um/conditional/order` - DELETE `/papi/v1/um/conditional/order` - DELETE `/papi/v1/um/conditional/allOpenOrders` - GET `/papi/v1/um/conditional/allOrders` - GET `/papi/v1/um/conditional/openOrders` - GET `/papi/v1/um/conditional/openOrder` - GET `/papi/v1/um/conditional/orderHistory` Please refer to [announcement](https://www.binance.com/en/support/announcement/detail/13980e4145ee41259d32f985161d81b6) for API replacement --- ## 2026-04-13 Portfolio Margin and Portfolio Margin Pro New REST APIs: - `POST /sapi/v1/portfolio/margin-call-level` : Set the margin call level for a Portfolio Margin account. When the account's uniMMR drops to the specified level, a notification will be sent via email and SMS. - `GET /sapi/v1/portfolio/margin-call-level` : Get the margin call level for a Portfolio Margin account. - `DELETE /sapi/v1/portfolio/margin-call-level` : Delete the margin call level for a Portfolio Margin account. --- ## 2026-04-10 **Effective Date: 2026-04-14** COIN-M Futures / Portfolio Margin and Portfolio Margin Pro - `POST /dapi/v1/positionSide/dual` and `POST /papi/v1/cm/positionSide/dual` - CM `dualSidePosition` must now stay consistent with UM. If CM `dualSidePosition` is already the same as UM, changing it will be rejected. USDⓈ-M Futures - Liquidation Order Streams (`@forceOrder`) and All Market Liquidation Order Streams (`!forceOrder@arr`) - Updated description: changed "only the latest one liquidation order" to "only the largest one liquidation order" within 1000ms. --- ## 2026-04-09 Portfolio Margin - User Data Stream - [Event: Margin Order Update](pm/user-data-streams/Event-Margin-Order-Update) - Added new fields to the `executionReport` event payload: `Cs`, `pl`, `pL`, `pY`, `eR`. --- ## 2026-04-08 Portfolio Margin New REST APIs: - `POST /papi/v1/um/stock/contract` : sign TradFi-Perps agreement contract --- ## 2026-04-06 USDⓈ-M Futures / COIN-M Futures / Portfolio Margin and Portfolio Margin Pro - `GET /fapi/v1/forceOrders`, `GET /dapi/v1/forceOrders`, `GET /papi/v1/um/forceOrders` and `GET /papi/v1/cm/forceOrders` - Added note: Only support querying data in the past 90 days. --- ## 2026-04-02 USDⓈ-M Futures - WebSocket - Updated [important websocket change notice](/products/derivatives-trading-usds-futures/websocket-market-streams/Important-WebSocket-Change-Notice) with legacy URL decommissioning date: **2026-04-23**. --- ## 2026-03-19 USDⓈ-M Futures / COIN-M Futures - `GET /fapi/v1/historicalTrades` and `GET /dapi/v1/historicalTrades` - Updated data availability from the last 3 months to the last 1 month. ## 2026-03-16 USDⓈ-M Futures - Websocket Market Streams - Add new field `ap` in `Mark-Price-Stream` and `Mark-Price-Stream-for-All-market` to show mark price moving average. ## 2026-03-11 Option - Effective on 2026-03-19 - Self-Trade Prevention: - Similar to USDⓈ-M Futures, Self-Trade Prevention (aka STP) is added to the system. This prevents orders from matching with orders from the same account, or accounts under the same tradeGroupId - User can set selfTradePreventionMode when placing new orders. All option symbols support the following STP mode: - EXPIRE_MAKER: expire maker order when STP trigger - EXPIRE_TAKER: expire taker order when STP trigger - EXPIRE_BOTH: expire taker and maker order when STP trigger - REST Update: - New order status EXPIRED_IN_MATCH - This means that the order expired due to STP being triggered. - Add optional parameter selfTradePreventionMode in the endpoints below to set order's STP mode: - POST /eapi/v1/order - POST /eapi/v1/batchOrders - Add new field selfTradePreventionMode in response of the endpoints below to show order's STP mode: - POST /eapi/v1/order - POST /eapi/v1/batchOrders - GET /eapi/v1/order - GET /eapi/v1/openOrders - PUT /eapi/v1/order - PUT /eapi/v1/batchOrders - DELETE /eapi/v1/order - DELETE /eapi/v1/batchOrders - WEBSOCKET User Data Stream: - Add new field V in ORDER_TRADE_UPDATE to order STP mode. ## 2026-03-05 USDⓈ-M Futures - WebSocket - Add [important websocket change notice](usds-margined-futures/websocket-market-streams/Important-WebSocket-Change-Notice). - Added `URL PATH` section to all websocket market stream pages indicating the new base URL path (`/public`, `/market`). - Added `URL PATH` section to all user data stream event pages indicating the new base URL path (`/private`). ## 2026-01-09 Portfolio Margin and Portfolio Margin Pro - New endpoints for switch to Delta Mode: - `POST /sapi/v1/portfolio/delta-mode`: Switch the Delta Mode for existing PM PRO / PM RETAIL accounts. - `GET /sapi/v1/portfolio/delta-mode`: Query the Delta mode status of current account. ## 2026-01-07 Option - New REST APIs: - `GET /eapi/v1/commission`: query user commission rate ## 2025-12-29 USDⓈ-M Futures - The parameter "filterType": "MAX_NUM_ALGO_ORDERS" has been removed from the endpoint `GET /fapi/v1/exchangeInfo`. The condtional order limits is 200 across all symbols. - Effective on 2025-12-31, field `nq` will be available in `@aggTrade` stream. For this new field, only normal market trades will be aggregated, which means the trades involving RPI orders won't be aggregated. ## 2025-12-11 USDⓈ-M Futures - New REST APIs: - `GET /fapi/v1/tradingSchedule`: query trading session schedules for a one-week period - `POST /fapi/v1/stock/contract`: sign TradFi-Perps agreement contract - New Websocket API: - `tradingSession`: query current trading session information ## 2025-12-10 - Since conditional orders have been migrated to the Algo Service, the event `CONDITIONAL_ORDER_TRIGGER_REJECT` will be deprecated effective December 15, 2025. Any conditional order rejection reasons are provided within the `ALGO_UPDATE` event. ## 2025-12-09 COIN-M Futures - Effective on 2025-12-10, Order expire reason field `er` will be available in `ORDER_TRADE_UPDATE` stream. ## 2025-11-25 USDⓈ-M Futures - Effective on **2025-11-26**, RPI commisson fee is available in the response of User Commission Rate endpoint - REST - `GET /fapi/v1/commissionRate` - New endpoints to fetch RPI order book - REST - `GET /fapi/v1/rpiDepth` - WebSocket - `@rpiDepth@500ms` ## 2025-11-19 USDⓈ-M Futures - REST API - `GET /fapi/v1/symbolAdlRisk`: New endpoints to query ADL risk rating ## 2025-11-18 USDⓈ-M Futures - The RPI order is introduced to USDⓈ-M Futures - New time-in-force ENUM value - RPI is supported in - REST - `POST /fapi/v1/order` - `POST /fapi/v1/batchOrders` - WebSocket - `order.place` - New fields in the market data response - Boolean "IsRPITrade" available in - REST - `GET /fapi/v1/trades` - `GET /fapi/v1/historicalTrades` - Order Book Exclusion - RPI orders don't appear in - REST - `GET /fapi/v1/depth` - `GET /fapi/v1/ticker/bookTicker` - WebSocket - `ticker.book` - `@bookTicker` - `!bookTicker` - `@depth` - `@depth` - For more details, please refer to ## 2025-11-12 Binance Derivative is rebuilding the Options system to enhance overall stability, performance, and scalability, while also introducing new features. As the first step, a new Options Demo API environment has been launched to help existing users adapt their code to the updated system. Documentation is available under the "Options Demo Trading" tab. To get started, please visit to create a new API key. This key can be used to access the new Options Demo Trading environment. ## 2025-11-10 - As BFUSD has been migrated to Binance Earn on 2025-08-13. The following endpoints is deprecated: - `POST sapi/v1/portfolio/mint` - `POST sapi/v1/portfolio/redeem` ## 2025-11-06 - Effective on **2025-12-09**, USDⓈ-M Futures will migrate conditional orders to the Algo Service, which will affect the following order types: `STOP_MARKET`/`TAKE_PROFIT_MARKET`/`STOP`/`TAKE_PROFIT`/`TRAILING_STOP_MARKET`. - The new endpoints for conditional orders of REST API : - `POST fapi/v1/algoOrder`: Place an algo order - `DELETE /fapi/v1/algoOrder`: Cancel an algo order - `DELETE fapi/v1/algoOpenOrders`: Cancel all open algo orders - `GET /fapi/v1/algoOrder`: Query an algo order - `GET /fapi/v1/openAlgoOrders`: Query algo open order(s) - `GET /fapi/v1/allAlgoOrders`: Query algo order(s) - The following enpoints will block the requests for order types after the migration: `STOP_MARKET`/`TAKE_PROFIT_MARKET`/`STOP`/`TAKE_PROFIT`/`TRAILING_STOP_MARKET`. The error code `-4120` STOP_ORDER_SWITCH_ALGO will be encountered. - `POST /fapi/v1/order` - `POST /fapi/v1/batchOrders` - Websocket User Stream Update - New algo order event: `ALGO_UPDATE` - Websocket API Update - New algo order : `algoOrder.place` - Cancel algo order: `algoOrder.cancel` - Please note that after the migration: - No margin check before the conditional order gets triggered. - GTE_GTC orders no longer depend on open orders of the opposite side, but rather on positions only. - There should be no latency increase in order triggering. - Modification of untriggered conditional orders is not supported. ## 2025-10-21 - Effective **2025-10-23**, the `priceMatch` enum values **`OPPONENT_10`** and **`OPPONENT_20`** are temporarily removed from **place/amend** flows, other enums are not impacted. Affected endpoints: **USDT-M Futures (`/fapi`)** - `POST /fapi/v1/order` - `POST /fapi/v1/batchOrders` - `PUT /fapi/v1/order` - `PUT /fapi/v1/batchOrders` **COIN-M Futures (`/dapi`)** - `POST /dapi/v1/order` - `POST /dapi/v1/batchOrders` - `PUT /dapi/v1/order` - `PUT /dapi/v1/batchOrders` **Portfolio Margin (`/papi`)** - `POST /papi/v1/um/order` - `PUT /papi/v1/um/order` - `POST /papi/v1/um/conditional/order` - `POST /papi/v1/cm/order` - `PUT /papi/v1/cm/order` - `POST /papi/v1/cm/conditional/order` ## 2025-10-20 USDⓈ-M Futures - Effective 2025-10-23, Order expire reason field `er` will be available in `ORDER_TRADE_UPDATE` stream. ## 2025-10-14 - Effective 2025-10-23, the error message for the code below will be updated: ```javascript { "code": -1008, "msg": "Request throttled by system-level protection. Reduce-only/close-position orders are exempt. Please try again." } ``` ## 2025-10-09 - Futures now supports trading pair symbols in Chinese. Example from `exchangeInfo`: `"symbol": "测试USDT"`. - When placing orders via API, if `symbol` contains Chinese characters, it **must** be URL-encoded (UTF-8 percent-encoding). Example: `https://fapi.binance.com/fapi/v1/order?symbol=%E6%B5%8B%E8%AF%95USDT&side=BUY&type=TAKE_PROFIT_MARKET&timeInForce=GTE_GTC&quantity=1&stopPrice=30×tamp=1760000007980` - The `symbol` field in push messages (WebSocket/User Data Stream) may also contain Chinese. Ensure clients/downstream systems handle decoding and rendering properly. - Requests with unencoded Chinese `symbol` may fail or return parameter parsing errors. ## 2025-08-11 - BFUSD will be migrated to Binance Earn on 2025-08-13. The following endpoints will be deprecated after the migration: - `POST sapi/v1/portfolio/mint` - `POST sapi/v1/portfolio/redeem` - Error code `-21015` ENDPOINT_GONE will be encountered. - Portfolio Margin and Portfolio Margin Pro users can switch to Binance Earn for BFUSD minting and redeeming. After the migration, the existing BFUSD under the Portfolio Margin wallet can use the aggregate balance function(`POST /sapi/v1/portfolio/asset-collection`) first, and transfer from Portfolio Margin wallet to Spot wallet for redemption. ## 2025-07-25 - Added new error code in fapi: - `-4109`: _This account is inactive. Please activate it before trading._ This indicates the account has been archived due to inactivity. To activate it, transfer any amount of asset to the USDM Futures account. ## 2025-07-02 USDⓈ-M Futures - REST API - `GET /futures/data/openInterestHist`: add response field `CMCCirculatingSupply` - Websocket Market Streams - A single connection of maximum streams change from 200 to 1024. ## 2025-04-23 USDⓈ-M Futures - REST API - `GET /fapi/v1/insuranceBalance`: New endpoints to query insurance fund balance snapshot - `GET /fapi/v1/constituents`: add response field `price` and `weight` ## 2025-04-15 Portfolio Margin and Portfolio Margin Pro - New endpoints for Earn Asset transfer as collateral: - `POST /sapi/v1/portfolio/earn-asset-transfer`: Transfer LDUSDT for Portfolio Margin - `GET /sapi/v1/portfolio/earn-asset-balance`: Get Transferable Earn Asset Balance for Portfolio Margin ## 2025-02-28 Portfolio Margin - New endpoints to query user pmloan repay record(Release on 2025-02-28): - `GET /sapi/v1/portfolio/pmloan-history` ## 2025-02-20 COIN-M Futures WEBSOCKET API - Websocket API will be available on 2025-02-25 and can be accessed through this URL: `wss://ws-dapi.binance.com/ws-dapi/v1` - WebSocket API allows placing orders, canceling orders, etc. through a WebSocket connection. - WebSocket API is a separate service from WebSocket Market Data streams. I.e., placing orders and listening to market data requires two separate WebSocket connections. - WebSocket API is subject to the same Filter and Rate Limit rules as REST API. - WebSocket API and REST API are functionally equivalent: they provide the same features, accept the same parameters, return the same status and error codes. ## 2025-01-20 Portfolio Margin - New endpoints to query user negative balance auto exchange record(Release on 2025-01-22): - `GET /papi/v1/portfolio/negative-balance-exchange-record` ## 2025-01-13 USDⓈ-M Futures & COIN-M Futures - The following endpoints will be updated at 2024-01-14: - `GET /fapi/v1/historicalTrades` - `GET /dapi/v1/historicalTrades` Changes to the request parameter `limit`: - Maximum value changed from 1000 to 500 - Default value changed from 500 to 100 ## 2025-01-06 Portfolio Margin - New endpoints to query user rate limit: - `GET papi/v1/rateLimit/order` ## 2024-12-19 Portfolio Margin Pro & Portfolio Margin - New endpoints for BFUSD mint and redeem(Release on 2024-12-20): - `POST sapi/v1/portfolio/mint` - `POST sapi/v1/portfolio/redeem` ## 2024-12-17 Options - REST API: Added new endpoint `GET /eapi/v1/blockTrades` to get recent block trades - Websocket Market Streams: Add field `X` in streams `@trade` and `@trade` to show trade type ## 2024-12-02 USDⓈ-M Futures - The following error code will be added on 2024-12-03: - `-4116`: ClientOrderId is duplicated. - `-4117`: Stop order is in triggering process. Please try again later. ## 2024-11-04 USDⓈ-M Futures & COIN-M Futures - `GET /fapi/v1/pmExchangeInfo` and `GET /dapi/v1/pmExchangeInfo` will be deprecated on 2024-11-15 ## 2024-11-01 Options - Add block trade endpoints: - `POST eapi/v1/block/order/create` - `PUT eapi/v1/block/order/create` - `DELETE eapi/v1/block/order/create` - `GET eapi/v1/block/order/orders` - `POST eapi/v1/block/order/execute` - `GET eapi/v1/block/order/execute` - `GET eapi/v1/block/user-trades` ## 2024-10-29 Portfolio Margin Pro - The following REST endpoints will be adjusted: - `POST /sapi/v1/portfolio/repay-futures-switch`: Effective on 2024-11-01, rate limit will be adjusted to 20/day. Portfolio Margin - The following REST endpoints will be adjusted: - `POST /papi/v1/repay-futures-switch`: Effective on 2024-11-01, rate limit will be adjusted to 20/day. ## 2024-10-24 Options - API Field Removal(Effective 2024-10-28): - In the `GET /eapi/v1/exchangeInfo` endpoint, the `id` field will be removed from `optionContracts`, the `id` field will been removed from `optionAssets`, and both the `contractId` and `id` fields have been removed from `optionSymbols`. - The `id` and `cid` fields will been removed from the `option_pair` websocket stream ## 2024-10-21 USDⓈ-M Futures & COIN-M Futures - Effective from 2024-10-30 00:00 (UTC), the endpoints will only support querying futures trade histories within the most recent 6 months: - `GET /fapi/v1/userTrades` - `GET /dapi/v1/userTrades` COIN-M Futures - Add new historical data download endpoint: - `GET /dapi/v1/order/asyn`: to get Download Id For Futures Order History - `GET /dapi/v1/order/asyn/id`: to get Futures Order History Download Link by Id - `GET /dapi/v1/trade/asyn`: to get Download Id For Futures Trade History - `GET /dapi/v1/trade/asyn/id`: to get Futures Trade History Download Link by Id ## 2024-10-15 Portfolio Margin Pro(Release date 2024-10-18) - New endpoint to get Portfolio Margin Pro SPAN Account Info(For Portfolio Margin Pro SPAN users only): - `GET /sapi/v2/portfolio/account` - New endpoint to get Portfolio Margin Pro Account Balance Info: - `GET /sapi/v1/portfolio/balance` Portfolio Margin - New endpoint to get download id for UM futures trade history: - `GET /papi/v1/um/trade/asyn` - New endpoint to get UM futures trade download link by Id: - `GET /papi/v1/um/trade/asyn/id` - New endpoint to get download id for UM futures order history: - `GET /papi/v1/um/order/asyn` - New endpoint to get UM futures order download link by Id: - `GET /papi/v1/um/order/asyn/id` - New endpoint to get download id for UM futures transaction history: - `GET /papi/v1/um/income/asyn` - New endpoint to get UM futures transaction download link by Id: - `GET /papi/v1/um/income/asyn/id` ## 2024-10-14 USDⓈ-M Futures - The following REST endpoints will be adjusted: - `POST /fapi/v1/convert/getQuote`: Effective on 2024-10-19, rate limit will be adjusted to 360/hour, 500/day. - `POST /fapi/v1/convert/getQuote`: `validTime` can only be set to `10s` ## 2024-10-11 COIN-M Futures - **Self-Trade Prevention**: - Self-Trade Prevention (aka STP) is added to the system. This prevents orders from matching with orders from the same account, or accounts under the same `tradeGroupId`(currently only support same account). For more detail, please check [FAQ](https://www.binance.com/zh-CN/support/faq/what-is-self-trade-prevention-0941126f6413485b9a3df964a9aa2306) - User can set `selfTradePreventionMode` when placing new orders. All symbols support the following STP mode: - NONE: No Self-Trade Prevention - EXPIRE_TAKER: expire taker order when STP trigger - EXPIRE_BOTH: expire taker and maker order when STP trigger - EXPIRE_MAKER: expire maker order when STP trigger - REST Update: - New order status `EXPIRED_IN_MATCH` - This means that the order expired due to STP being triggered. - Add optional parameter `selfTradePreventionMode` in the endpoints below to set order's STP mode: - `POST /dapi/v1/order` - `POST /dapi/v1/batchOrders` - Add new field `selfTradePreventionMode` in response of the endpoints below to show order's STP mode: - `POST /dapi/v1/order` - `POST /dapi/v1/batchOrders` - `GET /dapi/v1/order` - `GET /dapi/v1/openOrders` - `GET /dapi/v1/allOrders` - `PUT /dapi/v1/order` - `PUT /dapi/v1/batchOrders` - `DELETE /dapi/v1/order` - `DELETE /dapi/v1/batchOrders` - WEBSOCKET User Data Stream: - Add new field `V` in `ORDER_TRADE_UPDATE` to order STP mode. - **Price Match** - Coin margin future supports order price match function. This feature allows users' LIMIT/STOP/TAKE_PROFIT orders to be placed without entering a price. The price match function will automatically determine the order price in real-time based on the price match mode and the order book. - The following priceMatch modes are supported on order level: - NONE: no price match - OPPONENT: counterparty best price - OPPONENT_5: counterparty 5th best price - OPPONENT_10: counterparty 10th best price - OPPONENT_20: counterparty 20th best price - QUEUE: the best price on the same side of the order book - QUEUE_5: the 5th best price on the same side of the order book - QUEUE_10: the 10th best price on the same side of the order book - QUEUE_20: the 20th best price on the same side of the order book - Example: - User places buy order and set priceMatch as QUEUE_5, the order price will be 5th best bid price of the orderbook - User places buy order and set priceMatch as OPPONENT, the order price will be best ask price of the orderbook - REST Update: - Add optional parameter priceMatch in the endpoints below to set order's priceMatch mode: - `POST /dapi/v1/order` - `POST /dapi/v1/batchOrders` - Add new field priceMatch in response of the endpoints below to show order's priceMatch mode: - `POST /dapi/v1/order` - `POST /dapi/v1/batchOrders` - `GET /dapi/v1/order` - `GET /dapi/v1/openOrders` - `GET /dapi/v1/allOrders` - `PUT /dapi/v1/order` - `PUT /dapi/v1/batchOrders` - `DELETE /dapi/v1/order` - `DELETE /dapi/v1/batchOrders` - WEBSOCKET User Data Stream: - Add new field `pm` in `ORDER_TRADE_UPDATE` to show price match mode. ## 2024-10-10 USDⓈ-M Futures - Binance will update the following endpoints, estimated to be in force on 2024-10-17 03:00 (UTC). After 2024-10-17 03:00 (UTC), the endpoints will support querying futures trade histories that are not older than one year: - `GET /fapi/v1/aggTrades` - `GET /dapi/v1/aggTrades` - Binance will update the following endpoints, estimated to be in force on 2024-10-16 03:00 (UTC). After 2024-10-16 03:00 (UTC), the endpoint will support querying future histories that are not older than 30 days: - `GET /fapi/v1/positionMargin/history` ## 2024-10-08 COIN-M Futures - The most recent 7-days data is returned by default when requesting the following endpoints. The query time period for these endpoints must be less than 7 days: - `GET /dapi/v1/allOrders` - `GET /dapi/v1/userTrades` - The following endpoints will be adjusted to keep only recent three month data: - `GET /dapi/v1/order` - `GET /dapi/v1/allOrders` ## 2024-09-27 USDⓈ-M Futures - The following websocket user data requests are deprecated: - `listenkey@account` - `listenkey@balance` - `listenkey@position` COIN-M Futures - The following websocket user data requests are deprecated: - `listenkey@account` - `listenkey@balance` - `listenkey@position` ## 2024-09-19 Portfolio Margin - New endpoint to repay debt for Margin: - `POST /papi/v1/margin/repay-debt`: Repay debt for a margin loan. ## 2024-09-06 Portfolio Margin - Update endpoint for Portfolio Margin/Trade(Release date 2024-09-06): - `POST /papi/v1/um/order`: add parameter `priceMatch` to support priceMatch for place order - `POST/papi/v1/um/conditional/order`: add parameter `priceMatch` to support priceMatch for plac conditional order - `PUT /papi/v1/um/order`: add parameter `priceMatch` to ssupport priceMatch for order modification - Add new field `priceMatch` in response of the endpoints below to show order's priceMatch: - `POST /papi/v1/um/order` - `POST/papi/v1/um/conditional/order` - `PUT /papi/v1/um/order` - `GET /papi/v1/um/orderAmendment` - `GET /papi/v1/um/order` - `GET /papi/v1/um/openOrder` - `GET /papi/v1/um/openOrders` - `GET /papi/v1/um/allOrders` - `GET /papi/v1/um/conditional/openOrder` - `GET /papi/v1/um/conditional/openOrders` - `GET /papi/v1/um/conditional/orderHistory` - `GET /papi/v1/um/conditional/allOrders` - `DELETE /papi/v1/um/order` - `DELETE /papi/v1/um/conditional/order` - WEBSOCKET - Add new field `pm` in `ORDER_TRADE_UPDATE` and `CONDITIONAL_ORDER_TRADE_UPDATE`, which represents priceMatch . ## 2024-09-05 Portfolio Margin Pro - New endpoint to query Portfolio Margin Pro Tiered Collateral Rate: - `GET /sapi/v2/portfolio/collateralRate`: Query Portfolio Margin Pro Tiered Collateral Rate. ## 2024-09-03 USDⓈ-M Futures - User data stream will add `TRADE_LITE` event. `TRADE_LITE` event designed to reduce user data latency by focusing solely on ‘TRADE’ execution type and minimizing the number of user data fields, providing a faster and more efficient experience compared to the original `ORDER_TRADE_UPDATE` user data stream. ## 2024-08-26 USDⓈ-M Futures - New endpoint to Future Convert: - `GET /fapi/v1/convert/exchangeInfo` - `POST /fapi/v1/convert/getQuote` - `POST /fapi/v1/convert/acceptQuote` - `GET /fapi/v1/convert/orderStatus` ## 2024-08-23 Portfolio Margin - New endpoint to toggle UM Futures BNB Burn: - `POST /papi/v1/um/feeBurn`: Toggle BNB Burn on UM Futures Trade. - `GET /papi/v1/um/feeBurn`: Get UM Futures BNB Burn status. - New Endpoints to Query Account Information: - `GET /papi/v1/um/accountConfig`: Query user UM account configuration. - `GET /papi/v1/um/symbolConfig`: Query user symbol configuration. - `GET /papi/v2/um/account`: Compared to `GET /papi/v1/um/account`, this endpoint only returns symbols that the user has positions or open orders in. Configuration-related fields have been removed and can now be queried from `GET /papi/v1/um/symbolConfig` and `GET /papi/v1/um/accountConfig`. The V2 endpoint also offers better performance. ## 2024-08-07 USDⓈ-M Futures - The following endpoints IP weight limit will be adjusted from 2024-09-03: - REST API: - `GET /fapi/v2/balance`: 5->10 - `GET /fapi/v2/account`: 5->10 - `GET /fapi/v2/positionRisk`: 5->10 - Websocket API: - `account.status`: 5->10 - `account.balance`: 5->10 - `account.position`: 5->10 - The following WebSocket User Data Requests will be deprecated from 2024-09-03 - \@account - \@balance - \@position Please refer to [annoucement](https://www.binance.com/en/support/announcement/notice-on-upcoming-binance-api-update-2024-09-03-19d4e3cd0758426584dd9686eb56ec64) for api replacement ## 2024-08-06 COIN-M Futures `GET /dapi/v1/pmExchangeInfo` will be deprecated on August 6,2024 due to removing `notionalLimit` restriction. ## 2024-07-24 USDⓈ-M Futures #### REST API - New Endpoints to Query Account Information: - `GET /fapi/v1/symbolConfig`: Query user symbol configuration. - `GET /fapi/v1/accountConfig`: Query user account configuration. - `GET /fapi/v3/account`: Compared to `GET /fapi/v2/account`, this endpoint only returns symbols that the user has positions or open orders in. Configuration-related fields have been removed and can now be queried from `GET /fapi/v1/symbolConfig` and `GET /fapi/v1/accountConfig`. The V3 endpoint also offers better performance. - `GET /fapi/v3/balance`: Query user account balance. - New Endpoints to Query Trade Information: - `GET /fapi/v3/positionRisk`: Compared to `GET /fapi/v2/positionRisk`, this endpoint only returns symbols that the user has positions or open orders in. Configuration-related fields have been removed and can now be queried from `GET /fapi/v1/symbolConfig`. The V3 endpoint also offers better performance. #### WebSocket API - New Endpoints to Query Account Information: - `v2/account.status`: Compared to `account.status`, this endpoint only returns symbols that the user has positions or open orders in. Configuration-related fields have been removed and can now be queried from `GET /fapi/v1/symbolConfig` and `GET /fapi/v1/accountConfig`. The V2 endpoint also offers better performance. - `v2/account.balance`: Query user account balance. - `v2/account.position`: Compared to `account.position`, this endpoint only returns symbols that the user has positions or open orders in. Configuration-related fields have been removed and can now be queried from `GET /fapi/v1/symbolConfig`. The V2 endpoint also offers better performance. **Deprecation Notice:** - The following endpoints will be deprecated in the coming months (exact date to be announced later). Please switch to the new endpoints listed above: - REST API: - `GET /fapi/v2/balance` - `GET /fapi/v2/account` - `GET /fapi/v2/positionRisk` - Websocket API: - `account.status` - `account.balance` - `account.position` --- ## 2024-07-17 Portfolio Margin REST API - The response field `marginAsset` in `GET /papi/v1/um/userTrades` will be removed on 2024-07-17. --- ## 2024-06-19 USDⓈ-M Futures REST API - The response field `marginAsset` in `GET /fapi/v1/userTrades` will be removed on 2024-06-25. --- ## 2024-05-22 USDⓈ-M Futures REST API & Websocket API - New endpoint to toggle BNB Burn: - `POST /fapi/v1/feeBurn` to toggle BNB Burn on Futures Trade. - `GET /fapi/v1/feeBurn` to get BNB Burn status. --- ## 2024-04-19 USDⓈ-M Futures REST API & Websocket API - The new field listenKey will be integrated into the response received from the `PUT /fapi/v1/listenKey` endpoint and WebSocket api `userDataStream.ping`. This enhancement will allow users to view the key that has been kept alive. This update is scheduled to take effect on 2024-04-25. ```javascript { "listenKey": "3HBntNTepshgEdjIwSUIBgB9keLyOCg5qv3n6bYAtktG8ejcaW5HXz9Vx1JgIieg" } ``` --- ## 2024-04-09 USDⓈ-M Futures/ COIN-M Futures / Portfolio Margin WEBSOCKET API - Good-Till-Cancel (GTC) timeInForce will have a one-year validity period after order placement. GTC orders longer than one-year will be automatically canceled. This applies to all order types including reduceOnly but does not affect part-filled orders or strategy trading or copy-trading orders. --- ## 2024-04-01 USDⓈ-M Futures WEBSOCKET API - Websocket API is now available and can be accessed through this URL: `wss://ws-fapi.binance.com/ws-fapi/v1` - WebSocket API allows placing orders, canceling orders, etc. through a WebSocket connection. - WebSocket API is a separate service from WebSocket Market Data streams. I.e., placing orders and listening to market data requires two separate WebSocket connections. - WebSocket API is subject to the same Filter and Rate Limit rules as REST API. - WebSocket API and REST API are functionally equivalent: they provide the same features, accept the same parameters, return the same status and error codes. --- ## 2024-03-11 USDⓈ-M Futures REST - Add new Account Endpoints: - `GET /fapi/v1/rateLimit/order`: query user order rate limits --- ## 2024-02-09 USDⓈ-M Futures Binance Future is doing Websocket Service upgrade and the upgrade impacts the following: - Before upgrade: - The websocket server will send a ping frame every 3 minutes. If the websocket server does not receive a pong frame back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. - After upgrade: - Websocket server will send a `ping frame` every 3 minutes. - If the websocket server does not receive a `pong frame` back from the connection within a 10 minute period, the connection will be disconnected. - When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible. - Unsolicited `pong frames` are allowed, but will not prevent disconnection. **It is recommended that the payload for these pong frames are empty.** --- ## 2024-01-24 USDⓈ-M Futures Testnet WEBSOCKET - The Websocket baseurl for **testnet** is updated to "wss://fstream.binancefuture.com" --- ## 2024-01-19 Portfolio Margin - REST - New endpoints `PUT /papi/v1/um/order` and `PUT /papi/v1/cm/order` to support UM/CM limit order modify - New endpoints `GET /papi/v1/um/orderAmendment` and `GET /papi/v1/cm/orderAmendment` to get UM/CM order modify history --- ## 2024-01-11 Portfolio Margin - **Self-Trade Prevention(Released):** - Self-Trade Prevention (aka STP) will be added to the system. This will prevent orders from matching with orders from the same account, or accounts under the same `tradeGroupId`. For more detail, please check [FAQ](https://www.binance.com/en/support/faq/what-is-self-trade-prevention-stp-0941126f6413485b9a3df964a9aa2306) - User can set `selfTradePreventionMode` when placing new orders. All symbols support the following STP mode: - NONE: No Self-Trade Prevention - EXPIRE_TAKER: expire taker order when STP trigger - EXPIRE_BOTH: expire taker and maker order when STP trigger - EXPIRE_MAKER: expire maker order when STP trigger - REST Update: - New order status `EXPIRED_IN_MATCH` - This means that the order expired due to STP being triggered. - GET /papi/v1/um/account: Add new field `tradeGroupId` in response to show user's tradeGroupId - Add optional parameter `selfTradePreventionMode` in the endpoints below to set order's STP mode: - POST /papi/v1/um/order - POST/papi/v1/um/conditional/order - POST /papi/v1/margin/order - POST /papi/v1/margin/order/oco - Add new field `selfTradePreventionMode` in response of the endpoints below to show order's STP mode: - POST /papi/v1/um/order - POST/papi/v1/um/conditional/order - GET /papi/v1/um/order - GET /papi/v1/um/openOrder - GET /papi/v1/um/openOrders - GET /papi/v1/um/allOrders - GET /papi/v1/um/conditional/openOrder - GET /papi/v1/um/conditional/openOrders - GET /papi/v1/um/conditional/orderHistory - GET /papi/v1/um/conditional/allOrders - DELETE /papi/v1/um/order - DELETE /papi/v1/um/conditional/order - DELETE /papi/v1/margin/order - DELETE /papi/v1/margin/allOpenOrders - DELETE /papi/v1/margin/orderList - GET /papi/v1/margin/order - GET /papi/v1/margin/allOrders - GET /papi/v1/margin/orderList - GET /papi/v1/margin/allOrderList - GET /papi/v1/margin/openOrderList - WEBSOCKET User Data Stream: - Add new field `V` in `ORDER_TRADE_UPDATE` and `CONDITIONAL_ORDER_TRADE_UPDATE` to order STP mode. - New fields for `executionReport` (These fields will only appear if the order has expired due to STP trigger) - `u` - `tradeGroupId` - `v` - `preventedMatchId` - `U` - `counterOrderId` - `A` - `preventedQuantity` - `B` - `lastPreventedQuantity` - **Good Till Date TIF(Released)** - USDⓈ margin future will support Good To Date TIF. Orders with the TIF set to GTD will be automatically canceled by the `goodTillDate` time. - REST Update: - Add optional parameter `goodTillDate` in the endpoints below to set order's `goodTillDate` : - POST /papi/v1/um/order - POST/papi/v1/um/conditional/order - Add new field `goodTillDate` in response of the endpoints below to show order's `goodTillDate`: - POST /papi/v1/um/order - POST/papi/v1/um/conditional/order - GET /papi/v1/um/order - GET /papi/v1/um/openOrder - GET /papi/v1/um/openOrders - GET /papi/v1/um/allOrders - GET /papi/v1/um/conditional/openOrder - GET /papi/v1/um/conditional/openOrders - GET /papi/v1/um/conditional/orderHistory - GET /papi/v1/um/conditional/allOrders - DELETE /papi/v1/um/order - DELETE /papi/v1/um/conditional/order - WEBSOCKET User Data Stream: - Add new field `gtd` in `ORDER_TRADE_UPDATE` and `CONDITIONAL_ORDER_TRADE_UPDATE` to order good till date. - **Breakeven Price(Released)** - REST Update - Add new field `breakEvenPrice` in The following endpoint - GET /papi/v1/um/account - GET /papi/v1/um/positionRisk - GET /papi/v1/cm/account - GET /papi/v1/cm/positionRisk - WEBSOCKET - New field `bep` represents Break-Even Price in position `P` of payload to event: Balance and Position Update – "e": "ACCOUNT_UPDATE" --- ## 2024-01-08 USDⓈ-M Futures REST - Update endpoint for Account/Trade(Release date 2023-01-11): - `PUT /fapi/v1/order`: add parameter `priceMatch` to support priceMatch for order modification - `PUT /fapi/v1/batchOrders`: add parameter `priceMatch` to support priceMatch for order modification - Order modification will preserve the original `selfTradePreventionMode` of the order --- ## 2023-12-12 USDⓈ-M Futures WEBSOCKET - Update speed for stream `!bookTicker` will be modified from real-time to every 5 seconds on starting December 20, 2023. Individual Symbol Book Ticker Streams `@bookticker` will remain unaffected by this update --- ## 2023-11-15 USDⓈ-M Futures REST - Add new Market Data Endpoints: - `GET /fapi/v2/ticker/price`: this is v2 endpoint for querying latest price. It has same parameters and response as the `GET /fapi/v1/ticker/price`, and it offers lower latency and consume less of the IP rate limit. Please note that the `GET /fapi/v1/ticker/price` will be deprecated in the future, with the exact timing to be determined. WEBSOCKET - Binance Futures will retire the `wss://fstream-auth.binance.com` domain at 2023-12-15 06:00. API users are advised to establish a new WebSocket connection to `wss://fstream.binance.com`. Please note that the connection method for `wss://fstream.binance.com` is different from that of `wss://fstream-auth.binance.com`. For instance: - `wss://fstream-auth.binance.com/ws/?listenKey=` should change to `wss://fstream.binance.com/ws/` --- ## 2023-11-01 COIN-M Futures REST - Update on `GET dapi/v1/fundingRate`: - add response field `markPrice` to display mark price associated with a particular funding fee charge --- ## 2023-11-01 USDⓈ-M Futures REST - Add new Market Data Endpoints: - `GET /futures/data/basis`: query basis data - Update on `GET /fapi/v1/fundingRate`: - add response field `markPrice` to display mark price associated with a particular funding fee charge --- ## 2023-10-19 COIN-M Futures REST - New Market Data Endpoints - `GET /futures/data/delivery-price`: query quarterly contract settlement price - Update Rate Limit to 1000/5min/IP on Market Data Endpoints below: - `GET /futures/data/openInterestHist` - `GET /futures/data/topLongShortAccountRatio` - `GET /futures/data/topLongShortPositionRatio` - `GET /futures/data/globalLongShortAccountRatio` - `GET /futures/data/takerlongshortRatio` --- ## 2023-10-19 European Options Binance Option is doing Websocket Service upgrade and the upgrade impacts the following: - Before upgrade: - The websocket server will send a ping frame every 5 minutes. If the websocket server does not receive a pong frame back from the connection within a 15 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. - To connect websocket server without subscription, user can connect by using - `wss://nbstream.binance.com/eoptions/ws` - `wss://nbstream.binance.com/eoptions/stream` - `wss://nbstream.binance.com/eoptions/ws/` - `wss://nbstream.binance.com/eoptions/stream/` - After upgrade: - The websocket server will send a ping frame every 3 minutes. If the websocket server does not receive a pong frame back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. - To connect websocket server without subscription: - Connect websocket server with subscription: - `wss://nbstream.binance.com/eoptions/ws` - `wss://nbstream.binance.com/eoptions/stream` - `/` at the end is no longer supported - Raw stream like `wss://nbstream.binance.com/eoptions/illegal_parameter/stream?steams=` or `wss://fstream.binance.com/illegal_parameter/ws/`is not supported, please use remove `illegal_parameter/` before `/ws` and `/stream`. --- ## 2023-10-19 USDⓈ-M Futures REST - New Market Data Endpoints - `GET /futures/data/delivery-price`: query quarterly contract settlement price - Update Rate Limit to 1000/5min/IP on Market Data Endpoints below: - `GET /futures/data/openInterestHist` - `GET /futures/data/topLongShortAccountRatio` - `GET /futures/data/topLongShortPositionRatio` - `GET /futures/data/globalLongShortAccountRatio` - `GET /futures/data/takerlongshortRatio` - Update Rate Limit to 500/5min/IP on Market Data Endpoints below: - `GET /fapi/v1/fundingRate` - `GET /fapi/v1/fundingInfo` --- ## 2023-10-16 COIN-M Futures REST - New Market Data Endpoints - `GET /dapi/v1/constituents`: query index constituents --- ## 2023-10-16 USDⓈ-M Futures REST - New Market Data Endpoints - `GET /fapi/v1/constituents`: query index constituents --- ## 2023-10-11 USDⓈ-M Futures REST - Account Endpoints IP Weight Update: - `GET /fapi/v1/income/asyn`: 5->1000 - `GET /fapi/v1/order/asyn`: 5->1000 - `GET /fapi/v1/trade/asyn`: 5->1000 - `GET /fapi/v1/income/asyn/id`: 5->10 - `GET /fapi/v1/order/asyn/id`: 5->10 - `GET /fapi/v1/trade/asyn/id`: 5->10 --- ## 2023-09-25 COIN-M Futures REST - New Market Data Endpoints Update - `GET /dapi/v1/fundingInfo`: query adjusted funding info --- ## 2023-09-25 USDⓈ-M Futures REST - New Market Data Endpoints Update - `GET /fapi/v1/fundingInfo`: query adjusted funding info --- ## 2023-09-22 Portfolio Margin - Update on endpoints: - `GET /papi/v1/um/positionRisk`: add response field `liquidationPrice` - `GET /papi/v1/cm/positionRisk`: add response field `liquidationPrice` - `GET /papi/v1/um/leverageBracket`: add response field `notionalCoef` - `GET /papi/v1/cm/leverageBracket`: add response field `notionalCoef` - Websocket User Data Streams Update: - `outboundAccountPosition` event add new field updateId `U` - `balanceUpdate` event add new field updateId `U` --- ## 2023-09-20 COIN-M Futures REST - Update on `GET /dapi/v1/ticker/bookTicker`: - add response field `lastUpdateId` - Update on `GET /dapi/v1/account`: - add response field `updateTime` in `assets` --- ## 2023-09-20 USDⓈ-M Futures REST - Update on `GET /fapi/v1/ticker/bookTicker`: - add response field `lastUpdateId` --- ## 2023-09-19 USDⓈ-M Futures ```javascript { "code": -1008, "msg": "Server is currently overloaded with other requests. Please try again in a few minutes." } ``` - New error code message for http `503` return code, endpoints below might have this response during high traffic: - `POST /fapi/v1/order` - `PUT /fapi/v1/order` - `DELETE /fapi/v1/order` - `POST /fapi/v1/batchOrder` - `PUT /fapi/v1/batchOrder` - `DELETE /fapi/v1/batchOrder` - `POST /fapi/v1/order/test` - `DELETE /fapi/v1/allOpenOrders` - This is a failure API operation and you can resend your request if you need. --- ## 2023-09-07 COIN-M Futures REST - New endpoint`GET /dapi/v1/income/asyn`to get Download Id For Futures Transaction History - New endpoint`GET /dapi/v1/income/asyn/id`to get Futures Transaction History Download Link by Id --- ## 2023-09-05 USDⓈ-M Futures - As per the [announcement](https://www.binance.com/en/support/announcement/binance-futures-launches-self-trade-prevention-stp-function-for-usd%E2%93%A2-margined-futures-on-api-32916877372243d69154c345200e34b8), Self Trade Prevention is enabled at **2023-09-05**. - Price Match/ Good Till Date TIF/ Breakeven Price(detail in 2023-08-29 changelog) are released at **2023-09-05** --- ## 2023-09-04 Portfolio Margin **Expect 2023-09-07 Release** - Overall papi order ratelimit change from 2400 orders/min to 1200 orders/min, impacted endpoints are: - POST `/papi/v1/um/order` - POST `/papi/v1/cm/order` - POST `/papi/v1/margin/order` - POST `/papi/v1/margin/order/oco` - POST `/papi/v1/um/conditional/order` - POST `/papi/v1/cm/conditional/order` --- ## 2023-08-31 COIN-M Futures Binance Future is doing Websocket Service upgrade and the upgrade impacts the following: - Before upgrade: - The websocket server will send a ping frame every 5 minutes. If the websocket server does not receive a pong frame back from the connection within a 15 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. - After upgrade: - The websocket server will send a ping frame every 3 minutes. If the websocket server does not receive a pong frame back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. --- ## 2023-08-31 USDⓈ-M Futures Binance Future is doing Websocket Service upgrade and the upgrade impacts the following: - Before upgrade: - The websocket server will send a ping frame every 5 minutes. If the websocket server does not receive a pong frame back from the connection within a 15 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. - After upgrade: - The websocket server will send a ping frame every 3 minutes. If the websocket server does not receive a pong frame back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. --- ## 2023-08-29 European Options REST - `GET /eapi/v1/account`: add new field `riskLevel` to show account risk level - `GET /eapi/v1/marginAccount`: add new field`riskLevel` to show account risk level Websocket User Data Stream - Add new event `RISK_LEVEL_CHANGE` to show account riskLevel change --- ## 2023-08-29 USDⓈ-M Futures - **Self-Trade Prevention(Release Date TBD)**: - Self-Trade Prevention (aka STP) will be added to the system. This will prevent orders from matching with orders from the same account, or accounts under the same `tradeGroupId`. For more detail, please check [FAQ](https://www.binance.com/zh-CN/support/faq/what-is-self-trade-prevention-0941126f6413485b9a3df964a9aa2306) - User can set `selfTradePreventionMode` when placing new orders. All symbols support the following STP mode: - NONE: No Self-Trade Prevention - EXPIRE_TAKER: expire taker order when STP trigger - EXPIRE_BOTH: expire taker and maker order when STP trigger - EXPIRE_MAKER: expire maker order when STP trigger - REST Update: - New order status `EXPIRED_IN_MATCH` - This means that the order expired due to STP being triggered. - `GET /fapi/v2/account`: Add new field `tradeGroupId` in response to show user's tradeGroupId - Add optional parameter `selfTradePreventionMode` in the endpoints below to set order's STP mode: - `POST /fapi/v1/order` - `POST /fapi/v1/batchOrders` - Add new field `selfTradePreventionMode` in response of the endpoints below to show order's STP mode: - `POST /fapi/v1/order` - `POST /fapi/v1/batchOrders` - `POST /fapi/v1/order` - `POST /fapi/v1/order` - `GET /fapi/v1/order` - `GET /fapi/v1/openOrders` - `GET /fapi/v1/allOrders` - `PUT /fapi/v1/order` - `PUT /fapi/v1/batchOrders` - `DELETE /fapi/v1/order` - `DELETE /fapi/v1/batchOrders` - WEBSOCKET User Data Stream: - Add new field `V` in `ORDER_TRADE_UPDATE` to order STP mode. --- ## 2023-08-25 COIN-M Futures - Binance Future is doing Websocket Service upgrade and the upgrade impacts the following: - Connect websocket server without subscription: - Before upgrade, user can connect by using: - `wss://dstream.binance.com/ws` - `wss://dstream.binance.com/stream` - `wss://dstream.binance.com/ws/` - `wss://dstream.binance.com/stream/` - After upgrade, user can connect by using: - `wss://dstream.binance.com/ws` - `wss://dstream.binance.com/stream` - `/` at the end is no longer supported - Connect websocket server with subscription: - Raw stream like `wss://dstream.binance.com/illegal_parameter/stream?steams=` or `wss://dstream.binance.com/illegal_parameter/ws/`is not supported, please use remove `illegal_parameter/` before `/ws` and `/stream`. --- ## 2023-08-19 USDⓈ-M Futures - Binance Future is doing Websocket Service upgrade and the upgrade impacts the following: - Connect websocket server without subscription: - Before upgrade, user can connect by using: - `wss://fstream.binance.com/ws` - `wss://fstream.binance.com/stream` - `wss://fstream.binance.com/ws/` - `wss://fstream.binance.com/stream/` - After upgrade, user can connect by using: - `wss://fstream.binance.com/ws` - `wss://fstream.binance.com/stream` - `/` at the end is no longer supported - Connect websocket server with subscription: - Raw stream like `wss://fstream.binance.com/illegal_parameter/stream?steams=` or `wss://fstream.binance.com/illegal_parameter/ws/`is not supported, please use remove `illegal_parameter/` before `/ws` and `/stream`. --- ## 2023-08-18 Portfolio Margin - New endpoints for Query Order: - `GET /papi/v1/margin/order`: Query Margin Account Order - `GET /papi/v1/margin/openOrders`: Query Current Margin Open Order - `GET /papi/v1/margin/allOrders`: Query All Margin Account Orders - `GET /papi/v1/margin/orderList`: Query Margin Account's OCO - `GET /papi/v1/margin/allOrderList`: Query Margin Account's all OCO - `GET /papi/v1/margin/openOrderList`: Query Margin Account's Open OCO - `GET /papi/v1/margin/myTrades`: Query Margin Account's Trade List --- ## 2023-08-14 COIN-M Futures - Update endpoint for Account/Trade: - `GET /dapi/v1/income`: Add parameter `page` for pagination --- ## 2023-08-14 USDⓈ-M Futures - Update endpoint for Account/Trade: - `GET /fapi/v1/income`: Add parameter `page` for pagination --- ## 2023-07-28 Portfolio Margin - New endpoints for account: - `POST /papi/v1/asset-collection`: Fund Collection by Asset --- ## 2023-07-21 European Options REST - New endpoint`GET /eapi/v1/income/asyn`to get Download Id For Option Transaction History - New endpoint`GET /eapi/v1/income/asyn/id`to get Option Transaction History Download Link by Id --- ## 2023-07-20 Portfolio Margin - New endpoints for account: - `GET /papi/v1/um/adlQuantile`: UM Position ADL Quantile Estimation - `GET /papi/v1/cm/adlQuantile`: CM Position ADL Quantile Estimation --- ## 2023-07-19 COIN-M Futures REST - Add field `notionalCoef` in `GET /dapi/v2/leverageBracket` to show the bracket multiplier comparing to default leverage bracket --- ## 2023-07-18 Portfolio Margin - New endpoints for account: - `POST /papi/v1/repay-futures-switch`: Change Auto-repay-futures Status - `GET /papi/v1/repay-futures-switch`: Get Auto-repay-futures Status - `POST /papi/v1/repay-futures-negative-balance`: Repay futures Negative Balance --- ## 2023-07-18 USDⓈ-M Futures REST - Add field `notionalCoef` in `GET /fapi/v1/leverageBracket` to show the bracket multiplier comparing to default leverage bracket --- ## 2023-07-13 European Options Websocket Market Streams - These change will be effective from 2023-07-14: - Add field `T` in streams `@ticker` and `@ticker@` to show transaction time - Add field `E` in stream `@depth` to show event time --- ## 2023-07-13 Portfolio Margin - New USER DATA STREAM event `riskLevelChange`(effective 2023-07-14) --- ## 2023-07-12 COIN-M Futures REST - New field `breakEvenPrice` represents Break-Even Price in position of response to: - GET /dapi/v1/account (HMAC SHA256) - GET /dapi/v1/positionRisk (HMAC SHA256) WEBSOCKET - New field `bep` represents Break-Even Price in position `P` of payload to event: Balance and Position Update – "e": "ACCOUNT_UPDATE" --- ## 2023-07-11 Portfolio Margin REST - Add new endpoint `POST /papi/v1/ping` for connectivity test --- ## 2023-07-04 USDⓈ-M Futures REST - The following endpoints will be adjust to keep only recent three month data: - `GET /fapi/v1/order`(effective 2023-07-27) - `GET /fapi/v1/allOrders`(effective 2023-07-27) - `GET /fapi/v1/userTrades`(exact time TBD) - Please maintain and record old order/trade infomation or switch querying historical order/trade using new endpoint below: - New endpoint`GET /fapi/v1/order/asyn`to get Download Id For Futures Order History - New endpoint`GET /fapi/v1/order/asyn/id`to get Futures Order History Download Link by Id - New endpoint`GET /fapi/v1/trade/asyn`to get Download Id For Futures Trade History - New endpoint`GET /fapi/v1/trade/asyn/id`to get Futures Trade History Download Link by Id --- ## 2023-06-28 USDⓈ-M Futures **Notice:** REST - The following endpoints will no longer be supported from 2023-07-15: - `GET /fapi/v1/account` - `GET /fapi/v1/balance` - `GET /fapi/v1/positionRisk` - Please switch to corresponding v2 endpoints: - `GET /fapi/v2/account` - `GET /fapi/v2/balance` - `GET /fapi/v2/positionRisk` --- ## 2023-06-22 COIN-M Futures **Notice:** WEBSOCKET - Raw stream like **/ws?\** is not supported, for example `wss://dstream.binance.com/ws?btcusd@depth` is invalid. - Sending websocket message with invalid JSON format will cause disconnection now, returning this error `{"error":{"code":3,"msg":"Invalid JSON: expected value at line 1 column 1"}}` --- ## 2023-06-22 USDⓈ-M Futures **Notice:** WEBSOCKET - Raw stream like **/ws?\** is not supported, for example `wss://fstream.binance.com/ws?btcusdt@depth` is invalid. - Sending websocket message with invalid JSON format will cause disconnection now, returning this error `{"error":{"code":3,"msg":"Invalid JSON: expected value at line 1 column 1"}}` --- ## 2023-06-19 Portfolio Margin REST - Add fields `CONTRACT_PRICE`,`priceProtect` in endpoints `POST /papi/v1/um/conditional/order` and `POST/papi/v1/cm/conditional/order` --- ## 2023-06-16 USDⓈ-M Futures **Notice:** - It is recommended to use standard HTTP request formats, non-standard request formats will not be supported in fapi, below are some examples for correct code practice: - Escaping (") with '\\x22' is no longer supported, please use the standard '%22' instead. It is necessary to URL encode the square brackets [] and the double quotes(")inside the square brackets. DELETE /fapi/v1/batchOrders?origClientOrderIdList= Unsupported: [\\x229151944646313025900\\x22] Suggest: ["9151944646313025900"] --After URL encode-- DELETE /fapi/v1/batchOrders?origClientOrderIdList=%5B%229151944646313025900%22%5D - Non-standard nested JSON formats are not supported, POST /fapi/v1/batchOrders?batchOrders= Unsupported: ["{\\"type\\":\\"LIMIT\\",\\"timeInForce\\":\\"GTC\\"}"] Suggest: [{"type":"LIMIT","timeInForce":"GTC"}] --After URL encode-- POST /fapi/v1/batchOrders?batchOrders=%5B%7B%22type%22%3A%22LIMIT%22%2C%22timeInForce%22%3A%22GTC%22%7D%5D - Using incorrect data type is not supported DELETE /fapi/v1/batchOrders?orderIdList= As the data type of the 'orderIdList' parameter is LIST\ Unsupported: ["159856286502","159856313662"] Suggest: [159856286502,159856313662] --After URL encode-- DELETE /fapi/v1/batchOrders?orderIdList=%5B159856286502%2C159856313662%5D - Invalid whitespace characters from the request parameters are not supported Unsupported: POST symbol=BTCUSDT& price= 40000.0 & signature=2d24a314 Suggest: POST symbol=BTCUSDT&&price=40000.0&signature=2d24a314 - Passing empty values in request parameters is not supported Unsupported: GET symbol=BTCUSDT&orderId=&signature=2d24a314 Suggest: GET symbol=BTCUSDT&signature=2d24a314 --- ## 2023-06-14 COIN-M Futures WEBSOCKET - New field `i` for quote asset and index price added in streams `@markPrice` and `@markPrice` --- ## 2023-06-14 USDⓈ-M Futures WEBSOCKET - New WebSocket stream `!assetIndex@arr`OR`@assetIndex` for multi-assets mode asset index update --- ## 2023-06-01 Portfolio Margin REST - The endpoints below will be deployed on 2023-06-02: - New endpoints `GET /papi/v1/um/income` and `GET /papi/v1/cm/income` to query portfolio margin UM/CM income history - New endpoints `GET /papi/v1/um/account` and `GET /papi/v1/cm/account` to query portfolio margin UM/CM account history --- ## 2023-05-31 USDⓈ-M Futures WEBSOCKET - Add user data stream: - new event `CONDITIONAL_ORDER_TRIGGER_REJECT` to the order reject reason for triggered TP/SL order --- ## 2023-05-30 European Options General Information on Endpoints - For `GET` endpoints, parameters must be sent as a `query string` without setting content type in the http headers. --- ## 2023-05-05 USDⓈ-M Futures REST - New endpoints `PUT /fapi/v1/order` and `PUT /fapi/v1/batchOrders` to support limit order modify - New endpoint `GET /fapi/v1/orderAmendment` to get order modify history WEBSOCKET - New type "AMENDMENT" as order modify in Execution Type `x` of Order Update event `ORDER_TRADE_UPDATE` --- ## 2023-05-04 Portfolio Margin - API doc for portfolio margin --- ## 2023-04-17 COIN-M Futures **RELEASE DATE TBD** The `recvWindow` check will also be performed when orders reach matching engine. The `recvWindow` will be checked more precisely on order placing endpoints. ```javascript { "code": -4188, "msg": "Timestamp for this request is outside of the ME recvWindow" } ``` **recvWindow Logic Before Release:** - The order placing requests are valid if `recvWindow` + `timestamp` => REST API service server `timestamp` **recvWindow Logic After Release:** - Add new recwWindow check: the order placing requests are valid if `recvWindow` + `timestamp` => matching engine `timestamp` - Impacted Endpoints: - POST /dapi/v1/order (HMAC SHA256) - PUT /dapi/v1/order (HMAC SHA256) - POST /dapi/v1/batchOrders (HMAC SHA256) - PUT /dapi/v1/batchOrders (HMAC SHA256) --- ## 2023-04-17 USDⓈ-M Futures **RELEASE DATE 2023-04-18** The `recvWindow` check will also be performed when orders reach matching engine. The `recvWindow` will be checked more precisely on order placing endpoints. ```javascript { "code": -5028, "msg": "Timestamp for this request is outside of the ME recvWindow" } ``` **recvWindow Logic Before Release:** - The order placing requests are valid if `recvWindow` + `timestamp` => REST API service server `timestamp` **recvWindow Logic After Release:** - Add new recwWindow check: the order placing requests are valid if `recvWindow` + `timestamp` => matching engine `timestamp` - Impacted Endpoints: - POST /fapi/v1/order - PUT /fapi/v1/order - POST /fapi/v1/batchOrders - PUT /fapi/v1/batchOrders --- ## 2023-03-28 USDⓈ-M Futures **Referal Rebate Logic Before Release** - For every trade,the referal rebate balance change will be reflected in `ACCOUNT_UPDATE` event of USER-DATA-STREAM in real time: ```javascript { "e": "ACCOUNT_UPDATE", "T": 1679974782150, "E": 1679974782155, "a": { "B": [ { "a": "USDT", "wb": "685.31478079", "cw": "677.17212454", "bc": "0.00258637" } ], "P": [], "m": "ADMIN_DEPOSIT" } } ``` **Referal Rebate Logic After Release** - Referral rebates are aggregated every 20 minutes and reflected as a single push in the `ACCOUNT_UPDATE` event of the USER-DATA-STREAM, showing the total sum of rebates earned from multiple referrals. --- ## 2023-03-08 USDⓈ-M Futures **RELEASE DATE 2023-03-22** **Order Logic Before Release:** - When placing order with `timeInForce` `FOK` or `GTX`(Post-only), user will get order response with `status` = “NEW“ and corresponding `order_trade_update` with `x` = “NEW”, `X` = “NEW”. If the orders can't meet execution criteria, user will receive another websocket `order_trade_update` message `x` = “EXPIRED”, `X` = “EXPIRED”. The order can be found in `GET /fapi/v1/order` or `GET /fapi/v1/allOrders`. ```javascript { "code": -5021, "msg": "Due to the order could not be filled immediately, the FOK order has been rejected. The order will not be recorded in the order history" } ``` **Order Logic After Release:** - When placing order with `timeInForce` `FOK` or `GTX`(Post-only), if the order can't meet execution criteria, order will get rejected directly and receive error response, no `order_trade_update` message in websocket. The order can't be found in `GET /fapi/v1/order` or `GET /fapi/v1/allOrders`. ```javascript { "code": -5022, "msg": "Due to the order could not be executed as maker, the Post Only order will be rejected. The order will not be recorded in the order history" } ``` - Impacted Endpoints: - POST /fapi/v1/order - POST /fapi/v1/batchOrders - GET /fapi/v1/order - GET /fapi/v1/allOrders --- ## 2023-02-02 European Options REST - Endpoint `POST /eapi/v1/transfer` is disabled. --- ## 2023-01-11 European Options REST - Add endpoint `GET /eapi/v1/order` to check order status. --- ## 2023-01-04 USDⓈ-M Futures WEBSOCKET - Delete Order Status `NEW_INSURANCE` and `NEW_ADL` in Order Update Event --- ## 2022-12-16 COIN-M Futures WEBSOCKET - New WebSocket stream `!contractInfo` for symbol information update --- ## 2022-12-16 USDⓈ-M Futures WEBSOCKET - New WebSocket stream `!contractInfo` for symbol information update --- ## 2022-12-13 European Options WEBSOCKET - Add `u` and `pu` in stream`@depth1000` to get diff orderbook update. --- ## 2022-12-09 European Options REST - Add updateId field `u` in `GET /eapi/v1/depth` - Add parameter `underlying` in `GET /eapi/v1/exerciseHistory` to query exercise histroy by underlying --- ## 2022-11-29 COIN-M Futures WEB SOCKET USER DATA STREAM - New WebSocket stream `STRATEGY_UPDATE` in USER-DATA-STREAM: update when a strategy is created/cancelled/expired, ...etc. - New WebSocket stream `GRID_UPDATE` in USER-DATA-STREAM: update when a sub order of a grid is filled or partially filled. --- ## 2022-11-29 USDⓈ-M Futures WEB SOCKET USER DATA STREAM - New WebSocket stream `STRATEGY_UPDATE` in USER-DATA-STREAM: update when a strategy is created/cancelled/expired, ...etc. - New WebSocket stream `GRID_UPDATE` in USER-DATA-STREAM: update when a sub order of a grid is filled or partially filled. --- ## 2022-11-18 European Options REST - New endpoint `GET /eapi/v1/openInterest` is added to get options open interest for specific underlying on certain expiration date. WEBSOCKET - New stream `@openInterest@` is added for real-time option open interest feed. --- ## 2022-11-16 European Options WEBSOCKET - New trade stream `@trade` is added for all option trades on specific underlying asset. - Adjust format in stream `option_pair`. --- ## 2022-11-03 European Options REST - New endpoint for Auto-Cancel All Open Orders will be added on 2022-11-07: - `POST /eapi/v1/countdownCancelAll`:Set Auto-Cancel All Open Orders (Kill-Switch) Config - `GET /eapi/v1/countdownCancelAll`:Get Auto-Cancel All Open Orders (Kill-Switch) Config - `POST /eapi/v1/countdownCancelAllHeartBeat`:Auto-Cancel All Open Orders (Kill-Switch) Heartbeat --- ## 2022-10-13 COIN-M Futures **Note:** This change will be effictive on 2022-10-17 REST RATE LIMIT WEIGHT Endpoint `GET /dapi/v1/ticker/bookTicker` **Weight Update:** **2** for a single symbol; **5** when the symbol parameter is omitted --- ## 2022-10-13 USDⓈ-M Futures **Note:** This change will be effictive on 2022-10-17 REST RATE LIMIT WEIGHT Endpoint `GET /fapi/v1/ticker/bookTicker` **Weight Update:** **2** for a single symbol; **5** when the symbol parameter is omitted --- ## 2022-09-22 COIN-M Futures - Add new endpoint for Portfolio Margin: - `GET /dapi/v1/pmAccountInfo`: Get Portfolio Margin current account information. --- ## 2022-09-22 USDⓈ-M Futures - Update endpoint for Account/Trade: - `GET /fapi/v1/income`: Support more incomeType - Add new endpoint for Portfolio Margin: - `GET /fapi/v1/pmAccountInfo`: Get Portfolio Margin current account information. --- ## 2022-09-20 European Options WEBSOCKET - New streams `@markPrice` and `@ticker@` are added. - Streams `` will be deprecated on 2022/10/30. --- ## 2022-09-14 European Options REST - Adjust endpoint field `strikePrice`,`makerFeeRate`,`takerFeeRate`,`minQty`,`maxQty`,`initialMargin`,`maintenanceMargin`,`minInitialMargin`,`minMaintenanceMargin` to string in endpoint `GET /eapi/v1/exchangeInfo` - Only finished orders within 5 days can be queried in `GET /eapi/v1/historyOrders` --- ## 2022-09-05 European Options REST - Adjust response result in endpoint `DELETE /eapi/v1/allOpenOrdersByUnderlying` --- ## 2022-08-22 European Options REST - Add `rateLimits` information in endpoint `GET /eapi/v1/exchangeInfo` - Parameters `symbol` set to not mandatory in `GET /eapi/v1/userTrades` --- ## 2022-07-27 COIN-M Futures REST RATE LIMIT WEIGHT - The weight of endpoint `GET /dapi/v1/trades` is updated to 5 --- ## 2022-07-27 USDⓈ-M Futures REST RATE LIMIT WEIGHT - The weight of endpoint `GET /fapi/v1/trades` is updated to 5 --- ## 2022-06-28 COIN-M Futures REST - New endpoint `GET /dapi/v1/pmExchangeInfo` to get current Portfolio Margin exchange trading rules. --- ## 2022-06-28 USDⓈ-M Futures REST - New endpoint `GET /fapi/v1/pmExchangeInfo` to get current Portfolio Margin exchange trading rules. --- ## 2022-04-28 COIN-M Futures REST - New endpoints `PUT /dapi/v1/order` and `PUT /dapi/v1/batchOrders` to support limit order modify - New endpoint `GET /dapi/v1/orderAmendment` to get order modify history WEBSOCKET - New type "AMENDMENT" as order modify in Execution Type `x` of Order Update event `ORDER_TRADE_UPDATE` --- ## 2022-04-14 COIN-M Futures WEB SOCKET USER DATA STREAM - New WebSocket stream `ACCOUNT_CONFIG_UPDATE` in USER-DATA-STREAM for leverage changed update --- ## 2022-03-01 USDⓈ-M Futures REST - New endpoint`GET /fapi/v1/income/asyn`to get Download Id For Futures Transaction History - New endpoint`GET /fapi/v1/income/asyn/id`to get Futures Transaction History Download Link by Id --- ## 2022-02-18 COIN-M Futures REST - The maximum value of `limit` in `GET /dapi/v1/userTrades` is adjusted to 1000 --- ## 2022-02-10 USDⓈ-M Futures REST - Update `GET /fapi/v2/account` endpoints: - If user is in multiAssetsMargin mode, all assets will be included in calculation for fields `totalInitialMargin``totalMaintMargin``totalWalletBalance``totalUnrealizedProfit``totalMarginBalance``totalPositionInitialMargin``totalOpenOrderInitialMargin``totalCrossWalletBalance``totalCrossUnPnl``availableBalance``maxWithdrawAmount` and the results will be show as value in USD - If user is in singleAssetsMargin mode, only USDT assets are included in the calculation(same as before) --- ## 2021-12-30 USDⓈ-M Futures WEBSOCKET - New connection method for WEBSOCKET. - Base Url is `wss://fstream-auth.binance.com` - Streams can be access either in a single raw stream or a combined stream - Raw streams are accessed at `/ws/?listenKey=` - Combined streams are accessed at `/stream?streams=//&listenKey=` - `` must be a valid listenKey when you establish a connection. - More details: [Websocket Market Streams](#websocket-market-streams) and [User Data Streams](#user-data-streams) --- ## 2021-11-02 USDⓈ-M Futures REST - New endpoint`GET /fapi/v1/assetIndex`to get asset index for Multi-Assets mode margin asset --- ## 2021-08-18 COIN-M Futures REST - New field `positionAmt` as position amount in response of `GET /dapi/v1/account` --- ## 2021-08-17 COIN-M Futures REST - New endpoints `PUT /dapi/v1/order` and `PUT /dapi/v1/batchOrders` to support limit order modify - New endpoint `GET /dapi/v1/orderAmendment` to get order modify history WEBSOCKET - New type "AMENDMENT" as order modify in Execution Type `x` of Order Update event `ORDER_TRADE_UPDATE` --- ## 2021-07-23 COIN-M Futures REST - New field `updateTime` as last update time of asset and position in response of `GET /dapi/v1/account` and `GET /dapi/v1/positionRisk` --- ## 2021-07-06 COIN-M Futures REST - New fields in the response of `GET /dapi/v1/exchangeInfo`: - "liquidationFee" for liquidation fee rate - "marketTakeBound" for he max price difference rate( from mark price) a market order can make --- ## 2021-07-06 USDⓈ-M Futures REST - New field `updateTime` as last update time of asset and position in response of `GET /fapi/v2/account` and `GET /fapi/v2/positionRisk` - New fields in the response of `GET /fapi/v1/exchangeInfo`: - "liquidationFee" for liquidation fee rate - "marketTakeBound" for he max price difference rate( from mark price) a market order can make --- ## 2021-06-15 USDⓈ-M Futures WEBSOCKET - New fields "q" and "i" for quote asset and index price added in stream `@compositeIndex` REST - Update endpoints: - New fields `component` and `quoteAsset` as component asset and quote asset added in response of `GET /fapi/v1/indexInfo` --- ## 2021-05-06 COIN-M Futures WEBSOCKET - New field "bc" for balance change in event "ACCOUNT_UPDATE" --- ## 2021-05-06 USDⓈ-M Futures WEBSOCKET - Update streams: - Previous Leverage Update event `ACCOUNT_CONFIG_UPDATE` expanded as account configuration update event, including leverage update and Multi-Assets margin status update. - Balance and Position Update event `ACCOUNT_UPDATE` add new event reason type `m` as `AUTO_EXCHANGE`to represent Multi-Assets margin auto-exchange event REST - New endpoints: - `POST /fapi/v1/multiAssetsMargin` to change Multi-Assets margin mode - `GET /fapi/v1/multiAssetsMargin` to check Multi-Assets margin mode - Update endpoints: - New object `assets` as asset information in response of `GET /fapi/v1/exchangeInfo`. - New field `marginAvailable` in response of `GET /fapi/v2/balance` and `GET /fapi/v2/account` to indicate whether the asset can be used as margin in Multi-Assets mode. --- ## 2021-04-27 COIN-M Futures WEBSOCKET - The following liquidation orders streams do not push realtime order data anymore. Instead, they push snapshot order data at a maximum frequency of 1 order push per second.: - `@forceOrder` - `!forceOrder@arr` REST - The endpoint `GET /dapi/v1/allForceOrders` stop being maintained and no longer accepts request. --- ## 2021-04-27 USDⓈ-M Futures WEBSOCKET - The following liquidation orders streams do not push realtime order data anymore. Instead, they push snapshot order data at a maximum frequency of 1 order push per second.: - `@forceOrder` - `!forceOrder@arr` REST - The endpoint `GET /fapi/v1/allForceOrders` stop being maintained and no longer accepts request. --- ## 2021-04-22 USDⓈ-M Futures WEBSOCKET - New field "bc" for balance change in event "ACCOUNT_UPDATE" --- ## 2021-03-10 COIN-M Futures REST - The query time period for endpoint `GET /dapi/v1/allForceOrders` must be less than 7 days (default as the recent 7 days). --- ## 2021-03-02 USDⓈ-M Futures - New endpoint `GET /fapi/v1/indexPriceKlines` to get index price kline/candlestick data. - New endpoint `GET /fapi/v1/markPriceKlines` to get mark price kline/candlestick data. --- ## 2021-02-24 USDⓈ-M Futures REST RATE LIMIT WEIGHT - The weight of endpoint `GET /fapi/v2/balance` is updated to 5 - The weight of endpoint `GET /fapi/v2/positionRisk` is updated to 5 --- ## 2021-02-22 USDⓈ-M Futures REST RATE LIMIT WEIGHT - The weight of endpoint `GET /fapi/v1/income` is updated to 30 REST - The query time period for endpoint `GET /fapi/v1/allOrders` must be less than 7 days. - The query time period for endpoint `GET /fapi/v1/allForceOrders` must be within the recent 7 days. --- ## 2021-01-26 COIN-M Futures REST RATE LIMIT WEIGHT - Following endpoints' weights will be updated to 20 with symbol and 50 without symbol: - `GET /dapi/v1/allForceOrders` - `GET /dapi/v1/forceOrders` --- ## 2021-01-26 USDⓈ-M Futures WEB SOCKET USER DATA STREAM - New WebSocket stream `ACCOUNT_CONFIG_UPDATE` in USER-DATA-STREAM for leverage changed update REST RATE LIMIT WEIGHT - Following endpoints' weights will be updated to 20 with symbol and 50 without symbol: - `GET /fapi/v1/allForceOrders` - `GET /fapi/v1/forceOrders` REST - New filter "MIN_NOTIONAL" whicht defines the minimum notional value allowed for an order on a symbol, and shown in the `/fapi/v1/exchangeInfo` --- ## 2021-01-21 COIN-M Futures The regular expression rule for `newClientOrderId` updated as `^[\.A-Z\:/a-z0-9_-]{1,36}$` --- ## 2021-01-21 USDⓈ-M Futures The regular expression rule for `newClientOrderId` updated as `^[\.A-Z\:/a-z0-9_-]{1,36}$` --- ## 2021-01-04 USDⓈ-M Futures REST RATE LIMIT WEIGHT - Following endpoints will use new weight rule based on the paremeter "LIMIT" in the request: - `GET /fapi/v1/klines` - `GET /fapi/v1/continuousKlines` - Following endpoints' weights will be updated to 20: - `GET /fapi/v1/historicalTrades` - `GET /fapi/v1/allForceOrders` - `GET /fapi/v1/forceOrders` - `GET /fapi/v1/aggTrades` --- ## 2020-12-30 COIN-M Futures REST - Following DAPI endpoints will use new weight rule based on the parameter "LIMIT" in the request: - `GET /dapi/v1/klines` - `GET /dapi/v1/continuousKlines` - `GET /dapi/v1/indexPriceKlines` - `GET /dapi/v1/markPriceKlines` - Following DAPI endpoints' weights will be updated to 20: - `GET /dapi/v1/historicalTrades` - `GET /dapi/v1/allForceOrders` - `GET /dapi/v1/forceOrders` - `GET /dapi/v1/aggTrades` --- ## 2020-12-08 USDⓈ-M Futures WEBSOCKET - New field `e` for event type in payload of streams `@bookTicker` and `!bookTicker` - New field `P` for estimated settle price in payload of streams `@markPrice`, `@markPrice@1s`, `!markPrice@arr`, and `!markPrice@arr@1s`. - New stream `_@continuousKline_` for continuous contract kline REST API - New field "estimatedSettlePrice" in response to `GET /fapi/v1/premiumIndex` - New fields in response to `GET /fapi/v1/exchangeInfo`: - "pair" - "contractType" - "deliveryDate" - "onboardDate" - New endpoint `GET /fapi/v1/continuousKlines` to get continuous contract kline data ENUM - Contract types: - PERPETUAL - CURRENT_MONTH - NEXT_MONTH - CURRENT_QUARTER - NEXT_QUARTER --- ## 2020-11-27 COIN-M Futures - New endpoint `GET /dapi/v1/commissionRate` to get user commission rate. --- ## 2020-11-27 USDⓈ-M Futures - New endpoint `GET /fapi/v1/commissionRate` to get user commission rate. --- ## 2020-11-13 USDⓈ-M Futures WEB SOCKET STREAM - In order to provide users with more secure and stable services, the update time of `depth@0ms` and `@depth@0ms` is dynamically adjusted according to the total amount of data traffic and other objective conditions. --- ## 2020-11-10 USDⓈ-M Futures - New field "marginAsset" for margin asset in the response to `GET /fapi/v1/exchangeInfo`. - New field "positionAmt" for position amount in the response to `GET /fapi/v2/account`. --- ## 2020-11-09 USDⓈ-M Futures WEB SOCKET USER DATA STREAM Please notice: new streamlined and optimized push rules on event `ACCOUNT_UPDATE` in USER-DATA-STREAM - When an asset of a user is changed: - Only this asset and its balance information will be pushed - Other assets and information will no longer be pushed even the balances may not be 0 - If none of the open positions change, the position "P" will only return an empty `[]` - When a position or the margin type of a symbol is changed: - "P" will push the details in the "BOTH" position of this symbol - If the change happens in "LONG" or "SHORT" position, the changed "LONG" or "SHORT" position of this symbol will be pushed - Initialized "LONG" or "SHORT" isolated position of this symbol will also be pushed - Position information of other symbols will no longer be pushed, even their positions may not be 0 - In short, the **full** information of assets and positions should be obtained via the related RESTful endpoints(`GET /fapi/v2/account` and `GET /fapi/v2/positionRisk`), and the locally cached asset or position data can be updated via the event `ACCOUNT_UPDATE` in Websocket USER-DATA-STREAM with the information of **changed** asset or position. - Please visit [here](https://dev.binance.vision/t/838) to get examples for helping to understand the upgrade. --- ## 2020-10-27 USDⓈ-M Futures WEB SOCKET STREAM - The maximum stream number that a single connection can listen to changes as 200. --- ## 2020-10-10 USDⓈ-M Futures WEBSOCKET - New WebSocket streams `@compositeIndex` for composite index symbol information. --- ## 2020-10-09 USDⓈ-M Futures - New endpoint `GET /fapi/v1/indexInfo` to get information of composite index. --- ## 2020-09-18 USDⓈ-M Futures - New endpoint `GET /fapi/v1/apiTradingStatus` to get futures API trading quantitative rules indicators --- ## 2020-09-16 USDⓈ-M Futures - New endpoint `GET /fapi/v1/lvtKlines` to get gistorical BLVT Kline. The BLVT NAV system is working relatively with Binance Futures, so the endpoint is based on fapi. WEBSOCKET - New WebSocket streams for BLVT The BLVT NAV system is working relatively with Binance Futures, so the endpoint is based on futures websocket service. _`@tokenNav` for BLVT Info streams_ `@nav_kline_` for BLVT NAV Kline streams --- ## 2020-09-09 USDⓈ-M Futures - Some orders that were cancelled/expired will be removed gradually from API endpoints. - Orders that meet criteria - order status is `CANCELED` or `EXPIRED`, **AND** - order has NO filled trade, **AND** - created time + 7 days < current time - These endpoints are affected: - `GET /fapi/v1/order` - `GET /fapi/v1/allOrders` --- ## 2020-08-16 COIN-M Futures WEBSOCKET - Websocket Request for user data: - `@account` request for user's account information - `@balance` request for user's account balance - `@balance` request for user's position information REST - New endpoint `GET /dapi/v1/adlQuantile` to get the positions' ADL quantile estimation values --- ## 2020-08-14 USDⓈ-M Futures - New field "indexPrice" in response to endpoint `GET /fapi/v1/premiumIndex`. - New field "i" for indexPrice in payload of ws streams: - `@markPrice`, - `@markPrice@1s`, - `!markPrice@arr`, - `!markPrice@arr@1s` --- ## 2020-08-12 COIN-M Futures - New endpoint `GET /dapi/v1/forceOrders` to get the user's force orderes. --- ## 2020-08-12 USDⓈ-M Futures - New endpoint `GET /fapi/v1/forceOrders` to get the user's force orderes. --- ## 2020-08-11 COIN-M Futures COIN MARGINED PERPETUAL FUTURES - New contract type ("contractType") `PERPETUAL` for coin margined perpetual futures countract. - New fields in the reponse to endpoint `GET /dapi/v1/premiumIndex`: - `lastFundingRate` for the lasted funding rate of the perpetual futures contract - `nextFundingTime` for the next funding time of the perpetual futures contract - New endpoint `GET /dapi/v1/fundingRate` to get funding rate history of perpetual futures - New fields in the payload of WSS `@markPrice`, `@markPrice@1s`, `@markPrice`, and `@markPrice@1s`: - `r` for the lasted funding rate of the perpetual futures contract - `T` for the next funding time of the perpetual futures contract --- ## 2020-07-30 USDⓈ-M Futures - New endpoint `GET /fapi/v1/adlQuantile` to get the positions' ADL quantile estimation values --- ## 2020-07-22 COIN-M Futures - New endpoints of coin margined futures trading data: - `GET /futures/data/openInterestHist` - `GET /futures/data/topLongShortAccountRatio` - `GET /futures/data/topLongShortPositionRatio` - `GET /futures/data/globalLongShortAccountRatio` - `GET /futures/data/takerBuySellVol` - `GET /futures/data/basis` --- ## 2020-07-17 USDⓈ-M Futures - Weights of endpoint `GET /fapi/v1/income` has been changed as 20 --- ## 2020-07-02 USDⓈ-M Futures WEBSOCKET - New field "m" for event reason type in event "ACCOUNT_UPDATE" - New field "rp" for the realized profit of the trade in event "ORDER_TRADE_UPDATE" --- ## 2020-06-15 USDⓈ-M Futures - New fields in responses to `GET /fapi/v2/account` and `GET /fapi/v2/balance`: - `availableBalance` - `maxWithdrawAmount` --- ## 2020-06-04 USDⓈ-M Futures - New endpoints of version 2 of fapi, having better performance than the v1 endpoints: - `GET /fapi/v2/account` - `GET /fapi/v2/balance` --- ## 2020-06-02 USDⓈ-M Futures - New endpoint `GET /fapi/v2/positionRisk` in version 2 of fapi: - User can choose to send specific "symbol". - All symbols in the market can be returned. - Different responses for "One-way" or "Hedge" position mode. - Better performance than the v1 endpoint. --- ## 2020-05-18 USDⓈ-M Futures - New parameter `closePosition` for endpoint `POST /fapi/v1/order`: If a `STOP_MARKET` or `TAKE_PROFIT_MARKET` order with `closePosition=true` is triggered,all of the current long position( if `SELL` order) or current short position( if `BUY` order) will be closed. - New field `closePosition` in response to endpoints: - `POST /fapi/v1/order` - `POST /fapi/v1/batchOrders` - `GET /fapi/v1/order` - `DELETE /fapi/v1/order` - `DELETE /fapi/v1/batchOrders` - `GET /fapi/v1/openOrder` - `GET /fapi/v1/openOrders` - `GET /fapi/v1/allOrders` --- ## 2020-05-18 USDⓈ-M Futures - Some orders that were cancelled/expired will be removed gradually from API endpoints, but they are still available from Web UI. - Orders that meet criteria - order status is `CANCELED` or `EXPIRED`, **AND** - order has NO filled trade, **AND** - created time + 30 days < current time - These endpoints are affected: - `GET /fapi/v1/order` - `GET /fapi/v1/allOrders` --- ## 2020-05-15 USDⓈ-M Futures - New fields in payloads of `@bookTicker` and `!bookTicker`: - `E` for event time - `T` for transaction time --- ## 2020-05-14 USDⓈ-M Futures - New field `time` for transaction time in response to endpoints: - `GET /fapi/v1/ticker/price` - `GET /fapi/v1/ticker/bookTicker` - `GET /fapi/v1/openInterest` --- ## 2020-05-11 USDⓈ-M Futures - New endpoint `POST /fapi/v1/countdownCancelAll` to cancel all open orders of the specified symbol at the end of the specified countdown. This rest endpoint means to ensure your open orders are canceled in case of an outage. The endpoint should be called repeatedly as heartbeats so that the existing countdown time can be canceled and repalced by a new one. --- ## 2020-05-06 USDⓈ-M Futures REST - Endpoint `GET /fapi/v1/leverageBracket` is changed as "USER-DATA". It need to be signed, and timestamp is needed. WEB SOCKET USER DATA STREAM - Please notice: event `ACCOUNT_UPDATE` in USER-DATA-STREAM will be pushed with only account balance or relative position when "FUNDING FEE" occurs. - When "FUNDING FEE" occurs in a **crossed position**, `ACCOUNT_UPDATE` will be pushed with only the balance `B`(including the "FUNDING FEE" asset only), without any position `P` message. - When "FUNDING FEE" occurs in an **isolated position**, `ACCOUNT_UPDATE` will be pushed with only the balance `B`(including the "FUNDING FEE" asset only) and the relative position message `P`( including the isolated position on which the "FUNDING FEE" occurs only, without any other position message). --- ## 2020-04-25 USDⓈ-M Futures - New fields in USER DATA STREAM event `ORDER_TRADE_UPDATE`: - `cp` stands for Close-All conditional order - `AP` for Activation Price with `TRAILING_STOP_MARKET` order - `cr` for Callback Rate with `TRAILING_STOP_MARKET` order - New USER DATA STREAM event `MARGIN_CALL`. --- ## 2020-04-17 USDⓈ-M Futures - New parameter `newOrderRespType` for response type in endpoint `POST /fapi/v1/order`. `ACK` and `RESULT` are supported. And for `newOrderRespType= RESULT`: _`MARKET` order: the final FILLED result of the order will be return directly._ `LIMIT` order with special `timeInForce`: the final status result of the order(FILLED or EXPIRED) will be returned directly. --- ## 2020-04-14 USDⓈ-M Futures WEB SOCKET STREAM - WebSocket connections have a limit of 10 incoming messages per second. A message is considered: - A PING frame - A PONG frame - A JSON control message (e.g. subscribe, unsubscribe) - A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. - A single connection can listen to a maximum of 200 streams. --- ## 2020-04-09 USDⓈ-M Futures - New endpoint of futures trading data: `GET /futures/data/takerlongshortRatio` --- ## 2020-04-08 USDⓈ-M Futures - New endpoint `GET /fapi/v1/positionSide/dual` to get current position mode. - New endpoint `POST /fapi/v1/batchOrders` to place multiple orders. --- ## 2020-04-06 USDⓈ-M Futures - Please notice: event `ACCOUNT_UPDATE` in USER-DATA-STREAM will not be pushed without update of account balances or positions. - `ACCOUNT_UPDATE` will be pushed only when update happens on user's account, including changes on balances, positions, or margin type. - Unfilled orders or cancelled orders will not make the event `ACCOUNT_UPDATE` pushed, since there's no change on positions. - Only positions of symbols with non-zero isolatd wallet or non-zero position amount will be pushed in the "position" part of the event `ACCOUNT_UPDATE`. - New endpoint `POST /fapi/v1/positionSide/dual` to change position mode: Hedge Mode or One-way Mode. - New parameter `positionSide` in the following endpoints: - `POST /fapi/v1/order` - `POST /fapi/v1/positionMargin` - New field `positionSide` in the responses to the following endpoints: - `POST /fapi/v1/order` - `GET /fapi/v1/order` - `DELETE /fapi/v1/order` - `DELETE /fapi/v1/batchOrders` - `GET /fapi/v1/openOrder` - `GET /fapi/v1/openOrders` - `GET /fapi/v1/allOrders` - `GET /fapi/v1/account` - `GET /fapi/v1/positionMargin/history` - `GET /fapi/v1/positionRisk` - `GET /fapi/v1/userTrades` - New field `ps` for "position side"in USER_DATA_STREAM events `ACCOUNT_UPDATE` and `ORDER_TRADE_UPDATE`. --- ## 2020-03-30 USDⓈ-M Futures - New endpoints of futures trading data: - `GET /futures/data/openInterestHist` - `GET /futures/data/topLongShortAccountRatio` - `GET /futures/data/topLongShortPositionRatio` - `GET /futures/data/globalLongShortAccountRatio` ## 2020-02-26 - New order type: `TRAILING_STOP_MARKET` --- ## 2020-02-20 USDⓈ-M Futures - New endpoint to query specific current open order: `GET /fapi/v1/openOrder` --- ## 2020-02-17 USDⓈ-M Futures - Update time changed as 1000ms for streams `@ticker` and `!ticker@arr` - New diff depth data with 500ms updates: `@depth@500ms` - New partial depth data with 500ms updates: `@depth@500ms` --- ## 2020-02-12 USDⓈ-M Futures - New [SDK and Code Demonstration](#sdk-and-code-demonstration) on Java - Faster mark price websocket data with 1s updates: `@markPrice@1s` and `!markPrice@arr@1s` --- ## 2020-02-05 USDⓈ-M Futures - New market data endpoint`GET /fapi/v1/leverageBracket` to check notional and leverage brackets. --- ## 2020-01-19 USDⓈ-M Futures - "cumQty" is going to be removed from the responses to `DELETE /fapi/v1/order`, `DELETE /fapi/v1/batchOrders` and other `order` relatived endpoints in the coming weeks. Please use "executedQty" instead. --- ## 2020-01-17 USDⓈ-M Futures - New [SDK and Code Demonstration](#sdk-and-code-demonstration) on Python --- ## 2020-01-06 USDⓈ-M Futures - Faster diff data with real time updates: `@depth@0ms` --- ## 2020-01-03 USDⓈ-M Futures - New endpoints related to isolated position: - `POST /fapi/v1/marginType` - `POST /fapi/v1/positionMargin` - `GET /fapi/v1/positionMargin/history` - New field in response to `GET /fapi/v1/positionRisk` related to isolated position: - `marginType` - `isolatedMargin` - New field in response to `GET /fapi/v1/account`related to isolated position: `isolated` - New field in event `ACCOUNT_UPDATE`: - "cw" for cross wallet - "mt" for margin type - "iw" for isolated wallet (if isolated) --- ## 2019-12-19 USDⓈ-M Futures - New endpoint `GET /fapi/v1/openInterest` to get present open interest of a specific symbol. --- ## 2019-12-18 USDⓈ-M Futures - New event type in user data stream:`listenKeyExpired`. --- ## 2019-12-12 USDⓈ-M Futures - New endpoint `DELETE /fapi/v1/allOpenOrders` to cancel all open orders of a specific symbol. - New endpoint`DELETE /fapi/v1/batchOrders` to cancel a list of open orders. - `reduceOnly` has been supported in orders with type: - `TAKE_PROFIT` - `TAKE_PROFIT_MARKET` - `STOP` - `STOP_MARKET` --- ## 2019-11-29 USDⓈ-M Futures - New endpoint `GET /fapi/v1/allForceOrders` to get all liquidation orders. - New websocket streams: - `@forceOrder`for liquidation order streams - `!forceOrder@arr` for all market liquidation order streams --- ## 2019-11-25 USDⓈ-M Futures - `GET /fapi/v1/account` has new field: `positions` - Added new field `time` for order creation time in: - `GET /fapi/v1/openOrders` - `GET /fapi/v1/order` - `GET /fapi/v1/allOrders` --- ## 2019-11-15 USDⓈ-M Futures - New websocket streams: - `!miniTicker@arr`: All market 24hr mini-tickers stream. - `!ticker@arr`: : All market 24hr tickers stream. --- ## 2019-11-12 USDⓈ-M Futures - WSS now supports live subscribing/unsubscribing to streams. --- ## 2019-11-05 USDⓈ-M Futures - New order type: - `STOP_MARKET`, - `TAKE_PROFIT_MARKET`. - New parameter `workingType` in `POST /fapi/v1/order`: order with stop price can be triggered by "CONTRACT_PRICE" or "MARK_PRICE" - New keys in USER-DATA-STREAMS: - in `ORDER_TRADE_UPDATE`: - "T" as transaction time - "wt" as workingType - in `ACCOUNT_UPDATE`: - "T" as transaction time --- ## 2019-10-28 USDⓈ-M Futures - New rest endpoint for income flow history `GET /fapi/v1/income` --- ## 2019-10-25 USDⓈ-M Futures - Added "up" in event `ACCOUNT_UPDATE` in user data stream: the unrealized PnL of the position. - Added "R" in event `ORDER_TRADE_UPDATE` in user data stream, showing if the trade is reduce only. --- ## 2019-10-24 USDⓈ-M Futures - New WebSocket streams for booktickers added: `@bookTicker` and `!bookTicker`. - New WebSocket streams for partial orderbook added: `@depth` and `@depth@100ms` - Faster diff data with 100ms updates: `@depth@100ms` - Added `Update Speed`: to `Websocket Market Streams` --- ## 2019-10-18 USDⓈ-M Futures - New endpoint `POST /fapi/v1/leverage` for changing user's initial leverage in specific symbol market. - Added "leverage" for current initial leverage and "maxNotionalValue" for notional value limit of current initial leverage in response to `GET /fapi/v1/positionRisk`. - `reduceOnly` now is supported in the `MARKET` orders. --- ## 2019-10-14 USDⓈ-M Futures - Added `GET /fapi/v1/fundingRate` for getting funding fee rate history. --- ## 2019-10-11 USDⓈ-M Futures - Added "m" in event `ORDER_TRADE_UPDATE` in user data stream, showing if the trade is the maker side. --- ## 2019-10-08 USDⓈ-M Futures - New order parameter `reduceOnly` for `LIMIT` orders. - New order type `TAKE_PROFIT`. --- --- ## Document: /products/common/derivatives-trading/Introduction URL: /en/dev-docs/products/common/derivatives-trading/Introduction # Introduction Derivative Trading API provide REST and WebSocket APIs to suit your derivative trading needs. --- ## Document: /products/common/binance-link/change-log URL: /en/dev-docs/products/common/binance-link/change-log **2026-05-08** - Update KYC SaaS endpoints to support KZ Entity Broker Partial Sharing mode. - POST `/bapi/ekyc/v2/public/ekyc/customer/share-kyc-data` - `basicInfo` / `identityInfo` changed from `YES` to `Conditional` (required for standard brokers; optional for KZ Entity brokers). - New optional `KycInfo` fields: `tncInfo`, `questionnaireInfo`. - New sub-sections: `TncInfo`, `QuestionnaireInfo`, `QuestionnaireAnswer`. - POST `/bapi/ekyc/v2/public/ekyc/customer/query-kyc-info` - New `KycInfoVo` response fields: `questionInfo`, `tncInfo`. - New sub-sections: `QuestionInfo`, `TncInfo` (response shape). --- **2025-11-25** - New response fields for GET `/sapi/v1/apiReferral/rebate/recentRecord` - `distributeTime` - `commissionAsset` - `commission` - `convertPrice` --- **2025-09-22** - New Futures Transfer for Link Sub-account endpoints * POST `/sapi/v1/broker/futures/accountTransfer` --- **2025-09-16** - Futures commission rebate query endpoints require to input `symbol` or `pair`. * GET `/sapi/v1/broker/subAccountApi/commission/futures` * GET `/sapi/v1/broker/subAccountApi/commission/coinFutures` --- **2025-07-02** - New endpoints for KYC SaaS Integration, KYC Querying, and Request for Information (RFI). --- **2025-04-18** - New Endpoint for delete sub account `DELETE /sapi/v1/broker/subAccount `. - Create Link sub account API key endpoint and FAST api key creation endpoint support asymmetrical key type(Ed25519 and RSA). Please see https://www.binance.com/en/support/faq/detail/6b9a63f1e3384cf48a2eedb82767a69a --- **2025-03-07** - New Endpoint for query sub account deposit by depositId `GET /sapi/v2/broker/subAccount/depositHist `. --- **2025-02-26** - Update sub account deposit history Endpoint `GET /sapi/v1/broker/subAccount/depositHist `, adding "travelRuleStatus". --- **2024-10-30** - Update the `Weight(UID)` to 60 for Endpoint `GET /sapi/v3/broker/subAccount/futuresSummary `. --- **2024-08-15** - New parameter `filterResult ` will be available on August 16, 2024 for query futures commission rebate record:`GET /sapi/v1/broker/rebate/futures/recentRecord `. If `filterResult ` = TRUE, rebates not from its own sub accounts will be filtered out in response. --- **2024-06-28** - New Endpoint for query futures assets of sub-accounts:`GET /sapi/v3/broker/subAccount/futuresSummary `. - Following endpoints will be deleted in a month: `GET /sapi/v1/broker/subAccount/futuresSummary `,`GET /sapi/v2/broker/subAccount/futuresSummary `. Please migrate the usage of legacy version(v1&v2) to the new (v3) version as soon as possible. --- **2024-06-06** - Endpoints adjustment: for internal transfers, the txid prefix has been replaced to “Off-chain transfer”on 28 May 2024. “internal transfer” flag is no longer available in the TXID field, including historical transactions, the following endpoints are impacted: `GET /sapi/v1/broker/subAccount/depositHist`. --- **2024-04-30** - Update the request limit for endpoint: `POST /sapi/v1/broker/subAccountApi`. You can only create 1 api key for each sub account per second - Update the request limit for endpoint: `DELETE /sapi/v1/broker/subAccountApi`. You can only delete 1 api key for each sub account per second --- **2024-03-05** - Remove endpoint: `POST /sapi/v1/broker/subAccount/blvt`. --- **2023-12-15** - Update the default parameter values of endpoint: `GET /sapi/v1/broker/universalTransfer`. --- **2023-11-20** - Add `depositId` and `selfReturnStatus` in response of endpoint: `GET /sapi/v1/broker/subAccount/deposit`. --- **2023-10-04** - Remove endpoint: `POST /sapi/v1/broker/subAccountApi/permission/vanillaOptions`. --- **2023-08-31** - Remove endpoint: `POST /sapi/v1/broker/subAccount/margin`. To enable the margin account, simply transfer assets into Cross Margin wallet. --- **2023-06-08** - Update weight for endpoint: `POST /sapi/v1/broker/subAccountApi`. Weight(Master Account) changed to 3000 --- **2023-01-13** - Remove 2 endpoints: `POST /sapi/v1/broker/subAccountApi/ipRestriction`, `POST /sapi/v1/broker/subAccountApi/ipRestriction/ipList`. --- **2022-12-16** - Remove "thirdPartyName" for `POST /sapi/v2/broker/subAccountApi/ipRestriction (HMAC SHA256)`, `POST /sapi/v1/broker/subAccountApi/ipRestriction`, `POST /sapi/v1/broker/subAccountApi/ipRestriction/ipList`, `DELETE /sapi/v1/broker/subAccountApi/ipRestriction/ipList`. --- **2022-11-28** - Add "the max length is 32 characters" in the description of clientTranId for endpoints `POST /sapi/v1/broker/universalTransfer`, `POST /sapi/v1/broker/transfer/futures`, `POST /sapi/v1/broker/transfer`. --- **2022-11-18** - Added new endpoint `POST /sapi/v2/sub-account/subAccountApi/ipRestriction` to support user update IP Restriction for Sub-Account API key. --- **2022-09-22** - Update `POST /sapi/v1/broker/subAccountApi/ipRestriction` to support user enable or disable Third party IP list name restriction for sub-account api key. - Update `POST /sapi/v1/broker/subAccountApi/ipRestriction/ipList` to support user update Third party IP list name restriction for sub-account api key. - Update `DELETE /sapi/v1/broker/subAccountApi/ipRestriction/ipList` to support user delete Third party IP list name restriction for sub-account api key. --- **2022-09-12** - Update `GET /sapi/v1/broker/subAccountApi/ipRestriction` to support user query third party IP list name. --- **2022-08-23** - Add 100-days query scope for `GET /sapi/v1/broker/universalTransfer` and `GET /sapi/v1/broker/transfer`. - Add requests per UID are limited to 60 requests per minute for `GET /sapi/v1/broker/subAccount/spotSummary`. --- **2022-06-27** - Added a new rebate status field in API response for endpoints `GET /sapi/v1/broker/rebate/futures/recentRecord` and `GET /sapi/v1/broker/rebate/recentRecord`. --- **2021-04-29** - Added parameter `tag` and new field `email` in endpoint `POST /sapi/v1/broker/subAccount`. --- **2021-03-26** - Added new endpoint `POST /sapi/v1/broker/subAccountApi/permission/universalTransfer` to enable the api permission for a sub account to use `POST /sapi/v1/asset/transfer`endpoint. - Added new endpoint `POST /sapi/v1/broker/subAccountApi/permission/vanillaOptions` to enable Vanilla Options permission for sub account api key. --- **2021-02-04** - Added parameter `fromId` and `toId` in endpoint `GET /sapi/v1/broker/transfer`. The parameter `subaccountId` will be removed on 02/10 16:00(UTC+8). Please adjust the program as soon as possible. --- **2021-02-04** - Added parameter showAllStatus in endpoint `GET /sapi/v1/broker/universalTransfer`. --- **2021-01-27** - Added new endpoint `GET /sapi/v2/broker/subAccount/futuresSummary` to support query subaccount Coin Margined Futures asset info. --- **2021-01-14** - Added parameter clientTranId in endpoint `POST /sapi/v1/broker/transfer/futures` and `GET /sapi/v1/broker/transfer/futures`. --- **2020-12-28** - Added parameters page and size in endpoint `GET /sapi/v1/broker/subAccountApi`. --- **2020-12-14** - The endpoint `GET /sapi/v1/broker/transfer/futures` can only get the latest history of past 30 days. --- **2020-12-10** - Added new endpoint `POST /sapi/v1/broker/universalTransfer` to transfer spot and futures asset between master account and sub accounts. - Added new endpoint `GET /sapi/v1/broker/universalTransfer` to get universal transfer history. --- **2020-11-27** - Added tranId in response of endpoint `GET /sapi/v1/broker/transfer/futures`. --- **2020-10-23** - Added parameter showAllStatus in endpoint `GET /sapi/v1/broker/transfer`. --- **2020-10-12** - Added parameter status in the response of endpoint `GET /sapi/v1/broker/transfer`. --- **2020-09-16** - Added new endpoint `POST /sapi/v1/broker/subAccountApi/commission/coinFutures` to change sub- account COIN-Ⓜ futures commission adjustment. - Added new endpoint `GET /sapi/v1/broker/subAccountApi/commission/coinFutures` query sub- account COIN-Ⓜ futures commission adjustment. - Added parameter confirmTimes in endpoint `GET /sapi/v1/broker/subAccount/depositHist`. **2020-09-11** - Added parameter email in endpoint `GET /sapi/v1/broker/subAccount`. --- **2020-09-07** - Added new endpoint `POST /sapi/v1/broker/subAccountApi/ipRestriction` to enable or disable IP restriction for sub-account api key. - Added new endpoint `POST /sapi/v1/broker/subAccountApi/ipRestriction/ipList` to add IP restricion for sub-account api key. - Added new endpoint `GET /sapi/v1/broker/subAccountApi/ipRestriction` to get IP restriction for sub-account api key. - Added new endpoint `DELETE /sapi/v1/broker/subAccountApi/ipRestriction/ipList` to delete IP restriction for sub-account api key. --- **2020-09-02** - Added new endpoint `GET /sapi/v1/broker/rebate/futures/recentRecord` to get futures commision rebate record. - Added new endpoint `POST /sapi/v1/broker/transfer/futures` to transfer futures asset directly. - Added new endpoint `GET /sapi/v1/broker/transfer/futures` to get futures transfer history. --- **2020-08-25** - Added parameters page and size in endpoint `GET /sapi/v1/broker/rebate/recentRecord`. --- **2020-07-29** - Added new endpoint `POST /sapi/v1/broker/subAccount/blvt` to enable leverage token for sub-account. --- **2020-07-21** - Added parameters page and size in endpoint `GET /sapi/v1/broker/subAccount`. --- **2020-07-10** - Added default limit 500 in endpoint `GET /sapi/v1/broker/transfer`. --- **2020-06-15** - Added new endpoint `GET /sapi/v1/broker/subAccount/spotSummary` to query sub accounts spot asset. - Added new endpoint `GET /sapi/v1/broker/subAccount/marginSummary` to query sub accounts margin asset. - Added new endpoint `GET /sapi/v1/broker/subAccount/futuresSummary` to query sub accounts futures asset. --- **2020-06-12** - Added new endpoint `GET /sapi/v1/broker/rebate/recentRecord` to query broker commission rebate recent record. --- **2020-06-11** - Added new endpoint `GET /sapi/v1/broker/subAccount/depositHist` to query sub accounts deposit history. --- **2020-04-22** - New fields in response to `GET /sapi/v1/broker/subAccountApi/commission/futures` and `POST /sapi/v1/broker/subAccountApi/commission/futures`: - `makerCommission` for current futures commission ratio for maker; - `takerCommission` for current futures commission ratio for taker; --- **2020-04-03** - Added new endpoint `POST /sapi/v1/broker/subAccount/bnbBurn/spot` to enable or disable BNB Burn for sub-account spot and margin. - Added new endpoint `POST /sapi/v1/broker/subAccount/bnbBurn/marginInterest` to enable or disable BNB Burn for sub-account margin interest. - Added new endpoint `GET /sapi/v1/broker/subAccount/bnbBurn/status` to get BNB Burn status for sub-account. --- **2020-03-27** - Added parameters `clientTranId `in endpoints: - `POST /sapi/v1/broker/transfer`, - `GET /sapi/v1/broker/transfer`. --- **2020-02-12** - The below endpoints will be released in the future: - new endpoint `GET /sapi/v1/broker/rebate/recentRecord` to query broker commission rebate recent record. - new endpoint `GET /sapi/v1/broker/rebate/historicalRecord ` to get broker commission rebate historical record. --- **2019-12-23** - Added new endpoint `POST /sapi/v1/broker/subAccountApi/commission/futures` to change sub-account futures commission adjustment. - Added new endpoint `GET /sapi/v1/broker/subAccountApi/commission/futures` to query sub-account futures commission adjustment. --- **2019-11-11** - Added parameters `marginTrade ` and `futuresTrade` in endpoints: - `POST /sapi/v1/broker/subAccountApi`, - `POST /sapi/v1/broker/subAccountApi/permission`. - Added keys `marginTrade ` and `futuresTrade` in responses to endpoints: - `POST /sapi/v1/broker/subAccountApi`, - `GET /sapi/v1/broker/subAccountApi`, - `POST /sapi/v1/broker/subAccountApi/permission`. - Added parameters `marginMakerCommission ` and `marginTakerCommission ` in endpoint `POST /sapi/v1/broker/subAccountApi/commission`. - Added keys `marginMakerCommission ` and `marginTakerCommission ` in responses to endpoints: - `POST /sapi/v1/broker/subAccountApi/commission`, - `Get /sapi/v1/broker/subAccount/`. - Added new endpoint `POST /sapi/v1/broker/subAccount/margin` for setting subaccount enable on margin. - Added new endpoint `POST /sapi/v1/broker/subAccount/futures` for setting subaccount enable on futures. --- ## Document: /products/common/advanced-earn/change-log URL: /en/dev-docs/products/common/advanced-earn/change-log # Change Log ## 2026-03-23 - Dual Investment - `GET /sapi/v1/dci/product/positions` - Added `subscriptionTime` field in the response. --- ## 2025-12-26 ### Time-sensitive Notice - **The following change to REST API will occur at approximately 2026-01-15 07:00 UTC:**
When calling endpoints that require signatures, percent-encode payloads before computing signatures. Requests that do not follow this order will be rejected with [`-1022 INVALID_SIGNATURE`](./error-code.md#-1022-invalid_signature). Please review and update your signing logic accordingly. ### REST API - Updated documentation for REST API regarding [Signed Endpoints examples for placing an order](./general-info.md#signed-endpoint-examples-for-post-apiv3order). --- ## 2025-12-02 - New Endpoints for Discount Buy --- ## 2024-02-23 - New Endpoints for Dual-Investment: - `GET /sapi/v1/dci/product/list`: Get Dual Investment product list - `POST /sapi/v1/dci/product/subscribe`: Subscribe Dual Investment products - `GET /sapi/v1/dci/product/positions`: Get Dual Investment positions (batch) - `GET /sapi/v1/dci/product/accounts`: Check Dual Investment accounts - `POST /sapi/v1/dci/product/auto_compound/edit-status`: Change Auto-Compound status --- ## Document: /products/common/advanced-earn/Introduction URL: /en/dev-docs/products/common/advanced-earn/Introduction # Introduction Benefit from our innovative products that are designed to help navigate the various market scenarios. --- ## Document: Skills Reference URL: /en/dev-docs/products/agentic-wallet/reference/skills # Skills Reference The `binance-agentic-wallet` skill provides wallet management and on-chain trading through the `baw` CLI. **Supported chains:** BNB Smart Chain (BSC), Ethereum, Base, Solana --- ## Skill Documentation Structure ``` binance-agentic-wallet/ ├── SKILL.md # Main doc: command routing, security policy, common token addresses └── references/ ├── preflight.md # Preflight checks: skill version, CLI version ├── authentication.md # Sign-in/sign-out flow ├── wallet-view.md # Wallet queries: status, address, balance, history, etc. ├── wallet-setting.md # Security settings (read-only) ├── send.md # Token transfer ├── market-order.md # Market order (swap) ├── limit-order.md # Limit order ├── prediction.md # Prediction market trading └── security.md # Pre-trade security check flow ``` --- ## Key Features ### Wallet Management Query wallet status, addresses, balances, transaction history, and security settings. ``` Is my wallet connected? What's my wallet address? How much BNB and USDT do I have? Show me my recent transactions How much of my daily limit is left? ``` ### Token Transfer Send tokens to addresses in your address book (Binance App → Wallet → Settings → Address Book). ``` Send 0.02 BNB to 0x1234...5678 Transfer 10 USDT to 0x1234...5678 ``` ### Market Swap Get quotes or execute swaps at current market price. Supports custom slippage and MEV protection. ``` How much USDT would I get for 0.1 BNB? Quote only Swap 0.1 BNB for USDT Buy BNB with 50 USDT, max slippage 2% ``` ### Limit Order Set a target price — executes automatically when triggered. > **Note:** Limit orders are only supported on BSC and Solana. ``` Buy BNB with 100 USDT when the price drops to $500 Sell 1 BNB for USDT when the price reaches $650 Show my open limit orders Cancel my BNB limit order ``` ### Prediction Market Trade on prediction markets — browse markets, place bets on outcomes, track positions, and redeem winnings. ``` Search the most popular market in the sport category Buy "Up" in the most recent BTC 15m price market What are my current prediction positions? Show my prediction PnL Redeem my winning predictions Cancel my pending prediction order ``` --- ## Related - [Install Agentic Wallet](../quickstart/install-agentic-wallet.md) - [Tutorial and Use Cases](../quickstart/use-agentic-wallet-tutorial-and-use-cases.md) --- ## Document: Tutorial and Use Cases URL: /en/dev-docs/products/agentic-wallet/quickstart/use-agentic-wallet-tutorial-and-use-cases # Tutorial and Use Cases After completing [Install Agentic Wallet](/products/agentic-wallet/quickstart/install-agentic-wallet) and signing in, you can talk directly to your AI Agent in natural language. Agentic Wallet Skills will parse your intent and execute on-chain automatically. --- ## Minimal Tutorial The minimal workflow: check status → get a quote → confirm and swap. **1. Check wallet connection** > "Is my wallet connected? What's my address?" The AI returns your connection status and wallet address. **2. Check balances** > "How much BNB and USDT do I have?" The AI returns all non-zero balances with USD valuation. **3. Get a swap quote (no execution)** > "How much USDT would I get for 0.01 BNB? Don't execute." The AI returns the estimated output, slippage, and gas estimate — no on-chain transaction is triggered. **4. Execute the swap** > "Go ahead and execute." The AI requests your confirmation, then submits the on-chain swap and returns an order ID for tracking. --- ## Use Case 1: Wallet Operations ### Check status > "Is my wallet connected?" > "Which chain am I on? What networks are supported?" > "What's my wallet address?" ### Check balances > "What are all my token balances?" > "How much USDT do I have?" > "What's the total USD value of my assets?" ### View transaction history > "What are my recent transactions?" > "Are there any pending transactions?" > "Check the status of transaction 0xabc123..." ### Check daily quota > "How much of my daily limit is left today?" > "What's my daily limit and how much have I used?" --- ## Use Case 2: Send Tokens Transfer tokens to a whitelisted address. > **Prerequisite:** The recipient address must be added to the Address Book in the Binance App > (Wallet → Settings → Address Book). **Send native token:** > "Send 0.02 BNB to 0x1234...5678" **Send ERC-20 token:** > "Transfer 10 USDT to 0x1234...5678" The AI will show you the amount and destination address before executing. After success, it returns a transaction hash. You can follow up: > "Has that transfer been confirmed on-chain?" --- ## Use Case 3: Market Order (Swap) ### Get a quote > "How much USDT would I get for 0.1 BNB? Quote only, don't execute." The AI returns the estimated output, slippage, and routing — no on-chain transaction. ### Execute a market swap > "Swap 0.1 BNB for USDT" > "Buy BNB with 50 USDT, slippage max 2%" The AI shows the quote and waits for confirmation. Say "confirm" or "go ahead" to trigger the swap. ### Check order status > "Has my last swap completed?" > "Show me my recent swap orders" > "Any swaps still pending?" | Status | Description | | ---------- | --------------------- | | `PENDING` | Processing on-chain | | `FINISHED` | Executed successfully | | `FAILED` | Execution failed | --- ## Use Case 4: Limit Order Set a target price — the AI executes automatically when triggered. No need to watch the market. > **Note:** Limit orders are only supported on BSC and Solana. Buy orders: `fromToken` must be USDT, > USDC, USD1, U or native token. Sell orders: `toToken` must be USDT, USDC, USD1, U or native token. ### Place a limit buy > "Buy BNB with 100 USDT when the price drops to $500" > "When WETH drops to $2800, buy some with 200 USDT on BSC" The AI creates the conditional order and returns a strategy ID. It executes automatically when the price is hit. ### Place a limit sell > "Sell 1 BNB for USDT when the price reaches $650" > "Sell 0.5 WETH on BSC when it hits $3500" ### Check limit orders > "What limit orders do I have open?" > "Show me limit orders still waiting to trigger" > "Check the status of limit order 9876543210" | Status | Description | | ----------- | ------------------------- | | `WORKING` | Waiting for trigger price | | `TRIGGERED` | Price hit, executing | | `PENDING` | Processing on-chain | | `FINISHED` | Executed successfully | | `FAILED` | Execution failed | | `EXPIRED` | Order expired | | `CANCELED` | Order canceled | ### Cancel a limit order > "Cancel my BNB limit buy order" > "Cancel all my open orders" --- ## Use Case 5: Prediction Market Trade on prediction markets — browse markets, bet on outcomes, manage positions, and claim winnings. ### Browse markets > "Search the most popular market in the sport category" > "What prediction markets are available in the crypto category?" ### Place a prediction order > "Buy "Up" in the most recent BTC 15m price market" The AI fetches a quote, shows you the expected cost and payout, and waits for your confirmation before placing the order. ### Check positions & PnL > "What are my current prediction positions?" > "Show my prediction portfolio and unrealized PnL" > "What's my prediction trading history?" ### Redeem winnings > "Do I have any winning predictions ready to claim?" > "Redeem my winning prediction positions" The AI checks for `PENDING_CLAIM` positions and triggers the redemption. ### Cancel an order > "Cancel my pending prediction order" | Status | Description | | ------------------ | -------------------------------- | | `PENDING` | Order created, not yet submitted | | `SUBMITTED` | Submitted, awaiting execution | | `FILLED` | Fully filled | | `PARTIALLY_FILLED` | Partially filled | | `CANCELLED` | Cancelled by user or system | | `FAILED` | Execution failed | | `EXPIRED` | Expired due to market ending | --- ## Use Case 6: Security & Settings Security settings can only be modified in the Binance App. You can query the current configuration anytime through the AI: > "What's my current daily limit?" > "What's my tradable token scope?" > "Are high-risk transactions set to auto-reject or require confirmation?" To modify: **Binance App → Agentic Wallet management page → Settings icon (top right)** --- ## Use Case 7: Automated Trading Strategies Combine Agentic Wallet with published Wallet Skills like `meme-rush`, `trading-signal`, `query-token-info`, and `query-token-audit` to build end-to-end automated trading strategies. > **Tip:** The following use cases require the corresponding Skills to be installed. Get them from > [binance-skills-hub](https://github.com/binance/binance-skills-hub/tree/main/skills/binance-web3). ### Strategy 1: Meme Token Sniping Use `meme-rush` to monitor newly launched or migrating Meme tokens, run security pre-checks with `query-token-audit`, and execute trades when safe. **Example conversation:** > "What new Meme tokens launched on Solana recently?" The AI uses `meme-rush` to return tokens on the bonding curve. > "Audit the security of token XXX for me" The AI uses `query-token-audit` to return risk score, honeypot detection, tax analysis, etc. > "Looks safe enough. Buy with 50 USDT" The AI confirms and executes a market swap via Agentic Wallet. --- ### Strategy 2: Smart Money Following Use `trading-signal` to monitor smart money buy signals in real-time, auto-check security, and follow trades. **Basic usage:** > "What are the latest smart money buy signals?" The AI uses `trading-signal` to return active signals with token, trigger price, current price, max gain, etc. > "Is the token from this signal safe? Check it for me" The AI calls `query-token-audit` to return the security audit. > "Looks good, buy with 50 USDT" The AI executes the trade via Agentic Wallet. **Advanced usage — automated following:** > "Check smart money signals every 5 minutes. When a new signal appears, auto-audit it. If risk > level is LOW, buy with 50 USDT" The AI Agent will set up a scheduled task to automatically: fetch signals → security audit → execute trade if safe. The specific implementation is planned by the Agent based on your instructions. --- ### Strategy 3: Narrative Trend Capture Use `meme-rush`'s AI narrative detection to discover market hot spots and position early. **Example conversation:** > "What narratives are trending right now? Which themes have the most capital inflow?" The AI uses `meme-rush` to return narrative themes ranked by net capital inflow. > "What are the representative tokens for this narrative?" The AI returns related tokens with market data. > "Check the holder distribution and liquidity for XXX" The AI uses `query-token-info` to return token details, holder analytics, and liquidity data. > "Liquidity looks deep. Set a limit sell order for 50% when it reaches $1.2" The AI creates a limit sell order via Agentic Wallet. --- ### Best Practices | Principle | Description | | ----------------------- | --------------------------------------------------------------------------- | | **Audit before buying** | For any non-mainstream token, audit with `query-token-audit` before trading | | **Start small** | Test new strategies with small amounts before scaling up | | **Set stop-losses** | Use limit sell orders to define exit points and avoid being stuck | | **Diversify** | Don't put all funds into a single token or narrative | | **Monitor regularly** | Check limit order status and portfolio changes periodically | > ⚠️ **Risk Warning:** On-chain trading involves slippage, MEV attacks, and contract risks. All > trading decisions should be based on your own research (DYOR). Skills provide information and > execution capabilities only — they do not constitute investment advice. --- ## What's Next - [Skills Reference](/products/agentic-wallet/reference/skills) — Full capability reference for all Skills modules - [Supported Skills](/products/wallet-skills/supported-skills) — View all available Wallet Skills --- ## Document: Install Agentic Wallet URL: /en/dev-docs/products/agentic-wallet/quickstart/install-agentic-wallet # Install Agentic Wallet Two steps to start operating on-chain through natural language with your AI Agent. --- ## Prerequisites **Node.js 18+** — required by the Skills installer. **Binance Account & MPC Wallet** 1. You need a Binance account to get started 2. After signing in to Binance, create an MPC Wallet in the Binance App — this is required before you can create an Agentic Wallet --- ## Step 1: Install Skills ```bash npx skills add binance/binance-skills-hub/skills/binance-web3/binance-agentic-wallet ``` > If the `baw` CLI is not installed, Skills will detect this and install it automatically on first > use. --- ## Step 2: Sign In Once installed, say this to your AI Agent: > "Sign in to Binance Agentic Wallet" The Agent will return a signin link. If you click this link on mobile, you will be directly redirected to the Binance App. If you open it on the web, you will need to scan the QR code in the page using the Binance App and confirm the signin in the App. If this is your first time signing in, the Binance App will walk you through the Agentic Wallet creation process. Once complete, you'll land on the Agentic Wallet management page. To sign out, tell your AI: > "Sign out" --- ## Security Recommendations Security rules can only be configured in the Binance App — the AI can read them but cannot modify them. For first-time setup, we recommend: - Set a small daily limit (e.g., $50) to start - Restrict tradable tokens to the Limited scope - Set high-risk transaction handling to "Require App confirmation" To modify: **Binance App → Agentic Wallet management page → Settings icon (top right)** --- ## Next Steps → [Tutorial and Use Cases](./use-agentic-wallet-tutorial-and-use-cases.md) --- ## Document: WidgetSlot URL: /en/dev-docs/products/mini-program/framework/components/WidgetSlot # WidgetSlot Slot for Widget **Example** bxml ```html ``` ## Props | Name | Type | Description | | ------- | -------- | ----------- | | `appid` | `string` | | | `path` | `string` | | | `props` | `object` |   | --- ## Document: WebView URL: /en/dev-docs/products/mini-program/framework/components/WebView # WebView A container that hosts web pages. Will automatically cover the entire Mini Program page,**Personal type Mini Program is not supported for the time being.** **Example** ```js Page({ data: {}, onLoad(query) { console.log("onload", this, query); }, onShow() {}, onReady() {}, onWebViewLoad(e) { console.log("[WebView] onLoad", e.detail); }, onWebViewError(e) { console.log("[WebView] onError", e.detail); }, async onWebViewMessage(e) { await bn.showModal({ title: "Message From WebView", content: JSON.stringify(e.detail.data), }); bn.createSelectorQuery() .select(".web-view") .context((result) => { result.context.postMessage("hey!"); }) .exec(); }, }); ``` **Bug & Tip** - `tip`:Inside the page iframe The domain name also needs to be configured into the domain whitelist. - `tip`: On the developer tools, you can web-view Component by right-clicking - Debug, Open web-view Component debugging. - `tip`: Each page can have only one web-view,web-view Automatically covers the entire page and overwrites other components. - `tip`: web-view Division between web pages and Mini Programs is not supported JSSDK Provides communication beyond the interface provided by. - `tip`: Avoid Chinese characters in links, and iOS There will be a problem to open the white screen, it is recommended to add EncodeURIComponent ## Props | Name | Type | Description | Default | | ----------------- | --------- | ------------------------------------------------------------------------------------------- | ------- | | `src` | `string` | webview A link to a web page. | | | `injected` | `unknown` | js script file to be injected before jump to any pages. | | | `bounce` | `boolean` | | `true` | | `loading-bar` | `boolean` | | `true` | | `web-preferences` | `object` | | | | `hidden` | `boolean` | whether the webview is hidden | `false` | | `handle-error` | `boolean` | whether js has handled error or not. If true, native will show an error page. Default false | `false` | --- ## Document: View URL: /en/dev-docs/products/mini-program/framework/components/View # View View container **Example** bxml ```html {{msg}} ``` js ```js Page({ data() { return { msg: "view container", }; }, touchstart() { console.log("touchstart"); }, }); ``` ## Props | Name | Type | Description | Default | | ------------------------ | --------- | -------------------------------------------------------------------------------------------------- | -------- | | `hover-class` | `string` | Specifies the style class to press down on. when hover-class="none" There is no click state effect | `"none"` | | `hover-stop-propagation` | `boolean` | Specifies whether to prevent this node's ancestor from clicking | `false` | | `hover-start-time` | `number` | How long does it take to click, in milliseconds? | `50` | | `hover-stay-time` | `number` | Click hold time after finger release, in milliseconds | `400` | | `catch-move` | `boolean` | prevent scroll event's propagation | `false` | | `no-drag-propagation` | `boolean` | prevent scroll event's propagation jssdk > 4.33.0 | `false` | ## Events | Name | Description | | ---------------- | ---------------------- | | `bindtouchstart` | Touch start event trap | --- ## Document: Video URL: /en/dev-docs/products/mini-program/framework/components/Video # Video Video support Same-layer rendering. Related api:bn.createVideoContext **Example** ```js Page({ data: { id: "myVideo", }, onLoad(query) { console.log("onload", this, query); }, onShow() { console.log(`[LifeCycle][Textarea] useEffect`); setTimeout(() => { if (!this.videoContext) throw new Error("Missing VideoContext"); this.videoContext.play(); }, 500); }, onReady() { this.videoContext = bn.createVideoContext("myVideo"); }, onPlay(e) { console.log("[video] onPlay", e); }, onPause(e) { console.log("[video] onPause", e); }, onEnded(e) { console.log("[video] onEnded", e); }, onTimeupdate(e) { console.log("[video] onTimeupdate", e); }, onFullscreenchange(e) { console.log("[video] onFullscreenchange", e); }, onLoadedmetadata(e) { console.log("[video] onLoadedmetadata", e); }, onError(e) { console.log("[video] onError", e); }, }); ``` **Bug & Tip** - tip:video Default width 300px, altitude 225px, available via bxss Set the width and height. ## Props | Name | Type | Description | Default | | ---------------- | --------- | ----------------------------------------------------------------------------------- | ------- | | `id` | `string` | | | | `src` _required_ | `string` | Resource address to play video, support network path, local temporary path | | | `playsinline` | `boolean` | Whether to play inline | `false` | | `controls` | `boolean` | Whether to display the default playback controls/Pause on, playback progress, time) | `true` | | `autoplay` | `boolean` | Whether to autoplay | `false` | | `loop` | `boolean` | Whether to play on a loop | `false` | | `muted` | `boolean` | Mute Play | `false` | | `poster` | `string` | The image displayed before playing the video | `""` | ## Events | Name | Description | | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | `bindplay` | When it starts/Triggers play event while continuing playback | | `bindpause` | Triggered when playback is paused pause event | | `bindended` | Triggered when playback is paused pause event | | `bindtimeupdate` | Triggered when playback progress changes, event. detail = {currentTime, duration} Trigger frequency. 250ms first | | `bindfullscreenchange` | Triggered when video enters and exits full-screen, event.detail = {fullScreen, direction},direction Valid values are vertical or horizontal | | `binderror` | Triggered when video playback goes wrong | --- ## Document: textarea URL: /en/dev-docs/products/mini-program/framework/components/TextArea # textarea ## Props | Property | Type | Default Value | Required | Description | | ---------------------------- | ------------- | ---------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | value | String | | | The initial content in the input box. | | placeholder | String | | | The placeholder used when the input box is empty. | | placeholderStyle | String | | | Specifies the style of the placeholder. Only color, font-size, and font-weight styles are supported. | | placeholderClass | String | `textarea-placeholder` | | Specifies the style class of the placeholder. | | disabled | Boolean | `false` | | Specifies whether to disable the component. | | maxlength | Number | `140` | | The maximum length. When it is set to `-1`, the maximum length is not limited. | | autoFocus | Boolean | `false` | | (Will be discarded soon. Use the focus instead.) Auto focus. The keyboard is automatically displayed. | | focus | Boolean | `false` | | Gets focus. | | autoHeight | Boolean | `false` | | Specifies whether the height automatically increases. If this property is specified, style.height does not take effect. | | fixed | Boolean | `false` | | If the textarea is in an area of `position:fixed`, the value of the specified property should always be true. | | cursorSpacing | Number | `0` | | Specifies the distance between the cursor and the keyboard. It is either the distance between `textarea` and the bottom of the screen or the distance specified via `cursorSpacing`, whichever is smaller. | | cursor | Number | `-1` | | Specifies the cursor position during focusing. | | showConfirmBar | Boolean | `true` | | Specifies whether to display the bar containing the `Done` button above the keyboard. | | selectionStart | Number | `-1` | | The start position of the cursor. It takes effect only during auto focusing, and needs to used with selection-end. | | selectionEnd | Number | `-1` | | The end position of the cursor. It takes effect only during auto focusing, and needs to used with selection-start. | | adjustPosition | Boolean | `true` | | Specifies whether to automatically push up the page when the keyboard is displayed. | | holdKeyboard | Boolean | `false` | | Specifies whether to hide the keyboard when clicking page while the input is focused. | | disableDefaultPadding | Boolean | `false` | | Specifies whether to remove the default padding behavior on iOS. | | confirmType | String | `return` | | Sets the text on the lower-right button on the keyboard. It takes effect only when type='text'. | | confirmHold | Boolean | `false` | | Specifies whether the keyboard is not hidden when the lower-right button on the keyboard is tapped. | | onInput | Event handler | | | Triggered when the user taps the keyboard. `event.detail = { value, cursor, keyCode }`, where keyCode is the key value.box. | | onFocus | Event handler | | | Triggered when the input box is focused. `event.detail = { value, height }` | | onBlur | Event handler | | | Triggered when the input box is unfocused. `event.detail = { value, cursor }`. | | onLineChange | Event handler | | | Called when the number of lines in the input box changes. `event.detail = { height: number, heightRpx: number, lineCount: number }` | | onConfirm | Event handler | | | Triggered when the Done button is tapped. `event.detail = { value }`. | | onKeyboardHeightChange | Event handler | | | Triggered when the height of the keyboard changes. `event.detail = { height, duration}`. | | keyboardAccessoryItems | String[] | | | The array of keyboard accessory items, the items'length must be 2-5 | | onKeyboardAccessoryItemClick | Event handler | | | Triggered when the accessory item is clicked. `event.detail = { index }`. | #### Valid values of `confirm-type` | Value | Description | | -------- | -------------------------------------------------------------- | | `send` | Indicates that the button in the lower right corner is Send. | | `search` | Indicates that the button in the lower right corner is Search. | | `next` | Indicates that the button in the lower right corner is Next. | | `go` | Indicates that the button in the lower right corner is GO. | | `done` | Indicates that the button in the lower right corner is Done. | | `return` | Indicates that the button in the lower right corner is Return. | ### bug & tips - `tip`: if developer need change the caret-color of input component, developer should use css class to set it instead of inline style - `tip`: keyboardAccessoryItems's length must be 2-5 , otherwise the ui will be abnormal , and the onKeyboardAccessoryItemClick can listen the click event of the accessory item **Example** ```html ``` --- ## Document: Text URL: /en/dev-docs/products/mini-program/framework/components/Text # Text Text component for mp **Example** bxml ```html {{text}} ``` js ```js const texts = ["2017 we created a new world", "2018 we have a group of people", "2019 we have become a family", "2020 most of us are happy"]; Page({ onShareAppMessage() { return { title: "text", path: "page/component/pages/text/text", }; }, data: { text: "", canAdd: true, canRemove: false, }, extraLine: [], add() { this.extraLine.push(texts[this.extraLine.length % 12]); this.setData({ text: this.extraLine.join("\n"), canAdd: this.extraLine.length < 12, canRemove: this.extraLine.length > 0, }); setTimeout(() => { this.setData({ scrollTop: 99999, }); }, 0); }, remove() { if (this.extraLine.length > 0) { this.extraLine.pop(); this.setData({ text: this.extraLine.join("\n"), canAdd: this.extraLine.length < 12, canRemove: this.extraLine.length > 0, }); } setTimeout(() => { this.setData({ scrollTop: 99999, }); }, 0); }, }); ``` ##### `Tips` & `Bug`: - Decode can be parsed with ` ` `<` `>` `&` `&apos` `&ensp` `&emsp` - The standard of whitespace is not consistent across operating systems. ## Props | Name | Type | Description | Default | | ------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------- | ------- | | `user-select` | `boolean` | Whether the text is optional, this property causes the text node to display as inline-block | `false` | | `decode` | `boolean` | Whether to decode | `false` | | `space` | `'ensp'` | `'emsp'` | `'nbsp'` | Display continuous spaces |   | ## Events | Name | Description | | ---------- | ----------- | | `bindcopy` |   | --- ## Document: Switch URL: /en/dev-docs/products/mini-program/framework/components/Switch # Switch Switch selector. **Example** js ```js var pageData = { data: { switch1Checked: true, switch2Checked: false, switch1Style: "", switch2Style: "text-decoration: line-through", }, }; for (var i = 1; i <= 2; ++i) { (function (index) { pageData[`switch${index}Change`] = function (e) { console.log(`switch${index}发生change事件,携带值为`, e.detail.value); var obj = {}; obj[`switch${index}Checked`] = e.detail.value; this.setData(obj); obj = {}; obj[`switch${index}Style`] = e.detail.value ? "" : "text-decoration: line-through"; this.setData(obj); }; })(i); } Page(pageData); ``` bxml ```html switch 开关 type="switch" type="checkbox" ``` **Bug & Tip** - `tip`: When switching type comes with vibration feedback in iOS, can be set in the system -> Sound and touch -> System Tactile Feedback Shut Down ## Props | Name | Type | Description | Default | | ---------- | --------- | -------------------------------- | -------------------- | | `checked` | `boolean` | If selected | `false` | | `disabled` | `boolean` | Is it disabled? | `false` | | `color` | `string` | Switch The color of css of color | `var(--bnui-primay)` | ## Events | Name | Description | | ---------------- | ----------------------------------------------------------------------- | | `bindtap` | Tap event for the switch | | `bindtapcapture` | Tap capture event | | `bindchange` | checked Triggered when changed change Events, event.detail = `{ value}` | --- ## Document: SwiperSlide URL: /en/dev-docs/products/mini-program/framework/components/SwiperItem # SwiperSlide Only can be placed inswiper component, width and height are automatically set to 100%. ## Props | Name | Type | Description | Default | | ------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | | `item-id` | `string` | The id flag of the swiper item | | | `skip-hidden-item-layout` | `boolean` | Whether to skip the undisplayed slider layout, set to true Improves sliding performance in complex situations, but loses layout information for hidden state sliders | `false` | --- ## Document: swiper URL: /en/dev-docs/products/mini-program/framework/components/Swiper # swiper swiper item container. Only the swiper-item component can be placed in it, otherwise it will cause undefined problem. **Example** bxml ```html Default Style {{item}} indicatorColor: indicatorActiveColor: current: easingFunction: interval: duration: displayMultipleItems: ``` bxss: ```css .bn-swiper-item { background: red; } .options_line { width: 100%; display: flex; flex-direction: row; justify-content: space-between; } .options_btn { margin-top: 0; } .options_input { width: 100px; border: 1px solid #282828; border-radius: 4px; padding: 2px 12px; line-height: 1.6; font-size: 14px; font-weight: normal; box-sizing: border-box; } ``` js ```js Page({ data: { bgColorGroups: ['yellow', 'red', 'orange', 'green'], indicatorDots: true, isAutoplay: false, circular: true, vertical: false, indicatorColor: 'white', indicatorActiveColor: 'black', // * current: 0, easingFunction: this.easingFunction, displayMultipleItems: 1, indicatorColorInput: 'white', indicatorActiveColorInput: 'black', currentInput: 0, easingFunctionInput: 'linear', interval: 3000, intervalInput: 3000, duration: 200, durationInput: 200, displayMultipleItemsInput: 1, autoHeight: false, }, onLoad(query) { console.log('onload', this, query) }, onShow() { console.log('onShow', this.data) }, onReady() { console.log('onReady') }, onHide() { console.log('onHide') }, onTabItemTap(payload) { console.log('onTabItemTap', payload) }, // swiper page method onAutoPlayChange: function() { this.setData({ isAutoplay: !this.data.isAutoplay }) }, onCircularChange() { this.setData({ circular: !this.data.circular }) }, onVerticalChange() { this.setData({ vertical: !this.data.vertical }) }, onIndicatorDotsChange() { this.setData({ indicatorDots: !this.data.indicatorDots }) }, onIndicatorColorInput(e) { this.setData({ indicatorColorInput: e.detail.value }) }, onIndicatorColorClick() { this.setData({ indicatorColor: this.data.indicatorColorInput }) }, onIndicatorActiveColorInput(e) { this.setData({ indicatorActiveColorInput: e.detail.value }) }, onindicatorActiveColorClick() { this.setData({ indicatorActiveColor: this.data.indicatorActiveColorInput }) }, onCurrentinputInput(e) { this.setData({ currentInput: Number(e.detail.value) }) }, onCurrentinputClick() { this.setData({ current: this.data.currentInput }) }, onEasingFunctioninputInput(e) { this.setData({ easingFunctionInput: e.detail.value }) }, onEasingFunctioninputClick() { this.setData({ easingFunction: this.data.easingFunctionInput }) }, onIntervalinputInput(e) { this.setData({ intervalInput: Number(e.detail.value) }) }, onIntervalinputClick() { this.setData({ interval: this.data.intervalInput }) }, onDurationinputInput(e) { this.setData({ durationInput: Number(e.detail.value) }) }, onDurationinputClick() { this.setData({ duration: this.data.durationInput }) }, onDisplayMultipleItemsinputInput(e) { this.setData({ displayMultipleItemsInput: e.detail.value }) }, onDisplayMultipleItemsinputClick() { this.setData({ displayMultipleItems: this.data.displayMultipleItemsInput }) }, onAddBgColorGroupsClick() { const newBgColorGroups = [...this.data.bgColorGroups] newBgColorGroups.push("black") this.setData({ bgColorGroups: newBgColorGroups }) }, onRemoveBgColorGroupsClick() { const newBgColorGroups = [...this.data.bgColorGroups] newBgColorGroups.length > 0 && newBgColorGroups.pop() this.setData({ bgColorGroups: newBgColorGroups }) }, onChange(e) { console.log('[View] onClick', e) }, onTransition(e) { console.log('[View] onLongPress', e) }, onAnimationfinish(e) { console.log('[View] onTouchStart', e) }, }) ``` ## Props | Name | Type | Description | Default | | ----------------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | | `indicator-dots` | `boolean` | whether to display panel indicator points | `false` | | `indicator-color` | `string` | color of indicator | `"rgba(0, 0, 0, .3)"` | | `indicator-active-color` | `string` | color of active indicator | `"#000000"` | | `autoplay` | `boolean` | autoplay or not | `false` | | `current` | `number` | the index of current swiper | `0` | | `interval` | `number` | interval when using autoplay | `5000` | | `duration` | `number` | swipe animation duration | `500` | | `circular` | `boolean` | when last one finished, whether turn to the first one | `false` | | `vertical` | `boolean` | vertical or not(horizontal) | `false` | | `previous-margin` | `string` | exposing a small part of the previous item (child element setting width/height: 100%; set img's width/height: inherit) | `"0px"` | | `next-margin` | `string` | exposing a small part of the next item (child element setting width/height: 100%; set img's width/height: inherit) | `"0px"` | | `snap-to-edge` | `boolean` | When the number of swiper-items is greater than or equal to 2, circular is turned off and previous-margin or next-margin is turned on, you can specify that this margin is applied to the first and last element | `false` | | `display-multiple-items` | `number` | | `1` | | `easing-function` | `EasingFunctionName` | currently supported easingFunction: default,linear,easeInCubic,easeOutCubic,easeInOutCubic | `"default"` | | `rtl` | `boolean` | Right-to-left sliding mode default value is false | `false` | | `touch-start-prevent-default` | `boolean` | Whether to prevent default behavior when touch start | `true` | | `auto-height` | `boolean` | Auto height swiper - adjusts wrapper and container height to the height of the currently active slide | `false` | ## Events | Name | Description | | --------------------- | --------------------------------------------------------------------------------------------------------------- | | `bindchange` | The change event is fired when the current changes,event.detail = {current, source} | | `bindtransition` | The transition event is triggered when the position of the swiper-item changes,event.detail = {dx: dx, dy: dy} | | `bindanimationfinish` | Triggered when the animation finished,event.detail = {current, source} | --- ## Document: svg URL: /en/dev-docs/products/mini-program/framework/components/Svg # svg builtin svg component, will render raw svg tag **Example** js ```js Page({ data: { localImage: "pages/tabbar/component/resources/pic/1.jpg", remoteImage: "https://static.devfdg.net/image/julia/pie-chart-currentcolor.svg", colorChanged: false, svgStyle: "", colorClassChanged: false, colorClass: "", boxattrsChanged: false, boxattrs: { width: "48px", height: "48px" }, }, onChangeColor(e) { console.log(`[Svg] onChangeColor `, e); if (!this.data.colorChanged) { this.setData({ colorChanged: true, svgStyle: "color: #d22f2f;" }); } else { this.setData({ colorChanged: false, svgStyle: "" }); } }, onChangeBoxAttr() { if (!this.data.boxattrsChanged) { this.setData({ boxattrsChanged: true, boxattrs: { width: "96px", height: "96px" }, }); } else { this.setData({ boxattrsChanged: false, boxattrs: { width: "48px", height: "48px" }, }); } }, }); ``` bxml ```html color change box attributes boxattrs: {{ boxattrs }} box attributes priority set width & height at attribute with 48px set width & height at style with 96px svg will be 96px; set width & height at attribute with 96px svg will be 96px; data url demo ``` ### Bug & Tip - `tip`: for keep same code between webview and flutter, recommand not use class to custom svg style - `tip`: not support fully svg feature (document not ready) - `tip`: could use data-url format and pass by `src`. supported schema `text/html`, `image/svg+xml` (don't forget encode url content) - `tip`: style `width` and `height` have more priority than attribute `width` and `height` - `tip`: for `padding` and `margin`, we recommand only use `margin` for better compatibility in webview and flutter :::warn cannot direct receive svg content as child, eg `xxxx`, use `src` instead ::: - **remark** - required jssdk >= 4.37.6 - **remark** - required bundlerversion >= 3.0.112 - **remark** - if use from uikit, need config RootProvider's `iconConfig` with `svgTag: true` ## Props | Name | Type | Description | Default | | ---------------- | --------- | ------------------------------------------------------------------ | ------- | | `style` | `string` | container style | `""` | | `svg-style` | `string` | inner svg tag style | `""` | | `src` _required_ | `string` | resource url, could be remote or local | | | `width` | `string` | fit svg tag `width` attribute, lower priority than `style.width` | | | `height` | `string` | fit svg tag `height` attribute, lower priority than `style.height` | | | `no-sanitize` | `boolean` | determine should skip sanitize |   | --- ## Document: StickySectionr URL: /en/dev-docs/products/mini-program/framework/components/StickySection # StickySectionr StickySection container msv >= 4.35 **Example** bxml ```html ``` ## Props | Name | Type | Description | Default | | -------------------- | --------- | -------------------------------------------------------------------------------------------------- | ----------- | | `push-pinned-header` | `boolean` | Specifies the style class to press down on. when hover-class="none" There is no click state effect | `true` | | `padding` | `array` | Specifies whether to prevent this node's ancestor from clicking | `[0,0,0,0]` | --- ## Document: StickyHeader URL: /en/dev-docs/products/mini-program/framework/components/StickyHeader # StickyHeader StickyHeader container msv >= 4.35 **Example** bxml ```html ``` ## Props | Name | Type | Description | Default | | ------------ | -------- | -------------------------------------------------------------------------------------------------- | ----------- | | `offset-top` | `number` | Specifies the style class to press down on. when hover-class="none" There is no click state effect | `0` | | `padding` | `array` | Specifies whether to prevent this node's ancestor from clicking | `[0,0,0,0]` | --- ## Document: SortableItem URL: /en/dev-docs/products/mini-program/framework/components/SortableItem # SortableItem Only can be placed in Sortable component --- ## Document: SortableHandle URL: /en/dev-docs/products/mini-program/framework/components/SortableHandle # SortableHandle Only can be placed in SortableItem component,to support handle drag and drop gesture --- ## Document: Sortable URL: /en/dev-docs/products/mini-program/framework/components/Sortable # Sortable A sortable list component that supports drag-and-drop sorting **Example** bxml ```html btc {{item.title}} data: {{index}}: {{item.title}} ``` js ```js Page({ data: { list: [ { title: "eth", icon: "https://bin.bnbstatic.com/image/admin_mgs_image_upload/20201110/3a8c9fe6-2a76-4ace-aa07-415d994de6f0.png", }, { title: "bnb", icon: "https://bin.bnbstatic.com/image/admin_mgs_image_upload/20220218/94863af2-c980-42cf-a139-7b9f462a36c2.png", }, { title: "xrp", icon: "https://bin.bnbstatic.com/image/admin_mgs_image_upload/20201110/4766a9cc-8545-4c2b-bfa4-cad2be91c135.png", }, { title: "sol", icon: "https://bin.bnbstatic.com/image/admin_mgs_image_upload/20230404/b2f0c70f-4fb2-4472-9fe7-480ad1592421.png", }, { title: "ada", icon: "https://bin.bnbstatic.com/image/admin_mgs_image_upload/20230404/b2f0c70f-4fb2-4472-9fe7-480ad1592421.png", }, { title: "ltc", icon: "https://bin.bnbstatic.com/image/admin_mgs_image_upload/20230404/b2f0c70f-4fb2-4472-9fe7-480ad1592421.png", }, { title: "trx", icon: "https://bin.bnbstatic.com/image/admin_mgs_image_upload/20230404/b2f0c70f-4fb2-4472-9fe7-480ad1592421.png", }, { title: "bch", icon: "https://bin.bnbstatic.com/image/admin_mgs_image_upload/20230404/b2f0c70f-4fb2-4472-9fe7-480ad1592421.png", }, { title: "bsv", icon: "https://bin.bnbstatic.com/image/admin_mgs_image_upload/20230404/b2f0c70f-4fb2-4472-9fe7-480ad1592421.png", }, ], }, onReorder(e) { const { oldIndex, newIndex } = e.detail; const list = this.data.list; const item = list.splice(oldIndex, 1)[0]; list.splice(newIndex, 0, item); this.setData({ list }); bn.showToast({ title: `from ${oldIndex} to ${newIndex}` }); }, }); ``` bxss ```css .handle { height: 20px; width: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; } .icon { width: 20px; height: 20px; margin-right: 4px; } .left { display: flex; flex-direction: row; align-items: center; justify-content: center; } .line { width: 13px; height: 2.5px; background-color: #929aa5; margin-bottom: 3px; } .disable { background-color: pink; } .line2 { margin-bottom: 0; } .item { height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; font-size: 16px; line-height: 24px; background-color: white; } .app { height: 100vh; width: 100vw; background: #f0f0f0; } .title { width: 100%; height: 40px; display: flex; justify-content: center; align-items: center; font-size: 16px; line-height: 24px; font-weight: bold; } ``` - **remark** - supported jssdk >= 4.37.0 - **remark** - The configuration of being fixed at the top and not draggable is not supported. If you have similar requirements, please use two lists to implement it. - **remark** - If you use Pika to develop miniprogram, please do not use state to control sorting when using the Sortable component. React does not work well with sortablejs yet. Please use React ref to store the latest sorting state. ## Props | Name | Type | Description | Default | | ---------------------- | --------- | ---------------------------------------------------------- | ------- | | `enable-vibrate-short` | `boolean` | whether to enable vibration feedback | `true` | | `direction` | `string` | Set gesture direction, support x-axis/y-axis/free dragging | `"y"` | ## Events | Name | Description | | ------------- | ------------------------------------------------------------------------------- | | `bindreorder` | Triggered when the dragging item dropped,event.detail = { oldIndex, newIndex } | --- ## Document: slider URL: /en/dev-docs/products/mini-program/framework/components/Slider # slider Slider. **Example** bxml: ```html Set step disabled Display current value Set min/max value controlled normal Taroslider with position: relative ``` js ```js Page({ data: { controlledValue: 50, }, sliderChange(e) { console.log("slider fire change event,value:", e.detail.value); }, sliderClick(e) { console.log("slider fire click event,value:", e.detail.value); }, sliderLonePress(e) { console.log("slider fire lonePress event,value:", e.detail.value); }, onControlledValueChange(e) { console.log("slider fire change event,value:", e.detail.value); this.setData({ controlledValue: e.detail.value, }); }, }); ``` ## Props | Name | Type | Description | Default | | ------------------ | --------- | -------------------------------------------------------------- | ------------------------ | | `min` | `number` | Least value | `0` | | `max` | `number` | Maximum value | `100` | | `step` | `number` | Step size must be greater than 0 and can be(Max - Min) integer | `1` | | `disabled` | `boolean` | Is it disabled? | `false` | | `value` | `number` | Current value | | | `show-value` | `boolean` | Displays current value | `false` | | `active-color` | `string` | Selected color | `\`var(--bnui-primay)\`` | | `background-color` | `string` | Background Bar Color | `"#e9e9e9"` | ## Events | Name | Description | | ---------------- | ------------------------------------------------------------------------------ | | `bindchange` | `bindchange` Event triggered after completing a drag, event.detail = `{value}` | | `bindchanging` | `bindchaning` Event triggered during drag, event. detail = `{value}` | | `bindtap` | `bindtap` Event tap | | `bindtapcapture` | `bindtapcapture` Event tap | --- ## Document: scroll-view URL: /en/dev-docs/products/mini-program/framework/components/ScrollView # scroll-view Scrollable view area. A view group that allows the view hierarchy placed within it to be scrolled. When using vertical scrolling, you need to give the scroll view a fixed height. **Example** bxml ```html scrollY Vertical Scroll scroll-x="{{true}}" Horizontal Scroll scroll-y ScrollIntoView 2 item scroll-x ScrollIntoView 2 item Vertical Scroll with infinite scroll enhanced, fastDeceleration ``` bxss ```css .page-section-spacing { margin-top: 30px; } .scroll-view_H { white-space: nowrap; } .scroll-view-item { height: 150px; } .scroll-view-item_H { display: inline-block; width: 100%; height: 150px; } .demo-text-1 { position: relative; align-items: center; justify-content: center; background-color: #1aad19; color: #ffffff; font-size: 18px; } .demo-text-1:before { content: "A"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .demo-text-2 { position: relative; align-items: center; justify-content: center; background-color: #2782d7; color: #ffffff; font-size: 18px; } .demo-text-2:before { content: "B"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .demo-text-3 { position: relative; align-items: center; justify-content: center; background-color: #f1f1f1; color: #353535; font-size: 18px; } .demo-text-3:before { content: "C"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } ``` js ```js Page({ data: { items: new Array(3).fill(1), scrollTop: 25, scrollIntoView: "demo3", }, onShow() { setTimeout(() => { this.setData({ scrollTop: 50, scrollIntoView: "demo2", }); }, 3000); }, onScroll(e) { console.log("onScroll", e); }, onScrollToUpper(e) { console.log("onScrollToUpper", e); }, onScrollToLower(e) { console.log("onScrollToLower", e); }, onTap(e) { console.log(`[scroll-view] bindtap`, e); }, onLongpress(e) { console.log(`[scroll-view] longpress`, e); }, scrollToTop() {}, loadMore() { this.setData({ items: [...this.data.items, ...new Array(3).fill(1)], }); }, }); ``` **Bug & Tip** - `tip`: The priority of scroll-into-view is higher than that of scroll-top. - `tip`: Scrolling in the scroll-view will prevent the page from bouncing back, so scrolling in the scroll-view cannot trigger onpulldownrefresh. - `tip`: To use the pull-down refresh, please use the scroll of the page instead of the scroll-view, so that you can return to the top of the page by clicking the status bar at the top. ## Props | Name | Type | Description | Default | | ---------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ | | `scroll-x` | `boolean` | Allow lateral scrolling | `false` | | `scroll-y` | `boolean` | Allow vertical scrolling | `false` | | `scroll-top` | `string` | `number` | Set vertical scroll bar position | | | `scroll-left` | `string` | `number` | Set horizontal scroll bar position | | | `scroll-into-view` | `string` | The value should be the ID of a child element (ID cannot start with a number). Set which direction to scroll, then scroll to the element in which direction | | | `scroll-into-view-alignment` | `string` | set alignment of target view when scroll into the view, support from jssdk >= 4.17.0 | `"start"` | | `upper-threshold` | `string` | `number` | When it is far from the top / left, the scrolltupper event is triggered | `50` | | `lower-threshold` | `string` | `number` | When it is far from the bottom / right, the scrollcolor event is triggered | `50` | | `enhanced` | `boolean` | Enable the scroll view enhancement feature. After enabling, you can operate scroll view through ScrollViewContext | `false` | | `fast-deceleration` | `boolean` | Sliding deceleration rate control (effective after the enhanced attribute is turned on at the same time) | `false` | | `show-scrollbar` | `boolean` | Enabled when enhanced:true, control the scrollbar show/hide | `true` | | `refresher-enabled` | `boolean` | Enable pull-down refresh, support from jssdk >= 4.9.0 | `false` | | `refresher-threshold` | `number` | refresher threshold to trigger refresh (in px), support from jssdk >= 4.9.0 | `45` | | `refresher-default-style` | `string` | refresher default style, support from jssdk >= 4.9.0 options: black, white, none | `"black"` | | `refresher-background` | `string` | refresher background style, support from jssdk >= 4.9.0 | `"#FFF"` | | `refresher-triggered` | `boolean` | is refresher triggered, support from jssdk >= 4.9.0 | `false` | | `scroll-anchoring` | `boolean` | solve the problem of content jumping from jssdk >= 4.14.0 | | | `scroll-with-animation` | `boolean` | Use animation transitions when setting scroll bar position, support from jssdk >= 4.17.0 | `false` | | `scroll-speed-limit` | `number` | Scroll pixels per millisecond, Limit scroll speed, support from jssdk >= 4.18.0 | `"Infinity"` | | `type` | `string` | Skyline props for better long list performance, support from jssdk >= 4.31.0 | | | `extra` | `object` | Business related-custom data, support from jssdk >= 4.32.0 | | | `bounces` | `boolean` | | `true` | | `virtual-list-buffer` | `number` | | `250` | | `enable-back-to-top` | `boolean` | Enables the scroll bar to return to the top when the top status bar is tapped on iOS or the title bar is double-tapped on Android. Only vertical scrolling is supported. iOS support from jssdk >= 4.44.0, Android should support from jssdk >= 4.45.0 | `false` | ## Events | Name | Description | | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `bindscroll` | `bindscroll` Triggered when scrolling,
**Arguments**
  • **`event: detail: Object`** — The detail event object`Object{ scrollLeft, scrollTop, scrollHeight, scrollWidth, scrollWidth, deltaX, deltaY }`
| | `bindscrollstart` | `bindscrollstart` Triggered when scroll start, support msv >= 4.36.0
**Arguments**
  • **`event: detail: Object`** — The detail event object`Object{ scrollLeft, scrollTop, scrollHeight, scrollWidth, scrollWidth }`
| | `bindscrollend` | `bindscrollend` Triggered when scroll end, support msv >= 4.36.0
**Arguments**
  • **`event: detail: Object`** — The detail event object`Object{ scrollLeft, scrollTop, scrollHeight, scrollWidth, scrollWidth }`
| | `bindscrolltoupper` | `bindscrolltoupper` Scroll to the top/Triggered on the left | | `bindscrolltolower` | `bindscrolltolower` Scroll to the bottom/Triggered on the right | | `bindrefresherpulling` | `bindrefresherpulling` Triggered when pulling down | | `bindrefresherrefresh` | `bindrefresherrefresh` Triggered when refreshing | | `bindrefresherrestore` | `bindrefresherrestore` Triggered when pull-down refresher restoring | | `bindrefresherabort` | `bindrefresherabort` Triggered when refresh aborting | | `bindvirtuallistitemupdate` | `bindvitruallistitemupdate` Triggered when virtual list mounted item update | --- ## Document: ScrollViewItem URL: /en/dev-docs/products/mini-program/framework/components/ScrollItem # ScrollViewItem ## Props | Name | Type | Description | | ---------- | -------- | ------------------------------------------------------ | | `item-key` | `string` | Required. Need an unique key to calculate virtual list | --- ## Document: root-portal URL: /en/dev-docs/products/mini-program/framework/components/RootPortal # root-portal Makes the entire subtree off the page, similar to using fixed position in CSS. It is mainly used to make pop-up windows, pop-up layers, etc. **Example** bxml ```html I'm a dialog ``` js ```js Page({ data() { return { enable: true, }; }, }); ``` when use bn.createSelectorQuery, you may not get the dom in . add a second parameter in select funtion will make it work. **Example** ````html ``` ts bn.createSelectorQuery() .select('#canvas', { rootPortal: true }}) .fields({ node: true, size: true }) .exec(res => { const canvas = res[0].node const ctx = canvas.getContext('2d') ctx.fillRect(0, 0, 100, 100) }) ```` ## Props | Name | Type | Description | Default | | -------- | --------- | ------------------------------ | ------- | | `enable` | `boolean` | whether detached from the page | `true` | --- ## Document: rich-text URL: /en/dev-docs/products/mini-program/framework/components/RichText # rich-text rich text component. **Example** bxml ```html Select a space:  {{space || "default"}} HTML string