mirror of
https://github.com/bohd4nx/FragmentAPI.git
synced 2026-07-25 06:14:29 +00:00
8f865f4911
- 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.
1.7 KiB
1.7 KiB
Contributing to pyfragment
Development setup
git clone https://github.com/bohd4nx/pyfragment.git
cd pyfragment
pip install -e ".[dev]"
Running checks
# Lint and format
ruff check . --fix && ruff format .
# Type check
mypy . --explicit-package-bases
# Tests
pytest
All three must pass before opening a PR.
Project structure
pyfragment/
client.py — FragmentClient (public entry point)
core/ — transport, cookies, constants
domains/ — one package per feature domain
ads/ — recharge_ads, topup_gram
anonymous_numbers/— buy_number, manage_number
giveaways/ — giveaway_stars, giveaway_premium
marketplace/ — search_usernames, search_numbers, search_gifts
purchases/ — purchase_stars, purchase_premium
tonapi/ — wallet info, transaction signing
models/ — result dataclasses and enums
exceptions.py — exception hierarchy
tests/ — unit tests (pytest)
examples/ — runnable usage examples (excluded from CI)
Conventions
- All public async methods live on
FragmentClientand delegate to a domain service. - Domain functions receive a
FragmentClientinstance, never raw httpx clients. - Patch targets in tests use the module where the name is defined, e.g.
pyfragment.domains.tonapi.transaction.process_transaction. - Versioning follows CalVer:
YYYY.MINOR.MICRO. Bump inpyproject.toml; tag asvYYYY.MINOR.MICRO.
Pull requests
- Keep PRs focused — one feature or fix per PR.
- Update
CHANGELOG.mdunder[Unreleased]. - Add or update tests for any changed behaviour.