Metadata-Version: 2.1
Name: aiosend
Version: 2.0.0
Summary: sync & async Crypto Pay API client.
Home-page: https://github.com/vovchic17/
License: MIT
Keywords: crypto pay,CryptoBot,Crypto Pay API
Author: VoVcHiC
Author-email: tsvetkovvova17@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Provides-Extra: docs
Provides-Extra: fastapi
Provides-Extra: flask
Requires-Dist: aiohttp (>=3.9,<4.0)
Requires-Dist: certifi (>=2024.8.30,<2025.0.0)
Requires-Dist: fastapi[standard] (>=0.115.0,<0.116.0) ; extra == "fastapi"
Requires-Dist: flask[async] (>=3.0.3,<4.0.0) ; extra == "flask"
Requires-Dist: furo (>=2024.0.0,<2025.0.0) ; extra == "docs"
Requires-Dist: magic-filter (>=1.0.12,<2.0.0)
Requires-Dist: matplotlib (>=3.9.2,<4.0.0) ; extra == "docs"
Requires-Dist: pydantic (>=2.4,<3.0)
Requires-Dist: sphinx-autodoc-typehints (>=2.3.0,<3.0.0) ; extra == "docs"
Requires-Dist: sphinx-copybutton (>=0.5.2,<0.6.0) ; extra == "docs"
Requires-Dist: sphinxext-opengraph (>=0.9.1,<0.10.0) ; extra == "docs"
Project-URL: Documentation, https://aiosend.rtfd.io/en/latest/
Project-URL: Repository, https://github.com/vovchic17/
Description-Content-Type: text/markdown

<p align="center">
  <img src="https://raw.githubusercontent.com/vovchic17/static/refs/heads/main/src/aiosend.png" align="center"/>
  <h1 align="center">aiosend</h1>
</p>

[![Python](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/vovchic17/static/main/src/badges/python310_313.json)](https://www.python.org/)
[![Crypto Pay API](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/vovchic17/static/refs/heads/main/src/badges/cryptopayapi.json)](https://help.crypt.bot/crypto-pay-api)
[![Documentation Status](https://readthedocs.org/projects/aiosend/badge/?version=latest)](https://aiosend.readthedocs.io/en/latest/?badge=latest)
[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)
[![Aiohttp](https://img.shields.io/badge/aiohttp-v3-2c5bb4?logo=aiohttp)](https://docs.aiohttp.org/en/stable/)
[![Code linter: ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/charliermarsh/ruff)
[![Checked with mypy](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/vovchic17/static/main/src/badges/mypy.json)](https://mypy-lang.org/)

**aiosend** is a syncronous & asynchronous [Crypto Pay API](https://help.crypt.bot/crypto-pay-api) client.

> ## [Official documentation](https://aiosend.readthedocs.io/en/latest/)
> ## [<img src="https://raw.githubusercontent.com/vovchic17/static/refs/heads/main/src/telegram_logo.svg" width="30" align="top">  Telegram chat](https://aiosend.t.me/)


## Quick start
```python
import asyncio
from aiosend import CryptoPay


async def main():
    cp = CryptoPay(token="TOKEN")
    app = await cp.get_me()
    print(app.name)  # Your App Name


if __name__ == "__main__":
    asyncio.run(main())
```

## aiogram 3.x integration example

```python
import asyncio
from aiogram import Bot, Dispatcher
from aiosend import CryptoPay

cp = CryptoPay("TOKEN")
bot = Bot("TOKEN")
dp = Dispatcher()


@dp.message()
async def get_invoice(message):
    invoice = await cp.create_invoice(1, "USDT")
    await message.answer(f"pay: {invoice.bot_invoice_url}")
    invoice.await_payment(message=message)


@cp.polling_handler()
async def handle_payment(invoice, message):
    await message.answer(f"invoice #{invoice.invoice_id} has been paid")


async def main():
    await asyncio.gather(
        dp.start_polling(bot),
        cp.start_polling(),
    )


if __name__ == "__main__":
    asyncio.run(main())
```


