Metadata-Version: 2.4
Name: hookmind
Version: 0.1.2
Summary: HookMind Protocol SDK — AI-powered dynamic fees and IL insurance for Uniswap v4 on Unichain
Project-URL: Homepage, https://hookmind.xyz
Project-URL: Repository, https://github.com/ticketsafe4-5687/HookMind
Project-URL: Issues, https://github.com/ticketsafe4-5687/HookMind/issues
Project-URL: Changelog, https://github.com/ticketsafe4-5687/HookMind/blob/main/packages/sdk-python/CHANGELOG.md
Author-email: HookMind Protocol Contributors <neuralsol7@gmail.com>
License: MIT License
        
        Copyright (c) 2026 HookMind Protocol Contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: ai,defi,hookmind,impermanent-loss,liquidity,unichain,uniswap,v4
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: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: eth-account>=0.11.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: web3>=6.0
Requires-Dist: websockets>=12.0
Provides-Extra: dev
Requires-Dist: mypy>=1.9; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Description-Content-Type: text/markdown

# hookmind (Python)

Python SDK for the [HookMind Protocol](https://hookmind.xyz) — AI-powered dynamic fees and impermanent loss insurance for Uniswap v4 on Unichain.

## Install

```bash
pip install hookmind
```

Requires Python ≥ 3.10.

## Quick start

```python
import asyncio
from hookmind import Agent

async def main():
    async with Agent(api_key="hm_your_key") as agent:
        # Health check
        pong = await agent.ping()
        print(pong.version, pong.chain_id)

        # Live pool state
        pools = await agent.get_pools()
        fee   = await agent.get_fee(pools[0].pool_id)
        print(f"Current fee: {fee.current_fee} bps → recommended: {fee.recommended_fee} bps")

        # IL Insurance vault
        stats = await agent.get_vault_stats()
        quote = await agent.get_quote("0xYourLPAddress")
        print(f"Premium: {quote.premium} USDC  Max payout: {quote.max_payout} USDC")

asyncio.run(main())
```

## Class reference

### `Agent`

```python
from hookmind import Agent

agent = Agent(
    api_key="hm_your_key",
    api_url="https://hookmind-api.fly.dev",  # optional
    timeout=30.0,                             # optional, seconds
)
# Use as async context manager (recommended) or call await agent.close() manually
```

#### Signals
```python
signals = await agent.get_signals(limit=20)
signal  = await agent.submit_signal(
    signal={
        "poolId": "0xb60e6d...",
        "fee": 500,
        "volatilityScore": 4500,
        "nonce": 1,
        "chainId": 1301,
    },
    private_key_hex="0x_your_key",
)
```

#### Pools & fees
```python
pools = await agent.get_pools()
pool  = await agent.get_pool("0xb60e6d...")
fee   = await agent.get_fee("0xb60e6d...")
sim   = await agent.simulate_fee(SimulateParams(base_fee=300, sigma2=5000, sigma2_max=10000))
```

#### IL Insurance vault
```python
stats = await agent.get_vault_stats()
quote = await agent.get_quote("0xLP...", tick_lower=-887272, tick_upper=887272)
```

#### Operators
```python
operators = await agent.get_operators()
operator  = await agent.get_operator("0xAddress")
await agent.register_operator("0x_ecdsa_public_key")
```

#### Real-time WebSocket stream
```python
async for event in agent.listen():
    print(event["type"], event["data"])
```

### Types

```python
from hookmind import (
    Signal, PoolData, FeeRecommendation,
    SimulateParams, SimulationResult,
    VaultStats, ILQuote,
    Operator, ApiKey, PingResult,
    HookMindError,
)
```

## Error handling

```python
from hookmind import HookMindError

try:
    pool = await agent.get_pool("0xbad...")
except HookMindError as e:
    print(e.code, e.status, str(e))
```

## Links

- [Protocol docs](https://hookmind.xyz/docs)
- [TypeScript SDK](https://npmjs.com/package/hookmind)
- [GitHub](https://github.com/ticketsafe4-5687/HookMind)

## License

MIT © 2026 HookMind Protocol Contributors
