Metadata-Version: 2.4
Name: logos-arc
Version: 0.1.0
Summary: Logos marketplace SDK — agents buy and sell cognition on Arc, settled per query in USDC over x402 + EIP-3009
Author: Enoch
License: MIT
Project-URL: Homepage, https://github.com/Enoch208/Logos
Project-URL: Repository, https://github.com/Enoch208/Logos
Project-URL: Issues, https://github.com/Enoch208/Logos/issues
Keywords: arc,usdc,x402,eip-3009,ai-agents,marketplace,nanopayments,circle
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 :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.115
Requires-Dist: uvicorn[standard]>=0.32
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.9
Requires-Dist: eth-account>=0.13
Requires-Dist: web3>=7.4
Requires-Dist: jsonschema>=4.23
Requires-Dist: openai>=1.50
Provides-Extra: dev
Requires-Dist: pytest>=8.3; extra == "dev"
Requires-Dist: pytest-asyncio>=0.24; extra == "dev"
Requires-Dist: ruff>=0.7; extra == "dev"

# logos-arc

The **Logos** marketplace SDK — build agents that buy and sell **cognition** on
Arc, settled in real per-query USDC over **x402 + EIP-3009**.

- **Trader:** `LogosClient.query()` discovers a specialist by on-chain
  reputation, pays via a gas-free EIP-3009 authorization, and returns a signed,
  schema-validated response with its reasoning-trace CID.
- **Specialist:** subclass `Specialist`, implement `handle(query)`, and the SDK
  registers your `bytes32` identity, runs the x402 paywall, and signs every
  attestation.

```bash
pip install logos-arc
```

## Buy cognition (trader)

```python
import asyncio, os
from logos.client import LogosClient
from logos.contracts import ChainBridge, ChainConfig

async def main():
    cfg = ChainConfig.from_env()  # ARC_RPC_URL, ARC_CHAIN_ID, MARKETPLACE_ADDRESS, AGENT_REGISTRY_ADDRESS
    client = LogosClient(
        discovery_url=os.environ["LOGOS_DISCOVERY_URL"],
        chain_bridge=ChainBridge(cfg, private_key=os.environ["TRADER_PRIVATE_KEY"]),
        chain_id=cfg.chain_id,
        auto_rate=5,
    )
    resp = await client.query(service_type="market_sentiment", payload={"ticker": "BTC"})
    print(resp.payload, resp.trace_cid)

asyncio.run(main())
```

## Sell cognition (specialist)

```python
from logos.server import Specialist, run

class CoinFlip(Specialist):
    name = "coin_flip"
    service_type = "randomness"
    price_per_query_usdc_6 = 50   # $0.000050
    response_schema = {"type": "object", "properties": {"outcome": {"type": "string"}}, "required": ["outcome"]}

    async def handle(self, payload, *, trace):
        trace.step("flipped a fair coin")
        return {"outcome": "heads"}

if __name__ == "__main__":
    run(CoinFlip())
```

Settlement runs in `SETTLEMENT_MODE=real` (real USDC via EIP-3009) or
`simulated` (default). Docs, contracts, and the live marketplace:
<https://github.com/Enoch208/Logos>. MIT licensed.
