### Start Development Server with CLI Source: https://developers.binance.com/docs/mini-program/cli Compiles the mini-program project and starts the development server, typically listening on localhost:3000. It includes live reloading for automatic updates upon code changes. ```bash # Navigate to the project root directory $ cd [path-to-project-root] # Run bmp dev $ npx bmp dev ``` -------------------------------- ### Install Binance Mini-Program CLI Source: https://developers.binance.com/docs/mini-program/cli Installs the Binance Mini-Program CLI globally using npm. It includes an optional step to set the npm registry if it's not already configured for Binance. ```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 ``` -------------------------------- ### Installing Third-party NPM Modules Source: https://developers.binance.com/docs/mini-program/framework/overview Provides the command to install a third-party NPM module, such as 'i18n', into the project's root directory. ```bash $ npm install i18n --save ``` -------------------------------- ### Full Configuration Example for app.json Source: https://developers.binance.com/docs/mini-program/framework/configuration This example demonstrates a comprehensive `app.json` configuration for dark mode, including settings for the window and tab bar. It utilizes theme variables for properties like `navigationBarBackgroundColor`, `navigationBarTextStyle`, and various tab bar attributes. ```json { "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" }] } } ``` -------------------------------- ### Install OpenSSL on Linux Source: https://developers.binance.com/docs/mini-program/openservice/preparation Command to install OpenSSL on Debian-based Linux systems. This is a prerequisite for generating RSA key pairs. ```bash sudo apt-get install openssl ``` -------------------------------- ### Reactive Data Binding Example Source: https://developers.binance.com/docs/mini-program/framework/overview Demonstrates the core concept of reactive data binding in Binance Mini Programs, showing how data changes in the logic layer automatically update the view layer. ```html Hello {{name}}! ``` ```javascript var helloData = { name: 'Binance' } Page({ data: helloData, changeName: function(e) { // Data change sent to the view this.setData({ name: 'World' }) } }) ``` -------------------------------- ### Start Device Motion Listening Source: https://developers.binance.com/docs/mini-program/framework/api/device/startDeviceMotionListening Initiates listening for device orientation changes. This function returns a Promise that resolves when the listening is successfully started. ```APIDOC ## POST /bn.startDeviceMotionListening ### Description Start listening for changes in device orientation. This method returns a Promise that resolves with no value upon successful initiation. ### Method POST ### Endpoint /bn.startDeviceMotionListening ### Parameters #### Query Parameters - **options** (StartDeviceMotionListeningOption) - Optional - Configuration object for setting the listening interval. ### Request Body ```json { "interval": "normal" | "game" | "ui" } ``` ### Request Example ```javascript bn.startDeviceMotionListening({ interval: "normal" }); ``` ### Response #### Success Response (200) - **void** - Indicates the device motion listening has started successfully. #### Response Example ```json {} ``` ### Interface: StartDeviceMotionListeningOption | Name | Type | Description | |---|---|---| | `interval?` | `"normal"` | `"game"` | `"ui"` | Monitor device direction change callback function execution frequency.; game: The callback frequency for updating the game, in 20ms/second About.; ui: Apply to update UI Callback frequency of 60ms/second About.; normal: Normal callback frequency, in the 200ms/second About. | ``` -------------------------------- ### Start Development Server for Binance Mini Program using CLI Source: https://developers.binance.com/docs/mini-program/devtools/interface/startup-page Starts the development server for an existing Binance Mini Program project. This command should be run from the root directory of the project. It is typically used after initializing or importing a project. ```bash $ bmp dev ``` -------------------------------- ### Start Device Motion Listening (JavaScript) Source: https://developers.binance.com/docs/mini-program/framework/api/device/startDeviceMotionListening Initiates listening for device orientation changes. This function returns a Promise that resolves when the listening starts. It can accept an optional options object to configure the callback interval. ```javascript bn.startDeviceMotionListening() bn.startDeviceMotionListening({ interval: "game" }) ``` -------------------------------- ### Build and Compile Project with CLI Source: https://developers.binance.com/docs/mini-program/cli Compiles the mini-program project, rendering the necessary files in the project directory for deployment. These files can then be uploaded to the Binance management portal for release or testing. ```bash # Navigate to the project root directory $ cd [path-to-project-root] # Run bmp build $ npx bmp build ``` -------------------------------- ### bn.startAccelerometer Source: https://developers.binance.com/docs/mini-program/framework/api/device/startAccelerometer Starts monitoring the acceleration data with configurable intervals. ```APIDOC ## POST /startAccelerometer ### Description Starts monitoring the acceleration data. This function allows you to receive real-time acceleration information from the device. ### Method POST ### Endpoint /startAccelerometer ### Parameters #### Request Body - **options** (StartAccelerometerOption) - Optional - Configuration options for starting the accelerometer. ### Interface: StartAccelerometerOption Name| Type| Description ---|---|--- `interval?`| `"normal"` | `"game"` | `"ui"`| Monitor the execution frequency of the acceleration data callback function.; game: The callback frequency for updating the game, in 20ms/second About.; ui: Apply to update UI Callback frequency of 60ms/second About.; normal: Normal callback frequency, in the 200ms/second About. ### Request Example ```json { "options": { "interval": "game" } } ``` ### Response #### Success Response (200) - **None** (void) - This endpoint does not return any specific data upon success, only indicating that the operation was completed. #### Response Example ```json {} ``` ``` -------------------------------- ### Initialize a New Mini-Program Project with CLI Source: https://developers.binance.com/docs/mini-program/cli Creates a new, initialized mini-program project with a specified project name. This command sets up the basic structure for a new mini-program. ```bash $ bmp init [project-name] ``` ```bash $ bmp init magnificent-mini-program ``` -------------------------------- ### Basic Styling for Icon Examples (BXSS) Source: https://developers.binance.com/docs/mini-program/framework/components/Icon Provides basic styling for the layout of the Icon component examples using BXSS. It sets margin and text alignment for elements with the 'intro' class. ```bxss .intro { margin: 30px; text-align: center; } ``` -------------------------------- ### Navigator Usage Example - BXML Source: https://developers.binance.com/docs/mini-program/framework/components/Navigator Demonstrates how to use the navigator component in BXML to create links for navigating to different pages within a Binance Mini Program. It shows examples of standard navigation and redirection. ```bxml jump to new page open in current page ``` -------------------------------- ### Configure Data Prefetching Rules Source: https://developers.binance.com/docs/mini-program/framework/configuration Sets up rules for prefetching data when the Mini Program starts. This allows for faster loading by saving request responses. Rules can be configured for specific launch paths or all paths using wildcards. ```json { "prefetchRules": { "pages/index/index": { "https://developer.binance.com/${pageid}": { "method": "POST", "header": { "token": "${token}" }, "data": { "pageSize": "${pageSize}", "pageNum": 1 }, "responseType": "text", "hitPrefetchExtraRules": { "requiredQueryKeys": ["testid"], "requiredHeaderKeys": ["token"] } } }, "*": { "file://nezha-i18n-data_${language}.json": { "mandatory": true } } } } ``` -------------------------------- ### Install Binance Mini Program DevDependencies (npm) Source: https://developers.binance.com/docs/mini-program/typescript Installs the necessary development dependencies for building Binance Mini Programs using npm. This includes the mp-service and mp-components packages. Ensure your npm registry is correctly configured if using a private registry. ```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 ``` -------------------------------- ### Start Compass Monitoring with Binance Mini-Program API Source: https://developers.binance.com/docs/mini-program/framework/api/device/startCompass Initiates the monitoring of compass data using the Binance Mini-Program API. This function returns a Promise that resolves to void, indicating the successful start of the monitoring process. No specific parameters are required. ```javascript bn.startCompass() ``` -------------------------------- ### bn.startLocationUpdate Source: https://developers.binance.com/docs/mini-program/framework/api/location/startLocationUpdate Starts monitoring real-time position changes in the foreground. This method requires specific location options. ```APIDOC ## bn.startLocationUpdate ### Description Starts monitoring real-time position changes in the foreground. This method takes an optional options object to configure location monitoring. ### Method `startLocationUpdate` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body ##### `options` (`StartLocationUpdateOptions`) - `type` (string) - Required - Specifies the coordinate type. Accepted values are 'gcj02' or 'wgs84'. ### Request Example ```json { "options": { "type": "gcj02" } } ``` ### Response #### Success Response (200) - **`Promise`**: Resolves when the location updates are successfully started. #### Response Example (This method returns a Promise that resolves to void, so there is no specific JSON response body for success.) * * * ## StartLocationUpdateOptions ### Description Type declaration for the options object used in `startLocationUpdate`. ### Type `Object` ### Fields - **`type`** (string) - Required - Coordinates type. Accepted values: 'gcj02', 'wgs84'. ``` -------------------------------- ### Project Directory Structure Source: https://developers.binance.com/docs/mini-program/framework/overview Illustrates the typical file organization for a Binance Mini Program project, including the root files and the structure for pages. ```tree . └── src/ ├─ app.js ├── app.json ├── app.bxss └── pages/ └── detail/ ├── index.js ├── index.bxml ├── index.bxss └── index.json ``` -------------------------------- ### bn.getLaunchOptionsSync Source: https://developers.binance.com/docs/mini-program/framework/api/basics/getLaunchOptionsSync Retrieves the launch options synchronously for the current mini-program. ```APIDOC ## GET /bn.getLaunchOptionsSync ### Description Retrieves the launch options synchronously for the current mini-program. This includes information like the path, query parameters, scene, and referrer details. ### Method GET ### Endpoint /bn.getLaunchOptionsSync ### Parameters This method does not accept any parameters. ### Request Example ```json { "example": "No request body needed for this method." } ``` ### Response #### Success Response (200) - **LaunchShowOptions** (`object`) - An object containing the launch details. - **path** (`string`) - The path that was opened. - **query** (`object`) - The query parameters associated with the path. - **scene** (`number`) - The scene number indicating how the mini-program was launched. - **referrerInfo** (`object`, optional) - Information about the referrer. - **appId** (`string`, optional) - The AppID of the referrer. - **extraData** (`object`, optional) - Additional data from the referrer. #### Response Example ```json { "path": "/pages/index/index", "query": { "userId": "12345", "source": "share" }, "scene": 1001, "referrerInfo": { "appId": "wx1234567890abcdef", "extraData": { "key": "value" } } } ``` ``` -------------------------------- ### Get File Status API Response Example (JSON) Source: https://developers.binance.com/docs/mini-program/openservice/get-file-status This is an example of a successful HTTP 200 response from the GetFileStatus API. It includes a status code, a message, and data containing the file's current status, which can be 'CHECKING', 'SUCCESS', or 'FAILED'. ```json { "code": "000000", "message": null, "data": { "status": "FAILED" }, "success": true } ``` -------------------------------- ### Project Configuration Example (project.config.json) Source: https://developers.binance.com/docs/mini-program/framework/project-configuration A sample `project.config.json` file demonstrating how to set the `miniprogramRoot` and configure `packOptions` with various ignore rules for project packaging. This configuration helps exclude specific files, folders, or patterns during the build process. ```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$" } ] } // ... } ``` -------------------------------- ### Request Example for GetUserPayId (JSON) Source: https://developers.binance.com/docs/mini-program/openservice/get-user-pay-id This snippet shows the structure of a JSON request to the GetUserPayId endpoint. It includes placeholders for the application ID and user's open ID. Ensure these are correctly populated before sending the request. ```json { "appId": "insert-your-app-id-from-workspace", "openId": "insert-user’s-openId-for-query" } ``` -------------------------------- ### Synchronously Get Prefetch Cache Data (JavaScript) Source: https://developers.binance.com/docs/mini-program/framework/api/network/getPrefetchCacheSync Retrieves prefetch cache data synchronously using the bn.getPrefetchCacheSync function. If prefetch data is not ready, it returns undefined. This example demonstrates how to call the function and handle potential errors, logging the result and its data. ```javascript let res try { res = bn.getPrefetchCacheSync?.({ url: 'https://nezha-mock.fe.qa1fdg.net/order' }) } catch(e) {} console.log(res, res.result) ``` -------------------------------- ### Get and Use Update Manager in JavaScript Source: https://developers.binance.com/docs/mini-program/framework/api/basics/getUpdateManager Obtains the globally unique version update manager for managing Mini Program updates. This example demonstrates how to check for updates, handle when an update is ready, and manage update failures. ```javascript const updateManager = bn.getUpdateManager() updateManager.onCheckForUpdate(function (res) { // Callback after requesting new version information console.log(res.hasUpdate) }) updateManager.onUpdateReady(function () { bn.showModal({ title: 'Update tip ', content: 'The new version is ready, reboot the app? ', success: function (res) { if (res.confirm) { // The new version has been downloaded and calls applyUpdate Apply a new version and restart updateManager.applyUpdate() } } }) }) updateManager.onUpdateFailed(function () { // New version download failed }) ``` -------------------------------- ### Configure File Prefetching Rules Source: https://developers.binance.com/docs/mini-program/framework/configuration Illustrates setting up file prefetching rules, where the request address is a local file path that supports variable substitution. It explains the 'mandatory' flag's effect on mini-program launch timing and how to access prefetched files using 'bn.getFileSystemManager'. ```json { "prefetchRules": { "pages/index/index": { "file://nezha-i18n-data_${language}.json": { "mandatory": true } } } } ``` ```javascript const fs = bn.getFileSystemManager() const filePath = 'file://nezha-i18n-data_zh_CN.json' const res = fs.readFileSync(filePath, 'utf8') console.log('File content:', res) ``` -------------------------------- ### Initialization API Source: https://developers.binance.com/docs/mini-program/framework/api/openapis/initUniversalWeb3Provider Initializes the universal Web3 provider for the Binance Mini-Program. ```APIDOC ## POST /bn.initUniversalWeb3Provider ### Description Initializes the universal Web3 provider with optional configuration. ### Method POST ### Endpoint /bn.initUniversalWeb3Provider ### Parameters #### Query Parameters - **options** (UniversalProviderOptions) - Optional - Configuration options for the provider, including `topicId` and `metaData`. ### Request Body ```json { "topicId": "string", "metaData": { "name": "string", "description": "string", "url": "string", "icons": ["string"] } } ``` ### Response #### Success Response (200) - **result** (UniversalProvider) - An object containing the initialized UniversalProvider instance. #### Response Example ```json { "result": { "topicId": "string", "metaData": { "name": "string", "description": "string", "url": "string", "icons": ["string"] }, "events": "SimpleEventEmitter", "namespaces": {}, "rpcHooks": {}, "isConnecting": false, "isConnected": false } } ``` ``` -------------------------------- ### Get Selected Text Range in Binance Mini Program Source: https://developers.binance.com/docs/mini-program/framework/api/keyboard/getSelectedTextRange Retrieves the cursor position within input or textarea elements. This API is effective only when called during the focus event of these elements. It returns a Promise that resolves with the start and end positions of the selected text. ```javascript bn .getSelectedTextRange() .then(res => { console.log('getSelectedTextRange res', res.start, res.end) }) .catch(error => { console.log('hideKeyboard error', error) }) ``` -------------------------------- ### Successful Response Example for GetUserPayId (JSON) Source: https://developers.binance.com/docs/mini-program/openservice/get-user-pay-id This snippet illustrates a successful HTTP 200 response from the GetUserPayId API. It contains the user's pay ID within the 'data' object. The 'code' field indicates success ('000000'). ```json { "code": "000000", "message": null, "data": { "payId": 26238454 }, "success": true } ``` -------------------------------- ### Initialize Provider Source: https://developers.binance.com/docs/mini-program/framework/api/openapis/getUniversalWeb3Provider Initializes the Universal Provider with specified options. ```APIDOC ## Static init ### Description Initializes the Universal Provider with the provided options. This is a static method that must be called before using other provider methods. ### Method POST ### Endpoint /init ### Parameters #### Request Body - **options** (UniversalProviderOptions) - Required - An object containing initialization options. - **rpcHooks** (RPCHooks) - Required - Hooks for RPC calls. - **topicId** (TopicId) - Optional - The topic ID for the provider. - **metaData** (ClientMetadata) - Optional - Metadata for the client. ### Request Example ```json { "options": { "rpcHooks": {}, "topicId": "some-topic-id", "metaData": { "name": "My App" } } } ``` ### Response #### Success Response (200) - **provider** (UniversalProvider) - A promise that resolves to the initialized UniversalProvider instance. #### Response Example ```json { "provider": "[UniversalProvider instance]" } ``` ``` -------------------------------- ### GET /mp-api/v1/apps/{appId}/users Source: https://developers.binance.com/docs/mini-program/openservice/get-user-pay-id Retrieves the payment ID for a specific user within a Binance mini-program. ```APIDOC ## GET /mp-api/v1/apps/{appId}/users ### Description Retrieves the payment ID for a specific user within a Binance mini-program. This endpoint requires authentication via a JWT token. ### Method GET ### Endpoint `/mp-api/v1/apps/{appId}/users` ### Parameters #### Path Parameters - **appId** (string) - Required - The AppId of the mini program. #### Query Parameters - **openId** (string) - Required - The openId of the user you wish to query. #### Header Parameters - **X-Mp-Open-Api-Token** (string) - Required - JWT token for authentication. Refer to the 'External Interface Signature Authentication Algorithm' for generation details. ### Request Example ```json { "appId": "insert-your-app-id-from-workspace", "openId": "insert-user’s-openId-for-query" } ``` ### Response #### Success Response (200) - **code** (string) - Response code indicating success or failure. - **message** (string) - Null if successful, otherwise contains an error message. - **data** (object) - Contains the payment ID if successful. - **payId** (integer) - The payment ID of the user. - **success** (boolean) - True if the request was successful, false otherwise. #### Response Example ```json { "code": "000000", "message": null, "data": { "payId": 26238454 }, "success": true } ``` ### Error Codes - **000000**: Success - **900001**: Invalid Parameter - **900002**: JWT Authentication Failed - **900003**: Unexpected Error ``` -------------------------------- ### Full Configuration Example for theme.json Source: https://developers.binance.com/docs/mini-program/framework/configuration This `theme.json` file provides detailed variable definitions for both light and dark modes. It includes settings for navigation bar colors, background styles, tab bar fonts, colors, and icon paths, enabling comprehensive theme customization. ```json { "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" } } ``` -------------------------------- ### Upload File Request Example (curl) Source: https://developers.binance.com/docs/mini-program/openservice/upload-file Example of how to upload a single file using curl to the Binance Mini Program API. This demonstrates the use of multipart/form-data and necessary headers. ```bash curl -X POST \ 'https://dip-cb.binanceapi.com/mp-api/v1/apps/{appId}/files/upload' \ -H 'X-Mp-Open-Api-Token: YOUR_JWT_TOKEN' \ -F 'file=@/path/to/your/image.jpg' ``` -------------------------------- ### Add Support to Existing React Project with CLI Source: https://developers.binance.com/docs/mini-program/cli Integrates the Binance Mini-Program CLI into an existing React project. This involves navigating to the project root and running the 'bootstrap' command, which adds a `.bmp` directory and updates `tsconfig.json` for TypeScript support. ```bash # Navigate to the project root directory $ cd [path-to-desirable-project-root] # Run bmp bootstrap $ bmp bootstrap ``` -------------------------------- ### Initialize Binance Mini Program Project using CLI Source: https://developers.binance.com/docs/mini-program/devtools/interface/startup-page Creates a new Binance Mini Program project using the @binance/mp-cli. This command generates a basic project structure. Ensure the @binance/mp-cli is installed globally. ```bash $ bmp init [project-name] ``` -------------------------------- ### Configure Page Window Behaviors Source: https://developers.binance.com/docs/mini-program/framework/configuration Demonstrates how to configure window behaviors for individual Mini Program pages using a JSON file. These configurations override global settings in 'app.json' and include options like navigation bar styles, background colors, and rendering cache settings. ```json { "navigationBarBackgroundColor": "#ffffff", "navigationBarTextStyle": "black", "navigationBarTitleText": "Binance API feature demo", "backgroundColor": "#eeeeee", "backgroundTextStyle": "light", "initialRenderingCache": "static", "staticTemplate": { "enable": true, "removeSkeleton": true, "data": { "list": [] } } } ``` -------------------------------- ### StickyHeader Usage Example (BXML) Source: https://developers.binance.com/docs/mini-program/framework/components/StickyHeader This example demonstrates how to use the StickyHeader component in BXML. It includes a basic structure with a view element for the header content. The component requires no specific external dependencies for basic usage. ```bxml ``` -------------------------------- ### Update SKU Request Body Example Source: https://developers.binance.com/docs/mini-program/openservice/update-sku Example JSON payload for updating SKU details. This includes localized names, country whitelists, and blacklists. Note that updating fields overwrites their entire original value. ```json { "names": { "en": "PUBG 100 points", "zh-TW": "PUBG 100 點" }, "countryWhitelist": ["JP"], "countryBlacklist": ["CN", "TW"] } ``` -------------------------------- ### Build Mini Program Bundle using CLI Source: https://developers.binance.com/docs/mini-program/management This command builds the mini-program files required for uploading. It requires navigating to the project directory and executing the 'bmp build' command. The output files are placed in the project directory and can be uploaded using Binance DevTools. ```bash cd [path-to-your-project] bmp build ``` -------------------------------- ### Start Accelerometer Monitoring (JavaScript) Source: https://developers.binance.com/docs/mini-program/framework/api/device/startAccelerometer Initiates the monitoring of acceleration data. The 'options' parameter allows specifying the interval for data updates, with options like 'game', 'ui', or 'normal'. This function returns a Promise that resolves when monitoring starts. ```javascript bn.startAccelerometer({ interval: 'game' }) ``` -------------------------------- ### Start Gyroscope Monitoring with bn.startGyroscope Source: https://developers.binance.com/docs/mini-program/framework/api/device/startGyroscope Initiates the monitoring of gyroscope data. This function can optionally accept an options object to configure the update interval for the gyroscope data callback. The function returns a Promise that resolves when the gyroscope monitoring has started. ```javascript bn.startGyroscope() ``` -------------------------------- ### Open Binance Mini Program Settings Source: https://developers.binance.com/docs/mini-program/framework/api/settings/openSetting Opens the Mini Program setup interface for the user to configure permissions. It returns a Promise that resolves with the user's authorization settings. This function is useful for requesting specific user permissions within the Mini Program. ```javascript const res = await bn.openSetting() console.log(res.authSetting) ``` -------------------------------- ### bn.getEnterOptionsSync Source: https://developers.binance.com/docs/mini-program/framework/api/basics/getEnterOptionsSync Retrieves the launch options for the mini-program synchronously. This includes information about how the mini-program was launched, such as the path, query parameters, scene, and referrer information. ```APIDOC ## GET /bn/getEnterOptionsSync ### Description Retrieves the launch options for the mini-program synchronously. This includes information about how the mini-program was launched, such as the path, query parameters, scene, and referrer information. ### Method GET ### Endpoint /bn/getEnterOptionsSync ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **LaunchShowOptions** (`object`) - An object containing the launch options. - **path** (`string`) - The path that was opened. - **query** (`Query` object) - The query parameters. - **scene** (`number`) - The scene of the launch. - **referrerInfo** (`object`, optional) - Information about the referrer. - **appId** (`string`, optional) - The AppID of the referrer. - **extraData** (`object`, optional) - Extra data from the referrer. #### Response Example ```json { "path": "/pages/index/index", "query": { "key1": "value1", "key2": "value2" }, "scene": 1001, "referrerInfo": { "appId": "wx1234567890abcdef", "extraData": { "customData": "someValue" } } } ``` ## LaunchShowOptions Ƭ **LaunchShowOptions** : `Object` Type declaration Name| Type ---|--- `path`| `string` `query`| `Query` `scene`| `number` `referrerInfo?`| { `appId?`: `string` ; `extraData?`: `object` } `referrerInfo.appId?`| `string` `referrerInfo.extraData?`| `object` * * * ## Query Ƭ **Query** : `Object` * * * ``` -------------------------------- ### HTML and CSS for Binance Mini Program Skeleton Source: https://developers.binance.com/docs/mini-program/framework/skeleton This code snippet demonstrates how to create a skeleton screen for a Binance mini-program using HTML and CSS. It utilizes supported tags like `div` and `p`, and attributes such as `id`, `class`, and `style`. The CSS includes styles for basic layout, positioning, and an animation for a blinking effect. ```html