Skip to main content

DeBox Decentralized Mini-Programs

DeBox Decentralized Mini-Programs

Technical Support

If you have any questions, feel free to join the DeBox Technical Discussion Group: Click to Join

What is a DeBox Mini-Program?

  • DeBox Mini-Programs are lightweight application solutions based on web technologies, enabling seamless integration of third-party web services and functionalities with a single click.
  • As an all-in-one blockchain social platform, DeBox offers a diverse ecosystem of features, including social interaction, digital payments, market analysis, media information, and token management.
  • Third-party developers can quickly integrate their existing web systems into the DeBox platform with minimal configuration, without complex modifications. This allows them to efficiently reach a large user base, leverage platform traffic, and rapidly expand their business scenarios.**

Features of DeBox Mini-Programs

  • Open Ecosystem: Supports developers in freely building diverse applications.
  • Simplified Integration: Existing web pages can run with almost no modifications.
  • Standards Compatibility: Fully supports the HTML5 protocol and modern web technology stacks.

DeBox Mini-Program Architecture

DeBox mini-programs are based on the phone's built-in browser and developed using common languages like HTML/CSS/JS, which are well-documented and easy to learn.
By adopting the H5 standard protocol, developers can directly use their existing web pages or systems, sometimes even without any modifications, to run within the mini-program.
This openness and low entry barrier enable developers to quickly go live and seamlessly integrate with the DeBox ecosystem.

How to Determine If a Mini-Program Runs in DeBox's Built-in Browser?

During mini-program development, developers can check the userAgent of the application through JS to see if it includes 'DeBox', which indicates it is a built-in browser.

  const isDeBox = !!window?.navigator?.userAgent?.includes('DeBox') 

Additionally, the DeBox App has injected the window.ethereum or window.solana object into the built-in browser. Through this object, developers can access the following functionalities:

  1. Blockchain Query: Retrieve on-chain data such as balances, transaction history, etc.;
  2. Wallet Address Authorization: Request user authorization and obtain wallet addresses;
  3. Signing: Sign messages or transactions to complete on-chain operations;
  4. Transfer: Initiate on-chain transfer transactions.
  5. DeBox Platform Features: Obtain public information such as users' nicknames, avatars, etc., on the DeBox platform, and call DeBox point payments, among other functionalities.

Providing Services via HTTPS Interface on the Server

Through interfaces, developers can achieve functions such as authorized login, vBOX payments, data queries, Bot interactions, and more.

Easy Integration with Third Parties

Without cumbersome configurations, developers can introduce their services into DeBox based on browser capabilities, DeBox browser extension capabilities, and server API capabilities, ultimately providing services to users in the form of an HTTPS website. Since it follows the H5 standard protocol, it is free, open, easy to develop, and easy to expand. Note to adapt to mobile resolutions and submit the H5 version of the mini-program.

Where Are Mini-Programs Found in DeBox?

A mini-program is an H5 application. For quality mini-programs, the platform may recommend them under 【My】【Discover】【Mini-Programs You Might Be Interested In】. Developers and users can directly share the HTTPS address in the DeBox community. After users bookmark it, they can view it under 【My】【Discover】【My Bookmarks】.

How to Develop a Mini-Program?

Apply for Developer Account -->Develop -->Test -->Release

  1. Please apply for a developer account on the Open Platform. Due to the risks associated with point payments, developers need to submit KYC. After completing KYC verification, you will receive the following for development:
    • Api Key: Required for calling APIs such as authorized login and message push
    • App Secret: Required for calling point payments
  2. After development and testing are complete, deploy and release it, and you can share the mini-program's link within DeBox groups for promotion.

How to Call API Interfaces?

The Open Platform provides interfaces using the HTTPS protocol, which can be called in any language. For detailed parameters of upstream and downstream, please refer to the API Documentation. By using the following curl command, you will complete the API call to send a group message:

Note

Please replace X-API-KEY with your own API KEY and group_id with your test group.

Message Send Example
  curl -X POST -H "Content-Type: application/json" -H "X-API-KEY: t2XJ........lEF6" \
-d '{"group_id":"l3ixp32y","object_name":"richtext","title":"tile","content":"i am rich text {\"uitag\":\"a\",\"text\":\"点击我\",\"href\":\"https://debox.pro/\"}将跳转"}' \
"https://open.debox.pro/openapi/messages/group/send"