{ "openapi": "3.0.0", "components": { "examples": {}, "headers": {}, "parameters": {}, "requestBodies": {}, "responses": {}, "schemas": { "IGetUserStatsResult": { "description": "'GetUserStats' return type", "properties": { "losses": { "type": "number", "format": "double" }, "nft_id": { "type": "number", "format": "double" }, "ties": { "type": "number", "format": "double" }, "wins": { "type": "number", "format": "double" } }, "required": [ "losses", "nft_id", "ties", "wins" ], "type": "object", "additionalProperties": false }, "UserStats": { "$ref": "#/components/schemas/IGetUserStatsResult" }, "GetUserStatsResponse": { "properties": { "stats": { "$ref": "#/components/schemas/UserStats" } }, "required": [ "stats" ], "type": "object", "additionalProperties": false }, "IGetNewLobbiesByUserAndBlockHeightResult": { "description": "'GetNewLobbiesByUserAndBlockHeight' return type", "properties": { "lobby_id": { "type": "string" } }, "required": [ "lobby_id" ], "type": "object", "additionalProperties": false }, "NewLobby": { "$ref": "#/components/schemas/IGetNewLobbiesByUserAndBlockHeightResult" }, "GetUserLobbiesBlockheightResponse": { "properties": { "lobbies": { "items": { "$ref": "#/components/schemas/NewLobby" }, "type": "array" } }, "required": [ "lobbies" ], "type": "object", "additionalProperties": false }, "LobbyStatus": { "type": "string", "enum": [ "active", "closed", "finished", "open" ] }, "IGetAllPaginatedUserLobbiesResult": { "description": "'GetAllPaginatedUserLobbies' return type", "properties": { "created_at": { "type": "string", "format": "date-time" }, "creation_block_height": { "type": "number", "format": "double" }, "current_match": { "type": "number", "format": "double", "nullable": true }, "current_proper_round": { "type": "number", "format": "double", "nullable": true }, "current_round": { "type": "number", "format": "double", "nullable": true }, "current_turn": { "type": "number", "format": "double", "nullable": true }, "hidden": { "type": "boolean" }, "lobby_creator": { "type": "number", "format": "double" }, "lobby_id": { "type": "string" }, "lobby_state": { "$ref": "#/components/schemas/LobbyStatus" }, "max_players": { "type": "number", "format": "double" }, "num_of_rounds": { "type": "number", "format": "double" }, "play_time_per_player": { "type": "number", "format": "double" }, "practice": { "type": "boolean" }, "round_length": { "type": "number", "format": "double" } }, "required": [ "created_at", "creation_block_height", "current_match", "current_proper_round", "current_round", "current_turn", "hidden", "lobby_creator", "lobby_id", "lobby_state", "max_players", "num_of_rounds", "play_time_per_player", "practice", "round_length" ], "type": "object", "additionalProperties": false }, "GetUserLobbiesResponse": { "properties": { "lobbies": { "items": { "$ref": "#/components/schemas/IGetAllPaginatedUserLobbiesResult" }, "type": "array" } }, "required": [ "lobbies" ], "type": "object", "additionalProperties": false }, "IGetOpenLobbyByIdResult": { "description": "'GetOpenLobbyById' return type", "properties": { "created_at": { "type": "string", "format": "date-time" }, "creation_block_height": { "type": "number", "format": "double" }, "current_match": { "type": "number", "format": "double", "nullable": true }, "current_proper_round": { "type": "number", "format": "double", "nullable": true }, "current_round": { "type": "number", "format": "double", "nullable": true }, "current_turn": { "type": "number", "format": "double", "nullable": true }, "hidden": { "type": "boolean" }, "lobby_creator": { "type": "number", "format": "double" }, "lobby_id": { "type": "string" }, "lobby_state": { "$ref": "#/components/schemas/LobbyStatus" }, "max_players": { "type": "number", "format": "double" }, "num_of_rounds": { "type": "number", "format": "double" }, "play_time_per_player": { "type": "number", "format": "double" }, "practice": { "type": "boolean" }, "round_length": { "type": "number", "format": "double" } }, "required": [ "created_at", "creation_block_height", "current_match", "current_proper_round", "current_round", "current_turn", "hidden", "lobby_creator", "lobby_id", "lobby_state", "max_players", "num_of_rounds", "play_time_per_player", "practice", "round_length" ], "type": "object", "additionalProperties": false }, "ISearchPaginatedOpenLobbiesResult": { "description": "'SearchPaginatedOpenLobbies' return type", "properties": { "created_at": { "type": "string", "format": "date-time" }, "creation_block_height": { "type": "number", "format": "double" }, "current_match": { "type": "number", "format": "double", "nullable": true }, "current_proper_round": { "type": "number", "format": "double", "nullable": true }, "current_round": { "type": "number", "format": "double", "nullable": true }, "current_turn": { "type": "number", "format": "double", "nullable": true }, "hidden": { "type": "boolean" }, "lobby_creator": { "type": "number", "format": "double" }, "lobby_id": { "type": "string" }, "lobby_state": { "$ref": "#/components/schemas/LobbyStatus" }, "max_players": { "type": "number", "format": "double" }, "num_of_rounds": { "type": "number", "format": "double" }, "play_time_per_player": { "type": "number", "format": "double" }, "practice": { "type": "boolean" }, "round_length": { "type": "number", "format": "double" } }, "required": [ "created_at", "creation_block_height", "current_match", "current_proper_round", "current_round", "current_turn", "hidden", "lobby_creator", "lobby_id", "lobby_state", "max_players", "num_of_rounds", "play_time_per_player", "practice", "round_length" ], "type": "object", "additionalProperties": false }, "SearchOpenLobbiesResponse": { "properties": { "lobbies": { "anyOf": [ { "items": { "$ref": "#/components/schemas/IGetOpenLobbyByIdResult" }, "type": "array" }, { "items": { "$ref": "#/components/schemas/ISearchPaginatedOpenLobbiesResult" }, "type": "array" } ] } }, "required": [ "lobbies" ], "type": "object", "additionalProperties": false }, "RoundStatusData": { "properties": { "executed": { "type": "boolean" }, "usersWhoSubmittedMoves": { "items": { "type": "number", "format": "double" }, "type": "array" }, "roundStarted": { "type": "number", "format": "double" }, "roundLength": { "type": "number", "format": "double" } }, "required": [ "executed", "usersWhoSubmittedMoves", "roundStarted", "roundLength" ], "type": "object", "additionalProperties": false }, "GetRoundStatusError": { "properties": { "error": { "type": "string", "enum": [ "round not found", "lobby not found" ] } }, "required": [ "error" ], "type": "object", "additionalProperties": false }, "GetRoundStatusResponse": { "anyOf": [ { "$ref": "#/components/schemas/RoundStatusData" }, { "$ref": "#/components/schemas/GetRoundStatusError" } ] }, "IGetLobbyByIdResult": { "description": "'GetLobbyById' return type", "properties": { "created_at": { "type": "string", "format": "date-time" }, "creation_block_height": { "type": "number", "format": "double" }, "current_match": { "type": "number", "format": "double", "nullable": true }, "current_proper_round": { "type": "number", "format": "double", "nullable": true }, "current_round": { "type": "number", "format": "double", "nullable": true }, "current_turn": { "type": "number", "format": "double", "nullable": true }, "hidden": { "type": "boolean" }, "lobby_creator": { "type": "number", "format": "double" }, "lobby_id": { "type": "string" }, "lobby_state": { "$ref": "#/components/schemas/LobbyStatus" }, "max_players": { "type": "number", "format": "double" }, "num_of_rounds": { "type": "number", "format": "double" }, "play_time_per_player": { "type": "number", "format": "double" }, "practice": { "type": "boolean" }, "round_length": { "type": "number", "format": "double" } }, "required": [ "created_at", "creation_block_height", "current_match", "current_proper_round", "current_round", "current_turn", "hidden", "lobby_creator", "lobby_id", "lobby_state", "max_players", "num_of_rounds", "play_time_per_player", "practice", "round_length" ], "type": "object", "additionalProperties": false }, "IGetMatchMovesResult": { "description": "'GetMatchMoves' return type", "properties": { "id": { "type": "number", "format": "double" }, "lobby_id": { "type": "string" }, "match_within_lobby": { "type": "number", "format": "double" }, "move_within_round": { "type": "number", "format": "double" }, "nft_id": { "type": "number", "format": "double" }, "roll_again": { "type": "boolean" }, "round_within_match": { "type": "number", "format": "double" } }, "required": [ "id", "lobby_id", "match_within_lobby", "move_within_round", "nft_id", "roll_again", "round_within_match" ], "type": "object", "additionalProperties": false }, "RoundExecutorBackendData": { "properties": { "lobby": { "$ref": "#/components/schemas/IGetLobbyByIdResult" }, "moves": { "items": { "$ref": "#/components/schemas/IGetMatchMovesResult" }, "type": "array" }, "seed": { "type": "string" } }, "required": [ "lobby", "moves", "seed" ], "type": "object", "additionalProperties": false }, "GetRoundExecutorError": { "properties": { "error": { "type": "string", "enum": [ "lobby not found", "bad round number", "round not found", "match not found", "internal error" ] } }, "required": [ "error" ], "type": "object", "additionalProperties": false }, "GetRoundExecutorResponse": { "anyOf": [ { "$ref": "#/components/schemas/RoundExecutorBackendData" }, { "$ref": "#/components/schemas/GetRoundExecutorError" } ] }, "IGetRandomActiveLobbyResult": { "description": "'GetRandomActiveLobby' return type", "properties": { "created_at": { "type": "string", "format": "date-time" }, "creation_block_height": { "type": "number", "format": "double" }, "current_match": { "type": "number", "format": "double", "nullable": true }, "current_proper_round": { "type": "number", "format": "double", "nullable": true }, "current_round": { "type": "number", "format": "double", "nullable": true }, "current_turn": { "type": "number", "format": "double", "nullable": true }, "hidden": { "type": "boolean" }, "lobby_creator": { "type": "number", "format": "double" }, "lobby_id": { "type": "string" }, "lobby_state": { "$ref": "#/components/schemas/LobbyStatus" }, "max_players": { "type": "number", "format": "double" }, "num_of_rounds": { "type": "number", "format": "double" }, "play_time_per_player": { "type": "number", "format": "double" }, "practice": { "type": "boolean" }, "round_length": { "type": "number", "format": "double" } }, "required": [ "created_at", "creation_block_height", "current_match", "current_proper_round", "current_round", "current_turn", "hidden", "lobby_creator", "lobby_id", "lobby_state", "max_players", "num_of_rounds", "play_time_per_player", "practice", "round_length" ], "type": "object", "additionalProperties": false }, "RandomActiveLobbyResponse": { "properties": { "lobby": { "allOf": [ { "$ref": "#/components/schemas/IGetRandomActiveLobbyResult" } ], "nullable": true } }, "required": [ "lobby" ], "type": "object", "additionalProperties": false }, "IGetPaginatedOpenLobbiesResult": { "description": "'GetPaginatedOpenLobbies' return type", "properties": { "created_at": { "type": "string", "format": "date-time" }, "creation_block_height": { "type": "number", "format": "double" }, "current_match": { "type": "number", "format": "double", "nullable": true }, "current_proper_round": { "type": "number", "format": "double", "nullable": true }, "current_round": { "type": "number", "format": "double", "nullable": true }, "current_turn": { "type": "number", "format": "double", "nullable": true }, "hidden": { "type": "boolean" }, "lobby_creator": { "type": "number", "format": "double" }, "lobby_id": { "type": "string" }, "lobby_state": { "$ref": "#/components/schemas/LobbyStatus" }, "max_players": { "type": "number", "format": "double" }, "num_of_rounds": { "type": "number", "format": "double" }, "play_time_per_player": { "type": "number", "format": "double" }, "practice": { "type": "boolean" }, "round_length": { "type": "number", "format": "double" } }, "required": [ "created_at", "creation_block_height", "current_match", "current_proper_round", "current_round", "current_turn", "hidden", "lobby_creator", "lobby_id", "lobby_state", "max_players", "num_of_rounds", "play_time_per_player", "practice", "round_length" ], "type": "object", "additionalProperties": false }, "OpenLobbiesResponse": { "properties": { "lobbies": { "items": { "$ref": "#/components/schemas/IGetPaginatedOpenLobbiesResult" }, "type": "array" } }, "required": [ "lobbies" ], "type": "object", "additionalProperties": false }, "LobbyPlayer": { "properties": { "score": { "type": "number", "format": "double" }, "points": { "type": "number", "format": "double" }, "turn": { "type": "number", "format": "double" }, "nftId": { "type": "number", "format": "double" } }, "required": [ "score", "points", "nftId" ], "type": "object" }, "Pick_IGetLobbyByIdResult.Exclude_keyofIGetLobbyByIdResult.LobbyStateProps__": { "properties": { "created_at": { "type": "string", "format": "date-time" }, "creation_block_height": { "type": "number", "format": "double" }, "hidden": { "type": "boolean" }, "lobby_creator": { "type": "number", "format": "double" }, "lobby_id": { "type": "string" }, "lobby_state": { "$ref": "#/components/schemas/LobbyStatus" }, "max_players": { "type": "number", "format": "double" }, "num_of_rounds": { "type": "number", "format": "double" }, "play_time_per_player": { "type": "number", "format": "double" }, "practice": { "type": "boolean" }, "round_length": { "type": "number", "format": "double" } }, "required": [ "created_at", "creation_block_height", "hidden", "lobby_creator", "lobby_id", "lobby_state", "max_players", "num_of_rounds", "play_time_per_player", "practice", "round_length" ], "type": "object", "description": "From T, pick a set of properties whose keys are in the union K" }, "Omit_IGetLobbyByIdResult.LobbyStateProps_": { "$ref": "#/components/schemas/Pick_IGetLobbyByIdResult.Exclude_keyofIGetLobbyByIdResult.LobbyStateProps__", "description": "Construct a type with the properties of T except for those in type K." }, "PropertiesNonNullable_Pick_IGetLobbyByIdResult.LobbyStateProps__": { "properties": { "current_match": { "type": "number", "format": "double" }, "current_round": { "type": "number", "format": "double" }, "current_turn": { "type": "number", "format": "double" }, "current_proper_round": { "type": "number", "format": "double" } }, "required": [ "current_match", "current_round", "current_turn", "current_proper_round" ], "type": "object" }, "LobbyState": { "properties": { "roundSeed": { "type": "string" }, "players": { "items": { "$ref": "#/components/schemas/LobbyPlayer" }, "type": "array" } }, "required": [ "roundSeed", "players" ], "type": "object", "additionalProperties": false }, "ExecutorDataSeed": { "properties": { "seed": { "type": "string" }, "block_height": { "type": "number", "format": "double" }, "round": { "type": "number", "format": "double" } }, "required": [ "seed", "block_height", "round" ], "type": "object", "additionalProperties": false }, "MatchExecutorData": { "properties": { "lobby": { "$ref": "#/components/schemas/LobbyState" }, "moves": { "items": { "$ref": "#/components/schemas/IGetMatchMovesResult" }, "type": "array" }, "seeds": { "items": { "$ref": "#/components/schemas/ExecutorDataSeed" }, "type": "array" } }, "required": [ "lobby", "moves", "seeds" ], "type": "object", "additionalProperties": false }, "GetMatchExecutorResponse": { "allOf": [ { "$ref": "#/components/schemas/MatchExecutorData" } ], "nullable": true }, "GetLobbyStateResponse": { "properties": { "lobby": { "allOf": [ { "$ref": "#/components/schemas/LobbyState" } ], "nullable": true } }, "required": [ "lobby" ], "type": "object", "additionalProperties": false }, "GetLobbiesRawResponse": { "properties": { "lobby": { "allOf": [ { "$ref": "#/components/schemas/IGetLobbyByIdResult" } ], "nullable": true } }, "required": [ "lobby" ], "type": "object", "additionalProperties": false } }, "securitySchemes": {} }, "info": { "title": "@dice/api", "version": "1.0.0", "description": "Webserver REST API for the middleware to interact with game node.", "license": { "name": "ISC" }, "contact": {} }, "paths": { "/user_stats": { "get": { "operationId": "Get", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetUserStatsResponse" } } } } }, "security": [], "parameters": [ { "in": "query", "name": "nftId", "required": true, "schema": { "format": "double", "type": "number" } } ] } }, "/user_lobbies_blockheight": { "get": { "operationId": "Get", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetUserLobbiesBlockheightResponse" } } } } }, "security": [], "parameters": [ { "in": "query", "name": "nftId", "required": true, "schema": { "format": "double", "type": "number" } }, { "in": "query", "name": "blockHeight", "required": true, "schema": { "format": "double", "type": "number" } } ] } }, "/user_lobbies": { "get": { "operationId": "Get", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetUserLobbiesResponse" } } } } }, "security": [], "parameters": [ { "in": "query", "name": "nftId", "required": true, "schema": { "format": "double", "type": "number" } }, { "in": "query", "name": "count", "required": false, "schema": { "format": "double", "type": "number" } }, { "in": "query", "name": "page", "required": false, "schema": { "format": "double", "type": "number" } } ] } }, "/search_open_lobbies": { "get": { "operationId": "Get", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchOpenLobbiesResponse" } } } } }, "security": [], "parameters": [ { "in": "query", "name": "nftId", "required": true, "schema": { "format": "double", "type": "number" } }, { "in": "query", "name": "searchQuery", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "page", "required": false, "schema": { "format": "double", "type": "number" } }, { "in": "query", "name": "count", "required": false, "schema": { "format": "double", "type": "number" } } ] } }, "/round_status": { "get": { "operationId": "Get", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetRoundStatusResponse" } } } } }, "security": [], "parameters": [ { "in": "query", "name": "lobbyID", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "matchWithinLobby", "required": true, "schema": { "format": "double", "type": "number" } }, { "in": "query", "name": "roundWithinMatch", "required": true, "schema": { "format": "double", "type": "number" } } ] } }, "/round_executor": { "get": { "operationId": "Get", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetRoundExecutorResponse" } } } } }, "security": [], "parameters": [ { "in": "query", "name": "lobbyID", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "matchWithinLobby", "required": true, "schema": { "format": "double", "type": "number" } }, { "in": "query", "name": "roundWithinMatch", "required": true, "schema": { "format": "double", "type": "number" } } ] } }, "/random_active_lobby": { "get": { "operationId": "Get", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RandomActiveLobbyResponse" } } } } }, "security": [], "parameters": [] } }, "/open_lobbies": { "get": { "operationId": "Get", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenLobbiesResponse" } } } } }, "security": [], "parameters": [ { "in": "query", "name": "nftId", "required": true, "schema": { "format": "double", "type": "number" } }, { "in": "query", "name": "count", "required": false, "schema": { "format": "double", "type": "number" } }, { "in": "query", "name": "page", "required": false, "schema": { "format": "double", "type": "number" } } ] } }, "/nfts/wallet": { "get": { "operationId": "GetWalletNFTs", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "items": { "type": "number", "format": "double" }, "type": "array" } } } } }, "security": [], "parameters": [ { "in": "query", "name": "wallet", "required": true, "schema": { "type": "string" } } ] } }, "/match_executor": { "get": { "operationId": "Get", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetMatchExecutorResponse" } } } } }, "security": [], "parameters": [ { "in": "query", "name": "lobbyID", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "matchWithinLobby", "required": true, "schema": { "format": "double", "type": "number" } } ] } }, "/lobby_state": { "get": { "operationId": "Get", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetLobbyStateResponse" } } } } }, "security": [], "parameters": [ { "in": "query", "name": "lobbyID", "required": true, "schema": { "type": "string" } } ] } }, "/lobby_raw": { "get": { "operationId": "Get", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetLobbiesRawResponse" } } } } }, "security": [], "parameters": [ { "in": "query", "name": "lobbyID", "required": true, "schema": { "type": "string" } } ] } } }, "servers": [ { "url": "/" } ] }