Simple libary 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 import Asset
import asyncio
async def main():
#create session
cryptopay = AioCryptoPay(token="token")
#get balance wallets
await cryptopay.get_balance()
#create invoice
invoice = await cryptopay.create_invoice(asset=Asset.BTC, amount=10)
print(invoice.pay_url)
#get list of inovices
invoices = await cryptopay.get_invoices(asset=Asset.TON)
#close session
await cryptopay.close()
asyncio.run(main())
Synchronous
from CryptoPayAPI.CryptoPay import CryptoPay
from CryptoPayAPI.types import Asset
# create session
cryptopay = CryptoPay(token="token")
# get balance wallets
cryptopay.get_balance()
# create invoice
invoice = cryptopay.create_invoice(asset=Asset.BTC, amount=10)
print(invoice.pay_url)
# get list of inovices
invoices = cryptopay.get_invoices(asset=Asset.TON)
Docs
The library is fully compatible with the official api - https://help.crypt.bot/crypto-pay-api
Donation
BTC - bc1qltq6d7lzprr9hhpya4pptwj3997gpwkzhulksh
ETH - 0x6727e912855A289A340Ba1213E1038AdB0E3CDb9
USDT (TRC20) - TH5JtPd7siwCb4AnHyGniMz52gtysY3zEJ
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-0.0.2.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for CryptoPayAPI-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9d643f5e2829da4ae43019159b48bcb0c416a7a1a8d0fe0588dfd9b6411f521 |
|
MD5 | 606bee61302cb9cff9b96ea84ee1958e |
|
BLAKE2b-256 | fad1249fd2e36a8c5c29c8969b535eb9738606dbde276a17cf5b88d08a22e288 |