พอร์ทัลนักพัฒนา

พอร์ทัลนักพัฒนา / เอกสารอ้างอิง API

เอกสารทางเทคนิคภาษาอังกฤษ

operator API  /  Catalogue

Game catalogue

GET/api/v1/operator/games

Every SPILVON game with its status for you, in normalised typed fields (identical for every game), and the game's own facts under details (pay tables, chance ranges ...). For compatibility the game's own facts are also still present at the top level where they do not clash with a normalised field. currencies[] lists the stakes a player can choose in each currency your account offers (a jurisdiction's stake cap can lower max_bet further in a session). Tiles are served cross-origin for your lobby. May be cached 5 minutes.

Authentication

X-Spilvon-Operator + X-Spilvon-Timestamp + X-Spilvon-Signature

Responses

200 The catalogue.

The catalogue.

application/json
gamesarray · required
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "games"
  ],
  "properties": {
    "games": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "code",
          "name",
          "kind",
          "enabled",
          "client_ready",
          "demo",
          "free_rounds",
          "rtp",
          "max_win_x",
          "volatility",
          "hit_frequency",
          "features",
          "platforms",
          "languages",
          "currencies",
          "assets",
          "details"
        ],
        "additionalProperties": true,
        "description": "Normalised fields (the same for every game); the game's own facts are in `details` (and, for compatibility, also at the top level where they do not clash).",
        "properties": {
          "code": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^[a-z0-9-]+$",
            "examples": [
              "dice",
              "zenith",
              "thunder-anvil"
            ]
          },
          "name": {
            "type": "string",
            "description": "Display name."
          },
          "kind": {
            "type": "string",
            "enum": [
              "instant",
              "slot",
              "crash"
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether you may launch it."
          },
          "client_ready": {
            "type": "boolean",
            "description": "Whether the game has a finished player-facing client. Launch only games where this is true."
          },
          "demo": {
            "type": "boolean",
            "description": "Whether demo (play-money) sessions are possible."
          },
          "free_rounds": {
            "type": "boolean",
            "description": "Whether free-round awards can name this game."
          },
          "rtp": {
            "type": "string",
            "description": "Theoretical return to player in percent, as configured for you.",
            "examples": [
              "97.00"
            ]
          },
          "max_win_x": {
            "type": [
              "number",
              "null"
            ],
            "description": "Largest payout of one round as a multiple of the stake. Always a number (null if the game states none)."
          },
          "volatility": {
            "type": [
              "string",
              "null"
            ],
            "description": "e.g. \"low\", \"medium\", \"high\"; null if not stated."
          },
          "hit_frequency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Percentage of rounds that win, as a decimal string; null if not stated."
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet"
              ]
            }
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Languages the game ships in."
          },
          "currencies": {
            "type": "array",
            "description": "The stakes a player can choose in each currency your account offers.",
            "items": {
              "type": "object",
              "required": [
                "code",
                "min_bet",
                "max_bet",
                "max_win",
                "stake_step",
                "base"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9]{2,8}$",
                  "description": "Currency enabled for your operator account: USD, EUR, GBP, TRY, USDT, USDC, TRX, BTC, ETH, LTC, SOL, DOGE, and the display units mBTC, uBTC, mETH, uETH, mLTC, uLTC (same money as the base coin, scaled; the session, wallet calls and reports then all use the unit code and its decimals).",
                  "examples": [
                    "USD",
                    "USDT",
                    "BTC"
                  ]
                },
                "min_bet": {
                  "type": "string",
                  "description": "Decimal string with at most the currency's number of decimals; no sign, no exponent.",
                  "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,8})?$",
                  "examples": [
                    "12.50",
                    "0.00010000"
                  ]
                },
                "max_bet": {
                  "type": "string",
                  "description": "Decimal string with at most the currency's number of decimals; no sign, no exponent.",
                  "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,8})?$",
                  "examples": [
                    "12.50",
                    "0.00010000"
                  ]
                },
                "max_win": {
                  "type": "string",
                  "description": "Decimal string with at most the currency's number of decimals; no sign, no exponent.",
                  "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,8})?$",
                  "examples": [
                    "12.50",
                    "0.00010000"
                  ]
                },
                "stake_step": {
                  "allOf": [
                    {
                      "type": "string",
                      "description": "Decimal string with at most the currency's number of decimals; no sign, no exponent.",
                      "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,8})?$",
                      "examples": [
                        "12.50",
                        "0.00010000"
                      ]
                    }
                  ],
                  "description": "Every stake is a multiple of this (your account's stake step",
                  "or the currency's smallest unit).": null
                },
                "base": {
                  "description": "For a unit currency (mBTC), its base and scale (1 unit = 10^-scale base).",
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "object",
                      "required": [
                        "code",
                        "scale"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "scale": {
                          "type": "integer"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "assets": {
            "type": "object",
            "description": "Lobby tiles (WebP, served with Cross-Origin-Resource-Policy cross-origin).",
            "properties": {
              "square": {
                "type": "object",
                "required": [
                  "url",
                  "width",
                  "height",
                  "format"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "width": {
                    "type": "integer"
                  },
                  "height": {
                    "type": "integer"
                  },
                  "format": {
                    "type": "string"
                  }
                }
              },
              "wide": {
                "type": "object",
                "required": [
                  "url",
                  "width",
                  "height",
                  "format"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "width": {
                    "type": "integer"
                  },
                  "height": {
                    "type": "integer"
                  },
                  "format": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "Game-specific facts. For crash games the edge and ceiling belong to the shared game, not the operator.",
            "properties": {
              "edge_bps": {
                "type": "integer"
              },
              "max_multiplier": {
                "description": "For crash games, the ceiling as a decimal multiplier string."
              },
              "min_auto_cashout": {
                "type": "string"
              },
              "max_bets_per_round": {
                "type": "integer",
                "minimum": 1,
                "maximum": 3
              },
              "curve_k": {
                "type": "number",
                "description": "Exponential growth constant per millisecond."
              },
              "betting_ms": {
                "type": "integer"
              },
              "pause_ms": {
                "type": "integer"
              },
              "partial_cashout": {
                "type": "boolean"
              }
            }
          }
        }
      }
    }
  }
}
Example
{
  "games": [
    {
      "code": "magma-vault",
      "name": "Magma Vault",
      "kind": "slot",
      "enabled": true,
      "client_ready": true,
      "demo": true,
      "free_rounds": true,
      "rtp": "96.10",
      "max_win_x": 5050,
      "volatility": "high",
      "hit_frequency": "24.80",
      "features": [
        "hold-and-win"
      ],
      "platforms": [
        "desktop",
        "mobile",
        "tablet"
      ],
      "languages": [
        "en",
        "tr",
        "de",
        "es",
        "pt",
        "fr",
        "it",
        "nl",
        "pl",
        "ru",
        "uk",
        "el",
        "fi",
        "ja",
        "ko",
        "zh",
        "id",
        "vi",
        "th",
        "hi"
      ],
      "currencies": [
        {
          "code": "USD",
          "min_bet": "0.10",
          "max_bet": "49.50",
          "max_win": "250000.00",
          "stake_step": "0.01",
          "base": null
        },
        {
          "code": "mBTC",
          "min_bet": "0.00100",
          "max_bet": "0.00990",
          "max_win": "25.00000",
          "stake_step": "0.00001",
          "base": {
            "code": "BTC",
            "scale": 3
          }
        }
      ],
      "assets": {
        "square": {
          "url": "https://games.example/static/magma-vault/assets/tile-square.webp",
          "width": 600,
          "height": 600,
          "format": "webp"
        },
        "wide": {
          "url": "https://games.example/static/magma-vault/assets/tile-wide.webp",
          "width": 1200,
          "height": 675,
          "format": "webp"
        }
      },
      "details": {
        "rtp": "96.10",
        "reels": 5,
        "rows": 3
      }
    },
    {
      "code": "dice",
      "name": "Setpoint",
      "kind": "instant",
      "enabled": true,
      "client_ready": true,
      "free_rounds": true,
      "rtp": "99.00",
      "min_chance": "0.01",
      "max_chance": "98.00"
    }
  ]
}
401 Authentication failed: INVALID_SIGNATURE (unknown operator, missing/malform

Authentication failed: INVALID_SIGNATURE (unknown operator, missing/malformed headers or a wrong signature, deliberately indistinguishable), TIMESTAMP_OUT_OF_RANGE (check your clock), REPLAYED_REQUEST (this exact signed request was already received: sign again).

application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
Example
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "authentication failed"
  },
  "request_id": "6f1c2a54-5b1e-4a8e-9a43-3f3e8b8f9d10"
}
403 IP_NOT_ALLOWED (caller IP not on your allowlist) or OPERATOR_SUSPENDED.

IP_NOT_ALLOWED (caller IP not on your allowlist) or OPERATOR_SUSPENDED.

application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
Example
{
  "error": {
    "code": "IP_NOT_ALLOWED",
    "message": "this IP address is not on the operator's allowlist"
  },
  "request_id": "6f1c2a54-5b1e-4a8e-9a43-3f3e8b8f9d10"
}
429 RATE_LIMITED. Wait Retry-After seconds.

RATE_LIMITED. Wait Retry-After seconds.

Response headers
Headers
{
  "Retry-After": {
    "description": "Seconds until the current one-minute window ends.",
    "schema": {
      "type": "integer",
      "minimum": 1
    }
  },
  "X-RateLimit-Limit": {
    "description": "Requests allowed per minute.",
    "schema": {
      "type": "integer"
    }
  },
  "X-RateLimit-Remaining": {
    "description": "Always 0 on a 429.",
    "schema": {
      "type": "integer"
    }
  }
}
application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
Example
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "rate limit of 3000 requests per minute exceeded; retry after 12 s"
  },
  "request_id": "6f1c2a54-5b1e-4a8e-9a43-3f3e8b8f9d10"
}
500 INTERNAL_ERROR. Safe to retry with a freshly signed request; quote request_

INTERNAL_ERROR. Safe to retry with a freshly signed request; quote request_id if it persists.

application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}

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.