Telegram has launched interactive widgets that run within chat messages and can request payments using its native TON wallet, offering developers an in-chat option instead of opening a Mini App.
“Any Telegram message can now become an app,” founder Pavel Durov wrote on his verified Telegram channel. He said the format downloads instantly at “just 4 KB,”, with native rendering, payments and “viral mechanics built in.”
The feature is live, though its initial availability is limited. Telegram's developer documentation says widgets in production work only in private chats between users and bots. Group widgets, inline distribution through bots and forwarding are available on the test server, but not in production.
For TON builders, the change allows a small interactive interface to appear directly in a message bubble, instead of behind a button that opens a web page. Telegram added widgets in Bot API 10.4, dated Nov. 9.
The 4 KB figure is the maximum compressed-code size, not a requirement for every app. Each widget is a standalone HTML document with inline styling and JavaScript, limited to 32 KB before compression and 4 KB afterward.
Telegram executes the JavaScript in a QuickJS sandbox and renders the interface itself, rather than using a browser-style WebView. Widgets cannot access the network directly: they send requests through Telegram to their bot, which can update the widget's data. The code remains fixed once the message has been sent.
This distinguishes widgets from existing Mini Apps, which are web pages hosted by developers and opened on demand. Widgets stay visible as users scroll through a chat, but do not accept keyboard input. Telegram's guide advises developers to link to a bot or Mini App for larger projects.
Payments Through the Built-In Wallet
The payment flow described in the documentation uses Telegram's built-in wallet and TON Connect transaction formats. Developers can reuse their TON Connect code without creating a separate wallet connection or bridge for the widget.
The feature builds on Telegram's native Gram Wallet, described by TON's website as a non-custodial wallet developed by Telegram. Gram is TON's native coin, previously called Toncoin. The Defiant has previously reported on the wallet's broader rollout.
A widget asks its bot to prepare a transaction, then opens Telegram's wallet confirmation window, which displays the bot, amounts and destinations. The user has to approve the transaction. Wallet access depends on app support and regional availability, the guide says.
Telegram also tells developers to verify the sender, recipients, amounts and transaction outcome onchain before marking a payment complete, rather than relying solely on the returned message hash.
Source: thedefiant.io. Adapted by NBTC.

Add A Comment
Comments are closed.