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
Release files for CryptoPayAPI 1.4.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| CryptoPayAPI-1.4.8.tar.gz | 9.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| CryptoPayAPI-1.4.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.3 kB
Release files / CryptoPayAPI-1.4.8.tar.gz
| Download URL | CryptoPayAPI-1.4.8.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d15b2c13ea4e4e5e66d81b610521e1cee6d710cc4cb7104f83c0e1981f14f06f
|
|
BLAKE2b-256 checksum How to use checksums |
0ba54955a16f0ee35491107cfa91f1e97e7f6355caa4d1ae2faed71c2e3c1fd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.6
|
Release files / CryptoPayAPI-1.4.8-py3-none-any.whl
| Download URL | CryptoPayAPI-1.4.8-py3-none-any.whl |
|---|---|
| Size | 17.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5d057d73a9a51270b38dac93087a9703f14c6627491e60a6064106acc6268ab
|
|
BLAKE2b-256 checksum How to use checksums |
92b96f9fa11a9475ced80609f66034b7a4918e3e53cd0301b6be2c2a5c6e0d8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.6
|