Commit Graph

141 Commits

Author SHA1 Message Date
bohd4nx 4873d6d6dd fix: update PyPI publish action to use the latest release version
Co-authored-by: Copilot <copilot@github.com>
2026-05-03 19:19:54 +03:00
Bohdan 👾 1f6085acdc Merge pull request #18 from bohd4nx/dev
Dev
2026-05-03 19:16:19 +03:00
bohd4nx d5dfed5f1a fix: update CI and publish workflows to use consistent action versions and improve error handling in API requests
Co-authored-by: Copilot <copilot@github.com>
2026-05-03 19:10:11 +03:00
bohd4nx 7923dff8b2 fix: remove unnecessary 'method' key from API request data and improve error handling for expired cookies and non-200 HTTP responses 2026-04-21 20:06:11 +03:00
bohd4nx 8c7423a6ab fix: update Python version in CI workflow and refine project metadata for clarity 2026-04-18 21:11:14 +03:00
bohd4nx 8f3e9f4bd8 chore: update action versions in CI workflow and adjust linter ignores for compatibility 2026-04-18 21:05:12 +03:00
bohd4nx fca60135a6 refactor: update type hints for better clarity and consistency across the codebase 2026-04-18 21:02:53 +03:00
bohd4nx d66602b646 fix: replace Miniconda setup with Python setup in CI workflow for consistency 2026-04-14 02:03:22 +03:00
bohd4nx 333b6f45ce fix: update Miniconda setup action version and adjust activation settings 2026-04-14 02:01:16 +03:00
Bohdan 👾 1a070ce8b9 Merge pull request #13 from bohd4nx/dev
feat: browser cookie extraction, CookieResult type, Python 3.10+ support
v2026.2.0
2026-04-14 02:00:46 +03:00
bohd4nx 415d9d9a9c docs: update examples and changelog to reflect CookieResult usage and Python version changes 2026-04-14 01:57:12 +03:00
bohd4nx 6a5e007a1b refactor: update import statements and patching methods in test files for better modularity 2026-04-14 01:45:04 +03:00
bohd4nx d81b83ac91 fix: reorder import statements in conftest.py for better organization 2026-04-14 01:37:52 +03:00
bohd4nx 6b6ca37f10 fix: update Python version requirements to support 3.10 and adjust CI workflow 2026-04-14 01:34:27 +03:00
bohd4nx 028984155b fix: update Python version matrix in CI workflow to include 3.10, 3.11, and 3.12 2026-04-14 01:30:52 +03:00
bohd4nx 391d15221b feat: enhance cookie handling by introducing CookieResult and updating get_cookies_from_browser to return structured results 2026-04-14 01:25:25 +03:00
bohd4nx 269551da2f feat: Update CI workflows, add changelog extraction, and enhance README with cookie retrieval methods 2026-04-14 01:13:45 +03:00
bohd4nx ebd45d2991 Add unit tests for FragmentClient methods
- Implement tests for Stars methods: purchase_stars and giveaway_stars, including validation and success scenarios.
- Add tests for Premium methods: purchase_premium and giveaway_premium, covering validation and success cases.
- Create tests for topup_ton functionality, validating input and mocking successful operations.
- Introduce wallet tests to verify get_wallet() functionality, ensuring correct wallet info retrieval.
- Add tests for FragmentClient.call() method, validating API response handling and data merging.
- Implement tests for anonymous number methods, including login codes and session management.
- Create recharge_ads tests for self-service Telegram Ads recharge, validating input and success scenarios.
- Add username search tests for the Fragment marketplace, ensuring correct result parsing and parameter forwarding.
- Implement number search tests for the Fragment marketplace, validating result parsing and parameter handling.
- Create gift search tests for the Fragment gifts marketplace, ensuring correct result parsing and parameter forwarding.
- Add cookie extraction tests for get_cookies_from_browser(), validating successful extraction and error handling.
2026-04-14 00:22:48 +03:00
bohd4nx 733d138fcc feat: Enhance cookie handling and browser support
- Added new exceptions in `exceptions.py` for unsupported browsers and cookie read failures.
- Introduced `get_cookies_from_browser` function in `cookies.py` to extract session cookies from various browsers.
- Modified tests to cover new cookie extraction functionality, including success and failure cases.
- Refactored existing tests to use `patch.object` for mocking client calls.
- Updated dependencies in `pyproject.toml` to include `rookiepy` for cookie extraction.
2026-04-14 00:12:22 +03:00
bohd4nx 503baa9a94 ci: update test job to use matrix strategy for multiple Python versions and switch to conda setup
fix: specify type for headers parameter in execute_transaction_request
fix: specify type for transaction_data parameter in process_transaction
deps: update tonutils dependency version to 2.0.5
2026-04-07 00:52:39 +03:00
bohd4nx d4ac44f698 style: remove unnecessary blank line in test_hash.py 2026-03-25 18:35:09 +02:00
bohd4nx 3aedd619dc Merge remote-tracking branch 'origin/master' into dev 2026-03-25 18:34:30 +02:00
bohd4nx bae2e1b400 tests: add section comments to all test files 2026-03-25 18:33:47 +02:00
bohd4nx 0a71e6c508 chore: merge dev into master for v2026.1.0 v2026.1.0 2026-03-25 18:27:21 +02:00
bohd4nx fb0b82e429 chore: update version to 2026.1.0 in pyproject.toml and finalize changelog 2026-03-25 18:23:21 +02:00
bohd4nx 3c60bf5e5a feat: add unit tests for search_usernames, search_numbers, and search_gifts methods in FragmentClient 2026-03-25 18:22:25 +02:00
bohd4nx da2eb37a10 chore: update examples and README for improved clarity and consistency; streamline print statements and descriptions 2026-03-25 18:18:40 +02:00
bohd4nx 3156160778 Refactor examples: reorganize and update scripts for managing Telegram services
- Removed outdated example scripts for managing anonymous numbers, making raw API calls, fetching wallet info, and various giveaways.
- Introduced new scripts for searching gifts, numbers, and usernames in the Fragment marketplace.
- Added examples for recharging Telegram Ads accounts and managing user balances with TON.
- Updated example scripts to improve clarity and maintainability, ensuring they align with the latest API changes.
2026-03-25 18:09:41 +02:00
bohd4nx 8163ed1a9d feat: Add gift and number search functionality to FragmentClient
- Implemented `search_gifts` method for searching gifts in the Fragment marketplace.
- Implemented `search_numbers` method for searching anonymous Telegram numbers.
- Added new example scripts for searching gifts, numbers, and usernames.
- Updated HTML parsing logic to handle gift items and number listings.
- Added unit tests for the new search methods and updated existing tests for usernames and numbers.
- Removed obsolete test file for auction searches.
2026-03-25 18:01:22 +02:00
bohd4nx f37a4ab985 feat: implement search_auctions method for Fragment marketplace; add AuctionsResult type; enhance topup_ton example and tests 2026-03-25 17:40:02 +02:00
bohd4nx dfe7bb4140 feat: implement recharge_ads method for Telegram Ads account funding; add associated result type and example; enhance tests for validation and success cases 2026-03-25 00:57:31 +02:00
bohd4nx 327ca35190 feat: update README and pyproject description; enhance test docstrings for clarity and consistency 2026-03-21 17:51:19 +02:00
bohd4nx 6e4d4da740 feat: add anonymous number management methods; implement get_login_code, toggle_login_codes, and terminate_sessions with associated results and error handling 2026-03-21 17:43:58 +02:00
bohd4nx ab8d463d54 feat: add unit tests for balance checks, giveaway stars, and premium methods; validate float inputs for winners and amounts 2026-03-21 17:18:56 +02:00
bohd4nx b55cd00205 feat: update changelog and examples; unify result fields and improve error messages 2026-03-21 17:12:26 +02:00
bohd4nx 25d70a77ed feat: implement client.call() method for raw Fragment API requests; add example and unit tests 2026-03-21 16:45:52 +02:00
bohd4nx c7b6c6c933 feat: add comprehensive unit tests for FragmentClient methods; include shared test constants 2026-03-21 16:30:44 +02:00
bohd4nx 2d1a119768 feat: update purchase and giveaway methods; improve header management and add example scripts 2026-03-21 16:16:14 +02:00
bohd4nx 902b692dcb Refactor methods for Telegram Premium and Stars giveaways
- Added new methods for handling giveaways: `giveaway_premium` and `giveaway_stars`.
- Refactored existing purchase methods into separate files: `purchase_premium.py` and `purchase_stars.py`.
- Removed old premium and stars methods from the codebase.
- Updated `__init__.py` to include new giveaway methods in the public API.
- Introduced new result types for giveaways: `PremiumGiveawayResult` and `StarsGiveawayResult`.
- Updated constants for new giveaway pages.
- Enhanced error handling for configuration and user validation in giveaway methods.
- Updated tests to cover new functionality and refactored existing tests to match new method locations.
2026-03-21 16:05:38 +02:00
bohd4nx 7cf5ab4500 chore: release 2026.0.2 v2026.0.2 2026-03-20 20:58:06 +02:00
bohd4nx 6cae351607 docs: update installation instructions to include unreleased changes from the dev branch 2026-03-20 20:58:06 +02:00
bohd4nx 13f5aaf555 chore: update setup-uv action to v7.6.0 in CI and publish workflows; fix image source in README 2026-03-20 20:58:06 +02:00
bohd4nx 9660e4858f chore: streamline CI linting steps and update changelog with recent changes 2026-03-20 20:58:06 +02:00
bohd4nx 75cbe52507 fix: cast cookies to dict for type safety and improve error handling in FragmentClient 2026-03-20 20:58:06 +02:00
bohd4nx 4e03d2e2f6 refactor: harden client, clean tests, and fix timeouts
- Security & validation: tighten hash regex, add HTTP timeouts to all
  requests, pass client.timeout through get_fragment_hash and AsyncClient
