Asynchronous Python library for Heleket API
Project description
aioheleket
Asynchronous Python library for Heleket crypto payments.
pip
pip install aioheleket
uv
uv pip install aioheleket
Documentation
Official Heleket documentation
Features
Creating payment
import asyncio
from aioheleket import HeleketClient, Currency, Network, Lifetime
async def main() -> None:
client = HeleketClient(
merchant_id="<merchant_id>",
payment_api_key="<payment_api_key>"
)
payment_service = await client.payment()
payment = await payment_service.create_invoice(
currency=Currency.USDT,
network=Network.ETH,
order_id="order_3331",
amount="2",
lifetime_sec=Lifetime.HOUR_2
)
print(payment.url, payment.uuid)
await client.close_session() # <!>
if __name__ == "__main__":
asyncio.run(main())
Transfer funds from a business wallet to a personal wallet
import asyncio
from aioheleket import HeleketClient, Currency
async def main() -> None:
client = HeleketClient(
merchant_id="<merchant_id>",
payout_api_key="<payout_api_key>"
)
payout_service = await client.payout()
transfer = await payout_service.personal_transfer(
currency=Currency.USDT,
amount="4"
)
print(transfer.user_wallet_transaction_uuid, transfer.user_wallet_balance)
await client.close_session() # <!>
if __name__ == "__main__":
asyncio.run(main())
Creating static wallet
import asyncio
from aioheleket import HeleketClient, Network, Currency
async def main() -> None:
client = HeleketClient(
merchant_id="<merchant_id>",
payment_api_key="<payment_api_key>"
)
wallet_service = await client.static_wallet()
wallet = await wallet_service.create(
currency=Currency.USDT,
network=Network.ETH,
order_id="wal_7342"
)
print(wallet.uuid, wallet.url)
await client.close_session() # <!>
if __name__ == "__main__":
asyncio.run(main())
Get the current exchange rate
import asyncio
from aioheleket import HeleketClient, Currency
async def main() -> None:
client = HeleketClient(
merchant_id="<merchant_id>",
payment_api_key="<payment_api_key>"
)
finance_service = await client.finance()
rates = await finance_service.exchange_rate(Currency.BTC, ("RUB", Currency.TRX, "KZT"))
print(rates) # output BTC exchange rate only for RUB, KZT, TRX
all_rates = await finance_service.exchange_rate(Currency.BTC)
print(all_rates) # output all exchange rate for BTC
await client.close_session() # <!>
if __name__ == "__main__":
asyncio.run(main())
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
aioheleket-1.1.0.tar.gz
(10.8 kB
view details)
File details
Details for the file aioheleket-1.1.0.tar.gz.
File metadata
- Download URL: aioheleket-1.1.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca958e68bca67cfb8a8d05e2e626c8dcb765a81bb5c570f38297494782c282e8
|
|
| MD5 |
573f69227d6631f59b0e8eee68608733
|
|
| BLAKE2b-256 |
a5255d70a5b7eeda8042b5ca5fd13e628e54141c54f4c9f30969c6ccd85e558f
|