desslyhub 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. desslyhub-0.1.0/.claude/settings.local.json +7 -0
  2. desslyhub-0.1.0/.gitignore +24 -0
  3. desslyhub-0.1.0/CLAUDE.md +48 -0
  4. desslyhub-0.1.0/PKG-INFO +229 -0
  5. desslyhub-0.1.0/README.md +207 -0
  6. desslyhub-0.1.0/assets/desslyhub-logo.svg +13 -0
  7. desslyhub-0.1.0/desslyhub/__init__.py +6 -0
  8. desslyhub-0.1.0/desslyhub/client/__init__.py +3 -0
  9. desslyhub-0.1.0/desslyhub/client/client.py +353 -0
  10. desslyhub-0.1.0/desslyhub/client/session/__init__.py +4 -0
  11. desslyhub-0.1.0/desslyhub/client/session/aiohttp.py +64 -0
  12. desslyhub-0.1.0/desslyhub/client/session/base.py +56 -0
  13. desslyhub-0.1.0/desslyhub/enums.py +153 -0
  14. desslyhub-0.1.0/desslyhub/exceptions.py +148 -0
  15. desslyhub-0.1.0/desslyhub/methods/__init__.py +20 -0
  16. desslyhub-0.1.0/desslyhub/methods/base.py +47 -0
  17. desslyhub-0.1.0/desslyhub/methods/buy_voucher.py +28 -0
  18. desslyhub-0.1.0/desslyhub/methods/check_steam_login.py +26 -0
  19. desslyhub-0.1.0/desslyhub/methods/get_balance.py +21 -0
  20. desslyhub-0.1.0/desslyhub/methods/get_mobile_game_details.py +25 -0
  21. desslyhub-0.1.0/desslyhub/methods/get_mobile_games.py +25 -0
  22. desslyhub-0.1.0/desslyhub/methods/get_steam_exchange_rate.py +25 -0
  23. desslyhub-0.1.0/desslyhub/methods/get_steam_exchange_rates.py +21 -0
  24. desslyhub-0.1.0/desslyhub/methods/get_steam_gift_game_details.py +25 -0
  25. desslyhub-0.1.0/desslyhub/methods/get_steam_gift_games.py +21 -0
  26. desslyhub-0.1.0/desslyhub/methods/get_transaction.py +22 -0
  27. desslyhub-0.1.0/desslyhub/methods/get_transaction_status.py +22 -0
  28. desslyhub-0.1.0/desslyhub/methods/get_transactions.py +25 -0
  29. desslyhub-0.1.0/desslyhub/methods/get_voucher_product.py +25 -0
  30. desslyhub-0.1.0/desslyhub/methods/get_voucher_products.py +21 -0
  31. desslyhub-0.1.0/desslyhub/methods/send_mobile_game_refill.py +33 -0
  32. desslyhub-0.1.0/desslyhub/methods/send_steam_gift_game.py +30 -0
  33. desslyhub-0.1.0/desslyhub/methods/steam_top_up.py +28 -0
  34. desslyhub-0.1.0/desslyhub/types/__init__.py +9 -0
  35. desslyhub-0.1.0/desslyhub/types/balance.py +11 -0
  36. desslyhub-0.1.0/desslyhub/types/base.py +31 -0
  37. desslyhub-0.1.0/desslyhub/types/exchange_rate.py +27 -0
  38. desslyhub-0.1.0/desslyhub/types/mobile.py +71 -0
  39. desslyhub-0.1.0/desslyhub/types/steam.py +76 -0
  40. desslyhub-0.1.0/desslyhub/types/transaction.py +60 -0
  41. desslyhub-0.1.0/desslyhub/types/voucher.py +64 -0
  42. desslyhub-0.1.0/desslyhub/utils.py +0 -0
  43. desslyhub-0.1.0/main.py +17 -0
  44. desslyhub-0.1.0/pyproject.toml +100 -0
  45. desslyhub-0.1.0/tests/__init__.py +0 -0
  46. desslyhub-0.1.0/tests/test_balance_model.py +15 -0
  47. desslyhub-0.1.0/tests/test_buy_voucher_model.py +30 -0
  48. desslyhub-0.1.0/tests/test_check_steam_login_model.py +21 -0
  49. desslyhub-0.1.0/tests/test_mobile_game_details_model.py +32 -0
  50. desslyhub-0.1.0/tests/test_mobile_game_list_model.py +24 -0
  51. desslyhub-0.1.0/tests/test_mobile_game_refill_model.py +25 -0
  52. desslyhub-0.1.0/tests/test_send_steam_gift_game_model.py +21 -0
  53. desslyhub-0.1.0/tests/test_steam_exchange_rate_model.py +16 -0
  54. desslyhub-0.1.0/tests/test_steam_exchange_rates_model.py +27 -0
  55. desslyhub-0.1.0/tests/test_steam_game_details_model.py +40 -0
  56. desslyhub-0.1.0/tests/test_steam_game_list_model.py +24 -0
  57. desslyhub-0.1.0/tests/test_steam_top_up_model.py +17 -0
  58. desslyhub-0.1.0/tests/test_transaction_model.py +25 -0
  59. desslyhub-0.1.0/tests/test_transaction_status_model.py +14 -0
  60. desslyhub-0.1.0/tests/test_transactions_list_model.py +30 -0
  61. desslyhub-0.1.0/tests/test_voucher_product_list_model.py +62 -0
  62. desslyhub-0.1.0/tests/test_voucher_product_model.py +43 -0
  63. desslyhub-0.1.0/uv.lock +851 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(uv run:*)"
