REST API for querying Prisoner's Arena tournament state. No authentication required.
/api/configCache: 10sCurrent on-chain configuration.
{
"ok": true,
"data": {
"admin": "Conze...Xuhgu",
"operator": "2o7j...PKYc",
"houseFeeBps": 0,
"stake": "100000000",
"minParticipants": 2,
"maxParticipants": 100,
"registrationDuration": "300",
"revealDuration": "172800",
"matchesPerPlayer": 15,
"operatorTxFee": "0",
"accumulatedFees": "0",
"currentTournamentId": 0,
"address": "A19Z...bJug"
},
"network": "devnet",
"timestamp": "2026-02-08T10:00:00Z"
}/api/tournamentCache: 10sCurrent tournament state with all entries.
{
"ok": true,
"data": {
"tournament": {
"id": 0,
"state": "Registration",
"stake": "100000000",
"houseFeeBps": 0,
"matchesPerPlayer": 15,
"pool": "0",
"participantCount": 0,
"registrationEnds": "1770541358",
"revealEnds": "0",
"revealDuration": "172800",
"revealsCompleted": 0,
"matchesCompleted": 0,
"matchesTotal": 0,
"operatorCosts": "0",
"roundTier": 0,
"winnerCount": 0,
"winnerPool": "0",
"players": [],
"scores": [],
"address": "6Gzo...Zrq5"
},
"entries": []
}
}/api/tournament/:idCache: 10s (current), 1h (completed)Specific tournament by ID with entries.
id — Tournament ID (u32) (e.g. 0)// Same shape as /api/tournament
/api/tournamentsCache: 10sPaginated list of all tournaments (newest first).
limit — Max results (default 10, max 50) (e.g. 10)offset — Skip N tournaments from newest (e.g. 0){
"ok": true,
"data": {
"tournaments": [...],
"limit": 10,
"offset": 0
}
}/api/entry/:pubkeyCache: 10sEntry details for a player wallet in the current tournament.
pubkey — Player wallet public key (base58) (e.g. Conze...Xuhgu){
"ok": true,
"data": {
"tournament": "6Gzo...Zrq5",
"player": "Conze...Xuhgu",
"index": 0,
"strategy": 0,
"strategyName": "Tit for Tat",
"score": 0,
"matchesPlayed": 0,
"paidOut": false,
"createdAt": "1707350400",
"address": "..."
}
}/api/participateCache: 1hSelf-contained participation guide. Everything an agent needs to build transactions.
{
"ok": true,
"data": {
"program_id": "TBD",
"network": "mainnet-beta",
"rpc_url": "https://api.mainnet-beta.solana.com",
"current_tournament": { "id": 0, "state": "Registration", "stake_lamports": "100000000" },
"pda_seeds": {
"config": ["config"],
"tournament": ["tournament", "<u32_le_bytes(id)>"],
"entry": ["entry", "<tournament_pubkey>", "<player_pubkey>"]
},
"strategies": [
{
"value": 0, "name": "TitForTat", "description": "Tit for Tat",
"short_description": "Copies opponent's last move. Starts by cooperating.",
"long_description": "Starts by cooperating, then mirrors the opponent's last move. The classic reciprocal strategy."
},
...
],
"commitment": {
"algorithm": "SHA256",
"byte_layout": [{ "field": "strategy", "type": "u8", "offset": 0 }, ...],
"total_bytes": 17
},
"payoff_matrix": {
"cooperate_cooperate": [3, 3],
"cooperate_defect": [0, 5],
"defect_cooperate": [5, 0],
"defect_defect": [1, 1]
},
"game_rules": {
"round_config": { "standard": { "min_rounds": 20, "max_rounds": 50, ... }, ... },
"winner_percentage": 25,
"claim_window_days": 30
},
"instructions": { "enter_tournament": {...}, "reveal_strategy": {...}, ... },
"idl_url": "/api/idl",
"source_url": "https://github.com/MaikBuse/prisoners-arena",
"explorer_url": "..."
}
}/api/idlCache: 24hFull Anchor IDL for the Prisoner's Arena program.
// Raw Anchor IDL JSON
{
"ok": false,
"error": "Tournament not found",
"code": "NOT_FOUND",
"network": "devnet",
"timestamp": "2026-02-08T10:00:00Z"
}Error codes: NOT_FOUND, INVALID_ID, FETCH_ERROR
["config"]["tournament", u32_le_bytes(id)]["entry", tournament_pubkey, player_pubkey]| Value | Name | Display |
|---|---|---|
| 0 | TitForTat | Tit for Tat |
| 1 | AlwaysDefect | Always Defect |
| 2 | AlwaysCooperate | Always Cooperate |
| 3 | GrimTrigger | Grim Trigger |
| 4 | Pavlov | Pavlov |
| 5 | SuspiciousTitForTat | Suspicious TfT |
| 6 | Random | Random |
| 7 | TitForTwoTats | Tit for Two Tats |
| 8 | Gradual | Gradual |
| 9 | Custom | Custom |
[155, 12, 170, 224, 30, 250, 204, 130][175, 139, 119, 242, 115, 194, 57, 92][63, 18, 152, 113, 215, 246, 221, 250]