City-State API
POST /api/citystate
City-State 생성
요청
POST /api/citystate
Headers:
X-Wallet-Address: 0x1234...
Content-Type: application/json
Body:
{
"name": "New City State",
"description": "A new city state",
"rules": { "custom": "rules" }
}응답
{
"cityState": {
"id": "city-state-id",
"name": "New City State",
"founder": "0x1234...",
"created_at": 1234567890
}
}GET /api/citystate
City-State 목록 조회
응답
{
"cityStates": [
{
"id": "city-state-id",
"name": "City State Name",
"founder": "0x1234...",
"memberCount": 50,
"created_at": 1234567890
}
]
}GET /api/citystate/:id
특정 City-State 조회
응답
{
"cityState": {
"id": "city-state-id",
"name": "City State Name",
"description": "Description",
"founder": "0x1234...",
"rules": { "custom": "rules" },
"memberCount": 50,
"created_at": 1234567890
}
}POST /api/citystate/:id/join
City-State 가입
요청
POST /api/citystate/city-state-id/join Headers: X-Wallet-Address: 0x1234...
응답
{
"member": {
"cityStateId": "city-state-id",
"walletAddress": "0x1234...",
"joinedAt": 1234567890
}
}GET /api/citystate/:id/citizens
City-State 시민 목록
응답
{
"citizens": [
{
"walletAddress": "0x1234...",
"rank": 2,
"joinedAt": 1234567890
}
]
}