Πύλη προγραμματιστών

Πύλη προγραμματιστών / Τεκμηρίωση API

Τεχνική τεκμηρίωση στα αγγλικά

operator API  /  Public

Public provably-fair record of one shared crash game

GET/api/v1/public/crash/{game_code}

Up to 5 real-money hash chains and 100 revealed rounds for this code only. Demo rooms are never published.

Authentication

Public endpoint · no signing headers

Parameters

game_codepath · required
{ "type": "string", "maxLength": 32, "pattern": "^[a-z0-9-]+$", "examples": [ "dice", "zenith", "thunder-anvil" ] }

Responses

200 The record.

The record.

application/json
gamestring · required
how_to_verifyarray · required
chainsarray · required
roundsarray · required
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "game",
    "how_to_verify",
    "chains",
    "rounds"
  ],
  "properties": {
    "game": {
      "type": "string",
      "maxLength": 32,
      "pattern": "^[a-z0-9-]+$",
      "examples": [
        "dice",
        "zenith",
        "thunder-anvil"
      ]
    },
    "how_to_verify": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "chains": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "chain_no": {
            "type": "integer"
          },
          "commitment": {
            "type": "string"
          },
          "length": {
            "type": "integer"
          },
          "edge_bps": {
            "type": "integer"
          },
          "max_e2": {
            "type": "integer",
            "minimum": 101,
            "maximum": 100000000,
            "description": "Immutable crash point ceiling in hundredths."
          },
          "salt": {
            "type": [
              "string",
              "null"
            ]
          },
          "salt_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "integer"
          },
          "salted_at": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      }
    },
    "rounds": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "seq": {
            "type": "integer"
          },
          "chain_no": {
            "type": "integer"
          },
          "seed_index": {
            "type": "integer"
          },
          "seed": {
            "type": "string"
          },
          "crash": {
            "type": "string",
            "examples": [
              "2.47"
            ]
          },
          "ended_at": {
            "type": "integer"
          }
        }
      }
    }
  }
}
404 Not a registered crash game.

Not a registered crash game.

Request signing samples

Canonical string and HMAC helpers from the downloadable samples. Wallet callbacks may also use Ed25519; see the wallet signing modes.

Node.js node/spilvon.mjs
Node.js
export const signingString = (ts, method, pathAndQuery, body) => `${ts}.${method.toUpperCase()}.${pathAndQuery}.${body}`;
export const hmacHex = (secret, s) => createHmac("sha256", secret).update(s, "utf8").digest("hex");
Download full sample
Python python/spilvon.py
Python
def signing_string(ts: str, method: str, path_and_query: str, body: str) -> str:
    return f"{ts}.{method.upper()}.{path_and_query}.{body}"


def hmac_hex(secret: str, s: str) -> str:
    return hmac.new(secret.encode(), s.encode("utf-8"), hashlib.sha256).hexdigest()
Download full sample
Go go/main.go
Go
func signingString(ts, method, pathAndQuery, body string) string {
	return ts + "." + strings.ToUpper(method) + "." + pathAndQuery + "." + body
}

func hmacHex(secret, s string) string {
	m := hmac.New(sha256.New, []byte(secret))
	m.Write([]byte(s))
	return hex.EncodeToString(m.Sum(nil))
}
Download full sample · go.mod
PHP php/spilvon.php
PHP
function signing_string(string $ts, string $method, string $pathAndQuery, string $body): string {
    return $ts . '.' . strtoupper($method) . '.' . $pathAndQuery . '.' . $body;
}

function hmac_hex(string $secret, string $s): string {
    return hash_hmac('sha256', $s, $secret);
}
Download full sample

Reviewed, not executed by the sample authors.