# EmbiPay Python SDK

Client library for EmbiPay Admin and Agent APIs.

## Installation

```bash
pip install embipay
```

Or install from source for development:

```bash
git clone https://github.com/EmbiPay/EmbiPay-SDK-Python.git
cd EmbiPay-SDK-Python
pip install -e .
```

## Usage

### Admin API

```python
from embipay import EmbiPayAdmin

admin = EmbiPayAdmin(
    "https://embi-pay-dashboard.vercel.app",
    "your_admin_api_token"
)

# Create wallet
result = admin.create_wallet(owner_user_id="uuid-from-supabase-auth", balance=100)
wallet = result["wallet"]

# Create pool
result = admin.create_shared_pool("resource-123", 50)
pool = result["pool"]

# Contribute to pool
admin.contribute_to_pool(pool["pool_id"], wallet["agent_id"], 10, usage_limit=5)

# Approve loan
admin.approve_loan(5)

# Record repayment
admin.record_repayment(5, 100, "Paid in full")
```

### Agent API

```python
from embipay import EmbiPayAgent

agent = EmbiPayAgent(
    "https://embi-pay-dashboard.vercel.app",
    "your_agent_key"
)

tasks = agent.fetch_tasks()
agent.complete_task(tasks["tasks"][0]["id"], "completed", "Done")
```
