@clavion/adapter-telegram) for interacting with ISCL Core through Telegram chat.
Overview
The Telegram bot is a Domain A adapter built with grammY. It provides a conversational interface for requesting crypto operations: transfers, swaps, approvals, and balance checks. The bot renders inline approval keyboards so the operator can approve or deny transactions directly in the chat.How it works
- Sends
approve-requestto ISCL Core (which blocks waiting for approval) - Polls
/v1/approvals/pendingto find the pending request ID - Renders an inline keyboard with Approve/Deny buttons
- On user tap, calls
/v1/approvals/:id/decide - The blocked
approve-requestresolves with an approval token - Calls
sign-and-sendwith the token
Prerequisites
- ISCL Core running with
ISCL_APPROVAL_MODE=web(required — the bot uses web approval) - A Telegram bot token from @BotFather
- A wallet address imported into the ISCL keystore
- Node.js 20+
Setup
Bot commands
/transfer
Transfer ERC-20 tokens.- Build a TxIntent with
action.type: "transfer" - Send to ISCL Core for approval
- Show an inline keyboard: [Approve] [Deny]
- On approval, sign and broadcast
- Report the transaction hash
/send
Transfer native ETH./swap
Swap tokens via DEX.ONEINCH_API_KEY is configured on Core).
/approve
Approve ERC-20 spending allowance./balance
Check wallet balance./status
Check ISCL Core status (health endpoint).Approval flow
When a transaction command is sent, the bot renders an inline keyboard:- Only the user who initiated the transaction can tap Approve/Deny (same-sender check)
- Each approval keyboard is tied to a specific request ID
- Expired requests (>300s TTL) cannot be approved
- Tapping Approve triggers
sign-and-send; Deny cancels the pipeline
Authentication
Allowed Chat IDs
SetISCL_TELEGRAM_ALLOWED_CHATS to restrict which chats can use the bot:
Same-Sender Enforcement
Callback queries (button taps) are verified against the original command sender. If user A sends/transfer and user B taps Approve, the bot rejects B’s tap with “Only the transaction initiator can decide.”
Running in Docker
Add the Telegram bot as a service in your Docker Compose:Multi-chain usage
SetISCL_CHAIN_ID to change the default chain:
Ensure the corresponding
ISCL_RPC_URL_{chainId} is configured on ISCL Core.
Troubleshooting
Bot doesn’t respond
- Check that
TELEGRAM_BOT_TOKENis correct (test withcurl https://api.telegram.org/bot<TOKEN>/getMe) - Check that your chat ID is in
ISCL_TELEGRAM_ALLOWED_CHATS - Check bot logs for errors
”Transaction expired or not found”
The approval TTL is 300 seconds. If you wait too long to tap Approve/Deny, the request expires. Submit the command again.ISCL Core connection errors
Verify Core is running and reachable:http://iscl-core:3100), not localhost.
”Only the transaction initiator can decide”
Someone other than the command sender tried to tap the approval button. Only the original sender can approve or deny.References
- Configuration Reference — All environment variables
- API Reference — Endpoints used by the bot
- Web Approval UI — Web-based approval dashboard
- Multi-Chain Operations — Chain configuration