Developer Boilerplate for Telegram Miniapp

Overview

This boilerplate is designed to help developers quickly integrate and interact with the UTXO Global Wallet on Telegram. It provides a foundational code structure, enabling efficient setup and functionality implementation.

Setup & Configuration

1. Create a New Repository:

2. Deploy to Vercel:

3. Setting Up Your Telegram Miniapp

3.1. Setup a Telegram Bot:

  • Open Telegram and search for “BotFather” (the official bot to create other bots).

  • Start a conversation with “BotFather” and use the command

  • Follow the instructions to set up your bot:

    • You will be asked to provide a name for your bot.

    • Then, provide a username for your bot. The username must end with “bot” (e.g., MyCoolBot or MyCoolBot_bot).

3.2. Create a New App:

  • Start a conversation with “BotFather” and use the command:

  • Choose your bot just created from step 3.1

  • Follow the instructions to create a new web app for your bot

    • You will be asked to provide a title, a short description, and a photo (640x360 pixels) for the web app

    • Then, give the Web App URL you created from step 2. Deploy to Vercel

Once fully configured, your bot will be ready to interact with the UTXO Global Wallet on Telegramarrow-up-right. Here is the boilerplate bot for your reference: https://t.me/utxo_global_boilerplate_botarrow-up-right

Example Implementations

1. If you use React for your dApp:

  • Step 1: Installation

  • Step 2: Define customWallet with UTXO Global Wallet Information

  • Step 3: Define tonConnect variable

  • Step 4: Define tonConnectUI variable

  • Step 5: Listen Status Changed

  • Step 6: Connect Wallet

  • Step 7: Transfer CKB

2. If you use CDN for your dApp:

  • Step 1: Installation

  • Step 2: Define customWallet with UTXO Global Wallet Information

  • Step 3: Define tonConnectUI variable

  • Step 4: Listen Status Changed

  • Step 5: Connect Wallet

  • Step 6: Transfer CKB

References

Last updated