Skip to main content

sync & async Crypto Pay API client.

Project description

aiosend

Python Crypto Pay API Documentation Status Pydantic v2 Aiohttp uv Code linter: ruff Checked with mypy

aiosend is a synchronous & asynchronous Crypto Pay API client.

Official documentation

Telegram chat

Quick start

import asyncio
from aiosend import CryptoPay


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


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

aiogram 3.x integration example

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.poll(message=message)


@cp.invoice_paid()
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())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiosend-3.0.2.tar.gz (196.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiosend-3.0.2-py3-none-any.whl (59.8 kB view details)

Uploaded Python 3

File details

Details for the file aiosend-3.0.2.tar.gz.

File metadata

  • Download URL: aiosend-3.0.2.tar.gz
  • Upload date:
  • Size: 196.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aiosend-3.0.2.tar.gz
Algorithm Hash digest
SHA256 97b66286d367c89b79fa66ec6033593e52a1baafad6e4406294d9e8740cb8b65
MD5 a9b5c3d0728386eee97c1361be17ec8f
BLAKE2b-256 1aaa60d7a412dce79633b1742281b3d683df2dff048ebb21656cb3927db3195c

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiosend-3.0.2.tar.gz:

Publisher: deploy.yml on vovchic17/aiosend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiosend-3.0.2-py3-none-any.whl.

File metadata

  • Download URL: aiosend-3.0.2-py3-none-any.whl
  • Upload date:
  • Size: 59.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aiosend-3.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7365de0dab181270131d29de1411ce896ac726722adc5d21fe768e322f14be56
MD5 1aa19d2a0d5d6a5056bc0442cf60282d
BLAKE2b-256 502120d6a294a2d982e83391b9485ae900b48deb9b8eb5d9ea26d5337364492d

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiosend-3.0.2-py3-none-any.whl:

Publisher: deploy.yml on vovchic17/aiosend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page