Skip to main content

Overview

The games API manages the lifecycle of SolBid auction games. Each game tracks bids, players, prize pools, and game state on the Solana blockchain. All game-related endpoints return comprehensive game data including player information and bid history.

Create game

curl -X POST https://api.solbid.com/api/game \
  -H "Content-Type: application/json" \
  -H "userId: 123" \
  -d '{
    "gameId": 1,
    "initialBidAmount": 1000000,
    "creatorPublicKey": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "gamePda": "8xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsV",
    "playerPda": "9xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsW",
    "bidPda": "AxKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsX",
    "txId": "5j7s8K9mN3pQ4rT6vW8xY2zA1bC3dE4fG5hI6jK7lM8nO9pQ0r"
  }'
Creates a new SolBid game with an initial bid. This endpoint initializes the game state, creates the first player record, and records the initial bid.

Headers

userId
string
required
Authenticated user’s ID for authorization

Request body

gameId
number
required
Unique game identifier (positive integer)
initialBidAmount
number
required
Initial bid amount in lamports (positive integer)
creatorPublicKey
string
required
Creator’s Solana wallet public key (base58 encoded)
gamePda
string
required
Game’s Program Derived Address on Solana (base58 encoded)
playerPda
string
required
Player’s Program Derived Address on Solana (base58 encoded)
bidPda
string
required
Bid’s Program Derived Address on Solana (base58 encoded)
txId
string
required
Solana transaction ID for the game creation

Response

message
string
Success message
gameData
object
Complete game information including players and bids
{
  "message": "Game created successfully",
  "gameData": {
    "id": 1,
    "gameId": "1",
    "pda": "8xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsV",
    "initialBidAmount": 1000000,
    "highestBid": 1000000,
    "lastBidTime": "2026-03-02T20:30:00.000Z",
    "totalBids": 1,
    "lastBidderId": "AxKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsX",
    "prizePool": 1000000,
    "gameEnded": false,
    "players": [
      {
        "id": 1,
        "playerPubkey": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
        "pda": "9xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsW",
        "totalBidAmount": 1000000,
        "bidCount": 1,
        "royaltyEarned": 0,
        "safe": false,
        "role": "PLAYER",
        "bid": {
          "id": 1,
          "pda": "AxKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsX",
          "amount": 1000000,
          "timestamp": "2026-03-02T20:30:00.000Z",
          "txId": "5j7s8K9mN3pQ4rT6vW8xY2zA1bC3dE4fG5hI6jK7lM8nO9pQ0r"
        },
        "user": {
          "id": 123,
          "name": "Player1",
          "imageUrl": "https://example.com/avatar.jpg"
        }
      }
    ]
  }
}
After game creation, the global game ID counter is incremented automatically.

Get game

curl "https://api.solbid.com/api/game?id=1"
Retrieves detailed information about a specific game, including all players and their bid history.

Query parameters

id
string
required
Database ID of the game to retrieve

Response

game
object
Complete game data
{
  "game": {
    "gameData": {
      "id": 1,
      "gameId": "1",
      "pda": "8xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsV",
      "initialBidAmount": 1000000,
      "highestBid": 2000000,
      "lastBidTime": "2026-03-02T21:00:00.000Z",
      "totalBids": 5,
      "lastBidderId": "BxKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsY",
      "prizePool": 6000000,
      "gameEnded": false,
      "players": []
    }
  }
}

List all games

curl "https://api.solbid.com/api/game"
Retrieves a list of all games in the system.

Response

message
string
Status message
games
array
Array of game objects
{
  "message": "Games data fetched",
  "games": [
    {
      "id": 1,
      "gameId": "1",
      "pda": "8xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsV",
      "initialBidAmount": 1000000,
      "highestBid": 2000000,
      "totalBids": 5,
      "prizePool": 6000000,
      "gameEnded": false
    }
  ]
}

Get live games

curl "https://api.solbid.com/api/game/live"
Retrieves all games that are currently active (not ended).

Response

gameData
array
Array of active game objects
{
  "gameData": [
    {
      "id": 1,
      "gameId": "1",
      "pda": "8xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsV",
      "initialBidAmount": 1000000,
      "highestBid": 2000000,
      "lastBidTime": "2026-03-02T21:00:00.000Z",
      "totalBids": 5,
      "prizePool": 6000000,
      "gameEnded": false
    }
  ]
}

Get current game ID

curl "https://api.solbid.com/api/gameid"
Retrieves the current game ID counter, used for creating new games.

Response

currGameId
number
Current game ID counter value
{
  "currGameId": 42
}
This value is automatically incremented each time a new game is created.

Build docs developers (and LLMs) love