- Saved searches
- Use saved searches to filter your results more quickly
- License
- alberto-rota/CryptoWallet-TelegramBot
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- Saved searches
- Use saved searches to filter your results more quickly
- License
- CrimsonCoalition/wallet
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
A Telegram Bot with a wallet functionality for crypto-assets. It keeps track of your assets and displays charts and reports on demand. Moreover, the user can toggle volatility notifications, alerting him when the market price of his asset change rapidely.
License
alberto-rota/CryptoWallet-TelegramBot
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
A Telegram Bot with a wallet functionality for crypto-assets. It keeps track of your assets and displays charts and reports on demand. Moreover, the user can toggle volatility notifications, alerting him when the market price of his asset change rapidely. Financial data is queried through the Binance API
This bot is intended to be used by only one user: it therefore requires a host platform to run (the author is hosting his personal bot on a RaspberryPI) and the API keys for a Telegram Bot and a Binance account. Here is the guide for obtaining the API keys from binance, and here is how to create a new Telegram bot and how to obtain its API token,
The bot cannot therefore handle too many requests at a time withoud noticeble delays, and it is as a matter of facts thought to be used from a single user or, at max, from a small group of people, always minding that multiple contemporary requests may easily result in unwanted/unexpected outputs.
The code has been tested on Python 3.9.5. Here is the list of the required dependencies, installable with:
pip install python-telegram-bot pip install python-binance pip install mplfinance pip install numpy pip install pandas
Note: If you are hosting this program on a RaspberryPI , make sure that you install Python 3, as you may get automatically installed Python 2.7.x
Once the dependencies has been installed and the 3 API keys are available, the only thing to do is to make the keys available to the code, so that the connections with Binance and Telegram are estabilished correctly. To do this, format the file data/api_keys.txt as follows (debending on the status of this Github repository, **you may need to create api_keys.txt **:
telegram_bot_token binance_api_public_key binance_api_private_key
Now you are all set! Just run the main.py file with Python
If the Bot is launched correctly, these three lines should be visible:
>> [Current Date and Time]-BOT: Loading Telegram bot: SUCCESS >> [Current Date and Time]-BOT: Loading Binance Client: SUCCESS >> [Current Date and Time]-BOT: Callbacks initialized. Polling started
Once the bot is up and running, the main menu will always be available at the /home commmand:
Here is an overview of the main functions of the bot:
- 💰 Set Wallet: From here the user can specify his crypto assets in terms of quantity and buy-price, used from the bot to calculate prifits/losses based on the current price
- 💵 My Wallet 💵 : Displays a wallet report and the chart of the crypto assets on different timescales
- 💹 Check Asset 💹 : Displays the chart for any cryptocurrency on any timescale supported by binance (see the » 🚁 Help» command for the list of supported queries). Note: This function does not require a wallet
- 🔔 Notifications: The user can recieve daily reports of his wallet and/or notifications when the current price for the assets in his wallet increase or decrease rapidly
Please check the » 🚁 Help» button or type /help in the chat to get informations live from the bot.
Supplementary information about some of the bot tasks
- The charts sent by the bot are saved in a daily buffer in the savedfigs folder, which is periodically emptied every night at 00:00. The graphs are always available from the Telegram chat
- The wallet of a user is saved on a csv file in the data/wallets folder with the following filname syntax: data/wallets/xxxxxxxxx.csv (xxxxxxxxx is the telegram id of the user whos saves the wallet)
- The preferences for recieving notifications are saved in the file data/notification_settings.csv . The syntax of such file is very clear
- Daily notifications of wallet reports are sent at 9.00 PM (1 daily notification) and 12.00 AM (2 daily notifications) every day
- The major bot operations are logged in the console with a datetime stamp and the used ID
Issues can be opened from the link provided by the bot at the » 📢 Report an Issue» button or from the command /report .
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
💸 Wallet — это telegram-бот для хранения Ethereum, Bitcoin, Toncoin, USDT и других.
License
CrimsonCoalition/wallet
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Wallet by Crimson Coalition
Crimson Wallet или же просто Wallet — криптокошелек от @CrimsonCoalition
Wallet — это telegram-бот для хранения Ethereum, Bitcoin, Toncoin, USDT и других криптовалют. Этот кошелек основан на этом проекте
Следить за новостями проекта можно также на нашем сайте: crimson-coalition.ru
Логика работы бота
Меню ┌─────┼────────────────┬────────────────┐ │ │ │ │ │ │ │ │ │ │ │ │ КОШЕЛЕК │ ПОЛУЧЕНИЕ │ ## будет обновляться баланс │ показ адреса │ кошелька │ и QR-кода │ │ │ ОТПРАВКА КУПИТЬ Ввод адреса Ввод BTC, TON, ETH, USDT, TRON или RUB и отправка Информации о пользователе средств Отправка средств
Структура бота
Ядро бота состоит из двух модулей в корне проекта: app.py и bot.py
Первый модуль представляет из себя стартовый модуль, который запускает и инициализирует бота, он отвечает за создание Flask веб-приложения, создание объекта бота, инициализацию бота и вебхуков, получение и обработку данных с вебхуков.
Bot.py отвечает за класс Bot, который как представляет из себя центральную часть приложения, которая отвечает за работу бота. В нем описаны методы работы с: базой данных, Telegram API, обработку сообщений пользователя, загрузку модулей бота, работу с пользовательской сессией, генерирование пользовательских клавиатур и сообщений из шаблонов.
Модули представляют из себя некоторые скрипты, сценарии, которым бот передает сообщения от пользователя, а они в свою очередь решают что делать в той или иной ситуации. Модули состоят из некоторых функций обработчиков handler’ов. Самое первое сообщение пользователя обрабатывается стандартным хендлером, который указан в конфиге в дальнейшей работе бота хендлеры могут не только получать данные, но и указывать какой хендлер будет обрабатывать следующее сообщение. Таким образом строится неявный граф обработки сообщений пользователя.
Внутри модулей хендлеры могут оперировать любой информацией:
Получать и записывать данные в базу данных Отправлять сообщение через Telegram API Запрашивать или отправлять средства по средствам Bitcoin API Отрисовывать пользовательские клавиатуры И многое другое.
Конфиги представляют из себя статические JSON-файлы, которые хранят необходимую боту информацию. На данный момент в боте существует три конфиг-файлов: init.json , keyboards.json , messages.json .
Первый файл отвечает за основные настройки бота:
default-handler — стандартный обработчик сообщения, когда пользователь пишет первый раз или не указан обработчик который будет обрабатывать следующее сообщение
menu-button — сообщение при получении которого, бот всегда будет возвращаться в главное меню
commission — Bitcoin комиссия для совершения транзакции, указывается в сатоши!
keyboards.json — отвечает за хранение шаблонов клавиатур, о работе с которыми вы можете прочитать далее messages.json — отвечает за хранение шаблонов сообщений, о работе с которыми вы можете прочитать далее
Для работы с Bitcoin используется библиотека pybitcointools .
Для работы с Toncoin используется библиотека ton_client для python.
BNB (Binance Coin)
Для работы с BNB наш кошелек использует библиотеку bnb-chain/python-sdk
About
💸 Wallet — это telegram-бот для хранения Ethereum, Bitcoin, Toncoin, USDT и других.