This is the only possible workflow that came to my mind, but I’m looking for a way to call smart contracts and sign off-chain transactions using user’s wallet in Telegram

For example, we have a bot that lets a user to open a payment channel between the user and the bot’s wallet by calling a smart contract. And after that user can use their key to sign off-chain transactions generated by this bot

I was looking for a way to implement this using tonweb inside a webPage from Bot API. But I couldn’t find any examples or clues in the docs on how to connect a wallet to webPage

I had an idea of generating a wallet and storing its keys in localStorage of the webPage, but it is too unreliable to work in a real life

Jul 2, 2022, 7:39 AM
thank you for your help!
Jul 2, 2022, 8:19 AM
For the presentation part, this is what I would do:

The client-side user simulation should show a fake confirmation dialog in JS every time the user needs to sign something (sending a tx or signing off-chain message). This simulates the real wallet asking user for permission to use their private key.

Then I would make a screen capture video of the Telegram bot flow in Telegram mobile app.

Then edit the captured video, and replace the frames where the fake dialog is shown with real approval dialog frames from a mobile wallet like TonKeeper that I would record separately.

This would give a very good indication of what the real flow should feel like.
And one final tip for all hackathon participants, if I had to create a quick Telegram bot during a hackathon - I would definitely use glitch.com for that

This would give you free hassle free hosting for your bot and let you concentrate on the code, not the devops

https://support.glitch.com/t/host-telegram-bots-at-glitch/34865

Quick search found a tutorial, never tested it though
Jul 2, 2022, 9:19 AM

© 2024 Draquery.com All rights reserved.