Commit Graph

34 Commits

Author SHA1 Message Date
bohd4nx dc9661134d Refactor cookie handling and service structure
- Removed the old CookieResult model from pyfragment.core.models and created a new one in pyfragment.services.cookies.models.
- Implemented get_cookies_from_browser function in pyfragment.services.cookies.service to extract cookies directly from supported browsers.
- Updated imports across various modules to reflect the new structure and removed unused imports.
- Cleaned up models in ads, anonymous_numbers, giveaways, marketplace, and purchases domains by removing unnecessary __all__ declarations.
- Added new example scripts for cookie extraction and various purchase functionalities.
- Consolidated constants into a new pyfragment.core.constants module for better organization.
2026-06-16 01:19:33 +03:00
bohd4nx 8f865f4911 Refactor for GRAM (ex TON) integration
- Updated imports and references from TON to GRAM across multiple modules.
- Renamed functions and variables to reflect the change from TON to GRAM.
- Adjusted validation checks for top-up and recharge amounts to use GRAM limits.
- Modified error messages and exceptions to indicate GRAM instead of TON.
- Updated tests to ensure they reflect the new GRAM terminology and functionality.
- Introduced new constants for GRAM-related configurations.
2026-06-16 00:47:49 +03:00
bohd4nx 3481769757 feat: add Highload wallet versions and update mypy exclusion patterns 2026-06-05 02:04:44 +03:00
bohd4nx d01c45d85b feat: update version to 2026.3.2; enhance changelog with new payment methods and updated client documentation 2026-05-29 23:16:19 +03:00
bohd4nx b2d06a7f22 feat: add support for Python 3.13 and 3.14 in classifiers; update mypy overrides 2026-05-29 01:50:24 +03:00
bohd4nx f8ad801e0c feat: enhance documentation with contributing guidelines and security policy
refactor: update README configuration parameters and add error handling section
refactor: streamline tonapi imports and add WalletVersion to __all__
chore: update project metadata in pyproject.toml
2026-05-29 01:27:29 +03:00
bohd4nx d4e3d3491b chore: bump version to 2026.3.1 in pyproject.toml 2026-05-29 01:04:51 +03:00
bohd4nx e9dd706fa6 refactor: add documentation link to README and pyproject.toml 2026-05-21 17:16:19 +03:00
bohd4nx 3f5e0bc03f chore: update version to 2026.3.0 and enhance changelog with recent changes 2026-05-21 00:23:25 +03:00
bohd4nx e7dc0e051e feat: update README and pyproject.toml to clarify browser dependency installation 2026-05-20 22:55:18 +03:00
bohd4nx 363e0719ab Bump version to 2026.2.3 and refactor wallet utilities
- Updated version in pyproject.toml to 2026.2.3.
- Refactored wallet utilities:
  - Moved `clean_decode` and `process_transaction` to `transaction.py`.
  - Created `balance.py` for balance-related functions.
  - Created `info.py` for wallet information retrieval.
  - Created `transfer.py` for sending TON and USDT transfers.
- Updated tests to reflect new module structure and imports.
- Added new API utility functions for handling Fragment API requests.
2026-05-12 02:01:15 +03:00
bohd4nx 5df95bea29 chore: update version to 2026.2.2 and modify changelog for release 2026-05-11 13:19:56 +03:00
bohd4nx 311222d478 feat: add payment method options for purchases and giveaways, enhance documentation and examples 2026-05-11 12:12:07 +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 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 6b6ca37f10 fix: update Python version requirements to support 3.10 and adjust CI workflow 2026-04-14 01:34:27 +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 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 fb0b82e429 chore: update version to 2026.1.0 in pyproject.toml and finalize changelog 2026-03-25 18:23:21 +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 327ca35190 feat: update README and pyproject description; enhance test docstrings for clarity and consistency 2026-03-21 17:51:19 +02:00
bohd4nx 0af5ce5935 chore: release 2026.0.2 2026-03-20 20:57:37 +02:00
bohd4nx 3e14a01c92 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:16:43 +02:00
bohd4nx f5d2e8490a feat: restructure GitHub workflows; add CI workflow, update publish process, and remove obsolete test and lint workflows 2026-03-16 18:22:58 +02:00
bohd4nx 520153dfb1 feat: update terminology from "gift" to "purchase" for Telegram Premium and Stars; enhance README and example scripts 2026-03-16 01:14:12 +02:00
bohd4nx 041081b919 feat: add API key validation and corresponding error handling; update tests for validation 2026-03-15 23:01:37 +02:00
bohd4nx 8135a9da7e Refactor FragmentAPI to pyfragment
- Renamed the package from `fragmentapi` to `pyfragment` across all modules and tests.
- Removed the old wallet utility functions and replaced them with new implementations.
- Updated the `pyproject.toml` to reflect the new package name and repository links.
- Adjusted all import statements in tests to use the new package name.
- Implemented new methods for gifting Telegram Premium, Stars, and topping up TON balance.
- Added exception handling for various error scenarios in the API interactions.
- Created new utility functions for handling HTTP requests and decoding payloads.
- Established a clear structure for types and constants used throughout the library.
2026-03-15 22:07:01 +02:00
bohd4nx 9a090e3dbc feat: implement CI/CD workflows for testing, linting, and publishing to PyPI 2026-03-15 21:45:24 +02:00
bohd4nx d2d046a2b9 refactor: restructure as installable PyPI package
- Rename app/ → fragmentapi/ for proper package naming
- Add FragmentClient class with gift_premium, gift_stars, topup_ton methods
- Restructure core/ → types/ (exceptions, results, constants)
- Merge utils/hash.py into utils/client.py
- Replace _version.py with importlib.metadata
- Add input validation with min/max bounds
- Add unit tests: decode, client init/cookies
- Rename 002_test_hash → 003_test_hash
- Clean up pyproject.toml: pin deps, production classifiers
2026-03-15 21:03:03 +02:00
bohd4nx 6c869428aa refactor: streamline error messages and improve code formatting for consistency 2026-03-09 03:32:45 +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