@swarm-tips/client 0.2.2 → 0.2.4

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.2.2",
6
- "documentNamespace": "https://swarm.tips/sbom/client/0.2.2",
5
+ "name": "@swarm-tips/client-0.2.4",
6
+ "documentNamespace": "https://swarm.tips/sbom/client/0.2.4",
7
7
  "creationInfo": {
8
- "created": "2026-09-08T07:02:42.781Z",
8
+ "created": "2026-09-09T05:55:37.047Z",
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.2.2",
19
- "downloadLocation": "https://www.npmjs.com/package/@swarm-tips/client/v/0.2.2",
18
+ "versionInfo": "0.2.4",
19
+ "downloadLocation": "https://www.npmjs.com/package/@swarm-tips/client/v/0.2.4",
20
20
  "filesAnalyzed": false,
21
21
  "licenseConcluded": "MIT",
22
22
  "licenseDeclared": "MIT"
@@ -0,0 +1,52 @@
1
+ /** Canonical Coordination Game deployments, generated from the public chain registry. */
2
+ export declare const COORDINATION_GAME_DEPLOYMENTS: {
3
+ readonly "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1": {
4
+ readonly displayName: "Solana Devnet";
5
+ readonly network: "testnet";
6
+ readonly namespace: "solana";
7
+ readonly coordinationGame: "2qqVk7kUqffnahiJpcQJCsSd8ErbEUgKTgCn1zYsw64P";
8
+ readonly crossChainGame: "2qqVk7kUqffnahiJpcQJCsSd8ErbEUgKTgCn1zYsw64P";
9
+ readonly stakeBaseUnits: 50000000n;
10
+ readonly maxTrancheBaseUnits: 100000000n;
11
+ };
12
+ readonly "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp": {
13
+ readonly displayName: "Solana Mainnet";
14
+ readonly network: "mainnet";
15
+ readonly namespace: "solana";
16
+ readonly coordinationGame: "2qqVk7kUqffnahiJpcQJCsSd8ErbEUgKTgCn1zYsw64P";
17
+ readonly crossChainGame: "2qqVk7kUqffnahiJpcQJCsSd8ErbEUgKTgCn1zYsw64P";
18
+ readonly stakeBaseUnits: 68482585n;
19
+ readonly maxTrancheBaseUnits: 100000000n;
20
+ };
21
+ readonly "eip155:84532": {
22
+ readonly displayName: "Base Sepolia";
23
+ readonly network: "testnet";
24
+ readonly namespace: "eip155";
25
+ readonly coordinationGame: "0x4FBBceb96D2814b5d4ac26089Eb7E43471533253";
26
+ readonly crossChainGame: "0x7Cc7667f4B71c8eb1D4d3fADE088BFD8d01290AB";
27
+ readonly stakeBaseUnits: 3200000000000000n;
28
+ readonly maxTrancheBaseUnits: 6400000000000000n;
29
+ };
30
+ readonly "eip155:8453": {
31
+ readonly displayName: "Base";
32
+ readonly network: "mainnet";
33
+ readonly namespace: "eip155";
34
+ readonly coordinationGame: "0xd585baE48901513202dAEb7d4feE4Af508a96234";
35
+ readonly crossChainGame: "0x44aC6Eb44692Bcf724d7975B91B299E2c553Ca12";
36
+ readonly stakeBaseUnits: 2700000000000000n;
37
+ readonly maxTrancheBaseUnits: 5400000000000000n;
38
+ };
39
+ readonly "eip155:1": {
40
+ readonly displayName: "Ethereum";
41
+ readonly network: "mainnet";
42
+ readonly namespace: "eip155";
43
+ readonly coordinationGame: "0x265818b054E8413Bab870e0Ce0D8aB68400CF0F9";
44
+ readonly crossChainGame: "0xb84638E5d03AE68c5dC58408e05C001918A23fe9";
45
+ readonly stakeBaseUnits: 2700000000000000n;
46
+ readonly maxTrancheBaseUnits: 5400000000000000n;
47
+ };
48
+ };
49
+ export type CoordinationGameChainId = keyof typeof COORDINATION_GAME_DEPLOYMENTS;
50
+ export type CoordinationGameDeployment = (typeof COORDINATION_GAME_DEPLOYMENTS)[CoordinationGameChainId];
51
+ /** Return the pinned deployment for a supported CAIP-2 chain ID. */
52
+ export declare function coordinationGameDeployment(chainId: string): CoordinationGameDeployment | undefined;
@@ -0,0 +1,52 @@
1
+ /** Canonical Coordination Game deployments, generated from the public chain registry. */
2
+ export const COORDINATION_GAME_DEPLOYMENTS = {
3
+ "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1": {
4
+ displayName: "Solana Devnet",
5
+ network: "testnet",
6
+ namespace: "solana",
7
+ coordinationGame: "2qqVk7kUqffnahiJpcQJCsSd8ErbEUgKTgCn1zYsw64P",
8
+ crossChainGame: "2qqVk7kUqffnahiJpcQJCsSd8ErbEUgKTgCn1zYsw64P",
9
+ stakeBaseUnits: 50000000n,
10
+ maxTrancheBaseUnits: 100000000n,
11
+ },
12
+ "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp": {
13
+ displayName: "Solana Mainnet",
14
+ network: "mainnet",
15
+ namespace: "solana",
16
+ coordinationGame: "2qqVk7kUqffnahiJpcQJCsSd8ErbEUgKTgCn1zYsw64P",
17
+ crossChainGame: "2qqVk7kUqffnahiJpcQJCsSd8ErbEUgKTgCn1zYsw64P",
18
+ stakeBaseUnits: 68482585n,
19
+ maxTrancheBaseUnits: 100000000n,
20
+ },
21
+ "eip155:84532": {
22
+ displayName: "Base Sepolia",
23
+ network: "testnet",
24
+ namespace: "eip155",
25
+ coordinationGame: "0x4FBBceb96D2814b5d4ac26089Eb7E43471533253",
26
+ crossChainGame: "0x7Cc7667f4B71c8eb1D4d3fADE088BFD8d01290AB",
27
+ stakeBaseUnits: 3200000000000000n,
28
+ maxTrancheBaseUnits: 6400000000000000n,
29
+ },
30
+ "eip155:8453": {
31
+ displayName: "Base",
32
+ network: "mainnet",
33
+ namespace: "eip155",
34
+ coordinationGame: "0xd585baE48901513202dAEb7d4feE4Af508a96234",
35
+ crossChainGame: "0x44aC6Eb44692Bcf724d7975B91B299E2c553Ca12",
36
+ stakeBaseUnits: 2700000000000000n,
37
+ maxTrancheBaseUnits: 5400000000000000n,
38
+ },
39
+ "eip155:1": {
40
+ displayName: "Ethereum",
41
+ network: "mainnet",
42
+ namespace: "eip155",
43
+ coordinationGame: "0x265818b054E8413Bab870e0Ce0D8aB68400CF0F9",
44
+ crossChainGame: "0xb84638E5d03AE68c5dC58408e05C001918A23fe9",
45
+ stakeBaseUnits: 2700000000000000n,
46
+ maxTrancheBaseUnits: 5400000000000000n,
47
+ },
48
+ };
49
+ /** Return the pinned deployment for a supported CAIP-2 chain ID. */
50
+ export function coordinationGameDeployment(chainId) {
51
+ return COORDINATION_GAME_DEPLOYMENTS[chainId];
52
+ }
@@ -4,3 +4,4 @@ export * from "./session.js";
4
4
  export * from "./session-funding.js";
5
5
  export * from "./transactions.js";
6
6
  export * from "./cross-chain.js";
7
+ export * from "../chains.js";
@@ -4,3 +4,4 @@ export * from "./session.js";
4
4
  export * from "./session-funding.js";
5
5
  export * from "./transactions.js";
6
6
  export * from "./cross-chain.js";
7
+ export * from "../chains.js";
@@ -3,3 +3,4 @@ export type { CoordinationGame } from "../contracts/index.js";
3
3
  export * from "./outcome-oracle.js";
4
4
  export * from "./battery.js";
5
5
  export * from "./protocol.js";
6
+ export * from "./chains.js";
@@ -2,3 +2,4 @@ export { COORDINATION_GAME_IDL, COORDINATION_GAME_IDL as IDL, COORDINATION_GAME_
2
2
  export * from "./outcome-oracle.js";
3
3
  export * from "./battery.js";
4
4
  export * from "./protocol.js";
5
+ export * from "./chains.js";
package/dist/http.js CHANGED
@@ -27,9 +27,14 @@ export class HttpClient {
27
27
  const operation = `${init.method ?? "GET"} ${path}`;
28
28
  const token = init.token ?? this.getToken?.();
29
29
  const headers = {
30
- "Content-Type": "application/json",
31
30
  ...init.headers,
32
31
  };
32
+ // A Content-Type header on a bodyless GET turns an otherwise simple
33
+ // cross-origin read into a CORS preflight. Public browser reads should not
34
+ // require OPTIONS for a body that does not exist.
35
+ if (init.body !== undefined && !headers["Content-Type"]) {
36
+ headers["Content-Type"] = "application/json";
37
+ }
33
38
  if (token)
34
39
  headers.Authorization = `Bearer ${token}`;
35
40
  let response;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** The unified client package version. Functional APIs live in typed subpaths. */
2
- export declare const CLIENT_VERSION: "0.2.2";
2
+ export declare const CLIENT_VERSION: "0.2.4";
3
3
  export declare const CLIENT_MANIFEST_SCHEMA: "swarm.client-manifest/v1";
4
4
  export { SwarmClientError } from "./errors.js";
5
5
  export type { SwarmClientErrorCode, SwarmClientErrorOptions } from "./errors.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  /** The unified client package version. Functional APIs live in typed subpaths. */
2
- export const CLIENT_VERSION = "0.2.2";
2
+ export const CLIENT_VERSION = "0.2.4";
3
3
  export const CLIENT_MANIFEST_SCHEMA = "swarm.client-manifest/v1";
4
4
  export { SwarmClientError } from "./errors.js";
@@ -49,7 +49,7 @@ export class SwarmClient {
49
49
  async toolCount() {
50
50
  const headers = { "Content-Type": "application/json", Accept: "application/json, text/event-stream" };
51
51
  try {
52
- const init = await this.fetchImpl(`${this.baseUrl}/mcp`, { method: "POST", headers, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "initialize", params: { protocolVersion: "2025-03-26", capabilities: {}, clientInfo: { name: "swarm-client", version: "0.2.2" } } }) });
52
+ const init = await this.fetchImpl(`${this.baseUrl}/mcp`, { method: "POST", headers, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "initialize", params: { protocolVersion: "2025-03-26", capabilities: {}, clientInfo: { name: "swarm-client", version: "0.2.4" } } }) });
53
53
  if (!init.ok)
54
54
  return null;
55
55
  const session = init.headers.get("mcp-session-id");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarm-tips/client",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Typed browser and Node.js clients for Swarm Tips, Shillbot, and Coordination Game",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",