feat: enhance FragmentClient to support custom headers; update limits for TON topup and stars purchases

This commit is contained in:
bohd4nx
2026-05-29 22:51:27 +03:00
parent 6aa7037380
commit ed54d1f1a0
6 changed files with 28 additions and 14 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ import json
import logging
from typing import TYPE_CHECKING
from pyfragment.core.constants import ADS_TOPUP_PAGE, DEVICE_INFO
from pyfragment.core.constants import ADS_TOPUP_PAGE, DEVICE_INFO, TON_TOPUP_MAX, TON_TOPUP_MIN
from pyfragment.domains.tonapi.account import get_account_info
from pyfragment.domains.tonapi.transaction import process_transaction
from pyfragment.exceptions import ConfigurationError, FragmentAPIError, FragmentError, UnexpectedError, VerificationError
@@ -18,7 +18,7 @@ logger = logging.getLogger(__name__)
async def recharge_ads(client: FragmentClient, account: str, amount: int) -> AdsRechargeResult:
if not isinstance(amount, int) or not (1 <= amount <= 1_000_000_000):
if not isinstance(amount, int) or not (TON_TOPUP_MIN <= amount <= TON_TOPUP_MAX):
raise ConfigurationError(ConfigurationError.INVALID_TON_AMOUNT)
try: