@swarm-tips/client 0.4.11 → 0.4.12

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.
package/SBOM.spdx.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "spdxVersion": "SPDX-2.3",
3
3
  "dataLicense": "CC0-1.0",
4
4
  "SPDXID": "SPDXRef-DOCUMENT",
5
- "name": "@swarm-tips/client-0.4.11",
6
- "documentNamespace": "https://swarm.tips/sbom/client/0.4.11",
5
+ "name": "@swarm-tips/client-0.4.12",
6
+ "documentNamespace": "https://swarm.tips/sbom/client/0.4.12",
7
7
  "creationInfo": {
8
- "created": "2026-11-27T14:59:47.831Z",
8
+ "created": "2026-11-28T08:02:11.672Z",
9
9
  "creators": [
10
10
  "Tool: sdk/client/scripts/generate-sbom.mjs",
11
11
  "Organization: Swarm Tips"
@@ -15,8 +15,8 @@
15
15
  {
16
16
  "name": "@swarm-tips/client",
17
17
  "SPDXID": "SPDXRef-Package",
18
- "versionInfo": "0.4.11",
19
- "downloadLocation": "https://www.npmjs.com/package/@swarm-tips/client/v/0.4.11",
18
+ "versionInfo": "0.4.12",
19
+ "downloadLocation": "https://www.npmjs.com/package/@swarm-tips/client/v/0.4.12",
20
20
  "filesAnalyzed": false,
21
21
  "licenseConcluded": "MIT",
22
22
  "licenseDeclared": "MIT"
@@ -63,6 +63,7 @@ export declare function sendConfirmedTx(wallet: TxSender, pinned: PinnedReader,
63
63
  to: Hex;
64
64
  data: Hex;
65
65
  value: bigint;
66
+ gas?: bigint;
66
67
  }, label: string, { attempts, confirmMs, pollMs, }?: {
67
68
  attempts?: number;
68
69
  confirmMs?: number;
@@ -74,6 +75,7 @@ export declare function sendConfirmedGameTx(sessionKey: Hex, chain: Chain, rpcUr
74
75
  to: Hex;
75
76
  data: Hex;
76
77
  value: bigint;
78
+ gas?: bigint;
77
79
  }, label: string): Promise<TransactionReceipt>;
78
80
  /** CoordinationGame.sol Status enum: None=0, Pending=1, Active=2, Committing=3,
79
81
  * Revealing=4, Resolved=5. Any value >= 1 means the game EXISTS on-chain. */
@@ -123,6 +125,17 @@ export declare function gameExistsOnChain(contract: Hex, gameId: Hex, chain: Cha
123
125
  * anyway); re-throws only when the send threw AND the game is not on-chain.
124
126
  */
125
127
  export declare function sendCreateGameConfirmingEffect(send: () => Promise<unknown>, gameExists: () => Promise<boolean>): Promise<"sent" | "recovered">;
128
+ /**
129
+ * Gas limit floor for `revealGuess`.
130
+ *
131
+ * When both players reveal concurrently, `eth_estimateGas` simulates the cheap
132
+ * 1st-revealer path (~53k gas, storing one guess). Whichever transaction mines
133
+ * 2nd enters `_resolve()` (payouts, season accounting, and two ETH transfers,
134
+ * ~180k–250k gas) and reverts `OutOfGas` if capped at ~53k. EVM only bills
135
+ * `gasUsed`, so a 350k floor costs nothing extra for the 1st revealer while
136
+ * preventing concurrent 2nd-revealer `OutOfGas` reverts.
137
+ */
138
+ export declare const EVM_REVEAL_GUESS_MIN_GAS = 350000n;
126
139
  /**
127
140
  * Send a game CONTRACT call (session-key signed) and CONFIRM it. Encodes the call
128
141
  * and routes through sendConfirmedTx, so every game tx — createGame, joinGame,
@@ -134,4 +147,5 @@ export declare function sendAndConfirm(sessionKey: Hex, chain: Chain, rpcUrls: s
134
147
  functionName: string;
135
148
  args: readonly unknown[];
136
149
  to: Hex;
150
+ gas?: bigint;
137
151
  }, label: string): Promise<void>;
@@ -195,6 +195,17 @@ export async function sendCreateGameConfirmingEffect(send, gameExists) {
195
195
  throw e;
196
196
  }
197
197
  }
198
+ /**
199
+ * Gas limit floor for `revealGuess`.
200
+ *
201
+ * When both players reveal concurrently, `eth_estimateGas` simulates the cheap
202
+ * 1st-revealer path (~53k gas, storing one guess). Whichever transaction mines
203
+ * 2nd enters `_resolve()` (payouts, season accounting, and two ETH transfers,
204
+ * ~180k–250k gas) and reverts `OutOfGas` if capped at ~53k. EVM only bills
205
+ * `gasUsed`, so a 350k floor costs nothing extra for the 1st revealer while
206
+ * preventing concurrent 2nd-revealer `OutOfGas` reverts.
207
+ */
208
+ export const EVM_REVEAL_GUESS_MIN_GAS = 350000n;
198
209
  /**
199
210
  * Send a game CONTRACT call (session-key signed) and CONFIRM it. Encodes the call
200
211
  * and routes through sendConfirmedTx, so every game tx — createGame, joinGame,
@@ -207,5 +218,6 @@ export async function sendAndConfirm(sessionKey, chain, rpcUrls, call, label) {
207
218
  functionName: call.functionName,
208
219
  args: call.args,
209
220
  });
210
- await sendConfirmedGameTx(sessionKey, chain, rpcUrls, { to: call.to, data, value: 0n }, label);
221
+ const gas = call.gas ?? (call.functionName === "revealGuess" ? EVM_REVEAL_GUESS_MIN_GAS : undefined);
222
+ await sendConfirmedGameTx(sessionKey, chain, rpcUrls, { to: call.to, data, value: 0n, ...(gas !== undefined ? { gas } : {}) }, label);
211
223
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const CLIENT_VERSION = "0.4.11";
1
+ export declare const CLIENT_VERSION = "0.4.12";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLIENT_VERSION = "0.4.11";
1
+ export const CLIENT_VERSION = "0.4.12";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarm-tips/client",
3
- "version": "0.4.11",
3
+ "version": "0.4.12",
4
4
  "mcpName": "io.github.corsur/swarm-tips",
5
5
  "description": "Typed browser and Node.js clients for Swarm Tips, Shillbot, and Coordination Game",
6
6
  "type": "module",