Skip to main content

Simple library for https://t.me/CryptoBot

Project description

CryptoPayAPI

Simple library for https://t.me/CryptoBot

Installation

$ pip install CryptoPayAPI

Usage

Asynchronous

from CryptoPayAPI.AioCryptoPay import AioCryptoPay
from CryptoPayAPI.types.asset import USDT

import asyncio

async def main():
    # create session
    cryptopay = AioCryptoPay(
        token="token",
        is_test_net=True
    )

    await cryptopay.get_balance()

    invoice = await cryptopay.create_invoice(amount=1, asset=USDT)
    print(invoice.bot_invoice_url)

    await cryptopay.close()

asyncio.run(main())

Synchronous

from CryptoPayAPI.CryptoPay import CryptoPay
from CryptoPayAPI.types.asset import BTC

# create session
cryptopay = CryptoPay(
    token="token"
)

cryptopay.get_balance()

invoice = cryptopay.create_invoice(amount=0.3, asset=BTC)
print(invoice.bot_invoice_url)

Docs

The library is fully compatible with the official api - https://help.crypt.bot/crypto-pay-api

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

CryptoPayAPI-1.4.8.tar.gz (9.9 kB view hashes)

Uploaded Source

Built Distribution

CryptoPayAPI-1.4.8-py3-none-any.whl (17.4 kB view hashes)

Uploaded Python 3

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