Skip to main content

sync & async Crypto Pay API client.

This project has been quarantined.

PyPI Admins need to review this project before it can be restored. While in quarantine, the project is not installable by clients, and cannot be being modified by its maintainers.

Read more in the project in quarantine help article.

Project description

aiocpa

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

aiocpa is a syncronous & asynchronous Crypto Pay API client.

Official documentation

Quick start

import asyncio
from cryptopay 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

import asyncio
from aiogram import Bot, Dispatcher
from cryptopay 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.run_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

aiocpa-0.1.13.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

aiocpa-0.1.13-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

Details for the file aiocpa-0.1.13.tar.gz.

File metadata

  • Download URL: aiocpa-0.1.13.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Windows/11

File hashes

Hashes for aiocpa-0.1.13.tar.gz
Algorithm Hash digest
SHA256 ad9f5183aa8d792ed1bc991ab3ac9b0cd4160fd9276071a7e63e7d7b4e3481b8
MD5 9d865a455d4a89440521d585338567dc
BLAKE2b-256 ab987343281068a2c39086d0b877219668a487508197f46e89b3f41046a4a8ba

See more details on using hashes here.

File details

Details for the file aiocpa-0.1.13-py3-none-any.whl.

File metadata

  • Download URL: aiocpa-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 45.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Windows/11

File hashes

Hashes for aiocpa-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 6f435a3f209c09d8f7cf180f759a5faa2ff215edc1afce2cd62078574bb70c69
MD5 2e1ea4e805b16b82677b8107f95b1065
BLAKE2b-256 f21771ce6fa8009b585dc6b7cd72908b590dad02b32be0b02774ed7ea2a92895

See more details on using hashes here.

Supported by

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