No project description provided
Project description
Crypto Cloud SDK — простая асинхронная библиотека для работы с API CryptoCloud
💡 Регистрация мерчанта и получение API ключей описаны в документации
Установка библиотеки / Install
pip install cryptocloud-sdk
Примеры использования / Use cases
import asyncio
from datetime import date, timedelta
from cryptocloud_sdk import CryptoCloud, dto, errors
async def main():
merchant = CryptoCloud(
api_token="YOUR_API_TOKEN",
shop_id="YOUR_SHOP_ID"
)
invoice: dto.CreatedInvoice = await merchant.create_invoice(
invoice=dto.InvoiceInput(
amount=250,
currency="USD" # or dto.currency.SupportedFiatCurrency.USD
)
)
print(f"Invoice url is {invoice.link}")
invoices: list[dto.InvoiceInfo] = await merchant.get_invoices(uuids=[invoice.uuid])
canceled = await merchant.cancel_invoice(invoice.uuid)
balances: list[dto.CoinBalance] = await merchant.get_balance()
statictics: dto.Stats = await merchant.get_stats(
start=date.today() - timedelta(days=3),
end=date.today()
)
static_wallet: dto.StaticWallet = await merchant.create_static_wallet(
currency="BTC", # or dto.currency.SupportedCryptoCurrency.BTC ,
identify="my-new-user-7"
)
# Handling errors
try:
await merchant.get_balance()
except errors.UnauthorizedError:
... # your code
except errors.ForbiddenError:
... # your code
except errors.BadRequestError:
... # your code
if __name__ == "__main__":
asyncio.run(main())
Want to donate? Look at real app used CryptoCloud 😎
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
cryptocloud_sdk-0.1.1.tar.gz
(4.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cryptocloud_sdk-0.1.1.tar.gz.
File metadata
- Download URL: cryptocloud_sdk-0.1.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.13.1 Linux/6.12.10-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdeb3aa9063fe4f75869f51ef0d8cd3e2d3f8be8989b3ebd17597ff96dabbc95
|
|
| MD5 |
cad9ceb29031fe53a123ad9a22ac3e63
|
|
| BLAKE2b-256 |
7af7b3a5f9c46cb8b5d3280a999dc5e8a93cb7f87f90ef8d05d5c84573a20032
|
File details
Details for the file cryptocloud_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cryptocloud_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.13.1 Linux/6.12.10-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a435bea93f8c33bba27b89e44ba134cdd788ccd69f9d649100e1e2b7eb96762e
|
|
| MD5 |
1b126bdd26502f3d24c40a84b2d8e5cf
|
|
| BLAKE2b-256 |
147368f50051eb5a1ca759f63ab4b8d305de3dd63864253bcc83b934e3902bc2
|