5
+ ]
6
+ }
7
+ }
@@ -0,0 +1,24 @@
1
+ .idea/
2
+ .vscode/
3
+
4
+ __pycache__/
5
+ *.py[cod]
6
+
7
+ *.mo
8
+
9
+ env/
10
+ build/
11
+ _build/
12
+ dist/
13
+ site/
14
+ *.egg-info/
15
+ *.egg
16
+ .ruff_cache
17
+
18
+ .mypy_cache
19
+ .pytest_cache
20
+ .coverage
21
+ reports
22
+
23
+ dev/
24
+ .venv/
@@ -0,0 +1,48 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ desslyhub is an async Python SDK for the DesslyHub API (a Steam game gifting/transaction service). It uses aiohttp for HTTP and Pydantic v2 for response models.
8
+
9
+ ## Commands
10
+
11
+ ```bash
12
+ # Install dependencies (uses uv)
13
+ uv sync --group dev
14
+
15
+ # Run all tests
16
+ uv run pytest
17
+
18
+ # Run a single test
19
+ uv run pytest tests/test_balance_model.py
20
+
21
+ # Lint
22
+ uv run ruff check desslyhub/
23
+
24
+ # Format
25
+ uv run ruff format desslyhub/
26
+
27
+ # Type check
28
+ uv run mypy desslyhub/
29
+ ```
30
+
31
+ ## Architecture
32
+
33
+ The SDK follows a **method-object pattern**: each API endpoint is a Pydantic model class (`DesslyHubMethod[T]`) that knows its URL, HTTP verb, return type, and serializes itself into the request body. The `Client` creates these method objects and calls `method.execute(client)`, which delegates to the session layer.
34
+
35
+ **Key layers:**
36
+
37
+ - **`Client`** (`client/client.py`) — async context manager, public API surface. Each method (e.g. `get_balance`, `get_transaction`) instantiates a method object and executes it.
38
+ - **`DesslyHubMethod[T]`** (`methods/base.py`) — abstract base. Subclasses set `__api_method__`, `__http_method__`, `__return_type__` as class vars. `transform_response` uses Pydantic `model_validate` with a `{"client": client}` context so response objects can hold a back-reference to the client.
39
+ - **`BaseSession` / `AiohttpSession`** (`client/session/`) — transport abstraction. `BaseSession.raise_for_code` maps API error codes to exception classes via `DesslyHubAPIError.__subclasses__()`.
40
+ - **`DesslyHubObject`** (`types/base.py`) — base Pydantic model for all response types. Frozen, allows extras, captures client from validation context.
41
+ - **Exceptions** (`exceptions.py`) — each API error code has its own class with a `code` class attribute. The error registry is built dynamically from subclasses.
42
+
43
+ ## Code Style
44
+
45
+ - All files must start with `from __future__ import annotations`.
46
+ - Ruff is the linter/formatter (line-length 99, double quotes, LF line endings, space indentation).
47
+ - Ruff isort rules: `required-imports = ["from __future__ import annotations"]`, length-sorted imports.
48
+ - Python 3.11+ required.
@@ -0,0 +1,229 @@
1
+ Metadata-Version: 2.4
2
+ Name: desslyhub
3
+ Version: 0.1.0
4
+ Summary: Библиотека для работы с API DesslyHub
5
+ Project-URL: Telegram, https://t.me/desslyhub_api
6
+ Project-URL: Issues, https://github.com/kash1dd/desslyhub/issues
7
+ Project-URL: Repository, https://github.com/kash1dd/desslyhub
8
+ Author: kash1d
9
+ Maintainer: kash1d
10
+ License-Expression: MIT
11
+ Keywords: api,asyncio,dessly,desslyhub,framework,http,library,sdk,wrapper
12
+ Classifier: Development Status :: 2 - Pre-Alpha
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Programming Language :: Python :: 3.15
18
+ Requires-Python: >=3.11
19
+ Requires-Dist: aiohttp>=3.13.3
20
+ Requires-Dist: pydantic>=2.12.5
21
+ Description-Content-Type: text/markdown
22
+
23
+ <p align="center">
24
+ <img src="assets/desslyhub-logo.svg" alt="DesslyHub"/>
25
+ </p>
26
+
27
+ <h2 style="text-align:center;">DesslyHub API</h2>
28
+
29
+ Асинхронная Python-библиотека для работы с [DesslyHub API](https://desslyhub.com). Поддерживает пополнение Steam-аккаунтов, покупку и отправку игр в подарок, ваучеры, пополнение мобильных игр и управление транзакциями.
30
+
31
+ ## Установка
32
+
33
+ ```bash
34
+ # Using uv
35
+ uv add desslyhub
36
+
37
+ # Or using pip
38
+ pip install desslyhub
39
+ ```
40
+
41
+ **Требования:** Python 3.11+
42
+
43
+ ## Быстрый старт
44
+
45
+ ```python
46
+ import asyncio
47
+
48
+ from desslyhub import Client
49
+
50
+
51
+ async def main() -> None:
52
+ async with Client(api_key="ваш_api_ключ") as client:
53
+ balance = await client.get_balance()
54
+ print(f"Баланс: {balance.balance} USD")
55
+
56
+
57
+ asyncio.run(main())
58
+ ```
59
+
60
+ ## Возможности
61
+
62
+ ### Баланс и транзакции
63
+
64
+ ```python
65
+ # Получить баланс
66
+ balance = await client.get_balance()
67
+
68
+ # Получить список транзакций (постранично, 100 на страницу)
69
+ transactions = await client.get_transactions(page=1)
70
+ for tx in transactions.transactions:
71
+ print(f"{tx.id} — {tx.status} — {tx.final_amount} USD")
72
+
73
+ # Получить транзакцию по ID
74
+ transaction = await client.get_transaction("uuid-транзакции")
75
+
76
+ # Проверить статус транзакции
77
+ status = await client.get_transaction_status("uuid-транзакции")
78
+ print(status.status) # success / pending / failed / cancelled
79
+ ```
80
+
81
+ ### Пополнение Steam
82
+
83
+ ```python
84
+ # Проверить возможность пополнения аккаунта
85
+ check = await client.check_steam_login(amount=5.0, username="steam_login")
86
+ if check.can_refill:
87
+ # Пополнить баланс Steam (от 0.1 до 1000 USD)
88
+ result = await client.steam_top_up(amount=5.0, username="steam_login")
89
+ print(f"Транзакция: {result.transaction_id}, статус: {result.status}")
90
+ ```
91
+
92
+ ### Покупка и отправка игр в подарок
93
+
94
+ ```python
95
+ # Список доступных игр
96
+ games = await client.get_steam_gift_games()
97
+ for game in games.games:
98
+ print(f"{game.name} (app_id: {game.app_id})")
99
+
100
+ # Детали игры: издания, регионы, цены
101
+ details = await client.get_steam_gift_game_details(app_id=730)
102
+ for edition in details.game:
103
+ print(f"{edition.edition} (package_id: {edition.package_id})")
104
+ for region in edition.regions_info:
105
+ print(f" {region.region}: {region.price} USD (скидка {region.discount}%)")
106
+
107
+ # Отправить игру в подарок
108
+ result = await client.send_steam_gift_game(
109
+ invite_url="https://s.team/p/...",
110
+ package_id="12345",
111
+ region="RU",
112
+ )
113
+ ```
114
+
115
+ ### Курсы валют Steam
116
+
117
+ ```python
118
+ from desslyhub.enums import Currency
119
+
120
+ # Курс для одной валюты
121
+ rate = await client.get_steam_exchange_rate(Currency.RUB)
122
+ print(f"1 USD = {rate.exchange_rate} RUB")
123
+
124
+ # Все курсы
125
+ rates = await client.get_steam_exchange_rates()
126
+ for currency, value in rates.exchange_rates.items():
127
+ print(f"{currency.name}: {value}")
128
+ ```
129
+
130
+ ### Ваучеры
131
+
132
+ ```python
133
+ # Список продуктов
134
+ products = await client.get_voucher_products()
135
+ for product in products.products:
136
+ print(f"{product.name} ({product.country})")
137
+ for v in product.variations:
138
+ print(f" {v.name} — {v.price} {v.voucher_currency} (в наличии: {v.stock})")
139
+
140
+ # Детали продукта
141
+ product = await client.get_voucher_product(product_id=1)
142
+
143
+ # Покупка ваучера
144
+ result = await client.buy_voucher(root_id=1, variant_id=10)
145
+ for voucher in result.vouchers:
146
+ print(f"PIN: {voucher.pin}, S/N: {voucher.serial_number}")
147
+ ```
148
+
149
+ ### Мобильные игры
150
+
151
+ ```python
152
+ from desslyhub.enums import Variant
153
+
154
+ # Список игр
155
+ games = await client.get_mobile_games(variant=Variant.PROVIDER_1)
156
+
157
+ # Детали игры (серверы, поля, позиции)
158
+ details = await client.get_mobile_game_details(game_id="123")
159
+ for pos in details.positions:
160
+ print(f"{pos.name} — {pos.price} USD")
161
+
162
+ # Пополнение
163
+ result = await client.send_mobile_game_refill(
164
+ fields={"user_id": "12345", "server": "EU"},
165
+ position=1,
166
+ variant=Variant.PROVIDER_1,
167
+ )
168
+ ```
169
+
170
+ ## Обработка ошибок
171
+
172
+ Библиотека предоставляет типизированные исключения для каждого кода ошибки API:
173
+
174
+ ```python
175
+ from desslyhub.exceptions import (
176
+ DesslyHubAPIError,
177
+ InsufficientFundsError,
178
+ IncorrectSteamUsernameError,
179
+ GameAlreadyOwnedError,
180
+ )
181
+
182
+ try:
183
+ await client.steam_top_up(amount=5.0, username="login")
184
+ except InsufficientFundsError:
185
+ print("Недостаточно средств на балансе")
186
+ except IncorrectSteamUsernameError:
187
+ print("Неверный логин Steam")
188
+ except DesslyHubAPIError as e:
189
+ print(f"Ошибка API: код {e.code}, {e.message}")
190
+ ```
191
+
192
+ <details>
193
+ <summary>Полный список исключений</summary>
194
+
195
+ | Код | Класс | Описание |
196
+ |-----|-------|----------|
197
+ | -1 | `InternalServerError` | Внутренняя ошибка сервера |
198
+ | -2 | `InsufficientFundsError` | Недостаточно средств |
199
+ | -3 | `IncorrectAmountError` | Некорректная сумма |
200
+ | -4 | `IncorrectRequestBodyError` | Некорректное тело запроса |
201
+ | -5 | `AccessDeniedError` | Доступ запрещён |
202
+ | -51 | `InvalidFriendLinkError` | Неверная ссылка на друга |
203
+ | -52 | `IncorrectAppIDError` | Неверный App ID |
204
+ | -53 | `GameInfoNotFoundError` | Информация об игре не найдена |
205
+ | -54 | `MainGameNotOwnedError` | Базовая игра не куплена |
206
+ | -55 | `GameAlreadyOwnedError` | Игра уже в библиотеке |
207
+ | -56 | `UnableToAddFriendError` | Не удалось добавить в друзья |
208
+ | -57 | `IncorrectCustomerRegionError` | Неверный регион покупателя |
209
+ | -58 | `RecipientRegionUnavailableError` | Регион получателя недоступен |
210
+ | -59 | `BotFriendActionPendingError` | Ожидается действие с ботом |
211
+ | -100 | `IncorrectSteamUsernameError` | Неверный логин Steam |
212
+ | -120 | `IncorrectCurrencyValueError` | Неверное значение валюты |
213
+ | -121 | `CurrencyNotSupportedError` | Валюта не поддерживается |
214
+ | -151 | `InvalidTransactionIDError` | Неверный ID транзакции |
215
+ | -152 | `TransactionNotFoundError` | Транзакция не найдена |
216
+ | -153 | `PageNumberNotSpecifiedError` | Не указан номер страницы |
217
+ | -200 | `MobileGameNotFoundError` | Мобильная игра не найдена |
218
+ | -201 | `MobileGamePositionNotFoundError` | Позиция не найдена |
219
+ | -202 | `SourceVariantNotFoundError` | Провайдер не найден |
220
+ | -300 | `VoucherNotFoundError` | Ваучер не найден |
221
+ | -301 | `VoucherNotAvailableError` | Ваучер недоступен |
222
+
223
+ </details>
224
+
225
+ ## Поддерживаемые валюты
226
+
227
+ `Currency` — это `IntEnum` с 37 валютами:
228
+
229
+ USD, GBP, EUR, CHF, RUB, PLN, BRL, JPY, NOK, IDR, MYR, PHP, SGD, THB, VND, KRW, UAH, MXN, CAD, AUD, NZD, CNY, INR, CLP, PEN, COP, ZAR, HKD, TWD, SAR, AED, ILS, KZT, KWD, QAR, CRC, UYU
@@ -0,0 +1,207 @@
1
+ <p align="center">
2
+ <img src="assets/desslyhub-logo.svg" alt="DesslyHub"/>
3
+ </p>
4
+
5
+ <h2 style="text-align:center;">DesslyHub API</h2>
6
+
7
+ Асинхронная Python-библиотека для работы с [DesslyHub API](https://desslyhub.com). Поддерживает пополнение Steam-аккаунтов, покупку и отправку игр в подарок, ваучеры, пополнение мобильных игр и управление транзакциями.
8
+
9
+ ## Установка
10
+
11
+ ```bash
12
+ # Using uv
13
+ uv add desslyhub
14
+
15
+ # Or using pip
16
+ pip install desslyhub
17
+ ```
18
+
19
+ **Требования:** Python 3.11+
20
+
21
+ ## Быстрый старт
22
+
23
+ ```python
24
+ import asyncio
25
+
26
+ from desslyhub import Client
27
+
28
+
29
+ async def main() -> None:
30
+ async with Client(api_key="ваш_api_ключ") as client:
31
+ balance = await client.get_balance()
32
+ print(f"Баланс: {balance.balance} USD")
33
+
34
+
35
+ asyncio.run(main())
36
+ ```
37
+
38
+ ## Возможности
39
+
40
+ ### Баланс и транзакции
41
+
42
+ ```python
43
+ # Получить баланс
44
+ balance = await client.get_balance()
45
+
46
+ # Получить список транзакций (постранично, 100 на страницу)
47
+ transactions = await client.get_transactions(page=1)
48
+ for tx in transactions.transactions:
49
+ print(f"{tx.id} — {tx.status} — {tx.final_amount} USD")
50
+
51
+ # Получить транзакцию по ID
52
+ transaction = await client.get_transaction("uuid-транзакции")
53
+
54
+ # Проверить статус транзакции
55
+ status = await client.get_transaction_status("uuid-транзакции")
56
+ print(status.status) # success / pending / failed / cancelled
57
+ ```
58
+
59
+ ### Пополнение Steam
60
+
61
+ ```python
62
+ # Проверить возможность пополнения аккаунта
63
+ check = await client.check_steam_login(amount=5.0, username="steam_login")
64
+ if check.can_refill:
65
+ # Пополнить баланс Steam (от 0.1 до 1000 USD)
66
+ result = await client.steam_top_up(amount=5.0, username="steam_login")
67
+ print(f"Транзакция: {result.transaction_id}, статус: {result.status}")
68
+ ```
69
+
70
+ ### Покупка и отправка игр в подарок
71
+
72
+ ```python
73
+ # Список доступных игр
74
+ games = await client.get_steam_gift_games()
75
+ for game in games.games:
76
+ print(f"{game.name} (app_id: {game.app_id})")
77
+
78
+ # Детали игры: издания, регионы, цены
79
+ details = await client.get_steam_gift_game_details(app_id=730)
80
+ for edition in details.game:
81
+ print(f"{edition.edition} (package_id: {edition.package_id})")
82
+ for region in edition.regions_info:
83
+ print(f" {region.region}: {region.price} USD (скидка {region.discount}%)")
84
+
85
+ # Отправить игру в подарок
86
+ result = await client.send_steam_gift_game(
87
+ invite_url="https://s.team/p/...",
88
+ package_id="12345",
89
+ region="RU",
90
+ )
91
+ ```
92
+
93
+ ### Курсы валют Steam
94
+
95
+ ```python
96
+ from desslyhub.enums import Currency
97
+
98
+ # Курс для одной валюты
99
+ rate = await client.get_steam_exchange_rate(Currency.RUB)
100
+ print(f"1 USD = {rate.exchange_rate} RUB")
101
+
102
+ # Все курсы
103
+ rates = await client.get_steam_exchange_rates()
104
+ for currency, value in rates.exchange_rates.items():
105
+ print(f"{currency.name}: {value}")
106
+ ```
107
+
108
+ ### Ваучеры
109
+
110
+ ```python
111
+ # Список продуктов
112
+ products = await client.get_voucher_products()
113
+ for product in products.products:
114
+ print(f"{product.name} ({product.country})")
115
+ for v in product.variations:
116
+ print(f" {v.name} — {v.price} {v.voucher_currency} (в наличии: {v.stock})")
117
+
118
+ # Детали продукта
119
+ product = await client.get_voucher_product(product_id=1)
120
+
121
+ # Покупка ваучера
122
+ result = await client.buy_voucher(root_id=1, variant_id=10)
123
+ for voucher in result.vouchers:
124
+ print(f"PIN: {voucher.pin}, S/N: {voucher.serial_number}")
125
+ ```
126
+
127
+ ### Мобильные игры
128
+
129
+ ```python
130
+ from desslyhub.enums import Variant
131
+
132
+ # Список игр
133
+ games = await client.get_mobile_games(variant=Variant.PROVIDER_1)
134
+
135
+ # Детали игры (серверы, поля, позиции)
136
+ details = await client.get_mobile_game_details(game_id="123")
137
+ for pos in details.positions:
138
+ print(f"{pos.name} — {pos.price} USD")
139
+
140
+ # Пополнение
141
+ result = await client.send_mobile_game_refill(
142
+ fields={"user_id": "12345", "server": "EU"},
143
+ position=1,
144
+ variant=Variant.PROVIDER_1,
145
+ )
146
+ ```
147
+
148
+ ## Обработка ошибок
149
+
150
+ Библиотека предоставляет типизированные исключения для каждого кода ошибки API:
151
+
152
+ ```python
153
+ from desslyhub.exceptions import (
154
+ DesslyHubAPIError,
155
+ InsufficientFundsError,
156
+ IncorrectSteamUsernameError,
157
+ GameAlreadyOwnedError,
158
+ )
159
+
160
+ try:
161
+ await client.steam_top_up(amount=5.0, username="login")
162
+ except InsufficientFundsError:
163
+ print("Недостаточно средств на балансе")
164
+ except IncorrectSteamUsernameError:
165
+ print("Неверный логин Steam")
166
+ except DesslyHubAPIError as e:
167
+ print(f"Ошибка API: код {e.code}, {e.message}")
168
+ ```
169
+
170
+ <details>
171
+ <summary>Полный список исключений</summary>
172
+
173
+ | Код | Класс | Описание |
174
+ |-----|-------|----------|
175
+ | -1 | `InternalServerError` | Внутренняя ошибка сервера |
176
+ | -2 | `InsufficientFundsError` | Недостаточно средств |
177
+ | -3 | `IncorrectAmountError` | Некорректная сумма |
178
+ | -4 | `IncorrectRequestBodyError` | Некорректное тело запроса |
179
+ | -5 | `AccessDeniedError` | Доступ запрещён |
180
+ | -51 | `InvalidFriendLinkError` | Неверная ссылка на друга |
181
+ | -52 | `IncorrectAppIDError` | Неверный App ID |
182
+ | -53 | `GameInfoNotFoundError` | Информация об игре не найдена |
183
+ | -54 | `MainGameNotOwnedError` | Базовая игра не куплена |
184
+ | -55 | `GameAlreadyOwnedError` | Игра уже в библиотеке |
185
+ | -56 | `UnableToAddFriendError` | Не удалось добавить в друзья |
186
+ | -57 | `IncorrectCustomerRegionError` | Неверный регион покупателя |
187
+ | -58 | `RecipientRegionUnavailableError` | Регион получателя недоступен |
188
+ | -59 | `BotFriendActionPendingError` | Ожидается действие с ботом |
189
+ | -100 | `IncorrectSteamUsernameError` | Неверный логин Steam |
190
+ | -120 | `IncorrectCurrencyValueError` | Неверное значение валюты |
191
+ | -121 | `CurrencyNotSupportedError` | Валюта не поддерживается |
192
+ | -151 | `InvalidTransactionIDError` | Неверный ID транзакции |
193
+ | -152 | `TransactionNotFoundError` | Транзакция не найдена |
194
+ | -153 | `PageNumberNotSpecifiedError` | Не указан номер страницы |
195
+ | -200 | `MobileGameNotFoundError` | Мобильная игра не найдена |
196
+ | -201 | `MobileGamePositionNotFoundError` | Позиция не найдена |
197
+ | -202 | `SourceVariantNotFoundError` | Провайдер не найден |
198
+ | -300 | `VoucherNotFoundError` | Ваучер не найден |
199
+ | -301 | `VoucherNotAvailableError` | Ваучер недоступен |
200
+
201
+ </details>
202
+
203
+ ## Поддерживаемые валюты
204
+
205
+ `Currency` — это `IntEnum` с 37 валютами:
206
+
207
+ USD, GBP, EUR, CHF, RUB, PLN, BRL, JPY, NOK, IDR, MYR, PHP, SGD, THB, VND, KRW, UAH, MXN, CAD, AUD, NZD, CNY, INR, CLP, PEN, COP, ZAR, HKD, TWD, SAR, AED, ILS, KZT, KWD, QAR, CRC, UYU
@@ -0,0 +1,13 @@
1
+ <svg width="156" height="26" viewBox="0 0 156 26" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M155.495 15.8505C155.495 16.8936 155.11 17.717 154.542 18.3208C153.809 19.1077 152.563 19.4736 151.28 19.4736H146.918V6.5H151.28C152.508 6.5 153.662 6.84767 154.395 7.63451C154.89 8.16516 155.202 8.952 155.202 9.84863C155.202 11.0929 154.542 12.2823 153.332 12.7215C154.67 13.1607 155.495 14.4782 155.495 15.8505ZM153.534 9.97672C153.534 8.62263 152.434 7.94558 151.188 7.94558H148.512V12.0262H151.225C152.581 12.0262 153.534 11.4223 153.534 9.97672ZM153.827 15.7407C153.827 14.3135 152.709 13.4534 151.261 13.4534H148.512V17.9732H151.28C152.709 17.9732 153.827 17.3693 153.827 15.7407Z" fill="white"/>
3
+ <path d="M143.874 14.7526C143.874 17.6804 142.371 19.7115 139.311 19.7115C136.268 19.7115 134.766 17.6621 134.766 14.7526V6.5H136.397V14.7709C136.397 16.7472 137.185 18.1745 139.329 18.1745C141.455 18.1745 142.243 16.7289 142.243 14.7709V6.5H143.874V14.7526Z" fill="white"/>
4
+ <path d="M132.38 19.4736H130.713V13.49H125.196V19.4736H123.547V6.5H125.196V11.9164H130.713V6.5H132.38V19.4736Z" fill="white"/>
5
+ <rect x="115.617" y="10.9023" width="3.52307" height="3.52307" fill="white"/>
6
+ <path d="M98.2383 7.0111C98.2383 6.71984 98.3976 6.57422 98.7161 6.57422H100.462C101.154 6.57422 101.687 6.86244 102.061 7.43887L105.038 11.9806L108.006 7.43887C108.386 6.86244 108.919 6.57422 109.605 6.57422H111.36C111.673 6.57422 111.829 6.71984 111.829 7.0111C111.829 7.14459 111.78 7.28718 111.682 7.43887L106.766 14.9659V18.7886C106.766 19.0252 106.68 19.2254 106.509 19.3893C106.343 19.547 106.141 19.6259 105.902 19.6259H104.174C103.936 19.6259 103.73 19.547 103.559 19.3893C103.387 19.2254 103.302 19.0252 103.302 18.7886V14.9659L98.3945 7.43887C98.2904 7.28718 98.2383 7.14459 98.2383 7.0111Z" fill="white"/>
7
+ <path d="M87.5352 18.7886V7.45707C87.5352 7.2083 87.6209 6.99896 87.7925 6.82906C87.964 6.65917 88.1692 6.57422 88.4081 6.57422H90.1357C90.3746 6.57422 90.5768 6.65917 90.7422 6.82906C90.9137 6.99896 90.9995 7.2083 90.9995 7.45707V17.0502H99.0032C99.2422 17.0502 99.4443 17.1351 99.6097 17.305C99.7812 17.4749 99.867 17.6782 99.867 17.9148V18.7704C99.867 19.007 99.7812 19.2103 99.6097 19.3802C99.4443 19.544 99.2422 19.6259 99.0032 19.6259H88.4081C88.1692 19.6259 87.964 19.547 87.7925 19.3893C87.6209 19.2254 87.5352 19.0252 87.5352 18.7886Z" fill="white"/>
8
+ <path d="M72.7422 16.2842C72.7422 15.9262 72.8494 15.6714 73.0638 15.5197C73.2782 15.3619 73.4865 15.283 73.6887 15.283H74.7822C75.3335 15.283 75.7532 15.5804 76.0411 16.175C76.329 16.7696 76.9753 17.0669 77.98 17.0669L81.1962 17.1307C82.2744 17.1307 82.8135 16.7818 82.8135 16.084C82.8135 15.5561 82.155 15.1404 80.8378 14.8371C80.2497 14.6975 79.6004 14.561 78.8897 14.4275C78.1791 14.2879 77.4715 14.115 76.767 13.9087C76.0687 13.7024 75.4254 13.4597 74.8373 13.1806C74.2492 12.9015 73.7714 12.5192 73.4038 12.0338C73.0424 11.5423 72.8616 10.9658 72.8616 10.3045C72.8616 9.08485 73.2997 8.14739 74.1757 7.49207C75.0517 6.83069 76.5588 6.5 78.6968 6.5L81.0308 6.55461C82.2867 6.55461 83.4169 6.8762 84.4216 7.51938C85.4324 8.15649 85.9378 8.9544 85.9378 9.9131C85.9378 10.2711 85.8306 10.529 85.6162 10.6867C85.4018 10.8445 85.1966 10.9234 85.0005 10.9234H83.907C83.3557 10.9234 82.936 10.6261 82.6481 10.0314C82.3602 9.43071 81.7139 9.13036 80.7092 9.13036L77.9433 9.07575C76.8651 9.07575 76.326 9.42465 76.326 10.1224C76.326 10.5047 76.666 10.8172 77.346 11.0599C78.0321 11.3026 78.8591 11.518 79.827 11.7061C80.8011 11.8881 81.7782 12.1096 82.7584 12.3705C83.7386 12.6314 84.5686 13.0622 85.2486 13.663C85.9348 14.2576 86.2778 15.0009 86.2778 15.8928C86.2778 17.1125 85.8367 18.053 84.9546 18.7143C84.0786 19.3697 82.5746 19.6973 80.4427 19.6973L77.6584 19.6427C76.4025 19.6427 75.2692 19.3241 74.2584 18.687C73.2476 18.0439 72.7422 17.2429 72.7422 16.2842Z" fill="white"/>
9
+ <path d="M58.7031 16.2842C58.7031 15.9262 58.8103 15.6714 59.0247 15.5197C59.2392 15.3619 59.4474 15.283 59.6496 15.283H60.7431C61.2945 15.283 61.7141 15.5804 62.002 16.175C62.29 16.7696 62.9363 17.0669 63.9409 17.0669L67.1572 17.1307C68.2354 17.1307 68.7745 16.7818 68.7745 16.084C68.7745 15.5561 68.1159 15.1404 66.7988 14.8371C66.2107 14.6975 65.5613 14.561 64.8507 14.4275C64.14 14.2879 63.4325 14.115 62.728 13.9087C62.0296 13.7024 61.3864 13.4597 60.7983 13.1806C60.2101 12.9015 59.7323 12.5192 59.3647 12.0338C59.0033 11.5423 58.8226 10.9658 58.8226 10.3045C58.8226 9.08485 59.2606 8.14739 60.1366 7.49207C61.0127 6.83069 62.5197 6.5 64.6577 6.5L66.9918 6.55461C68.2476 6.55461 69.3779 6.8762 70.3826 7.51938C71.3934 8.15649 71.8988 8.9544 71.8988 9.9131C71.8988 10.2711 71.7916 10.529 71.5771 10.6867C71.3627 10.8445 71.1575 10.9234 70.9615 10.9234H69.868C69.3166 10.9234 68.897 10.6261 68.609 10.0314C68.3211 9.43071 67.6748 9.13036 66.6701 9.13036L63.9042 9.07575C62.826 9.07575 62.2869 9.42465 62.2869 10.1224C62.2869 10.5047 62.6269 10.8172 63.3069 11.0599C63.993 11.3026 64.82 11.518 65.788 11.7061C66.762 11.8881 67.7391 12.1096 68.7193 12.3705C69.6995 12.6314 70.5296 13.0622 71.2096 13.663C71.8957 14.2576 72.2388 15.0009 72.2388 15.8928C72.2388 17.1125 71.7977 18.053 70.9155 18.7143C70.0395 19.3697 68.5355 19.6973 66.4036 19.6973L63.6193 19.6427C62.3635 19.6427 61.2301 19.3241 60.2193 18.687C59.2085 18.0439 58.7031 17.2429 58.7031 16.2842Z" fill="white"/>
10
+ <path d="M46.0625 18.7521V7.42067C46.0625 7.18403 46.1483 6.98379 46.3198 6.81996C46.4913 6.65613 46.6966 6.57422 46.9355 6.57422H57.5306C57.7695 6.57422 57.9717 6.65917 58.1371 6.82906C58.3086 6.99896 58.3944 7.20223 58.3944 7.43887V8.29442C58.3944 8.53106 58.3086 8.73433 58.1371 8.90423C57.9717 9.06805 57.7695 9.14997 57.5306 9.14997H49.5268V11.7985H56.4187C56.6576 11.7985 56.8598 11.8835 57.0252 12.0534C57.1967 12.2172 57.2825 12.4174 57.2825 12.6541V13.5096C57.2825 13.7463 57.1967 13.9495 57.0252 14.1194C56.8598 14.2833 56.6576 14.3652 56.4187 14.3652H49.5268V17.0502H57.5122C57.745 17.0502 57.9441 17.1321 58.1095 17.2959C58.2749 17.4597 58.3576 17.66 58.3576 17.8966V18.7704C58.3576 19.007 58.2718 19.2103 58.1003 19.3802C57.9288 19.544 57.7235 19.6259 57.4846 19.6259H46.9355C46.6966 19.6259 46.4913 19.544 46.3198 19.3802C46.1483 19.2103 46.0625 19.0009 46.0625 18.7521Z" fill="white"/>
11
+ <path d="M31.1797 18.7886V7.45707C31.1797 7.2083 31.2655 6.99896 31.437 6.82906C31.6085 6.65917 31.8137 6.57422 32.0527 6.57422H37.1894C39.8481 6.57422 41.7809 7.10211 42.9878 8.1579C44.2007 9.20761 44.8072 10.858 44.8072 13.1092C44.8072 15.3542 44.2007 17.0016 42.9878 18.0513C41.7809 19.101 39.8481 19.6259 37.1894 19.6259H32.0527C31.8137 19.6259 31.6085 19.547 31.437 19.3893C31.2655 19.2254 31.1797 19.0252 31.1797 18.7886ZM34.644 17.0502H37.0883C38.7362 17.0502 39.8573 16.7528 40.4516 16.1582C41.0458 15.5636 41.3429 14.5472 41.3429 13.1092C41.3429 11.665 41.0458 10.6457 40.4516 10.051C39.8573 9.45032 38.7362 9.14997 37.0883 9.14997H34.644V17.0502Z" fill="white"/>
12
+ <path d="M8.27246 18.166C8.60854 18.3052 9.01905 18.4231 9.5752 18.5293C10.1342 18.6359 11.602 18.8223 12.6641 18.793V23.5957C11.6282 23.7582 10.8352 24.652 10.835 25.7334C10.835 25.8253 10.8434 25.916 10.8545 26.0049H4.14746C3.80952 26.0049 3.48137 25.9632 3.16699 25.8867C3.47332 25.513 3.6582 25.0356 3.6582 24.5146C3.6582 24.0348 3.50036 23.5925 3.23633 23.2334L8.27246 18.166ZM22.8203 23.1631C22.5241 23.5337 22.3467 24.0033 22.3467 24.5146C22.3467 25.0352 22.53 25.5131 22.8359 25.8867C22.5219 25.9631 22.1941 26.0049 21.8564 26.0049H15.1504C15.1615 25.916 15.1689 25.8253 15.1689 25.7334C15.1687 24.6524 14.377 23.7588 13.3418 23.5957V18.793C14.4001 18.8166 15.8363 18.6344 16.3867 18.5293C16.9826 18.4155 17.4107 18.2876 17.7598 18.1348L22.8203 23.1631ZM23.5918 13.3408C23.7439 14.3888 24.6432 15.1943 25.7334 15.1943C25.8254 15.1943 25.9159 15.1869 26.0049 15.1758V21.8564C26.0049 22.1951 25.9626 22.5239 25.8857 22.8389C25.512 22.5325 25.0347 22.3477 24.5137 22.3477C24.0726 22.3477 23.6626 22.4798 23.3203 22.7061L18.374 17.791C18.4091 17.7667 18.4449 17.7432 18.4795 17.7178C19.241 17.1566 19.3412 16.7888 19.542 16.2236C19.5768 16.1262 19.6089 16.0245 19.6396 15.9219C20.0656 15.8859 20.3194 15.5239 20.4297 15.0898C20.6404 15.0255 20.7679 14.7954 20.8242 14.5293C20.9005 14.1379 20.9325 13.7388 20.9238 13.3408H23.5918ZM5.0332 13.3408C5.02454 13.7387 5.05654 14.1374 5.13281 14.5283C5.2077 14.8025 5.32208 15.0272 5.5293 15.0898C5.67089 15.5365 5.89563 15.8886 6.32129 15.9219C6.35206 16.0251 6.38412 16.1262 6.41895 16.2236C6.61977 16.7888 6.72069 17.1561 7.48145 17.7178C7.53596 17.758 7.59141 17.7966 7.64746 17.834L2.75488 22.7568C2.39896 22.5004 1.96335 22.3477 1.49121 22.3477C0.969953 22.3477 0.491041 22.5312 0.117188 22.8379C0.040707 22.5233 0 22.1946 0 21.8564V15.1758C0.0889109 15.1869 0.179563 15.1943 0.271484 15.1943C1.36156 15.1942 2.26101 14.3888 2.41309 13.3408H5.0332ZM10.1982 11.1152C12.0494 10.961 13.9115 10.961 15.7627 11.1152C16.7871 11.1154 17.6182 11.9455 17.6182 12.9688V15.1279C17.6182 16.1512 16.7871 16.9813 15.7627 16.9814C13.9115 17.1357 12.0494 17.1357 10.1982 16.9814C9.17371 16.9814 8.34277 16.1512 8.34277 15.1279V12.9688C8.34277 11.9455 9.17371 11.1153 10.1982 11.1152ZM15.6855 13.9746C15.5257 13.9746 15.3955 14.1048 15.3955 14.2646C15.3957 14.4244 15.5258 14.5537 15.6855 14.5537C15.8453 14.5536 15.9744 14.4243 15.9746 14.2646C15.9746 14.1048 15.8454 13.9747 15.6855 13.9746ZM10.0625 13.2031H9.29004V13.6855H10.0625V14.458H10.5449V13.6855H11.3164V13.2031H10.5449V12.4307H10.0625V13.2031ZM14.9131 13.2031C14.7535 13.2034 14.6242 13.3326 14.624 13.4922C14.624 13.6519 14.7534 13.782 14.9131 13.7822C15.073 13.7822 15.2031 13.6521 15.2031 13.4922C15.203 13.3324 15.0729 13.2031 14.9131 13.2031ZM16.458 13.2031C16.2982 13.2031 16.1681 13.3324 16.168 13.4922C16.168 13.6521 16.2981 13.7822 16.458 13.7822C16.6177 13.782 16.7471 13.6519 16.7471 13.4922C16.7469 13.3326 16.6176 13.2033 16.458 13.2031ZM15.6855 12.4307C15.5257 12.4307 15.3955 12.5608 15.3955 12.7207C15.3955 12.8806 15.5257 13.0098 15.6855 13.0098C15.8454 13.0097 15.9746 12.8805 15.9746 12.7207C15.9746 12.5609 15.8454 12.4307 15.6855 12.4307ZM25.8857 3.16504C25.9626 3.48003 26.0049 3.80877 26.0049 4.14746V10.8779C25.9159 10.8668 25.8254 10.8604 25.7334 10.8604C24.6608 10.8604 23.773 11.6399 23.5996 12.6631H20.8691C20.8563 12.5742 20.8414 12.4856 20.8242 12.3975V12.3965C20.7494 12.1224 20.6347 11.8977 20.4277 11.835C20.3035 11.4442 20.1159 11.1259 19.7861 11.0303C19.6846 10.4501 19.5418 10.1517 19.3584 9.89258C19.0291 9.4272 18.4564 8.95844 17.8125 8.56348L23.1621 3.18262C23.5328 3.47897 24.0022 3.65723 24.5137 3.65723C25.0349 3.65721 25.5119 3.47163 25.8857 3.16504ZM0.117188 3.16602C0.491096 3.47285 0.969777 3.65723 1.49121 3.65723C1.96975 3.65716 2.41004 3.49908 2.76855 3.23633L8.13281 8.57129C7.49482 8.96425 6.92891 9.43038 6.60254 9.89258C6.41918 10.1517 6.27638 10.4499 6.1748 11.0293C5.83416 11.1255 5.62491 11.4529 5.52734 11.8359C5.31662 11.9003 5.18912 12.1304 5.13281 12.3965C5.11556 12.485 5.1008 12.5739 5.08789 12.6631H2.40527C2.23194 11.6399 1.34393 10.8605 0.271484 10.8604C0.179597 10.8604 0.0888789 10.8668 0 10.8779V4.14746C2.52944e-05 3.80928 0.0407073 3.48063 0.117188 3.16602ZM10.8545 0C10.8434 0.0887182 10.835 0.178793 10.835 0.270508C10.835 1.3521 11.6281 2.2456 12.6641 2.4082V7.23145C11.4829 7.2709 10.3074 7.5293 9.20215 8.01074C9.19409 8.01419 9.18676 8.01803 9.17871 8.02148C9.03469 8.08465 8.88989 8.15345 8.74609 8.22656L3.24609 2.75684C3.50385 2.40032 3.65816 1.96378 3.6582 1.49023C3.6582 0.969065 3.47355 0.491012 3.16699 0.117188C3.48134 0.0408665 3.80961 2.51458e-05 4.14746 0H10.8545ZM21.8564 0C22.194 0 22.5219 0.0410003 22.8359 0.117188C22.5298 0.490899 22.3467 0.969425 22.3467 1.49023C22.3467 1.9307 22.4793 2.33965 22.7051 2.68164L17.1992 8.21875C17.0605 8.14852 16.9211 8.08246 16.7822 8.02148C16.7747 8.01803 16.7669 8.01419 16.7588 8.01074C15.6676 7.53543 14.5077 7.27693 13.3418 7.23242V2.4082C14.3771 2.24504 15.1689 1.35164 15.1689 0.270508C15.1689 0.178809 15.1615 0.0887033 15.1504 0H21.8564Z" fill="white"/>
13
+ </svg>
@@ -0,0 +1,6 @@
1
+ from __future__ import annotations
2
+
3
+ from .client import Client
4
+
5
+
6
+ __all__ = ("Client",)
@@ -0,0 +1,3 @@
1
+ from __future__ import annotations
2
+
3
+ from .client import *