Skip to main content
This guide covers setting up the Clavion Telegram bot (@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

The bot uses a split pipeline:
  1. Sends approve-request to ISCL Core (which blocks waiting for approval)
  2. Polls /v1/approvals/pending to find the pending request ID
  3. Renders an inline keyboard with Approve/Deny buttons
  4. On user tap, calls /v1/approvals/:id/decide
  5. The blocked approve-request resolves with an approval token
  6. Calls sign-and-send with 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.
Parameters are parsed from the message. The bot will:
  1. Build a TxIntent with action.type: "transfer"
  2. Send to ISCL Core for approval
  3. Show an inline keyboard: [Approve] [Deny]
  4. On approval, sign and broadcast
  5. Report the transaction hash

/send

Transfer native ETH.

/swap

Swap tokens via DEX.
Supports both Uniswap V3 and 1inch (if 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:
Security enforcement:
  • 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

Set ISCL_TELEGRAM_ALLOWED_CHATS to restrict which chats can use the bot:
If a message arrives from an unauthorized chat, the bot silently ignores it.

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:
The bot container uses http://iscl-core:3100 (Docker internal DNS) to reach ISCL Core instead of localhost.

Multi-chain usage

Set ISCL_CHAIN_ID to change the default chain: Ensure the corresponding ISCL_RPC_URL_{chainId} is configured on ISCL Core.

Troubleshooting

Bot doesn’t respond

  1. Check that TELEGRAM_BOT_TOKEN is correct (test with curl https://api.telegram.org/bot<TOKEN>/getMe)
  2. Check that your chat ID is in ISCL_TELEGRAM_ALLOWED_CHATS
  3. 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:
If running in Docker, ensure the bot uses the Docker service name (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