@swarm-tips/client 0.4.3 → 0.4.5

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/README.md CHANGED
@@ -27,7 +27,7 @@ const inbox = await agent.inbox.list({ status: "pending" });
27
27
 
28
28
  All signers keep private key material strictly in closure scope (redacted from `JSON.stringify`, `String()`, and `util.inspect`) and work in both browser and Node runtimes without Node built-ins:
29
29
 
30
- - `fromSolanaKeypair(keypair)` / `fromSolanaSecretKey(secret)` (`Uint8Array`, base58, or JSON byte array) / `fromSolanaWalletAdapter(adapter)`
30
+ - `fromSolanaKeypair(keypairOrSecretBytes)` (`Keypair` or 64-byte `Uint8Array`) / `fromSolanaSecretKey(secret)` (`Uint8Array`, base58, or JSON byte array) / `fromSolanaWalletAdapter(adapter)`
31
31
  - `fromEvmPrivateKey(hex, { chainId, rpcUrl })` / `fromEvmWalletClient(walletClient)`
32
32
 
33
33
  ### Local Safety Guarantees (C1, C6, C9, C10)
@@ -44,9 +44,10 @@ The package installs `swarm` (plus `npx -y @swarm-tips/client`, `swarm-tx`, and
44
44
  # Inspect wallet identity (keypair file must be chmod 600 on POSIX; raw --private-key flags are rejected)
45
45
  swarm auth whoami --keypair-file ~/.config/solana/id.json
46
46
 
47
- # Discover listings, tasks, and inbox messages (JSON auto-enabled when piped)
47
+ # Discover listings, tasks, task details, and inbox messages (JSON auto-enabled when piped)
48
48
  swarm listings --limit 10
49
49
  swarm tasks list --limit 20
50
+ swarm tasks get <task_id> --json
50
51
  swarm inbox list --status pending
51
52
 
52
53
  # Verify an unsigned Shillbot base64 transaction locally before signing (exit 0 = safe, exit 1 = rejected)
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.3",
6
- "documentNamespace": "https://swarm.tips/sbom/client/0.4.3",
5
+ "name": "@swarm-tips/client-0.4.5",
6
+ "documentNamespace": "https://swarm.tips/sbom/client/0.4.5",
7
7
  "creationInfo": {
8
- "created": "2026-11-13T03:56:51.595Z",
8
+ "created": "2026-11-15T20:57:08.285Z",
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.3",
19
- "downloadLocation": "https://www.npmjs.com/package/@swarm-tips/client/v/0.4.3",
18
+ "versionInfo": "0.4.5",
19
+ "downloadLocation": "https://www.npmjs.com/package/@swarm-tips/client/v/0.4.5",
20
20
  "filesAnalyzed": false,
21
21
  "licenseConcluded": "MIT",
22
22
  "licenseDeclared": "MIT"
package/dist/agent.d.ts CHANGED
@@ -95,7 +95,7 @@ export declare class SwarmAgent {
95
95
  };
96
96
  readonly tasks: {
97
97
  listAvailable: <TTask = unknown>(limit?: number) => Promise<TaskListResponse<TTask>>;
98
- get: <TTask = unknown>(id: string) => Promise<TTask>;
98
+ get: <TTask = unknown>(id: string, network?: SwarmNetwork) => Promise<TTask>;
99
99
  mine: <TTask = unknown>() => Promise<TTask[]>;
100
100
  earnings: <TResponse = unknown>() => Promise<TResponse>;
101
101
  onboard: <TResponse = unknown>() => Promise<TResponse>;
package/dist/agent.js CHANGED
@@ -197,7 +197,7 @@ export class SwarmAgent {
197
197
  };
198
198
  this.tasks = {
199
199
  listAvailable: (limit = 50) => self.shillbotClient.listTasks(limit),
200
- get: (id) => self.shillbotClient.getTask(id),
200
+ get: (id, net) => self.shillbotClient.getTask(id, net),
201
201
  async mine() {
202
202
  const res = await self.shillbotClient.listAgentTasks();
203
203
  return Array.isArray(res) ? res : (res.tasks ?? []);
package/dist/cli/swarm.js CHANGED
@@ -101,7 +101,7 @@ Commands:
101
101
  auth whoami | token
102
102
  listings [--limit N] [--category CAT] [--chain CHAIN]
103
103
  reputation <wallet>
104
- tasks list [--limit N] | mine | earnings | next <task-json-or-id>
104
+ tasks list [--limit N] | get <id> | mine | earnings | next <task-json-or-id>
105
105
  tasks claim <id> [--payout-to <pubkey>] [--no-exec]
106
106
  tasks submit <id> --content <str> [--payout-to <pubkey>] [--no-exec]
107
107
  tasks verify <id> [--no-exec]
@@ -317,6 +317,15 @@ export async function runSwarmCli(argv, io = {}) {
317
317
  writeOutput(stdout, jsonMode, res);
318
318
  return 0;
319
319
  }
320
+ if (sub === "get") {
321
+ const id = rest[0]?.trim();
322
+ if (!id) {
323
+ throw new CliUsageError("Usage: swarm tasks get <task_id>");
324
+ }
325
+ const res = await agent.tasks.get(id);
326
+ writeOutput(stdout, jsonMode, res);
327
+ return 0;
328
+ }
320
329
  if (sub === "mine") {
321
330
  const tasks = await agent.tasks.mine();
322
331
  writeOutput(stdout, jsonMode, { tasks });
@@ -382,7 +391,7 @@ export async function runSwarmCli(argv, io = {}) {
382
391
  writeOutput(stdout, jsonMode, res);
383
392
  return 0;
384
393
  }
385
- throw new CliUsageError("Usage: swarm tasks <list|mine|earnings|next|claim|submit|verify|finalize> ...");
394
+ throw new CliUsageError("Usage: swarm tasks <list|get|mine|earnings|next|claim|submit|verify|finalize> ...");
386
395
  }
387
396
  if (cmd === "inbox") {
388
397
  if (sub === "list") {
@@ -45,9 +45,12 @@ export interface XLegPayload {
45
45
  export interface XMatchPayload {
46
46
  match_id: string;
47
47
  tournament_id: number;
48
+ matchup_commitment: string;
48
49
  match_live_digest: string;
49
50
  operator_signature: string;
50
51
  create_match_operator_sig: string;
52
+ quote_timestamp: number;
53
+ quote_max_age_secs: number;
51
54
  fund_deadline: number;
52
55
  match_deadline: number;
53
56
  claim_window_secs: number;
@@ -55,6 +58,35 @@ export interface XMatchPayload {
55
58
  leg_a: XLegPayload;
56
59
  leg_b: XLegPayload;
57
60
  }
61
+ export interface XOutcomeCertPayload {
62
+ match_id: string;
63
+ match_live_digest: string;
64
+ outcome_digest: string;
65
+ outcome_kind: number;
66
+ step_count: number;
67
+ p1_guess: number;
68
+ p2_guess: number;
69
+ first_committer: number;
70
+ matchup_type: number;
71
+ transcript_hash: string;
72
+ operator_outcome_sig: string;
73
+ ready?: boolean;
74
+ live_sigs?: [string, string, string] | null;
75
+ oc_sigs?: [string, string, string] | null;
76
+ [key: string]: unknown;
77
+ }
78
+ export interface XSettleSigsResponse {
79
+ match_id: string;
80
+ ready: boolean;
81
+ live_sigs: [string, string, string] | null;
82
+ oc_sigs: [string, string, string] | null;
83
+ }
84
+ export interface XSolSettleTxResponse {
85
+ unsigned_tx: string;
86
+ blockhash: string;
87
+ match_id: string;
88
+ action: string;
89
+ }
58
90
  export interface XQueueResponse {
59
91
  status: "waiting" | "matched";
60
92
  match?: XMatchPayload;
@@ -172,6 +204,23 @@ export declare class CoordinationGameApiClient {
172
204
  } | {
173
205
  wallet: string;
174
206
  }): Promise<XGameplayView>;
207
+ submitCrossChainSettleSigs(body: {
208
+ handle?: string;
209
+ wallet?: string;
210
+ live_signature?: string;
211
+ outcome_signature?: string;
212
+ }, token?: string): Promise<XSettleSigsResponse>;
213
+ crossChainOutcomeCosign(body: {
214
+ handle?: string;
215
+ wallet?: string;
216
+ live_signature?: string;
217
+ outcome_signature?: string;
218
+ }, token?: string): Promise<XOutcomeCertPayload>;
219
+ buildCrossChainSolSettle(body: {
220
+ handle?: string;
221
+ wallet?: string;
222
+ payer?: string;
223
+ }, token?: string): Promise<XSolSettleTxResponse>;
175
224
  joinEvmGame(body: {
176
225
  wallet: string;
177
226
  player_wallet?: string;
@@ -43,6 +43,15 @@ export class CoordinationGameApiClient {
43
43
  : `wallet=${encodeURIComponent(by.wallet)}`;
44
44
  return this.http.get(`/internal/xqueue/gameplay?${query}`);
45
45
  }
46
+ submitCrossChainSettleSigs(body, token) {
47
+ return this.http.post("/internal/xqueue/settle-sigs", body, token);
48
+ }
49
+ crossChainOutcomeCosign(body, token) {
50
+ return this.http.post("/internal/xqueue/outcome-cosign", body, token);
51
+ }
52
+ buildCrossChainSolSettle(body, token) {
53
+ return this.http.post("/internal/xqueue/build-sol-settle", body, token);
54
+ }
46
55
  joinEvmGame(body, token) {
47
56
  return this.http.post("/internal/evmgame/join", body, token);
48
57
  }
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * Minimal CrossChainGame ABI for client-side EVM-leg calls (viem
3
3
  * encodeFunctionData). Vendored from the Foundry artifact
4
- * (swarm-tips-repo/evm/out/CrossChainGame.sol/CrossChainGame.json) — only the
5
- * functions the cross-chain match UX needs: fund (createMatch), refund
6
- * (refundTimeout/refundNoCert), and the read views (stakeWei, CHAIN_TAG,
7
- * matches). Settle is permissionless and operator/harness-driven, so it is not
8
- * vendored here. Regenerate if the contract ABI changes.
4
+ * (swarm-tips-repo/evm/out/CrossChainGame.sol/CrossChainGame.json) — covers
5
+ * fund (createMatch), lock (lockTranche), settle, refund
6
+ * (refundTimeout/refundNoCert), and the read views (stakeWei, poolFree,
7
+ * CHAIN_TAG, matches). Regenerate if the contract ABI changes.
9
8
  */
10
9
  export declare const CROSS_CHAIN_GAME_ABI: readonly [{
11
10
  readonly type: "function";
@@ -51,6 +50,111 @@ export declare const CROSS_CHAIN_GAME_ABI: readonly [{
51
50
  }];
52
51
  readonly outputs: readonly [];
53
52
  readonly stateMutability: "payable";
53
+ }, {
54
+ readonly type: "function";
55
+ readonly name: "lockTranche";
56
+ readonly inputs: readonly [{
57
+ readonly name: "cert";
58
+ readonly type: "tuple";
59
+ readonly internalType: "struct CertLib.MatchLiveCert";
60
+ readonly components: readonly [{
61
+ readonly name: "matchId";
62
+ readonly type: "bytes32";
63
+ readonly internalType: "bytes32";
64
+ }, {
65
+ readonly name: "tournamentId";
66
+ readonly type: "uint64";
67
+ readonly internalType: "uint64";
68
+ }, {
69
+ readonly name: "matchupCommitment";
70
+ readonly type: "bytes32";
71
+ readonly internalType: "bytes32";
72
+ }, {
73
+ readonly name: "legA";
74
+ readonly type: "tuple";
75
+ readonly internalType: "struct CertLib.Leg";
76
+ readonly components: readonly [{
77
+ readonly name: "chainTag";
78
+ readonly type: "bytes32";
79
+ readonly internalType: "bytes32";
80
+ }, {
81
+ readonly name: "contractId";
82
+ readonly type: "bytes32";
83
+ readonly internalType: "bytes32";
84
+ }, {
85
+ readonly name: "player";
86
+ readonly type: "bytes32";
87
+ readonly internalType: "bytes32";
88
+ }, {
89
+ readonly name: "sessionKey";
90
+ readonly type: "address";
91
+ readonly internalType: "address";
92
+ }, {
93
+ readonly name: "stake";
94
+ readonly type: "uint128";
95
+ readonly internalType: "uint128";
96
+ }, {
97
+ readonly name: "tranche";
98
+ readonly type: "uint128";
99
+ readonly internalType: "uint128";
100
+ }];
101
+ }, {
102
+ readonly name: "legB";
103
+ readonly type: "tuple";
104
+ readonly internalType: "struct CertLib.Leg";
105
+ readonly components: readonly [{
106
+ readonly name: "chainTag";
107
+ readonly type: "bytes32";
108
+ readonly internalType: "bytes32";
109
+ }, {
110
+ readonly name: "contractId";
111
+ readonly type: "bytes32";
112
+ readonly internalType: "bytes32";
113
+ }, {
114
+ readonly name: "player";
115
+ readonly type: "bytes32";
116
+ readonly internalType: "bytes32";
117
+ }, {
118
+ readonly name: "sessionKey";
119
+ readonly type: "address";
120
+ readonly internalType: "address";
121
+ }, {
122
+ readonly name: "stake";
123
+ readonly type: "uint128";
124
+ readonly internalType: "uint128";
125
+ }, {
126
+ readonly name: "tranche";
127
+ readonly type: "uint128";
128
+ readonly internalType: "uint128";
129
+ }];
130
+ }, {
131
+ readonly name: "quoteTimestamp";
132
+ readonly type: "uint64";
133
+ readonly internalType: "uint64";
134
+ }, {
135
+ readonly name: "quoteMaxAgeSecs";
136
+ readonly type: "uint32";
137
+ readonly internalType: "uint32";
138
+ }, {
139
+ readonly name: "matchDeadline";
140
+ readonly type: "uint64";
141
+ readonly internalType: "uint64";
142
+ }, {
143
+ readonly name: "claimWindowSecs";
144
+ readonly type: "uint32";
145
+ readonly internalType: "uint32";
146
+ }, {
147
+ readonly name: "aIsP1";
148
+ readonly type: "uint8";
149
+ readonly internalType: "uint8";
150
+ }];
151
+ }, {
152
+ readonly name: "operatorSig";
153
+ readonly type: "bytes";
154
+ readonly internalType: "bytes";
155
+ }];
156
+ readonly outputs: readonly [];
157
+ readonly stateMutability: "nonpayable";
54
158
  }, {
55
159
  readonly type: "function";
56
160
  readonly name: "matches";
@@ -123,6 +227,20 @@ export declare const CROSS_CHAIN_GAME_ABI: readonly [{
123
227
  readonly name: "bestOutcomeKind";
124
228
  readonly type: "uint8";
125
229
  readonly internalType: "uint8";
230
+ }, {
231
+ readonly name: "timeoutOpensAt";
232
+ readonly type: "uint64";
233
+ readonly internalType: "uint64";
234
+ }];
235
+ readonly stateMutability: "view";
236
+ }, {
237
+ readonly type: "function";
238
+ readonly name: "poolFree";
239
+ readonly inputs: readonly [];
240
+ readonly outputs: readonly [{
241
+ readonly name: "";
242
+ readonly type: "uint256";
243
+ readonly internalType: "uint256";
126
244
  }];
127
245
  readonly stateMutability: "view";
128
246
  }, {
@@ -145,6 +263,156 @@ export declare const CROSS_CHAIN_GAME_ABI: readonly [{
145
263
  }];
146
264
  readonly outputs: readonly [];
147
265
  readonly stateMutability: "nonpayable";
266
+ }, {
267
+ readonly type: "function";
268
+ readonly name: "settle";
269
+ readonly inputs: readonly [{
270
+ readonly name: "cert";
271
+ readonly type: "tuple";
272
+ readonly internalType: "struct CertLib.MatchLiveCert";
273
+ readonly components: readonly [{
274
+ readonly name: "matchId";
275
+ readonly type: "bytes32";
276
+ readonly internalType: "bytes32";
277
+ }, {
278
+ readonly name: "tournamentId";
279
+ readonly type: "uint64";
280
+ readonly internalType: "uint64";
281
+ }, {
282
+ readonly name: "matchupCommitment";
283
+ readonly type: "bytes32";
284
+ readonly internalType: "bytes32";
285
+ }, {
286
+ readonly name: "legA";
287
+ readonly type: "tuple";
288
+ readonly internalType: "struct CertLib.Leg";
289
+ readonly components: readonly [{
290
+ readonly name: "chainTag";
291
+ readonly type: "bytes32";
292
+ readonly internalType: "bytes32";
293
+ }, {
294
+ readonly name: "contractId";
295
+ readonly type: "bytes32";
296
+ readonly internalType: "bytes32";
297
+ }, {
298
+ readonly name: "player";
299
+ readonly type: "bytes32";
300
+ readonly internalType: "bytes32";
301
+ }, {
302
+ readonly name: "sessionKey";
303
+ readonly type: "address";
304
+ readonly internalType: "address";
305
+ }, {
306
+ readonly name: "stake";
307
+ readonly type: "uint128";
308
+ readonly internalType: "uint128";
309
+ }, {
310
+ readonly name: "tranche";
311
+ readonly type: "uint128";
312
+ readonly internalType: "uint128";
313
+ }];
314
+ }, {
315
+ readonly name: "legB";
316
+ readonly type: "tuple";
317
+ readonly internalType: "struct CertLib.Leg";
318
+ readonly components: readonly [{
319
+ readonly name: "chainTag";
320
+ readonly type: "bytes32";
321
+ readonly internalType: "bytes32";
322
+ }, {
323
+ readonly name: "contractId";
324
+ readonly type: "bytes32";
325
+ readonly internalType: "bytes32";
326
+ }, {
327
+ readonly name: "player";
328
+ readonly type: "bytes32";
329
+ readonly internalType: "bytes32";
330
+ }, {
331
+ readonly name: "sessionKey";
332
+ readonly type: "address";
333
+ readonly internalType: "address";
334
+ }, {
335
+ readonly name: "stake";
336
+ readonly type: "uint128";
337
+ readonly internalType: "uint128";
338
+ }, {
339
+ readonly name: "tranche";
340
+ readonly type: "uint128";
341
+ readonly internalType: "uint128";
342
+ }];
343
+ }, {
344
+ readonly name: "quoteTimestamp";
345
+ readonly type: "uint64";
346
+ readonly internalType: "uint64";
347
+ }, {
348
+ readonly name: "quoteMaxAgeSecs";
349
+ readonly type: "uint32";
350
+ readonly internalType: "uint32";
351
+ }, {
352
+ readonly name: "matchDeadline";
353
+ readonly type: "uint64";
354
+ readonly internalType: "uint64";
355
+ }, {
356
+ readonly name: "claimWindowSecs";
357
+ readonly type: "uint32";
358
+ readonly internalType: "uint32";
359
+ }, {
360
+ readonly name: "aIsP1";
361
+ readonly type: "uint8";
362
+ readonly internalType: "uint8";
363
+ }];
364
+ }, {
365
+ readonly name: "oc";
366
+ readonly type: "tuple";
367
+ readonly internalType: "struct CertLib.OutcomeCert";
368
+ readonly components: readonly [{
369
+ readonly name: "matchId";
370
+ readonly type: "bytes32";
371
+ readonly internalType: "bytes32";
372
+ }, {
373
+ readonly name: "matchLiveDigest";
374
+ readonly type: "bytes32";
375
+ readonly internalType: "bytes32";
376
+ }, {
377
+ readonly name: "outcomeKind";
378
+ readonly type: "uint8";
379
+ readonly internalType: "uint8";
380
+ }, {
381
+ readonly name: "stepCount";
382
+ readonly type: "uint8";
383
+ readonly internalType: "uint8";
384
+ }, {
385
+ readonly name: "p1Guess";
386
+ readonly type: "uint8";
387
+ readonly internalType: "uint8";
388
+ }, {
389
+ readonly name: "p2Guess";
390
+ readonly type: "uint8";
391
+ readonly internalType: "uint8";
392
+ }, {
393
+ readonly name: "firstCommitter";
394
+ readonly type: "uint8";
395
+ readonly internalType: "uint8";
396
+ }, {
397
+ readonly name: "matchupType";
398
+ readonly type: "uint8";
399
+ readonly internalType: "uint8";
400
+ }, {
401
+ readonly name: "transcriptHash";
402
+ readonly type: "bytes32";
403
+ readonly internalType: "bytes32";
404
+ }];
405
+ }, {
406
+ readonly name: "liveSigs";
407
+ readonly type: "bytes[3]";
408
+ readonly internalType: "bytes[3]";
409
+ }, {
410
+ readonly name: "ocSigs";
411
+ readonly type: "bytes[3]";
412
+ readonly internalType: "bytes[3]";
413
+ }];
414
+ readonly outputs: readonly [];
415
+ readonly stateMutability: "nonpayable";
148
416
  }, {
149
417
  readonly type: "function";
150
418
  readonly name: "stakeWei";