Metadata-Version: 2.4
Name: ombrachain
Version: 0.1.0
Summary: Official Python SDK for OmbraChain — REST/WS/SSE client, wallet, tx builders, encrypted storage
Project-URL: Homepage, https://docs.ombra-net.com
Project-URL: Documentation, https://docs.ombra-net.com/dev-guide/sdk-python
Project-URL: Repository, https://github.com/Ombra-Studios/ombrachain-sdk-py
Project-URL: Issues, https://github.com/Ombra-Studios/ombrachain-sdk-py/issues
Author-email: OmbraChain <team@ombra-net.com>
License: MIT
License-File: LICENSE
Keywords: ai,bip39,blockchain,ed25519,ombrachain,sdk,wallet
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Distributed Computing
Requires-Python: >=3.10
Requires-Dist: bip-utils>=2.9.3
Requires-Dist: cryptography>=42.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: mnemonic>=0.21
Requires-Dist: pynacl>=1.5.0
Requires-Dist: sseclient-py>=1.8.0
Requires-Dist: websockets>=12.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest-httpx>=0.30; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# ombrachain

Official **Python SDK** for [OmbraChain](https://ombra-net.com) — Proof of AI Tokens Used blockchain with native AI compute pool.

[![PyPI](https://img.shields.io/pypi/v/ombrachain.svg)](https://pypi.org/project/ombrachain/)
[![Python](https://img.shields.io/pypi/pyversions/ombrachain.svg)](https://pypi.org/project/ombrachain/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

- REST clients for all mainnet endpoints
- Wallet (BIP39 + HD `m/44'/7777'/0'/0/*` + Ed25519)
- All 11 tx builders with bit-exact-match signatures cu TS SDK
- EncryptedStorage (AES-256-GCM + PBKDF2 100k iter)
- Async WebSocket + SSE streaming

## Install

```bash
pip install ombrachain
```

## Quick start

### Check balance

```python
from ombrachain import OmbraClient

client = OmbraClient("https://api.ombra-net.com")
account = client.chain.get_account("5bb5c50f185363cf913f93a18c6837c20d720a69")
print(f"balance: {account['balance']} micro-OMBRA, nonce: {account['nonce']}")
```

### Create wallet + send OMBRA

```python
from ombrachain import OmbraClient, Wallet

client = OmbraClient("https://api.ombra-net.com")

wallet = Wallet.generate()          # new BIP39 12-word
print("address:", wallet.address)
print("mnemonic (BACKUP!):", wallet.mnemonic)

# SAU
wallet = Wallet.from_mnemonic("twelve word mnemonic ...")

result = client.send(wallet, to="abc...", amount=1_000_000, fee=10_000)
print("tx hash:", result["hash"])
```

### Submit AI task

```python
result = client.submit_task(
    wallet,
    prompt="Explain Proof of AI Tokens Used in 100 words",
    task_type="chat",
    fee=500_000,
)
print("task ID:", result["task_id"])

# Poll for result
import time
while True:
    task = client.tasks.get_detailed(result["task_id"])
    if task["status"] in ("completed", "failed"):
        break
    time.sleep(5)
print("result:", task.get("result"))
```

### Subscribe to new blocks (async)

```python
import asyncio
from ombrachain import OmbraClient

async def main():
    client = OmbraClient("https://api.ombra-net.com")
    async with client.subscribe_chain() as sub:
        async for evt in sub:
            if evt["type"] == "block":
                print("new block:", evt["block"]["index"])

asyncio.run(main())
```

### Encrypted wallet storage

```python
from ombrachain import Wallet, EncryptedStorage

storage = EncryptedStorage("wallet.enc")

wallet = Wallet.generate()
storage.save(wallet, "user-password-123")

# Later
loaded = storage.load("user-password-123")
print(loaded.address)
```

## Cross-language compatibility

Tx-uri semnate cu acest SDK sunt **bit-exact identice** cu cele semnate cu `@ombrachain/sdk` (TypeScript). Vector tests în `tests/test_cross_language.py` validează roundtrip TS ↔ Python pe mnemonic-uri și payload-uri fixe.

## License

MIT © OmbraChain
