hiero-ledger / hiero-ledger/hiero-sdk-python

feat: Add async/await support for network calls

Open
#2,236 2 comments 0 reactions 0 assignees View on GitHub
dev: blocked status: discussion
Dominant language
Python
Stars
63
Forks
298
Avg merge
3d 18h
Merged PRs (30d)
38

Description

## Summary
The current SDK executes all gRPC network calls synchronously (blocking). Python 3.10+ has mature asyncio support and modern Python applications expect non-blocking I/O for network operations.

## Current Behavior
All calls like `client.execute(transaction)` block the calling thread until the node responds. This makes the SDK incompatible with async frameworks (FastAPI, aiohttp, async Django, etc.).

## Expected Behavior
An async variant of the execute path should be available:
```python
result = await client.execute_async(transaction)
balance = await AccountBalanceQuery().set_account_id(account_id).execute_async(client)
```

## Motivation
- Async Python is the standard for I/O-bound applications
- Hedera's own JS/Java SDKs support async patterns
- Blocking calls in async contexts cause event loop stalls

## Suggested Approach
- Wrap existing gRPC stubs with `grpc.aio` channel variants
- Expose `execute_async()` alongside existing `execute()` for backwards compatibility
- Add async examples to the `examples/` directory

## Environment
- SDK version: v0.2.6
- Python: 3.10+

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.