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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for CryptoPayAPI-1.4.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5d057d73a9a51270b38dac93087a9703f14c6627491e60a6064106acc6268ab |
|
MD5 | ad8a7fe1b918475572ca392c4bc83f16 |
|
BLAKE2b-256 | 92b96f9fa11a9475ced80609f66034b7a4918e3e53cd0301b6be2c2a5c6e0d8f |