# Seal Of Hermeto: Backend/Admin Spec

This extension now calls these API endpoints on `API_BASE`:

1. `GET /seal/status/:tokenAddress`
2. `POST /seal/vote`

## Expected `GET /seal/status/:tokenAddress` behavior

Inputs:
- Path: `tokenAddress`
- Query:
  - `installId`
  - `fingerprint` (JSON string)
  - `creatorAddress` (optional)
  - `tokenSymbol` (optional)
  - `tokenAgeDays` (optional)

Response JSON:
```json
{
  "success": true,
  "votes": 12,
  "isOnSeal": false,
  "canVote": true,
  "message": ""
}
```

## Expected `POST /seal/vote` behavior

Request JSON:
```json
{
  "tokenAddress": "So11111111111111111111111111111111111111112",
  "tokenSymbol": "SOL",
  "creatorAddress": "CreatorWallet111111111111111111111111111111",
  "userIP": "1.2.3.4",
  "installId": "uuid",
  "fingerprint": { "userAgent": "...", "platform": "..." }
}
```

Response JSON:
```json
{
  "success": true,
  "votes": 13,
  "isOnSeal": false,
  "canVote": false,
  "message": "Vote recorded"
}
```

Recommended rule:
- One vote per `(tokenAddress, installId)`; optionally also enforce by IP/fingerprint.
- If token is already in seal (`is_on_seal=true`), return `isOnSeal=true`, `canVote=false`.

## Admin sections required

1. `Seal Of Hermeto` (approved list)
- Add button: input `tokenAddress`, backend auto-fills `ticker` and `creatorAddress`.
- Save with `is_on_seal = true`.

2. `Seal Candidates` (community votes)
- Show: `tokenAddress`, `ticker`, `creatorAddress`, `votes`, latest voter IP.
- Action button: grant seal (moves/marks token into approved list).

## Suggested SQL

Use the SQL in `scripts/seal_of_hermeto.sql`.
