{"_id":"@bch-intents/sdk-telegram-bot","name":"@bch-intents/sdk-telegram-bot","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bch-intents/sdk-telegram-bot","version":"1.0.0","description":"BCH Intents SDK — Reference Telegram Bot Solver","type":"module","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@solana/spl-token":"^0.3.9","@solana/web3.js":"^1.87.0","axios":"^1.6.0","bn.js":"^5.2.1","cashscript":"^0.9.3","chalk":"^4.1.2","dotenv":"^16.4.5","mainnet-js":"^1.1.33","pg":"^8.13.0","telegraf":"^4.15.0","@bch-intents/sdk-common":"0.1.0","@bch-intents/sdk-contracts":"0.1.0","@bch-intents/sdk-cross-chain":"0.1.0"},"devDependencies":{"@types/bn.js":"^5.1.5","@types/node":"^18.0.0","esbuild":"^0.27.3","ts-node":"^10.9.2","typescript":"^5.3.3"},"scripts":{"build":"tsc","start":"node dist/index.js","dev":"tsx src/index.ts","clean":"rm -rf dist tsconfig.tsbuildinfo"},"_id":"@bch-intents/sdk-telegram-bot@1.0.0","_integrity":"sha512-YRRH8L4zLMNrPiq9KviDbljWrCrlQLtCkU90gJJfGMloeaMoknhfAM5l67RZMp8i8MGJRULLHd1VTWdJtz83Bw==","_resolved":"C:\\Users\\ANTONY~1\\AppData\\Local\\Temp\\8e89bfda49e17652f81d78fd104c6353\\bch-intents-sdk-telegram-bot-1.0.0.tgz","_from":"file:bch-intents-sdk-telegram-bot-1.0.0.tgz","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-YRRH8L4zLMNrPiq9KviDbljWrCrlQLtCkU90gJJfGMloeaMoknhfAM5l67RZMp8i8MGJRULLHd1VTWdJtz83Bw==","shasum":"4d8019a27a206413192c58caf7805d9d0a8a6382","tarball":"https://registry.npmjs.org/@bch-intents/sdk-telegram-bot/-/sdk-telegram-bot-1.0.0.tgz","fileCount":34,"unpackedSize":96748,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICYfyuVXEZ8IhFfzPPAWK300X4ghVYEaXN9UOqWT+ty6AiEA5JgMGWcuvuS0Ni26+4XFs1eeeIZgu/LtP0CXHGYh8Tk="}]},"_npmUser":{"name":"bchintents","email":"bchintents@gmail.com"},"directories":{},"maintainers":[{"name":"bchintents","email":"bchintents@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk-telegram-bot_1.0.0_1777752995610_0.8693157521284878"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-02T20:16:35.476Z","1.0.0":"2026-05-02T20:16:35.755Z","modified":"2026-05-02T20:16:36.003Z"},"maintainers":[{"name":"bchintents","email":"bchintents@gmail.com"}],"description":"BCH Intents SDK — Reference Telegram Bot Solver","readme":"# BCH Intents Auto-Solver Telegram Bot\r\n\r\nThis repository contains the reference implementation of an automated cross-chain intent solver for the [BCH Intents Protocol](https://bch-1.org). It is designed to run as a Telegram Bot, allowing operators to easily manage funding and monitor intent resolution on-the-go.\r\n\r\n## How it Works\r\n\r\nThe Auto-Solver Bot listens for cross-chain exchange intents (e.g., swapping BCH for Solana). It acts as a liquidity provider by programmatically fulfilling the requested side of the intent, capturing a profit spread in the process.\r\n\r\nIt is built utilizing the powerful `@bch-intents/sdk-cross-chain` components to safely interact with Hash Time Locked Contracts (HTLCs) and secure cryptographic primitives.\r\n\r\n### Flow Example: BCH to Solana\r\n1. **Monitor**: The bot continuously polls the Relayer API for open `bch-to-solana` intents.\r\n2. **Validate**: Upon finding an intent, the bot verifies the timelock duration and the profitability of the requested exchange rate.\r\n3. **Execute**: The bot uses its local, encrypted Solana wallet to send the required `SOL` to the maker's requested address.\r\n4. **Claim**: By fulfilling the swap, the bot gains access to the maker's secret, which it then uses to unlock the HTLC on the Bitcoin Cash network and claim the `BCH` reward.\r\n\r\n## 🚀 Features\r\n\r\n- **Automated Polling Engine**: Enable auto-resolve mode to continuously scan and fill profitable intents without manual intervention.\r\n- **Integrated HD Wallets**: Automatically generates and securely encrypts (AES-256-GCM) independent local wallets for BCH and Solana to be used exclusively as solver liquidity.\r\n- **Telegram Management**: A simple command-based UI to check balances, view deposit addresses, list actionable intents, and manually trigger resolutions.\r\n- **Built on BCH Intents SDK**: Natively integrates with the `@bch-intents` SDK packages to handle the heavy lifting of HTLC construction, transaction signing, and secret hashing.\r\n\r\n## Getting Started\r\n\r\n### Prerequisites\r\n- Node.js (v18 or higher)\r\n- A Telegram Bot Token from [@BotFather](https://t.me/BotFather)\r\n\r\n### Installation\r\n\r\n1. Copy the example environment variables:\r\n```bash\r\ncp .env.example .env\r\n```\r\n2. Open `.env` and fill in your `TELEGRAM_BOT_TOKEN`. (Optionally configure your custom `SOLANA_RPC_URL` or `RELAYER_API_URL`).\r\n\r\n3. Install dependencies:\r\n```bash\r\nnpm install\r\n```\r\n\r\n4. Start the bot:\r\n```bash\r\nnpm run dev\r\n```\r\n\r\n### Usage\r\n\r\nInteract with your bot on Telegram using the following commands:\r\n- `/start` - Boot up the bot and generate your solver wallets.\r\n- `/deposit` - View your BCH (Chipnet) and Solana (Devnet) deposit addresses.\r\n- `/status` - Check the solver’s current balances and the status of the auto-resolve engine.\r\n- `/intents` - Manually scan the relayer for open cross-chain intents.\r\n- `/auto_resolve <on|off>` - Toggle the background autonomous solver loop.\r\n- `/resolve <intent_id>` - Force the bot to manually attempt resolution on a specific intent ID.\r\n\r\n## Security Warning\r\n\r\nThis bot generates and stores private keys locally on the machine it runs on. It uses AES symmetric encryption derived from a secret key in your `.env` file. **Never commit your `.env` file or your encrypted wallet database (`.sqlite`) to source control.** This is a reference implementation meant for testing and development. Trade at your own risk.\r\n","readmeFilename":"README.md","_rev":"1-845b83044a1e9e924f3b09bdc4109b23"}