feat: add anonymous number management methods; implement get_login_code, toggle_login_codes, and terminate_sessions with associated results and error handling

This commit is contained in:
bohd4nx
2026-03-21 17:43:58 +02:00
parent ab8d463d54
commit 6e4d4da740
13 changed files with 521 additions and 6 deletions
+8
View File
@@ -67,6 +67,13 @@ class UserNotFoundError(FragmentAPIError):
)
class AnonymousNumberError(FragmentAPIError):
"""Raised for Fragment anonymous number API failures."""
NOT_OWNED = "Number '{number}' is not associated with your Fragment account or has no active sessions to terminate."
TERMINATE_FAILED = "Failed to terminate sessions for '{number}': {error}"
class TransactionError(FragmentAPIError):
"""Raised when a TON transaction fails to build or broadcast."""
@@ -133,6 +140,7 @@ __all__ = [
"CookieError",
"FragmentAPIError",
"FragmentPageError",
"AnonymousNumberError",
"UserNotFoundError",
"TransactionError",
"ParseError",