Async Python SDK for Jito Block Engine
Project description
Jito Async SDK
An async Python SDK for interacting with Jito Block Engine.
Installation
pip install jito-async
Or with Poetry:
poetry add jito-async
Usage
Here's a simple example of how to use the SDK:
import asyncio
from jito_async import JitoJsonRpcSDK
async def main():
# Initialize the SDK
async with JitoJsonRpcSDK("https://your-jito-endpoint.com") as jito:
# Get tip accounts
tip_accounts = await jito.get_tip_accounts()
print(tip_accounts)
# Get a random tip account
random_account = await jito.get_random_tip_account()
print(random_account)
# Send a transaction
txn_result = await jito.send_txn(params={"your": "transaction_data"})
print(txn_result)
if __name__ == "__main__":
asyncio.run(main())
Features
- Async/await support
- Context manager for proper resource cleanup
- Type hints for better IDE support
- Proper error handling with custom exceptions
- Support for all Jito Block Engine endpoints:
- Get tip accounts
- Get bundle statuses
- Send bundles
- Get inflight bundle statuses
- Send transactions
Authentication
To use authentication, you can pass an environment variable name that contains your UUID:
jito = JitoJsonRpcSDK("https://your-jito-endpoint.com", uuid_var="JITO_UUID")
Error Handling
The SDK provides custom exceptions for better error handling:
from jito_async import JitoError, JitoConnectionError, JitoResponseError
try:
result = await jito.send_bundle(params={"your": "bundle_data"})
except JitoConnectionError as e:
print(f"Connection error: {e}")
except JitoResponseError as e:
print(f"API error: {e}")
except JitoError as e:
print(f"General error: {e}")
License
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 jito_async-0.1.0.tar.gz.
File metadata
- Download URL: jito_async-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.13.1 Darwin/24.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9bd7865140225b97cb110b996f2bec7096058f3cd1c75f706371037774226fb
|
|
| MD5 |
29c76128c1c3d46633b3eee2c970e0e0
|
|
| BLAKE2b-256 |
b37d2980a7c93d39cd0502aede3c853d5aeb1a2c02a95408750c4c432fad3ca4
|
File details
Details for the file jito_async-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jito_async-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.13.1 Darwin/24.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c49fb240c2b3a3f1dfa0bc385dea2c3e8853e8aff0218735250be053a5b8b71
|
|
| MD5 |
e9acc4830e2068f517cbe83e1c8c8f12
|
|
| BLAKE2b-256 |
16178a620ceec94b5f05ec8da80f261a3102977512a38d97986740c29de01583
|