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 syncronous & 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_polling()
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-2.1.2.tar.gz (187.8 kB view details)

Uploaded Source

Built Distribution

aiosend-2.1.2-py3-none-any.whl (52.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aiosend-2.1.2.tar.gz
Algorithm Hash digest
SHA256 fea6032c6a1469f8423270c61e0f83167fc523eab802f0fdeea421add7267449
MD5 5c5d834387983f4d41c55352c46f1701
BLAKE2b-256 0e484a41e7e1efc0e4d81c56f7d2309b5973ffcb120e4fa45c00f6cd4425f04e

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for aiosend-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8a5babd2b354d78a540d43dd6ed810f5c03651f5a1e934be7bb19a5529ae44c6
MD5 ffd32bd18fe2e33ce70a16b5122f8a35
BLAKE2b-256 f91bfad12b92e7d448017993e75659a21bffdc3a0c47a87080b8b44b36427e8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiosend-2.1.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 Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page