# Sui Agent

> Paid AI agent for Sui blockchain analysis — query objects, check balances, inspect gas coins, look up transaction blocks, and get chain info across mainnet, devnet, and testnet. Powered by sui client CLI. Accepts USDC payment via x402 protocol.

## Skills

| Skill | Price | Description |
|-------|-------|-------------|
| Object Query | $0.001 | Look up any Sui object by ID — type, owner, version, and content across mainnet/devnet/testnet. |
| Balance Check | $0.001 | Check SUI balance and gas coin details for any address. |
| Transaction Lookup | $0.001 | Look up a transaction block by digest — status, gas cost, effects, and events. |
| Network Info | $0.001 | Get Sui network information — chain identifier, dynamic fields, and environment listing. |

- **Object Query** (`object_query`, $0.001): Look up any Sui object by ID — type, owner, version, and content across mainnet/devnet/testnet.
  - Examples: "Show object 0x2::coin::Coin<0x2::sui::SUI>", "List all objects owned by this address on devnet"
- **Balance Check** (`balance_check`, $0.001): Check SUI balance and gas coin details for any address.
  - Examples: "What's the SUI balance of this address?", "Show gas coins for this address on testnet"
- **Transaction Lookup** (`transaction_lookup`, $0.001): Look up a transaction block by digest — status, gas cost, effects, and events.
  - Examples: "Show transaction block for digest abc123...", "What happened in this transaction on mainnet?"
- **Network Info** (`network_info`, $0.001): Get Sui network information — chain identifier, dynamic fields, and environment listing.
  - Examples: "What chain ID is this?", "List configured Sui environments"

## Payment

- Protocol: x402 (HTTP 402 Payment Required)
- Network: eip155:8453
- Asset: USDC
- Default price: $0.001
- Pay to: 0xa016f608aDb394B861A6a6282Ac3cB842d43d25C
- Facilitator: https://api.cdp.coinbase.com/platform/v2/x402

### Flow

1. POST / with A2A JSON-RPC task request
2. Receive HTTP 402 + `PAYMENT-REQUIRED` header with payment details
3. Sign USDC authorization (EIP-712) on eip155:8453
4. Retry the same request with `X-PAYMENT` header containing signed proof
5. Receive 200 response with task result

## Endpoints

| Method | Path | Paid | Description |
|--------|------|------|-------------|
| POST | / | Yes ($0.001) | A2A JSON-RPC task execution |
| GET | /.well-known/agent-card.json | No | A2A agent card |
| GET | /discovery | No | JSON service discovery |
| GET | /llms.txt | No | This document |
| GET | /health | No | Health check |

## Integration

```python
import httpx

resp = httpx.post("https://aliasai.io/sui/", json={
    "jsonrpc": "2.0",
    "method": "message/send",
    "params": {
        "message": {
            "role": "user",
            "parts": [{"kind": "text", "text": "YOUR PROMPT HERE"}]
        }
    },
    "id": "1"
})
# Returns 402 if payment required, 200 with result if paid
```

## Standards

- [A2A Protocol](https://a2a-protocol.org) — Agent-to-Agent communication
- [x402](https://x402.org) — HTTP-native payment protocol
- [ERC-8004](https://eips.ethereum.org/EIPS/eip-8004) — Trustless AI agent registry
- [llms.txt](https://llmstxt.org) — LLM-friendly documentation standard
