This document provides a comprehensive reference for all JSON message formats used in communication between the Pangea-Bet backend and the GUI frontend via WebSocket.
9000 (default, defined as gui_ws_port in common.h)ws://<backend_ip>:9000These messages are supported by all node types (Dealer, Player, Cashier).
Request:
{
"method": "get_bal_info"
}
Response:
{
"method": "bal_info",
"chips_bal": 123.45678900
}
Fields:
method (string, required): Always "bal_info" in responsechips_bal (number, required): Current CHIPS balance in the walletRequest:
{
"method": "get_addr_info"
}
Response:
{
"method": "addr_info",
"chips_addr": "Rxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
Fields:
method (string, required): Always "addr_info" in responsechips_addr (string, required): New CHIPS address generated for receiving fundsRequest:
{
"method": "withdrawRequest"
}
Response:
{
"method": "withdrawResponse",
"balance": 123.45678900,
"tx_fee": 0.00010000,
"addrs": [
{
"address": "Rxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"label": "default"
}
]
}
Fields:
method (string, required): Always "withdrawResponse" in responsebalance (number, required): Current wallet balancetx_fee (number, required): Transaction fee required for withdrawaladdrs (array, required): List of addresses owned by the wallet that can receive withdrawalsRequest:
{
"method": "withdraw",
"amount": 10.5,
"addr": "Rxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
Response:
{
"method": "withdrawInfo",
"tx": {
"txid": "abc123...",
"hex": "01000000...",
"fee": 0.00010000
}
}
Fields:
method (string, required): Always "withdrawInfo" in responseamount (number, required): Amount to withdraw (must be > 0)addr (string, required): Address to send funds to (must be owned by wallet)tx (object, required): Transaction details including txid, hex, and feeNote: Withdrawals are restricted to addresses owned by the backend wallet for security.
Request:
{
"method": "game"
}
Response:
{
"method": "game",
"game": {
"tocall": 0,
"seats": 2,
"pot": [0],
"gametype": "NL Hold'em<br>Blinds: 3/6"
}
}
Fields:
tocall (number, optional): Amount to callseats (number, required): Number of seats at the tablepot (array, required): Array of pot values (main pot and side pots)gametype (string, required): Game type description (e.g., “NL Hold’emRequest:
{
"method": "seats"
}
Response:
{
"method": "seats",
"seats": [
{
"playerid": 0,
"name": "Player1",
"chips": 1000,
"status": "active"
},
{
"playerid": 1,
"name": "Player2",
"chips": 1000,
"status": "active"
}
]
}
Fields:
seats (array, required): Array of seat information
playerid (number, required): Player ID (0-based)name (string, required): Player name/identifierchips (number, required): Player’s chip countstatus (string, required): Player status (e.g., “active”, “folded”, “allin”)Request:
{
"method": "chat",
"message": "Hello everyone!"
}
Response: (Echoed back or broadcast to all players)
Fields:
message (string, required): Chat message textRequest:
{
"method": "reset"
}
Response: (No specific response, game state is reset)
Note: Resets all dealer control variables and game state.
Request:
{
"method": "backend_status"
}
Response:
{
"method": "backend_status",
"backend_status": 1
}
Fields:
backend_status (number, required): Status code
0 = backend_not_ready1 = backend_readyRequest:
{
"method": "betting",
"round": 0,
"action": 4,
"amount": 10.5
}
Response: (Game state updates sent via other messages)
Fields:
round (number, required): Betting round
0 = preflop1 = flop2 = turn3 = riveraction (number, required): Betting action
1 = small_blind2 = big_blind3 = check4 = call5 = raise6 = allin7 = foldamount (number, required): Bet amount (for raise/call actions)Request:
{
"method": "player_join",
"table_id": "abc123...",
"player_id": "player_verus_id@"
}
Response:
{
"method": "join_info",
"playerid": 0,
"table_id": "abc123...",
"status": "joined"
}
Fields:
table_id (string, required): Table identifierplayer_id (string, required): Player Verus IDplayerid (number, required): Assigned player ID (0-based)status (string, required): Join statusRequest:
{
"method": "reset"
}
Response: (Game state reset)
Request:
{
"method": "sitout",
"value": 1
}
Response: (No specific response)
Fields:
value (number, required): 1 to sit out, 0 to sit inRequest:
{
"method": "walletInfo"
}
Response:
{
"method": "walletInfo",
"addr": "Rxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"balance": 123.45678900,
"backend_status": 1,
"max_players": 9,
"table_min_stake": 0.5,
"small_blind": 0.01,
"big_blind": 0.02,
"table_id": "abc123...",
"tx_fee": 0.00010000
}
Fields:
addr (string, required): Wallet addressbalance (number, required): Current balancebackend_status (number, required): Backend status (0 or 1)max_players (number, required): Maximum players at tabletable_min_stake (number, required): Payin amount in CHIPS (default 0.5)small_blind (number, required): Small blind in CHIPS (default 0.01)big_blind (number, required): Big blind in CHIPS (default 0.02)table_id (string, required): Current table IDtx_fee (number, required): Transaction feeSent from backend (unsolicited):
{
"method": "warning",
"warning_num": 0
}
Fields:
warning_num (number, required): Warning code
0 = seat_already_taken1 = insufficient_funds2 = table_is_full{
"method": "init_d",
"deckid": "abc123...",
"cardprods": [...],
"dcvblindcards": [...]
}
{
"method": "init",
"playerid": 0,
"deckid": "abc123...",
"cardprods": [...]
}
{
"method": "join_res",
"playerid": 0,
"status": "joined"
}
{
"method": "turn",
"playerid": 0,
"cardid": 5,
"card_type": 1
}
{
"method": "game_info",
"round": 0,
"pot": 100,
"tocall": 10
}
{
"method": "finalInfo",
"winners": [0, 1],
"payouts": [50, 50]
}
Cashier nodes support only the common wallet messages listed above:
get_bal_infoget_addr_infowithdrawRequestwithdrawCashier nodes do not have game-specific functionality in the GUI.
GUI → Backend: {"method": "game"}
Backend → GUI: {"method": "game", "game": {...}}
GUI → Backend: {"method": "seats"}
Backend → GUI: {"method": "seats", "seats": [...]}
GUI → Backend: {"method": "player_join", ...}
Backend → GUI: {"method": "join_info", ...}
GUI → Backend: {"method": "walletInfo"}
Backend → GUI: {"method": "walletInfo", ...}
GUI → Backend: {"method": "betting", "round": 0, "action": 4, "amount": 10}
Backend → GUI: {"method": "game_info", "round": 0, "pot": 100, ...}
Backend → GUI: {"method": "turn", "playerid": 0, ...}
GUI → Backend: {"method": "get_bal_info"}
Backend → GUI: {"method": "bal_info", "chips_bal": 123.45}
GUI → Backend: {"method": "withdrawRequest"}
Backend → GUI: {"method": "withdrawResponse", "balance": 123.45, "addrs": [...]}
GUI → Backend: {"method": "withdraw", "amount": 10, "addr": "Rxxx..."}
Backend → GUI: {"method": "withdrawInfo", "tx": {...}}
If an unknown method is sent, the backend will log a warning but may not send an error response. The GUI should handle timeouts appropriately.
If required parameters are missing or invalid:
null responsewarning messages for various conditionsbet_dcv_lws_write() → lws_write()player_lws_write() → WebSocket writelws_write() directlyAll wallet operations use common functions from payment.c:
bet_wallet_get_bal_info()bet_wallet_get_addr_info()bet_wallet_withdraw_request()bet_wallet_withdraw()bet_dcv_frontend() in host.cbet_player_frontend() in client.cbet_cashier_frontend() in cashier.c