Telegram bot
Use your Sup Wallet from Telegram without treating Telegram as a custodian. The bot always supports reads and owner-signable drafts. During linking you may also explicitly bind one Sup vault and allow its managed agent to execute inside the vault's existing on-chain caps.
#Use it
- Open the bot and send /start.
- Tap Connect Sup wallet (Telegram Mini App, or a one-time pairing link in a normal browser); connect your wallet once. Optionally enable delegated execution for the vault (the bound Sup agent can then run capped actions).
- Tap a button or just type. /menu shows the action grid — deterministic
button flows with feedback on every step:
- 🏦 Vault — create · deposit · withdraw
- 🔌 Protocols — browse supported DeFi integrations
- 🛡 Delegate & Agent — register agent key · init policy · grant a delegate cap · revoke all · "what can my delegates do?"
- 📈 Trade & Earn — swap · lend/earn · perps · strategy
- 🔎 Research — price · market · analyze · news · 🤝 Jobs — hire (escrow)
- Acting on funds returns a ✍️ Review & sign link — you sign in your own wallet (owner action), or, with delegated execution enabled, the bound agent runs a capped action and the bot reports the real result. After a signature the bot auto-reports "✅ Signed & confirmed" with the tx digest.
Commands: /start, /menu, /cancel, /reset, /unlink.
#What it can and can't do
- ✅ Read — prices, technical analysis, market & DeFi data, news, your balances and vault, delegation/policy state.
- ✅ Owner signing — portable transactions are reviewed with the connected wallet inside Telegram; the fallback link can open Sup's full approval UI.
- ✅ Optional execution — one linked vault's managed agent can run swaps, lending, staking, transfers, compose flows, and configured perps inside policy.
- 🚫 No arbitrary signing. Telegram never receives an owner key and cannot
exceed the on-chain delegation. Disable it with
/unlink, revoke the Agent Key/delegate, freeze the agent, or lower the caps.
#Run your own (deploy)
The bot ships inside the web app — no separate service:
- Webhook route
/api/tg/webhook(grammY) + one shared brain (runAgentTurn);/tg/linkrecords the explicit wallet-bound execution consent;/tg/signsigns portable transactions with the user's wallet. - Secrets (set in /admin → Secrets, or env):
TELEGRAM_BOT_TOKEN(from @BotFather) andTELEGRAM_WEBHOOK_SECRET(a long random string).SUP_APP_URLdefaults to the production URL. Both are required: with the bot token alone the webhook answers503andtg-set-webhook.tsrefuses to register. The secret token is the only thing that authenticates an incoming update, and an update's ownmessage.from.iddecides whose wallet the bot acts for. - Register the webhook AFTER deploying (it must reach an HTTPS endpoint):
TELEGRAM_BOT_TOKEN=… TELEGRAM_WEBHOOK_SECRET=… APP_URL=https://www.supwallet.app \
bun apps/web/scripts/tg-set-webhook.ts
- Local dev: Telegram can't reach localhost, so test the chat brain with
long polling —
bun apps/web/scripts/tg-dev-poll.ts(the Mini App connect/sign flow still needs the deployed HTTPS site).
