### GET /event/{team}/{game}/{version}/{mode} Source: https://stake-engine.com/fair/api Returns the ordered list of payout outcomes and probability weight ranges for a specific game configuration. ```APIDOC ## GET https://fair.stake-engine.com/event/{team}/{game}/{version}/{mode} ### Description Returns the ordered list of every possible payout outcome and its corresponding probability weight range. ### Method GET ### Endpoint https://fair.stake-engine.com/event/{team}/{game}/{version}/{mode} ### Parameters #### Path Parameters - **team** (string) - Required - Publisher slug - **game** (string) - Required - Game slug - **version** (integer) - Required - Published math version number - **mode** (string) - Required - Game mode name #### Query Parameters - **from** (integer) - Optional - Starting event index (default: 0) - **to** (integer) - Optional - Ending event index (default: total events - 1) ### Response #### Success Response (200) - **event** (integer) - Event index - **start** (integer) - Cumulative weight range start (inclusive) - **end** (integer) - Cumulative weight range end (exclusive) - **payout** (integer) - Payout in cents ``` -------------------------------- ### GET /catalogue Source: https://stake-engine.com/fair/api Retrieves the full catalogue of published games, including versions, modes, RTP, and weight ranges. ```APIDOC ## GET https://fair.stake-engine.com/catalogue ### Description Returns every published game on the platform along with its versions, modes, RTP, event count, and total weight range. ### Method GET ### Endpoint https://fair.stake-engine.com/catalogue ### Response #### Success Response (200) - **game** (object) - Game name, slug, image URL, and replay support flag - **publisher** (object) - Publisher name and slug - **versions[]** (array) - Each published math version with its active status and array of modes - **versions[].modes[]** (array) - Per-mode details: name, rtp, events, and weight_range ``` -------------------------------- ### Retrieve Game Catalogue Source: https://stake-engine.com/fair/api Fetches all published games, versions, and modes. No authentication or parameters are required. ```bash curl https://fair.stake-engine.com/catalogue ``` -------------------------------- ### Fetch Event Table Source: https://stake-engine.com/fair/api Retrieves the probability weight ranges and payouts for a specific game configuration. Optional query parameters allow filtering by event index range. ```bash curl "https://fair.stake-engine.com/event/paperclip/balance/5/VERYLOW?from=0&to=10" ``` -------------------------------- ### POST https://fair.stake-engine.com/peek Source: https://stake-engine.com/fair/api Computes payouts over a nonce range and returns analytics including running balance, game metadata, and optional searches for specific payout targets. ```APIDOC ## POST https://fair.stake-engine.com/peek ### Description A higher-level verification endpoint that computes payouts over a nonce range and returns additional analytics: running balance, game metadata (mode cost, max payout, RTP), and optional searches for nonces that hit a target multiplier or the maximum payout. ### Method POST ### Endpoint https://fair.stake-engine.com/peek ### Parameters #### Request Body - **team** (string) - Required - Publisher slug - **game** (string) - Required - Game slug - **version** (integer) - Required - Published math version number - **mode** (string) - Required - Game mode name - **clientSeed** (string) - Required - Player-chosen base64url client seed (8 characters) - **serverSeed** (string) - Required - Unhashed base64url server seed revealed after rotation (43 characters) - **nonceStart** (integer) - Optional - Starting nonce (default: 1) - **nonceEnd** (integer) - Optional - Ending nonce (default: 1000, max range: 10,000) - **findTarget** (number) - Optional - Search for nonces with payouts ≥ this multiplier - **findMax** (boolean) - Optional - Search for nonces hitting the maximum possible payout ### Request Example { "team": "paperclip", "game": "balance", "version": 5, "mode": "VERYLOW", "clientSeed": "0a5fd1c5", "serverSeed": "FCMv7wHdWcf6pfmtJ7tEERRQiHswwVNGrM_lT2YfW7E", "nonceStart": 1, "nonceEnd": 100 } ### Response #### Success Response (200) - **publisher** (object) - Publisher name and slug - **game** (object) - Game name, slug, mode cost multiplier, max payout, and expected RTP - **payouts** (array) - Array of { nonce, value } — payout multiplier for each nonce - **runningBalance** (array) - Cumulative balance (payouts minus cost) at each nonce - **targetNonces** (array) - Nonces with payouts ≥ your target (if findTarget was set) - **maxNonces** (array) - Nonces hitting the maximum payout (if findMax was set) ``` -------------------------------- ### Verify game payouts with Peek Source: https://stake-engine.com/fair/api Use this POST request to retrieve payout data and analytics for a specific range of nonces. ```bash curl -X POST https://fair.stake-engine.com/peek \ -H "Content-Type: application/json" \ -d '{ "team": "paperclip", "game": "balance", "version": 5, "mode": "VERYLOW", "clientSeed": "0a5fd1c5", "serverSeed": "FCMv7wHdWcf6pfmtJ7tEERRQiHswwVNGrM_lT2YfW7E", "nonceStart": 1, "nonceEnd": 100 }' ``` -------------------------------- ### POST /outcome/{team}/{game}/{version}/{mode} Source: https://stake-engine.com/fair/api Computes the raw entropy roll and payout for a specific nonce range using provided seeds. ```APIDOC ## POST https://fair.stake-engine.com/outcome/{team}/{game}/{version}/{mode} ### Description Computes the raw entropy roll and payout for each nonce given a pair of seeds and a nonce range. ### Method POST ### Endpoint https://fair.stake-engine.com/outcome/{team}/{game}/{version}/{mode} ### Parameters #### Path Parameters - **team** (string) - Required - Publisher slug - **game** (string) - Required - Game slug - **version** (integer) - Required - Published math version number - **mode** (string) - Required - Game mode name #### Request Body - **clientSeed** (string) - Required - Player-chosen base64url client seed - **serverSeed** (string) - Required - Unhashed base64url server seed revealed after rotation - **nonceStart** (integer) - Required - First nonce in range - **nonceEnd** (integer) - Required - Last nonce in range (exclusive) ### Response #### Success Response (200) - **nonce** (integer) - The nonce value - **roll** (integer) - The raw 64-bit roll - **payout** (integer) - Payout in cents ``` -------------------------------- ### Verify Game Outcomes Source: https://stake-engine.com/fair/api Computes raw entropy rolls and payouts for a specific nonce range using provided seeds. Requires a POST request with JSON body containing seeds and nonce boundaries. ```bash curl -X POST https://fair.stake-engine.com/outcome/paperclip/balance/5/VERYLOW \ -H "Content-Type: application/json" \ -d '{ "clientSeed": "0a5fd1c5", "serverSeed": "FCMv7wHdWcf6pfmtJ7tEERRQiHswwVNGrM_lT2YfW7E", "nonceStart": 1, "nonceEnd": 10 }' ``` -------------------------------- ### Generate 32 bytes of entropy Source: https://stake-engine.com/fair/api Uses HMAC-SHA256 with the server seed as the key and a combination of client seed and nonce as the message. ```text entropy = HMAC-SHA256( key = serverSeed, message = clientSeed + ":" + nonce ) // entropy is 32 bytes (256 bits) ``` -------------------------------- ### Map random number to game event Source: https://stake-engine.com/fair/api Reduces the 128-bit value using modulo and performs a binary search over the cumulative weight table to select an event. ```text roll = rand128 % weightSum // binary search: find the first event where // cumulativeWeight[event + 1] > roll event = binary_search(weightTable, roll) payout = payoutTable[event] ``` -------------------------------- ### Derive 128-bit random number Source: https://stake-engine.com/fair/api Converts the first 16 bytes of the generated entropy into a big-endian unsigned 128-bit integer. ```text rand128 = uint128_from_big_endian(entropy[0..16]) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.