- Constants: move all constants to types/constants.py; remove re-exports
  from types/__init__.py; add DEFAULT_TIMEOUT, REQUIRED_COOKIE_KEYS
- FragmentClient: add timeout param (default 30 s); async-context-manager
  support; remove WALLET_CLASSES from public API
- Exceptions: remove dead INVALID_USERNAME constant (Fragment validates
  server-side); keep full hierarchy intact
- Tests: add 006_test_methods_mock.py (6 mock tests for all 3 methods);
  DRY-refactor 004_test_balance.py (_patch_wallet context manager);
  clean up 005_test_methods.py (remove fragile network test, rename tests)
- Examples: switch all 4 examples to async-with; align error messages;
  replace %-format with f-strings
- README: rewrite usage section with single comprehensive async-with
  example covering all 3 methods and full exception hierarchy
- CI: add mypy step to lint job; add pytest-mock and mypy to dev deps;
  set FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 on all jobs; fix COOKIES_JSON
  to job-level env var
2026-03-20 20:58:06 +02:00
bohd4nx 0af5ce5935 chore: release 2026.0.2 2026-03-20 20:57:37 +02:00
bohd4nx b07b4670fb docs: update installation instructions to include unreleased changes from the dev branch 2026-03-20 20:45:35 +02:00
bohd4nx 581886938b chore: update setup-uv action to v7.6.0 in CI and publish workflows; fix image source in README 2026-03-20 20:36:59 +02:00
bohd4nx 949796df17 chore: streamline CI linting steps and update changelog with recent changes 2026-03-20 20:25:35 +02:00
bohd4nx 75ee76b60e fix: cast cookies to dict for type safety and improve error handling in FragmentClient 2026-03-20 20:22:33 +02:00