API Endpoints

Base URL: https://your-domain.com/casino

All requests that require authentication must include Authorization: Bearer <token>.


Public endpoints

GET /health

Returns service health status. No auth required.

GET /wallet-address

Returns the casino treasury wallet address.

{ "address": "ABC123..." }

GET /public/whitelabel

Returns the platformโ€™s public branding configuration.

{
  "title": "My Casino",
  "logoUrl": "https://...",
  "accentColor": "#3b82f6"
}

GET /recent-bets

Returns the public recent bets feed (last 20 bets across all users).


Player endpoints (require auth)

POST /auth/login

Authenticate via Sign-In-With-Solana. See Authentication.

GET /balance

Returns all token balances for the authenticated user.

{
  "balances": [
    { "token": "So11111...", "balance": 1000000 }
  ]
}

POST /deposit

Register an on-chain deposit.

FieldTypeRequiredDescription
signaturestringโœ“Solana transaction signature
tokenstringโœ“SPL token mint address

POST /withdraw

Request a withdrawal. Debits immediately; pending admin approval.

FieldTypeRequiredDescription
amountnumberโœ“Amount in base units (lamports for SOL)
tokenstringโœ“SPL token mint
destinationstringโœ“Destination wallet address

GET /account/transactions

Returns ledger of deposits, withdrawals, and balance adjustments.

QueryTypeDescription
pagenumberPage number (default 1)
limitnumberPer page (default 20, max 100)

POST /play

Play a game round.

FieldTypeRequiredDescription
gameTypestringโœ“Game identifier (e.g. slots, crash)
wagernumberโœ“Wager in base units
tokenstringโœ“SPL token mint
configobjectโ€”Game-specific config

GET /history

Returns the userโ€™s game history.

GET /seed

Returns the server seed (hashed) and current nonce for provably fair verification.

POST /legacy/launch

Launch a Pragmatic Play or PGSoft game via Seamless mode.

FieldTypeRequiredDescription
gameCodestringโœ“Provider game code
userCodestringโœ“Platform user identifier
languagestringโ€”ISO language code (default: pt)

Returns { "url": "https://..." } โ€” redirect the user to this URL.


Admin endpoints (require admin role)

All admin endpoints require Authorization: Bearer <token> where the wallet has at least admin:read permission.

GET /admin/me

Returns the current walletโ€™s role, access level, and permissions.

{
  "wallet": "ABC...",
  "role": "superadmin",
  "level": 1,
  "permissions": ["admin:read", "admin:write", "..."],
  "agentCode": null
}

GET /admin/overview

Returns platform summary (games, transactions, balances).

GET /admin/metrics/ggr-daily

Returns daily GGR metrics.

QueryDescription
daysNumber of days to return (default 30)

GET /admin/games

Returns game history with filters.

GET /admin/transactions

Returns all transactions (deposits/withdrawals).

PATCH /admin/balances/:user

Adjust a userโ€™s balance (requires balances:write).

POST /admin/withdraw/approve

Approve a pending withdrawal (requires withdraw:approve).

POST /admin/withdraw/reject

Reject a pending withdrawal (requires withdraw:reject).

GET /admin/legacy/agents

List all legacy agents (operators).

POST /admin/legacy/agents

Create a new agent.

PATCH /admin/legacy/agents/:id

Update an agent (status, RTP, site endpoint, etc.).

DELETE /admin/legacy/agents/:id

Delete an agent.

GET /admin/provider-games

List game catalog from all providers.

PATCH /admin/provider-games/:gameCode

Enable or disable a game.

PATCH /admin/whitelabel

Update whitelabel branding (requires whitelabel:write).