Telegram Adds In-Message Widgets With TON Payments

For TON builders, the change places a small interactive interface immediately in a message bubble reasonably than behind a button that opens an online web page. Telegram added widgets in Bot API 10.4, dated Nov. 9.
The 4 KB determine is a compressed-code ceiling, not a requirement that each app be that measurement. Every widget is a self-contained HTML doc with inline styling and JavaScript, capped at 32 KB earlier than compression and 4 KB afterward.
Telegram runs the JavaScript in a QuickJS sandbox and attracts the interface itself, reasonably than utilizing a browser-style WebView. Widgets don’t have any direct community entry: they ship requests by Telegram to their bot, which may replace the widget’s information. Their code stays fastened after the message is distributed.
That makes widgets distinct from current Mini Apps, that are developer-hosted net pages opened on demand. Widgets stay seen as customers scroll the chat, however can not settle for keyboard enter. Telegram’s information directs builders to hyperlink to a bot or Mini App for something bigger.
Funds Via the Constructed-In Pockets
The documented fee move makes use of Telegram’s built-in pockets and TON Join transaction codecs. Builders can reuse their TON Join code with out establishing a separate pockets connection or bridge for the widget.
It builds on Telegram’s native Gram Pockets, which TON’s web site describes as a non-custodial pockets developed by Telegram. Gram is TON’s native coin, previously referred to as Toncoin. The Defiant beforehand coated the pockets’s wider rollout.
A widget asks its bot to organize a transaction, then opens Telegram’s pockets affirmation window displaying the bot, quantities and locations. The consumer should approve. Pockets entry is dependent upon app assist and regional availability, based on the information.
Telegram additionally instructs builders to confirm the sender, recipients, quantities and transaction final result onchain earlier than treating a fee as full—not merely depend on the returned message hash.





