Skip to main content

Async crypto pay api wrapper for t.me/cryptobot

Project description

async-crypto-pay-api

PyPI version Python versions License

Async Crypto Pay API wrapper for Telegram Crypto Bot written in Python 3.10+.

Requirements

  • Python 3.10 or higher
  • Valid Crypto Bot API token (get one here)

Installation

pip install async-crypto-pay-api

Example

from asyncio import run
from async_crypto_pay_api import CryptoPayApi
from async_crypto_pay_api.models import CurrencyType, FiatAsset

crypto = CryptoPayApi("{token}")

async def main() -> None:
    # Context manager handles connection lifecycle
    async with crypto:
        app_info = await crypto.get_me()
        print(app_info.model_dump_json(indent=4))

        # Create payment invoice
        invoice = await crypto.create_invoice(
            currency_type=CurrencyType.FIAT,
            fiat=FiatAsset.USD,
            amount=100,
        )
        print(f"Invoice URL: {invoice.bot_invoice_url}")

run(main())

License

This project is licensed under the GNU Lesser General Public License v3.0 only. See LICENSE for details.

Contributing

Contributions are welcome! Please open an issue or submit a PR for:

  • Bug fixes
  • New features
  • Documentation improvements

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

async_crypto_pay_api-1.2.0.tar.gz (61.0 kB view details)

Uploaded Source

Built Distribution

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

async_crypto_pay_api-1.2.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file async_crypto_pay_api-1.2.0.tar.gz.

File metadata

File hashes

Hashes for async_crypto_pay_api-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f43730462bcae012c7f1b1d9dde8d0f5ec79eb3dce31e75bf457b2bc69dc114f
MD5 c2dc5a4f5d62ac066ea52e3583600deb
BLAKE2b-256 c187ba746305abe3869837c3779fcd524316de8489f0ea33333c55ef4790c1f1

See more details on using hashes here.

File details

Details for the file async_crypto_pay_api-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for async_crypto_pay_api-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39e436bce29f291c07955b9878272b008ffab11761fce4fbc09de0aece7e6dab
MD5 c7276dc22b5f3080bd9a8f9957f2e799
BLAKE2b-256 e4df802f99868cc82908758d3888a0e5b477c4f62cef1acbfb09517a267b0b4b

See more details on using hashes here.

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