@flayerlabs/gamemode-gate 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/DEPLOY.md +1 -1
  2. package/README.md +31 -0
  3. package/package.json +2 -2
package/DEPLOY.md CHANGED
@@ -36,7 +36,7 @@ gate whose signatures a swap can actually verify.
36
36
  | `SESSION_SECRET` | yes | At least 32 characters, not the demo fallback. |
37
37
  | `SIGN_IN_DOMAIN` | yes | The page the player is looking at when they sign in — the embedding site (e.g. `flaunch.gg`), not the game and not this gate. |
38
38
  | `GATE_ORIGIN` | yes | This gate's own public https origin (e.g. `https://gate.example.com`) — the audience its sessions are scoped to. Configured, never derived from a request header. |
39
- | `ALLOWED_ORIGINS` | yes | Comma-separated origins allowed to call this gate: your game's Moongate origin(s) and the flaunch page origins. |
39
+ | `ALLOWED_ORIGINS` | yes | Comma-separated origins allowed to call this gate: your game's Moongate origin(s) AND every page that embeds it — the coin page calls `/rounds/adopt` itself. Production is `https://flaunch.gg`; a staging or preview launch page has its own origin and needs listing while you test against it. A launch that fails with a CORS error names the missing origin in its `Referer`. |
40
40
  | `PORT` | no | Default `8790`. |
41
41
  | `POSITION_MANAGER`, `SPEND_GATED_CALCULATOR` | no | Address-book overrides. Set both only with addresses read back from the chain in question — a wrong address fails silently (see `chain/chains.ts`). |
42
42
  | `SETTLER` | no | The address that may lift the gate early or rotate the signer on-chain. Defaults to the signing key's address; the gate expires on chain by itself either way. |
package/README.md CHANGED
@@ -101,6 +101,37 @@ const app = createGameServerGate({
101
101
  })
102
102
  ```
103
103
 
104
+ The launch page reads `GET /config` before it lets anyone launch a coin through your game, and
105
+ `createGameServerGate()` serves that route only when you pass `announce` — without it the form
106
+ reports your gate as not answering. Add it to the options:
107
+
108
+ ```ts
109
+ const app = createGameServerGate({
110
+ // ...the options above...
111
+ announce: () => ({
112
+ chainId: 84532,
113
+ contracts: {
114
+ positionManager: '0x4E7cB1e6800a7B297B38BddcecAF9Ca5b6616FDC',
115
+ spendGatedCalculator: '0x8cbbE6b4cFA5Ccf68399Dbf1429d91A21097ebA5',
116
+ },
117
+ signer: signerAddress,
118
+ settler: signerAddress,
119
+ walletCapWei: '25000000000000000',
120
+ roundDurationMs: 90_000,
121
+ minLobbyLeadMs: 60_000,
122
+ gateEndsAtGraceS: 10,
123
+ flaunchVariant: 'legacy11',
124
+ requiresEoa: false,
125
+ accepting: true,
126
+ publicLaunchesOpen: true,
127
+ privateLaunches: false,
128
+ }),
129
+ })
130
+ ```
131
+
132
+ The addresses are per chain (the pair above is Base Sepolia); announce a signer you actually hold —
133
+ launches write it into their pools as the trusted signer. Verify with `curl https://<gate>/config`.
134
+
104
135
  Generate a random 256-bit award token, for example with `openssl rand -hex 32`. Keep it on the gate
105
136
  and authoritative game server. Never send it to the browser or use a memorable value.
106
137
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flayerlabs/gamemode-gate",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Server-authoritative rooms, economy, admission and registry for Flaunch Game Modes",
5
5
  "license": "MIT",
6
6
  "author": "Flayer Labs",
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "@fastify/cors": "^11.3.0",
47
47
  "@fastify/websocket": "^11.3.0",
48
- "@flayerlabs/gamemode-spec": "^0.4.0",
48
+ "@flayerlabs/gamemode-spec": "^0.4.2",
49
49
  "@types/node": "^22.10.2",
50
50
  "@types/pg": "^8.21.0",
51
51
  "fastify": "^5.11.3",