diff options
| author | Tolmachev Igor <me@igorek.dev> | 2025-07-17 15:58:03 +0900 |
|---|---|---|
| committer | Tolmachev Igor <me@igorek.dev> | 2025-07-17 15:58:03 +0900 |
| commit | 76a599385befa877b85dba24f4596a3d2f5b560a (patch) | |
| tree | f31b05214a5f531fb5065476eaf35c4ab1366c01 | |
| parent | 166b2faed2ee31970ca77f03d0c2095b3482ad26 (diff) | |
| download | async_crypto_pay_api-76a599385befa877b85dba24f4596a3d2f5b560a.tar.gz async_crypto_pay_api-76a599385befa877b85dba24f4596a3d2f5b560a.zip | |
Add README.md
| -rw-r--r-- | README.md | 52 | ||||
| -rw-r--r-- | src/async_crypto_pay_api/__meta__.py | 2 |
2 files changed, 53 insertions, 1 deletions
| @@ -0,0 +1,52 @@ | |||
| 1 | # async-crypto-pay-api | ||
| 2 | |||
| 3 |  | ||
| 4 |  | ||
| 5 |  | ||
| 6 | |||
| 7 | Async Crypto Pay API wrapper for [Telegram Crypto Bot](https://t.me/cryptobot) written in Python 3.10+. | ||
| 8 | |||
| 9 | ## Requirements | ||
| 10 | - Python 3.10 or higher | ||
| 11 | - Valid Crypto Bot API token ([get one here](https://t.me/CryptoBot?start=pay)) | ||
| 12 | |||
| 13 | ## Installation | ||
| 14 | ```bash | ||
| 15 | pip install async-crypto-pay-api | ||
| 16 | ``` | ||
| 17 | |||
| 18 | ## Example | ||
| 19 | ```python | ||
| 20 | from asyncio import run | ||
| 21 | from async_crypto_pay_api import CryptoPayApi | ||
| 22 | from async_crypto_pay_api.models import CurrencyType, FiatAsset | ||
| 23 | |||
| 24 | crypto = CryptoPayApi("{token}") | ||
| 25 | |||
| 26 | async def main() -> None: | ||
| 27 | # Context manager handles connection lifecycle | ||
| 28 | async with crypto: | ||
| 29 | app_info = await crypto.get_me() | ||
| 30 | print(app_info.model_dump_json(indent=4)) | ||
| 31 | |||
| 32 | # Create payment invoice | ||
| 33 | invoice = await crypto.create_invoice( | ||
| 34 | currency_type=CurrencyType.FIAT, | ||
| 35 | fiat=FiatAsset.USD, | ||
| 36 | amount=100, | ||
| 37 | ) | ||
| 38 | print(f"Invoice URL: {invoice.bot_invoice_url}") | ||
| 39 | |||
| 40 | run(main()) | ||
| 41 | ``` | ||
| 42 | |||
| 43 | ## License | ||
| 44 | This project is licensed under the GNU Lesser General Public License v3.0 only. | ||
| 45 | See [LICENSE](LICENSE) for details. | ||
| 46 | |||
| 47 | |||
| 48 | ## Contributing | ||
| 49 | Contributions are welcome! Please open an issue or submit a PR for: | ||
| 50 | - Bug fixes | ||
| 51 | - New features | ||
| 52 | - Documentation improvements | ||
diff --git a/src/async_crypto_pay_api/__meta__.py b/src/async_crypto_pay_api/__meta__.py index d53578f..2986247 100644 --- a/src/async_crypto_pay_api/__meta__.py +++ b/src/async_crypto_pay_api/__meta__.py | |||
| @@ -1,2 +1,2 @@ | |||
| 1 | __version__ = "1.0.0" | 1 | __version__ = "1.0.1" |
| 2 | __api_version__ = "1.5.1" | 2 | __api_version__ = "1.5.1" |
