Commit Graph

14 Commits

Author SHA1 Message Date
bohd4nx 38a4619e42 fix: pass cookies to AsyncClient instead of per-request
Fixes httpx DeprecationWarning: Setting per-request cookies is deprecated.
Cookies are now set on the AsyncClient instance and removed from all
individual post() calls and internal function signatures.
2026-03-08 04:26:45 +02:00
bohd4nx 2cdc102a74 refactor: reorganize imports across multiple files for consistency and clarity 2026-03-05 06:36:27 +02:00
bohd4nx 7f3c3ea1c3 refactor: update API key source in .env.example and enhance README with badges and feature descriptions
feat: improve logging levels for HTTP clients and add detailed logging in premium and stars purchase methods
chore: remove unused transaction utility and adjust wallet processing logic
test: add end-to-end integration test for buying Stars
2026-03-05 06:26:49 +02:00
bohd4nx efcdda6b74 refactor: migrate to tonutils 2.0.0 and restructure codebase
- Migrate from tonutils 0.5.x to 2.0.0 API:
  - ToncenterClient → TonapiClient with NetworkGlobalID
  - tonutils.client → tonutils.clients
  - tonutils.wallet → tonutils.contracts.wallet
  - pub_key.as_hex property, wallet.balance nanotons
  - async with client context manager

- Centralize TON client init into initialize_ton_client() in wallet.py
- Move process_transaction logic into wallet.py, transaction.py re-exports
- Add WALLET_VERSION config (V4R2/V5R1, default V5R1)
- Add WALLET_CLASSES and SUPPORTED_WALLET_VERSIONS to constants.py
- Restore balance check before broadcasting
- Wait for seqno confirmation after transfer (120×2s) to prevent duplicate seqno

- Fix Fragment hash fetching: use browser navigation headers
- Remove accept-encoding from BASE_HEADERS (httpx handles decompression)
- Add cookies.example.json template
- Add cookies.json to .gitignore
2026-03-05 05:47:27 +02:00
bohd4nx 2d7860682d fix: tonutils 2.0.0 API — as_hex property, wallet.refresh(), balance as int nanotons 2026-03-05 05:04:17 +02:00
bohd4nx 64f8058c60 fix: don't sys.exit in config at import time, support CI env vars 2026-03-05 04:23:34 +02:00
bohd4nx 5dc3cddf1a refactor: replace manual base64 decoder with pytoniq_core Cell parser
- clean_decode now uses Cell.one_from_boc + load_snake_string
- no more regex/string hacks, native BOC parsing
- added full transaction_data debug log in process_transaction
2026-03-05 04:16:49 +02:00
bohd4nx e3706f01bf refactor: migrate to tonutils v2, pytest, pyproject.toml
- tonutils 2.0.0: TonapiClient → ToncenterV3Client, wallet.transfer()
- classes → plain async functions across all utils and methods
- core/: constants.py, cookies.py, exceptions.py extracted
- DEVICE constant in constants.py (single source of truth)
- account/device serialised with json.dumps() in all tx payloads
- tests: unittest → pytest, conftest.py fixtures, 001/002 naming
- pyproject.toml: pytest + ruff config
- min balance check: 0.056 TON
2026-03-05 04:08:35 +02:00
bohd4nx b1eae1dcb7 feat: Refactor cookie handling and hash retrieval; update environment configuration and improve logging levels 2026-01-19 19:02:28 +02:00
bohd4nx d299a1f804 feat: Refactor configuration handling and enhance logging setup; update imports and improve error handling in API methods 2026-01-18 06:41:08 +02:00
bohd4nx 76473993e2 feat: Enhance Fragment API with improved error handling and clean_decode utility; (#1) update version and dependencies 2025-11-24 19:52:22 +02:00
bohd4nx 49cf8843bc fix: Update README and SVG logo, correct import paths in utils 2025-11-03 06:01:56 +08:00
bohd4nx 8adfaf4ad2 feat: Implement ApiClient and WalletLinker classes for transaction handling 2025-11-03 06:01:53 +08:00
bohd4nx 760c853acd feat: Add Fragment API for TON topups, Telegram Premium purchases, and Stars transactions
- Implemented Fragment API with methods for TON topups, Premium gifts, and Stars purchases.
- Created configuration management using environment variables.
- Added detailed README documentation for installation, configuration, and usage.
- Developed utility classes for API client, wallet linking, and transaction processing.
- Included example usage in main.py for easy demonstration of API functionalities.
- Updated requirements.txt with necessary dependencies.
2025-11-03 05:58:34 +08:00