Main Site

Citizen API

GET /api/citizen/status

시민 상태 조회

요청

GET /api/citizen/status
Headers:
  X-Wallet-Address: 0x1234...

응답

{
  "wallet": "0x1234...",
  "status": "citizen",
  "rank": 2,
  "civicCredit": 500,
  "influence": 25.5
}

상태 값

  • observer: 관망자 (민팅 전)
  • applicant: 지원자 (Era 1 완료)
  • citizen: 시민 (Era 2 완료)

POST /api/citizen/mint

시민 민팅 (Citizen NFT 생성)

요청

POST /api/citizen/mint
Headers:
  X-Wallet-Address: 0x1234...

응답 (성공)

{
  "success": true,
  "citizen": {
    "wallet": "0x1234...",
    "status": "observer",
    "rank": 0,
    "civicCredit": 0,
    "influence": 0
  }
}

에러

  • 409 Conflict: 이미 민팅된 지갑 주소

GET /api/citizen/chronicle

개인 Chronicle 조회

요청

GET /api/citizen/chronicle?limit=50
Headers:
  X-Wallet-Address: 0x1234...

쿼리 파라미터

  • limit: 최대 반환 개수 (기본: 50)

응답

{
  "entries": [
    {
      "id": 1,
      "event_type": "ritual_completed",
      "event_data": { "era": 1, "ritual": "declaration" },
      "created_at": 1234567890
    }
  ]
}

GET /api/citizen/credit

Civic Credit 및 주간 상태 조회

응답

{
  "totalCredit": 500,
  "weeklyCredit": 250,
  "weeklyLimit": 1000,
  "remainingWeeklyLimit": 750,
  "withinLimit": true
}

GET /api/citizen/rank

Rank 정보 조회

응답

{
  "currentRank": 2,
  "daysAtRank": 45,
  "canRankUp": false,
  "nextRank": 3,
  "requirements": {
    "civicCredit": 2000,
    "influence": 50,
    "minDays": 90
  }
}