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.5.tar.gz (196.9 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.5-py3-none-any.whl (60.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiosend-3.0.5.tar.gz
  • Upload date:
  • Size: 196.9 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.5.tar.gz
Algorithm Hash digest
SHA256 8830f881b83b94231439a0e7ca5181e8e57c9ad4d700fa2dd9adb9107cc39c7c
MD5 0f2736a532cd1a806516ddd0156b93a9
BLAKE2b-256 bde947be0f3419aea112e7efaddfc1fb3316f25bb21e3e53937dfe7e877fa5f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiosend-3.0.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: aiosend-3.0.5-py3-none-any.whl
  • Upload date:
  • Size: 60.2 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 446736ae7b0dbc6c0283537fba47246b2a695d829e7c4b464ba0f70bfc2d1d02
MD5 91774a7819c74ff41ae5f20afbc44495
BLAKE2b-256 5e0649145a5d8b914b4acea860c555ae8f14555541a11191e070927fead0e5d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiosend-3.0.5-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