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 details)
Built Distribution
File details
Details for the file CryptoPayAPI-1.4.8.tar.gz
.
File metadata
- Download URL: CryptoPayAPI-1.4.8.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d15b2c13ea4e4e5e66d81b610521e1cee6d710cc4cb7104f83c0e1981f14f06f |
|
MD5 | 1af571831a09364e227276a5e919ac32 |
|
BLAKE2b-256 | 0ba54955a16f0ee35491107cfa91f1e97e7f6355caa4d1ae2faed71c2e3c1fd3 |
File details
Details for the file CryptoPayAPI-1.4.8-py3-none-any.whl
.
File metadata
- Download URL: CryptoPayAPI-1.4.8-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5d057d73a9a51270b38dac93087a9703f14c6627491e60a6064106acc6268ab |
|
MD5 | ad8a7fe1b918475572ca392c4bc83f16 |
|
BLAKE2b-256 | 92b96f9fa11a9475ced80609f66034b7a4918e3e53cd0301b6be2c2a5c6e0d8f |