# Jito Async SDK
<div align="center">
[![PyPI version](https://badge.fury.io/py/jito-async.svg)](https://badge.fury.io/py/jito-async)
[![Python](https://img.shields.io/pypi/pyversions/jito-async.svg)](https://pypi.org/project/jito-async/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
🚀 A modern, async Python SDK for interacting with Jito Block Engine
</div>
## Features
- 🔄 **Full async/await support** with proper resource management
- 🛡️ **Type hints** for better IDE support and code safety
- 🎯 **Simple, intuitive API** for all Block Engine endpoints
- 🔒 **Built-in authentication** via environment variables
- 🐛 **Comprehensive error handling** with custom exceptions
- 📦 **Zero configuration needed** - works out of the box with mainnet
## Installation
```bash
pip install jito-async
```
Or with Poetry (recommended):
```bash
poetry add jito-async
```
## Quick Start
```python
import asyncio
from jito_async import JitoJsonRpcSDK
async def main():
# Initialize with default mainnet URL
async with JitoJsonRpcSDK() as jito:
# Get tip accounts
tip_accounts = await jito.get_tip_accounts()
print(f"Found {len(tip_accounts['data']['result'])} tip accounts")
# Get a random tip account
random_account = await jito.get_random_tip_account()
print(f"Random tip account: {random_account}")
if __name__ == "__main__":
asyncio.run(main())
```
## Authentication
To use authentication, pass an environment variable name containing your UUID:
```python
# Set your UUID in environment
import os
os.environ["JITO_AUTH_TOKEN"] = "your-uuid-here"
# Use it in the SDK
jito = JitoJsonRpcSDK(uuid_var="JITO_AUTH_TOKEN")
```
## API Reference
### Initialization
```python
JitoJsonRpcSDK(
url: Optional[str] = None, # Defaults to mainnet: https://mainnet.block-engine.jito.wtf
uuid_var: Optional[str] = None # Environment variable name for auth token
)
```
### Methods
#### Get Tip Accounts
```python
async def get_tip_accounts() -> Dict:
"""Get tip accounts from the Block Engine."""
```
#### Get Random Tip Account
```python
async def get_random_tip_account() -> Optional[str]:
"""Get a random tip account."""
```
#### Get Bundle Statuses
```python
async def get_bundle_statuses(bundle_uuids: Union[str, List[str]]) -> Dict:
"""Get bundle statuses."""
```
#### Send Bundle
```python
async def send_bundle(params: Any = None) -> Dict:
"""Send a bundle to the Block Engine."""
```
#### Get Inflight Bundle Statuses
```python
async def get_inflight_bundle_statuses(bundle_uuids: Union[str, List[str]]) -> Dict:
"""Get inflight bundle statuses."""
```
#### Send Transaction
```python
async def send_txn(params: Any = None, bundle_only: bool = False) -> Dict:
"""Send a transaction to the Block Engine."""
```
## Error Handling
The SDK provides custom exceptions for better error handling:
```python
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}")
```
## Development
Clone the repository and install dependencies:
```bash
git clone https://github.com/ChefJodlak/jito-async.git
cd jito-async
poetry install
```
Run tests:
```bash
poetry run pytest
```
Format code:
```bash
poetry run black .
poetry run isort .
```
Type check:
```bash
poetry run mypy .
```
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/ChefJodlak/jito-async",
"name": "jito-async",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "jito, solana, blockchain, async, sdk",
"author": "ChefJodlak",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/2d/bc/b51c16152437657a57f5cb6e097ed0e70b905ae19a330d61f2d628e8143d/jito_async-0.1.4.tar.gz",
"platform": null,
"description": "# Jito Async SDK\n\n<div align=\"center\">\n\n[![PyPI version](https://badge.fury.io/py/jito-async.svg)](https://badge.fury.io/py/jito-async)\n[![Python](https://img.shields.io/pypi/pyversions/jito-async.svg)](https://pypi.org/project/jito-async/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n\ud83d\ude80 A modern, async Python SDK for interacting with Jito Block Engine\n</div>\n\n## Features\n\n- \ud83d\udd04 **Full async/await support** with proper resource management\n- \ud83d\udee1\ufe0f **Type hints** for better IDE support and code safety\n- \ud83c\udfaf **Simple, intuitive API** for all Block Engine endpoints\n- \ud83d\udd12 **Built-in authentication** via environment variables\n- \ud83d\udc1b **Comprehensive error handling** with custom exceptions\n- \ud83d\udce6 **Zero configuration needed** - works out of the box with mainnet\n\n## Installation\n\n```bash\npip install jito-async\n```\n\nOr with Poetry (recommended):\n\n```bash\npoetry add jito-async\n```\n\n## Quick Start\n\n```python\nimport asyncio\nfrom jito_async import JitoJsonRpcSDK\n\nasync def main():\n # Initialize with default mainnet URL\n async with JitoJsonRpcSDK() as jito:\n # Get tip accounts\n tip_accounts = await jito.get_tip_accounts()\n print(f\"Found {len(tip_accounts['data']['result'])} tip accounts\")\n \n # Get a random tip account\n random_account = await jito.get_random_tip_account()\n print(f\"Random tip account: {random_account}\")\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\n## Authentication\n\nTo use authentication, pass an environment variable name containing your UUID:\n\n```python\n# Set your UUID in environment\nimport os\nos.environ[\"JITO_AUTH_TOKEN\"] = \"your-uuid-here\"\n\n# Use it in the SDK\njito = JitoJsonRpcSDK(uuid_var=\"JITO_AUTH_TOKEN\")\n```\n\n## API Reference\n\n### Initialization\n\n```python\nJitoJsonRpcSDK(\n url: Optional[str] = None, # Defaults to mainnet: https://mainnet.block-engine.jito.wtf\n uuid_var: Optional[str] = None # Environment variable name for auth token\n)\n```\n\n### Methods\n\n#### Get Tip Accounts\n```python\nasync def get_tip_accounts() -> Dict:\n \"\"\"Get tip accounts from the Block Engine.\"\"\"\n```\n\n#### Get Random Tip Account\n```python\nasync def get_random_tip_account() -> Optional[str]:\n \"\"\"Get a random tip account.\"\"\"\n```\n\n#### Get Bundle Statuses\n```python\nasync def get_bundle_statuses(bundle_uuids: Union[str, List[str]]) -> Dict:\n \"\"\"Get bundle statuses.\"\"\"\n```\n\n#### Send Bundle\n```python\nasync def send_bundle(params: Any = None) -> Dict:\n \"\"\"Send a bundle to the Block Engine.\"\"\"\n```\n\n#### Get Inflight Bundle Statuses\n```python\nasync def get_inflight_bundle_statuses(bundle_uuids: Union[str, List[str]]) -> Dict:\n \"\"\"Get inflight bundle statuses.\"\"\"\n```\n\n#### Send Transaction\n```python\nasync def send_txn(params: Any = None, bundle_only: bool = False) -> Dict:\n \"\"\"Send a transaction to the Block Engine.\"\"\"\n```\n\n## Error Handling\n\nThe SDK provides custom exceptions for better error handling:\n\n```python\nfrom jito_async import JitoError, JitoConnectionError, JitoResponseError\n\ntry:\n result = await jito.send_bundle(params={\"your\": \"bundle_data\"})\nexcept JitoConnectionError as e:\n print(f\"Connection error: {e}\")\nexcept JitoResponseError as e:\n print(f\"API error: {e}\")\nexcept JitoError as e:\n print(f\"General error: {e}\")\n```\n\n## Development\n\nClone the repository and install dependencies:\n\n```bash\ngit clone https://github.com/ChefJodlak/jito-async.git\ncd jito-async\npoetry install\n```\n\nRun tests:\n```bash\npoetry run pytest\n```\n\nFormat code:\n```bash\npoetry run black .\npoetry run isort .\n```\n\nType check:\n```bash\npoetry run mypy .\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.",
"bugtrack_url": null,
"license": "MIT",
"summary": "Async Python SDK for Jito Block Engine",
"version": "0.1.4",
"project_urls": {
"Homepage": "https://github.com/ChefJodlak/jito-async",
"Repository": "https://github.com/ChefJodlak/jito-async"
},
"split_keywords": [
"jito",
" solana",
" blockchain",
" async",
" sdk"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9bc00d4e564ab42dd0fc527a3fcb1a3fdf9a170ae13cb61187506c5a92f14c43",
"md5": "7f71c57853dacb4808b5c550ca981420",
"sha256": "56efe161a5959e451c7d9a5b219485975c6b204b5e8fbe1b2be11661225f95cc"
},
"downloads": -1,
"filename": "jito_async-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7f71c57853dacb4808b5c550ca981420",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 6068,
"upload_time": "2025-01-31T23:26:15",
"upload_time_iso_8601": "2025-01-31T23:26:15.611682Z",
"url": "https://files.pythonhosted.org/packages/9b/c0/0d4e564ab42dd0fc527a3fcb1a3fdf9a170ae13cb61187506c5a92f14c43/jito_async-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2dbcb51c16152437657a57f5cb6e097ed0e70b905ae19a330d61f2d628e8143d",
"md5": "47124d0f6e694a86e895b195df15c21e",
"sha256": "aad93aa94faf34b39fa36a654a21c98c4c5d37a98b83ad9ec17241b672e41238"
},
"downloads": -1,
"filename": "jito_async-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "47124d0f6e694a86e895b195df15c21e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 5078,
"upload_time": "2025-01-31T23:26:17",
"upload_time_iso_8601": "2025-01-31T23:26:17.236531Z",
"url": "https://files.pythonhosted.org/packages/2d/bc/b51c16152437657a57f5cb6e097ed0e70b905ae19a330d61f2d628e8143d/jito_async-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-31 23:26:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ChefJodlak",
"github_project": "jito-async",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "jito-async"
}